X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb751cf906f6e538efafd863414d027c6aa3a872..19caf2292672bd3c6ecad003ab213709f2d98319:/src/mac/stattext.cpp diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index c31530e181..bc89591282 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_windowId = id; m_windowStyle = style; - m_label = label ; + m_label = wxStripMenuCodes(label) ; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); SetBestSize( size ) ; @@ -63,10 +63,20 @@ const wxString punct = " ,.-;:!?"; void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y) { + long width, height ; + + if (paragraph.Length() == 0) + { + // empty line + dc.GetTextExtent( "H", &width, &height ); + y += height; + + return; + } + int x = 0 ; int i = 0 ; - long width, height ; bool linedrawn = true; while( paragraph.Length() > 0 ) { @@ -153,19 +163,19 @@ void wxStaticText::OnDraw( wxDC &dc ) while (i < text.Length()) { - if (text[i] == 13 || text[i] == 10) - { - DrawParagraph(dc, paragraph,y); - paragraph = "" ; - } - else - { + if (text[i] == 13 || text[i] == 10) + { + DrawParagraph(dc, paragraph,y); + paragraph = "" ; + } + else + { paragraph += text[i]; } ++i; } if (paragraph.Length() > 0) - DrawParagraph(dc, paragraph,y); + DrawParagraph(dc, paragraph,y); } void wxStaticText::OnPaint( wxPaintEvent &event )