X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3355efa93c7ef81088344b7ddbc7355c4730bb57..a9249b2eb2a40d8c71f828669045c4ddaa8dc5ff:/src/mac/stattext.cpp?ds=sidebyside diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index 39a5e39b06..88b0edf3f9 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -128,44 +128,24 @@ void wxStaticText::OnDraw( wxDC &dc ) if (m_width <= 0 || m_height <= 0) return; - wxString paragraph; - int i = 0 ; - wxString text = m_label; - - PrepareDC(dc); - - bool doClear = true ; - WindowRef window = GetMacRootWindow() ; - if ( window ) - { - wxWindow* win = wxFindWinFromMacWindow( window ) ; - if ( win ) - { - wxWindow* parent = GetParent() ; - while ( parent ) - { - if( parent->MacGetWindowData() ) - { - break ; - } - - parent = parent->GetParent() ; - } - } - } - - while (i < text.Length()) - { - paragraph += text[i]; - - if (text[i] == 13 || text[i] == 10) - DrawParagraph(dc, paragraph); - - ++i; - } - - if (paragraph.Length() > 0) - DrawParagraph(dc, paragraph); + if ( !IsWindowHilited( MacGetRootWindow() ) ) + { + dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; + } + wxString paragraph; + int i = 0 ; + wxString text = m_label; + while (i < text.Length()) + { + paragraph += text[i]; + + if (text[i] == 13 || text[i] == 10) + DrawParagraph(dc, paragraph); + + ++i; + } + if (paragraph.Length() > 0) + DrawParagraph(dc, paragraph); } void wxStaticText::OnPaint( wxPaintEvent &event ) @@ -227,13 +207,11 @@ wxSize wxStaticText::DoGetBestSize() const void wxStaticText::SetLabel(const wxString& st ) { - SetTitle( st ) ; - m_label = st ; - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - SetSize( GetBestSize() ) ; - - Refresh() ; - MacUpdateImmediately() ; -// wxClientDC dc(this); -// OnDraw( dc ) ; + SetTitle( st ) ; + m_label = st ; + if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) + SetSize( GetBestSize() ) ; + + Refresh() ; + Update() ; }