X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/170acdc90e9f92f8b8120fa6c04acdbf45c89582..0286d08d1453506f9ff9a830d58b3b35817d0b14:/src/univ/stattext.cpp diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp index 509a5d6dde..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); @@ -91,4 +86,28 @@ void wxStaticText::DoDraw(wxControlRenderer *renderer) 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