Controls will readjust their size and minsize when SetLabel or SetFont

are called.  Fixed up wxStaticText to blend the wxST_NO_AUTOSIZE with
this new functionality.  Made SetBestSize public under the
SetBestFittingSize name.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-06-19 01:35:10 +00:00
parent 8de5b24e54
commit fe161a2685
43 changed files with 176 additions and 154 deletions

View File

@@ -68,6 +68,13 @@ bool wxControlBase::Create(wxWindow *parent,
return ret;
}
void wxControlBase::Init()
{
m_adjustMinSize = true;
}
bool wxControlBase::CreateControl(wxWindowBase *parent,
wxWindowID id,
const wxPoint& pos,
@@ -116,6 +123,24 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const
}
}
void wxControlBase::SetLabel(const wxString& label)
{
wxWindow::SetLabel(label);
if (GetAdjustMinSizeFlag())
SetBestSize(wxDefaultSize);
}
bool wxControlBase::SetFont(const wxFont& font)
{
bool ret = wxWindow::SetFont(font);
if (GetAdjustMinSizeFlag())
SetBestSize(wxDefaultSize);
return ret;
}
// ----------------------------------------------------------------------------
// wxStaticBitmap
// ----------------------------------------------------------------------------