X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f38374d0d7aa865e9bbe8ee61b75b94ffcdfb220..7dc3cc31af71522b8fc55b7f97bcba7f5ef9eac5:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index dd3822251d..f097009630 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -118,8 +118,10 @@ void wxWindowBase::InitBase() wxSystemSettings settings; m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_BTNFACE); - m_foregroundColour = *wxBLACK; // TODO take this from sys settings too? -#ifndef __WXMAC__ + // m_foregroundColour = *wxBLACK; // TODO take this from sys settings too? + m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT); + +#if !defined(__WXMAC__) && !defined(__WXGTK__) m_font = *wxSWISS_FONT; // and this? #else m_font = settings.GetSystemFont(wxSYS_DEFAULT_GUI_FONT); @@ -158,9 +160,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long style, -#if wxUSE_VALIDATORS const wxValidator& validator, -#endif const wxString& name) { // m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other @@ -174,7 +174,10 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, SetName(name); SetWindowStyleFlag(style); SetParent(parent); + +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS return TRUE; } @@ -1216,14 +1219,14 @@ void wxWindowBase::UpdateWindowUI() } #endif // wxUSE_CHECKBOX -#if wxUSE_RADIOBUTTON +#if wxUSE_RADIOBTN wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton); if ( radiobtn ) { if ( event.GetSetChecked() ) radiobtn->SetValue(event.GetChecked()); } -#endif // wxUSE_RADIOBUTTON +#endif // wxUSE_RADIOBTN } } @@ -1275,7 +1278,9 @@ void wxWindowBase::DoSetClientObject( wxClientData *data ) wxClientData *wxWindowBase::DoGetClientObject() const { - wxASSERT_MSG( m_clientDataType == ClientData_Object, + // it's not an error to call GetClientObject() on a window which doesn't + // have client data at all - NULL will be returned + wxASSERT_MSG( m_clientDataType != ClientData_Void, wxT("this window doesn't have object client data") ); return m_clientObject; @@ -1292,7 +1297,9 @@ void wxWindowBase::DoSetClientData( void *data ) void *wxWindowBase::DoGetClientData() const { - wxASSERT_MSG( m_clientDataType == ClientData_Void, + // it's not an error to call GetClientData() on a window which doesn't have + // client data at all - NULL will be returned + wxASSERT_MSG( m_clientDataType != ClientData_Object, wxT("this window doesn't have void client data") ); return m_clientData;