X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1433926f2b2c6354b358f77de3cad53deadef9b..08680429a25d66e284c75f69f14fe8ca6ab15f72:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 115b91a2c6..f906802a0f 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1041,6 +1041,9 @@ bool wxWindowBase::SetBackgroundColour( const wxColour &colour ) return false; m_hasBgCol = colour.Ok(); + if ( m_backgroundStyle != wxBG_STYLE_CUSTOM ) + m_backgroundStyle = m_hasBgCol ? wxBG_STYLE_COLOUR : wxBG_STYLE_SYSTEM; + m_inheritBgCol = m_hasBgCol; m_backgroundColour = colour; SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() ); @@ -2210,7 +2213,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event ) #else "", #endif -#if __WXDEBUG__ +#ifdef __WXDEBUG__ _T(" Debug build"), #else _T(""), @@ -2460,6 +2463,11 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move) wxCHECK_RET( GetParent(), _T("MoveBefore/AfterInTabOrder() don't work for TLWs!") ); + // detect the special case when we have nothing to do anyhow and when the + // code below wouldn't work + if ( win == this ) + return; + // find the target window in the siblings list wxWindowList& siblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator i = siblings.Find(win);