X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ff647cf66f6c05aacba8eb96b818fc70d7b4939..1ec46a5b35233f3c69c5b73e4b0b36f44c650633:/src/mac/stattext.cpp diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index a99f6c4e69..26f16be642 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -15,6 +15,8 @@ #include "wx/app.h" #include "wx/stattext.h" +#include "wx/notebook.h" +#include "wx/tabctrl.h" #include "wx/dc.h" #include "wx/dcclient.h" @@ -61,8 +63,42 @@ void wxStaticText::OnDraw( wxDC &dc ) return; PrepareDC(dc); -// dc.Clear() ; this eventually draws in the wrong background colour (appearance panels) + bool doClear = true ; + WindowRef window = GetMacRootWindow() ; + if ( window ) + { + wxWindow* win = wxFindWinFromMacWindow( window ) ; + if ( win ) + { + wxWindow* parent = GetParent() ; + while ( parent ) + { + if( parent->MacGetWindowData() ) + { + break ; + } + + if( parent->IsKindOf( CLASSINFO( wxNotebook ) ) || parent->IsKindOf( CLASSINFO( wxTabCtrl ) )) + { + if ( ((wxControl*)parent)->GetMacControl() ) { + Rect rect = { -32767 , -32767 , 32767 , 32767 } ; + if ( DrawThemeTabPane != (void*)kUnresolvedCFragSymbolAddress ) + { + DrawThemeTabPane ( &rect, kThemeStateActive); + doClear = false ; + } + } + break ; + } + + parent = parent->GetParent() ; + } + } + } + if ( doClear ) + dc.Clear() ; + int x = 0 ; int y = 0 ; wxString text = m_label ;