Refactor: extra wxStaticText auto-resizing code from wxMSW to common.
This will allow its reuse in wxGenericStaticText and maybe other ports that need it in the future. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -194,6 +194,18 @@ void wxStaticTextBase::Wrap(int width)
|
||||
wrapper.WrapLabel(this, width);
|
||||
}
|
||||
|
||||
void wxStaticTextBase::AutoResizeIfNecessary()
|
||||
{
|
||||
// adjust the size of the window to fit to the label unless autoresizing is
|
||||
// disabled
|
||||
if ( !HasFlag(wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
InvalidateBestSize();
|
||||
DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord,
|
||||
wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticTextBase - generic implementation for wxST_ELLIPSIZE_* support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user