]> git.saurik.com Git - wxWidgets.git/commitdiff
adding min and max size support for resizing events
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 11 Sep 2008 17:02:52 +0000 (17:02 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 11 Sep 2008 17:02:52 +0000 (17:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/nonownedwnd.mm

index ec7fcf12c1db53541532e13b5a5d9d2a5e741ac2..ed05e210890e43f84077e7b03d181481ccb216f5 100644 (file)
@@ -137,10 +137,26 @@ wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p )
     return NO;
 }
 
-- (NSSize)windowWillResize:(NSWindow *)window
+- (NSSize)windowWillResize:(NSWindow *)win
                     toSize:(NSSize)proposedFrameSize
 {
-    // todo
+    NSRect frame = [win frame];
+    wxRect wxframe = wxFromNSRect( NULL, frame );
+    wxframe.SetWidth( proposedFrameSize.width );
+    wxframe.SetHeight( proposedFrameSize.height );
+    wxNSWindow* window = (wxNSWindow*) win;
+    wxNonOwnedWindowCocoaImpl* windowimpl = [window implementation];
+    if ( windowimpl )
+    {
+        wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
+        if ( wxpeer )
+        {
+            wxpeer->HandleResizing( 0, &wxframe );
+            NSSize newSize = NSMakeSize(wxframe.GetWidth(), wxframe.GetHeight());
+            return newSize;
+        }
+    }
+
     return proposedFrameSize;
 }