X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/48580976469f7c46b730f96effacfa680e55e3cd..580cc1eb856780d56396da36a9f0f5826638ba3a:/src/cocoa/mdi.mm diff --git a/src/cocoa/mdi.mm b/src/cocoa/mdi.mm index fdac990686..a0c8022306 100644 --- a/src/cocoa/mdi.mm +++ b/src/cocoa/mdi.mm @@ -1,18 +1,24 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/mdi.mm +// Name: src/cocoa/mdi.mm // Purpose: wxMDIParentFrame, wxMDIChildFrame, wxMDIClientWindow // Author: David Elliott // Modified by: // Created: 2003/09/08 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" + +#if wxUSE_MDI + +#include "wx/mdi.h" + +#include "wx/cocoa/objc/objc_uniquifying.h" + #ifndef WX_PRECOMP #include "wx/log.h" - #include "wx/mdi.h" #endif // WX_PRECOMP // #include "wx/cocoa/autorelease.h" @@ -23,7 +29,7 @@ // #import // #import -#include +#include "wx/listimpl.cpp" WX_DEFINE_LIST(wxCocoaMDIChildFrameList); WX_DECLARE_HASH_MAP(int, wxMDIChildFrame*, wxIntegerHash, wxIntegerEqual, wxIntMDIChildFrameHashMap); @@ -40,6 +46,7 @@ WX_DECLARE_HASH_MAP(int, wxMDIChildFrame*, wxIntegerHash, wxIntegerEqual, wxIntM - (id)initWithWxMDIParentFrame: (wxMDIParentFrame *)mdiParent; - (void)windowDidBecomeMain: (NSNotification *)notification; @end // interface wxMDIParentFrameObserver : NSObject +WX_DECLARE_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject) @implementation wxMDIParentFrameObserver : NSObject - (id)init @@ -63,6 +70,7 @@ WX_DECLARE_HASH_MAP(int, wxMDIChildFrame*, wxIntegerHash, wxIntegerEqual, wxIntM } @end // implementation wxMDIParentFrameObserver : NSObject +WX_IMPLEMENT_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject) // ======================================================================== // wxMDIParentFrame @@ -75,7 +83,7 @@ void wxMDIParentFrame::Init() { m_clientWindow = NULL; m_currentChild = NULL; - m_observer = [[wxMDIParentFrameObserver alloc] + m_observer = [[WX_GET_OBJC_CLASS(wxMDIParentFrameObserver) alloc] initWithWxMDIParentFrame:this]; [[NSNotificationCenter defaultCenter] addObserver:m_observer selector:@selector(windowDidBecomeMain:) @@ -228,10 +236,10 @@ void wxMDIParentFrame::WindowDidBecomeMain(NSNotification *notification) } if(!hashmap.empty()) { - int windowCount = 0; + NSInteger windowCount = 0; NSCountWindows(&windowCount); wxASSERT(windowCount>0); - int *windowList = new int[windowCount]; + NSInteger *windowList = new NSInteger[windowCount]; NSWindowList(windowCount, windowList); wxIntMDIChildFrameHashMap::iterator iter = hashmap.end(); for(int i=0; i