]> git.saurik.com Git - wxWidgets.git/commitdiff
font inheritance fixes (patch 983251)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Jul 2004 10:46:38 +0000 (10:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Jul 2004 10:46:38 +0000 (10:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/control.cpp
src/msw/glcanvas.cpp
src/msw/listbox.cpp
src/msw/spinctrl.cpp
src/msw/statbr95.cpp

index 7b4bdfa54291cced27ff24e91e6bd2680826f8e9..20c7dd20fe0e257c6b30ead00819c0b58e5701e2 100644 (file)
@@ -168,7 +168,8 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
 
     // set up fonts and colours
     InheritAttributes();
-    SetFont(GetDefaultAttributes().font);
+    if (!m_hasFont)
+        SetFont(GetDefaultAttributes().font);
 
     // set the size now if no initial size specified
     SetInitialBestSize(size);
index 75f1b955ff87eafecd55e3aef8348cb759ce7828..657418e4d25c3c73f1d33c93fc0fe13857e9064a 100644 (file)
@@ -168,7 +168,6 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
   if ( ret )
   {
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
-    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
   }
 
   m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
@@ -192,7 +191,6 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
   if ( ret )
   {
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
-    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
   }
 
   m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
@@ -217,7 +215,6 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID i
   if ( ret )
   {
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
-    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
   }
 
   m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
index eea13ecbe30bedf649be68ce9ea0f06c4f6aae0f..c1cd5c2e0d2ce429d22800143ae8ebc17b49637a 100644 (file)
@@ -773,7 +773,7 @@ bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
 
     wxDC dc;
     dc.SetHDC((WXHDC)hdc);
-    dc.SetFont(wxSystemSettings::GetFont(wxSYS_ANSI_VAR_FONT));
+    dc.SetFont(GetFont());
 
     pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
     pStruct->itemWidth  = dc.GetCharWidth();
index ee0c5794e9e5117e6118825bbf35492d97fe8291..a2a61fc04a5e2cbca01a22b5b7aba9414e49862d 100644 (file)
@@ -372,7 +372,8 @@ bool wxSpinCtrl::Create(wxWindow *parent,
 
     // set up fonts and colours  (This is nomally done in MSWCreateControl)
     InheritAttributes();
-    SetFont(GetDefaultAttributes().font);
+    if (!m_hasFont)
+        SetFont(GetDefaultAttributes().font);
 
     // set the size of the text window - can do it only now, because we
     // couldn't call DoGetBestSize() before as font wasn't set
index 3b203df0b0425507e547b35fbd3aedbde11f0d37..b72590f0760b092f4a6ff21ce16124c6df30eb74 100644 (file)
@@ -116,6 +116,7 @@ bool wxStatusBar95::Create(wxWindow *parent,
 
     SetFieldsCount(1);
     SubclassWin(m_hWnd);
+    InheritAttributes();
 
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));