]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/wizard.cpp
fixed icon drawing when they have different sizes (patch 554973)
[wxWidgets.git] / src / generic / wizard.cpp
index 325ff9974c93bdcbcf9f9e3da182b15b16321700..1e2e0f9fbf940e20e3a11f34900eb64552569e21 100644 (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") );