/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
-
-#if wxOSX_USE_COCOA
-#include <Cocoa/Cocoa.h>
-#else
-#include <UIKit/UIKit.h>
+#ifndef WX_PRECOMP
+ #include "wx/nonownedwnd.h"
+ #include "wx/frame.h"
#endif
-#ifdef __WXMAC__
#include "wx/osx/private.h"
-#endif
NSRect wxToNSRect( NSView* parent, const wxRect& r )
{
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;
}
else
m_macWindow = [wxNSWindow alloc];
- CGWindowLevel level = kCGNormalWindowLevelKey;
+ CGWindowLevel level = kCGNormalWindowLevel;
if ( style & wxFRAME_TOOL_WINDOW )
{