From: Vadim Zeitlin Date: Thu, 1 Jul 2004 10:46:38 +0000 (+0000) Subject: font inheritance fixes (patch 983251) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e0176dd9fb716ad0a1a8804f0a93e16048f09054 font inheritance fixes (patch 983251) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 7b4bdfa542..20c7dd20fe 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -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); diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index 75f1b955ff..657418e4d2 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -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()); diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index eea13ecbe3..c1cd5c2e0d 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -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(); diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index ee0c5794e9..a2a61fc04a 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -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 diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index 3b203df0b0..b72590f076 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -116,6 +116,7 @@ bool wxStatusBar95::Create(wxWindow *parent, SetFieldsCount(1); SubclassWin(m_hWnd); + InheritAttributes(); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));