// implementation
// ============================================================================
-IMPLEMENT_ABSTRACT_CLASS(wxStaticText, wxControl)
-
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
return true;
}
-// ----------------------------------------------------------------------------
-// size management
-// ----------------------------------------------------------------------------
-
-wxSize wxStaticText::DoGetBestClientSize() const
-{
- wxStaticText *self = wxConstCast(this, wxStaticText);
- wxClientDC dc(self);
- dc.SetFont(GetFont());
- wxCoord width, height;
- dc.GetMultiLineTextExtent(GetLabel(), &width, &height);
-
- return wxSize(width, height);
-}
-
// ----------------------------------------------------------------------------
// drawing
// ----------------------------------------------------------------------------
void wxStaticText::DoDraw(wxControlRenderer *renderer)
{
- if ( UseBgCol() )
- {
- wxDC& dc = renderer->GetDC();
- dc.SetBrush(GetBackgroundColour());
- dc.SetPen(*wxTRANSPARENT_PEN);
- dc.DrawRectangle(renderer->GetRect());
- }
-
renderer->DrawLabel();
}
// save original label
m_labelOrig = str;
- // draw as real label the result of GetEllipsizedLabelWithoutMarkup:
- DoSetLabel(GetEllipsizedLabelWithoutMarkup());
+ // draw as real label the abbreviated version of it
+ DoSetLabel(GetEllipsizedLabel());
}
void wxStaticText::DoSetLabel(const wxString& str)