Fixed wxMac's wxStaticText::SetFont to behave like the others and
resize the control to fit the text git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -41,6 +41,8 @@ class WXDLLEXPORT wxStaticText: public wxStaticTextBase
|
|||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
void SetLabel( const wxString &str ) ;
|
void SetLabel( const wxString &str ) ;
|
||||||
|
bool SetFont( const wxFont &font );
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
@@ -234,3 +234,15 @@ void wxStaticText::SetLabel(const wxString& st )
|
|||||||
Refresh() ;
|
Refresh() ;
|
||||||
Update() ;
|
Update() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxStaticText::SetFont(const wxFont& font)
|
||||||
|
{
|
||||||
|
bool ret = wxControl::SetFont(font);
|
||||||
|
|
||||||
|
// adjust the size of the window to fit to the label unless autoresizing is
|
||||||
|
// disabled
|
||||||
|
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||||
|
SetSize( GetBestSize() );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -234,3 +234,15 @@ void wxStaticText::SetLabel(const wxString& st )
|
|||||||
Refresh() ;
|
Refresh() ;
|
||||||
Update() ;
|
Update() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxStaticText::SetFont(const wxFont& font)
|
||||||
|
{
|
||||||
|
bool ret = wxControl::SetFont(font);
|
||||||
|
|
||||||
|
// adjust the size of the window to fit to the label unless autoresizing is
|
||||||
|
// disabled
|
||||||
|
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||||
|
SetSize( GetBestSize() );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user