X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4799f3baab3805e51cc1754b89d855d32e94c232..e10caf88b6cbf09bb38dea47dc258eb638237559:/src/cocoa/mdi.mm diff --git a/src/cocoa/mdi.mm b/src/cocoa/mdi.mm index 63e1bfd0e0..b1aa7c6b26 100644 --- a/src/cocoa/mdi.mm +++ b/src/cocoa/mdi.mm @@ -15,6 +15,8 @@ #include "wx/mdi.h" +#include "wx/cocoa/objc/objc_uniquifying.h" + #ifndef WX_PRECOMP #include "wx/log.h" #endif // WX_PRECOMP @@ -44,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 @@ -67,6 +70,7 @@ WX_DECLARE_HASH_MAP(int, wxMDIChildFrame*, wxIntegerHash, wxIntegerEqual, wxIntM } @end // implementation wxMDIParentFrameObserver : NSObject +WX_IMPLEMENT_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject) // ======================================================================== // wxMDIParentFrame @@ -79,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:) @@ -91,10 +95,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { - bool success = wxFrame::Create(parent,winid,title,pos,size,style,name); - if(success) - OnCreateClient(); - return success; + if ( !wxFrame::Create(parent,winid,title,pos,size,style,name) ) + return false; + + m_clientWindow = OnCreateClient(); + + return m_clientWindow != NULL; } wxMDIParentFrame::~wxMDIParentFrame() @@ -141,8 +147,7 @@ wxMDIClientWindow *wxMDIParentFrame::GetClientWindow() const wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() { - m_clientWindow = new wxMDIClientWindow( this ); - return m_clientWindow; + return new wxMDIClientWindow( this ); } void wxMDIParentFrame::ActivateNext()