X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c5fd8a319e58c0d8c58d73360ee9d4874c87bd8..c4e43bea7b24f7b7f58e3f87786490cd81abf0a7:/src/univ/stattext.cpp?ds=inline diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp index 83ebf31eaf..f854398a17 100644 --- a/src/univ/stattext.cpp +++ b/src/univ/stattext.cpp @@ -66,11 +66,6 @@ bool wxStaticText::Create(wxWindow *parent, // size management // ---------------------------------------------------------------------------- -void wxStaticText::SetLabel(const wxString& label) -{ - wxControl::SetLabel(label); -} - wxSize wxStaticText::DoGetBestClientSize() const { wxStaticText *self = wxConstCast(this, wxStaticText); @@ -88,15 +83,31 @@ wxSize wxStaticText::DoGetBestClientSize() const void wxStaticText::DoDraw(wxControlRenderer *renderer) { - if ( UseBgCol() ) - { - wxDC& dc = renderer->GetDC(); - dc.SetBrush(GetBackgroundColour()); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(renderer->GetRect()); - } - renderer->DrawLabel(); } +void wxStaticText::SetLabel(const wxString& str) +{ + // save original label + m_labelOrig = str; + + // draw as real label the result of GetEllipsizedLabelWithoutMarkup: + DoSetLabel(GetEllipsizedLabelWithoutMarkup()); +} + +void wxStaticText::DoSetLabel(const wxString& str) +{ + UnivDoSetLabel(str); +} + +wxString wxStaticText::DoGetLabel() const +{ + return wxControl::GetLabel(); +} + +/* + FIXME: UpdateLabel() should be called on size events to allow correct + dynamic ellipsizing of the label +*/ + #endif // wxUSE_STATTEXT