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
|
||||
void SetLabel( const wxString &str ) ;
|
||||
bool SetFont( const wxFont &font );
|
||||
|
||||
// operations
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
@@ -226,11 +226,23 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
|
||||
void wxStaticText::SetLabel(const wxString& st )
|
||||
{
|
||||
SetTitle( st ) ;
|
||||
m_label = st ;
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
SetSize( GetBestSize() ) ;
|
||||
SetTitle( st ) ;
|
||||
m_label = st ;
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
SetSize( GetBestSize() ) ;
|
||||
|
||||
Refresh() ;
|
||||
Update() ;
|
||||
Refresh() ;
|
||||
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;
|
||||
}
|
||||
|
@@ -226,11 +226,23 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
|
||||
void wxStaticText::SetLabel(const wxString& st )
|
||||
{
|
||||
SetTitle( st ) ;
|
||||
m_label = st ;
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
SetSize( GetBestSize() ) ;
|
||||
SetTitle( st ) ;
|
||||
m_label = st ;
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
SetSize( GetBestSize() ) ;
|
||||
|
||||
Refresh() ;
|
||||
Update() ;
|
||||
Refresh() ;
|
||||
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