X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..a380af4dbff98b71780c32772625f1d974522e4e:/src/common/ctrlcmn.cpp diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 6b834f3aba..ec97111188 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -55,7 +55,7 @@ bool wxControlBase::Create(wxWindow *parent, const wxPoint &pos, const wxSize &size, long style, - const wxValidator& validator, + const wxValidator& wxVALIDATOR_PARAM(validator), const wxString &name) { bool ret = wxWindow::Create(parent, id, pos, size, style, name); @@ -92,13 +92,15 @@ bool wxControlBase::CreateControl(wxWindowBase *parent, // inherit colour and font settings from the parent window void wxControlBase::InheritAttributes() { - // it definitely doesn't make sense to inherit the background colour as the - // controls typically have their own standard one and probably not the - // foreground neither? -#if 0 - SetBackgroundColour(GetParent()->GetBackgroundColour()); - SetForegroundColour(GetParent()->GetForegroundColour()); -#endif // 0 + if ( ShouldInheritColours() ) + { + wxWindow *parent = GetParent(); + + wxCHECK_RET( parent, _T("a control without parent?") ); + + SetBackgroundColour(parent->GetBackgroundColour()); + SetForegroundColour(parent->GetForegroundColour()); + } #ifdef __WXPM__ //