added support for ellipsization and markup in wxStaticText (modified patch 1629946)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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);
|
||||
@@ -99,4 +94,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
|
||||
|
Reference in New Issue
Block a user