]> git.saurik.com Git - wxWidgets.git/commitdiff
applied Maximize patches (1203976)
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 19 May 2005 05:48:47 +0000 (05:48 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 19 May 2005 05:48:47 +0000 (05:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp

index 0723699637324e5a4443b400a0e4a844cbb7551b..5c67dbfb3ba19096352f6e3c1e0910a433777ddb 100644 (file)
@@ -976,8 +976,18 @@ wxTopLevelWindowMac::~wxTopLevelWindowMac()
 
 void wxTopLevelWindowMac::Maximize(bool maximize)
 {
+    // TODO Check, is this still necessary
+#if 0
     wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
     wxMacWindowClipper clip (this);
+#endif
+    if ( !IsWindowInStandardState( (WindowRef)m_macWindow, NULL, NULL) ) 
+    {
+        Rect rect;
+        GetWindowBounds((WindowRef)m_macWindow, kWindowGlobalPortRgn, &rect);
+        SetWindowIdealUserState((WindowRef)m_macWindow, &rect);
+        SetWindowUserState((WindowRef)m_macWindow, &rect);
+    }
     ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ;
 }
 
@@ -999,7 +1009,10 @@ bool wxTopLevelWindowMac::IsIconized() const
 
 void wxTopLevelWindowMac::Restore()
 {
-    // not available on mac
+    if ( IsMaximized() ) 
+        Maximize(false);
+    else if ( IsIconized() ) 
+        Iconize(false);
 }
 
 // ----------------------------------------------------------------------------