// size management
// ----------------------------------------------------------------------------
-void wxStaticText::SetLabel(const wxString& label)
-{
- wxControl::SetLabel(label);
-}
-
wxSize wxStaticText::DoGetBestClientSize() const
{
wxStaticText *self = wxConstCast(this, wxStaticText);
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