X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/db89aa764f72e1f0a73d15d41f68bf13760e151b..c97e7fa8dbda704c9c9cdb61c22ebdf9b692e114:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 59f3a09ffb..4e57c5fb9d 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -127,14 +127,16 @@ void wxWindowBase::InitBase() #endif // wxUSE_VALIDATORS // use the system default colours - wxSystemSettings settings; - - m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_BTNFACE); - // m_foregroundColour = *wxBLACK; // TODO take this from sys settings too? + m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE); m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT); - // GRG, changed Mar/2000 - m_font = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT); + // don't set the font here for wxMSW as we don't call WM_SETFONT here and + // so the font is *not* really set - but calls to SetFont() later won't do + // anything because m_font appears to be already set! +#ifndef __WXMSW__ + m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); +#endif // __WXMSW__ + // no style bits m_exStyle = m_windowStyle = 0; @@ -644,7 +646,7 @@ bool wxWindowBase::SetFont(const wxFont& font) // don't try to set invalid font, always fall back to the default const wxFont& fontOk = font.Ok() ? font : *wxSWISS_FONT; - if ( (wxFont&)fontOk == m_font ) + if ( fontOk == m_font ) { // no change return FALSE;