Patch #1203934: enable best size caching for MSW widgets

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-05-18 02:23:01 +00:00
parent 3de6964a9f
commit 31582e4e11
15 changed files with 63 additions and 16 deletions

View File

@@ -374,6 +374,8 @@ void wxRadioBox::SetString(int item, const wxString& label)
m_radioHeight[item] = wxDefaultCoord;
::SetWindowText((*m_radioButtons)[item], label.c_str());
InvalidateBestSize();
}
void wxRadioBox::SetSelection(int N)
@@ -428,7 +430,10 @@ bool wxRadioBox::Show(int item, bool show)
BOOL ret = ::ShowWindow((*m_radioButtons)[item], show ? SW_SHOW : SW_HIDE);
return (ret != 0) == show;
bool changed = (ret != 0) == show;
if( changed )
InvalidateBestSize();
return changed;
}
WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxRadioBox, wxStaticBox, m_radioButtons)
@@ -498,7 +503,9 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
wxSize wxRadioBox::DoGetBestSize() const
{
return GetTotalButtonSize(GetMaxButtonSize());
wxSize best = GetTotalButtonSize(GetMaxButtonSize());
CacheBestSize(best);
return best;
}
// Restored old code.