]> git.saurik.com Git - wxWidgets.git/commitdiff
don't set font unless necessary (patch 984853)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Jul 2004 11:20:44 +0000 (11:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 4 Jul 2004 11:20:44 +0000 (11:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp
src/generic/treectlg.cpp

index b7143eaa85313eb350aa7d0a37567b7c45e11c48..00af514ac06f27aeeb3fd9ca835d40d13cf22b33 100644 (file)
@@ -1668,11 +1668,13 @@ wxListHeaderWindow::wxListHeaderWindow( wxWindow *win,
     wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
     SetOwnForegroundColour( attr.colFg );
     SetOwnBackgroundColour( attr.colBg );
-    SetOwnFont( attr.font );
+    if (!m_hasFont)
+        SetOwnFont( attr.font );
 #else
     SetOwnForegroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
     SetOwnBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
-    SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT ));
+    if (!m_hasFont)
+        SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT ));
 #endif
 }
 
@@ -2214,7 +2216,8 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent,
     wxVisualAttributes attr = wxGenericListCtrl::GetClassDefaultAttributes();
     SetOwnForegroundColour( attr.colFg );
     SetOwnBackgroundColour( attr.colBg );
-    SetOwnFont( attr.font );
+    if (!m_hasFont)
+        SetOwnFont( attr.font );
 }
 
 wxListMainWindow::~wxListMainWindow()
index 4ca9560a5eb35279f85cc5b4c45e1e2eefd52aa1..2883e57b14994efd299b8febd30038635ed38798 100644 (file)
@@ -793,7 +793,8 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
     wxVisualAttributes attr = GetDefaultAttributes();
     SetOwnForegroundColour( attr.colFg );
     SetOwnBackgroundColour( attr.colBg );
-    SetOwnFont(attr.font);
+    if (!m_hasFont)
+        SetOwnFont(attr.font);
 
 //  m_dottedPen = wxPen( "grey", 0, wxDOT );  too slow under XFree86
     m_dottedPen = wxPen( wxT("grey"), 0, 0 );