added wxWizard::Fit()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-05-26 22:41:35 +00:00
parent ec5bb70d65
commit c73b439f80
4 changed files with 54 additions and 5 deletions

View File

@@ -280,6 +280,32 @@ void wxWizard::SetPageSize(const wxSize& size)
m_sizePage = size;
}
void wxWizard::Fit(const wxWizardPage *page)
{
// otherwise it will have no effect now as it's too late...
wxASSERT_MSG( !WasCreated(), _T("should be called before RunWizard()!") );
wxSize sizeMax;
while ( page )
{
wxSize size = page->GetBestSize();
if ( size.x > sizeMax.x )
sizeMax.x = size.x;
if ( size.y > sizeMax.y )
sizeMax.y = size.y;
page = page->GetNext();
}
if ( sizeMax.x > m_sizePage.x )
m_sizePage.x = sizeMax.x;
if ( sizeMax.y > m_sizePage.y )
m_sizePage.y = sizeMax.y;
}
bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
{
wxASSERT_MSG( page != m_page, wxT("this is useless") );