X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f1ae4143271ae63a17e052a1a471d16e9cd8c44..d9f9aa2d8fcb956444588b2c19ffe8d4a3f5d2bb:/src/mac/carbon/stattext.cpp?ds=inline diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 22653f651e..26f16be642 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -15,6 +15,10 @@ #include "wx/app.h" #include "wx/stattext.h" +#include "wx/notebook.h" +#include "wx/tabctrl.h" +#include "wx/dc.h" +#include "wx/dcclient.h" #include @@ -55,9 +59,46 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, void wxStaticText::OnDraw( wxDC &dc ) { + if (m_width <= 0 || m_height <= 0) + return; + PrepareDC(dc); - dc.Clear() ; + 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 ; @@ -254,7 +295,9 @@ void wxStaticText::SetLabel(const wxString& st ) m_label = st ; if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) SetSizeOrDefault() ; - - wxClientDC dc(this); - OnDraw( dc ) ; + + Refresh() ; + MacUpdateImmediately() ; +// wxClientDC dc(this); +// OnDraw( dc ) ; }