/////////////////////////////////////////////////////////////////////////////
-// 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: wxWidgets licence
+// Licence: wxWindows 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"
- (id)initWithWxMDIParentFrame: (wxMDIParentFrame *)mdiParent;
- (void)windowDidBecomeMain: (NSNotification *)notification;
@end // interface wxMDIParentFrameObserver : NSObject
+WX_DECLARE_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject)
@implementation wxMDIParentFrameObserver : NSObject
- (id)init
}
@end // implementation wxMDIParentFrameObserver : NSObject
+WX_IMPLEMENT_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject)
// ========================================================================
// wxMDIParentFrame
{
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:)
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()
SetActiveChild(NULL);
}
-wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
-{
- return m_currentChild;
-}
-
void wxMDIParentFrame::SetActiveChild(wxMDIChildFrame *child)
{
m_currentChild = child;
wxMenuBarManager::GetInstance()->UpdateMenuBar();
}
-wxMDIClientWindow *wxMDIParentFrame::GetClientWindow() const
-{
- return m_clientWindow;
-}
-
-wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
-{
- m_clientWindow = new wxMDIClientWindow( this );
- return m_clientWindow;
-}
-
-void wxMDIParentFrame::ActivateNext()
-{
-}
-
-void wxMDIParentFrame::ActivatePrevious()
-{
-}
-
wxMenuBar *wxMDIParentFrame::GetAppMenuBar(wxCocoaNSWindow *win)
{
if(m_currentChild && (win==this))
}
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<windowCount && iter == hashmap.end(); i++)
// ========================================================================
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxWindow)
-wxMDIClientWindow::wxMDIClientWindow()
-{
-}
-
-wxMDIClientWindow::wxMDIClientWindow(wxMDIParentFrame *parent, long style)
-: wxWindow(parent, -1)
-{
-}
-
-wxMDIClientWindow::~wxMDIClientWindow()
-{
-}
-
-bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style)
+bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
{
- return false;
+ return Create(parent, wxID_ANY, wxPoint(0, 0), wxSize(0, 0), style);
}
+#endif // wxUSE_MDI