X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac8d0c118b7403e2838e75124b442051299e6f6c..b08c90ca63723536960122fc798f673af1faed13:/src/common/ctrlcmn.cpp?ds=sidebyside diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 468a4ac93b..ec97111188 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -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__ //