2003-11-13 16:03:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/cocoa/mdi.h
|
|
|
|
// Purpose: wxMDIParentFrame, wxMDIChildFrame, wxMDIClientWindow
|
|
|
|
// Author: David Elliott
|
2008-11-04 02:46:19 +00:00
|
|
|
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
2003-11-13 16:03:08 +00:00
|
|
|
// Created: 2003/09/08
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2003 David Elliott
|
2008-11-04 02:46:19 +00:00
|
|
|
// (c) 2008 Vadim Zeitlin
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2003-11-13 16:03:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __WX_COCOA_MDI_H__
|
|
|
|
#define __WX_COCOA_MDI_H__
|
|
|
|
|
|
|
|
#include "wx/frame.h"
|
|
|
|
|
|
|
|
DECLARE_WXCOCOA_OBJC_CLASS(wxMDIParentFrameObserver);
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
2003-11-13 16:03:08 +00:00
|
|
|
|
2007-08-15 13:05:35 +00:00
|
|
|
WX_DECLARE_EXPORTED_LIST(wxMDIChildFrame, wxCocoaMDIChildFrameList);
|
2003-11-13 16:03:08 +00:00
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
// wxMDIParentFrame
|
|
|
|
// ========================================================================
|
2008-11-04 02:46:19 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
2003-11-13 16:03:08 +00:00
|
|
|
{
|
2007-07-09 10:09:52 +00:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
2003-11-13 16:03:08 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// initialization
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
wxMDIParentFrame() { Init(); }
|
|
|
|
wxMDIParentFrame(wxWindow *parent,
|
|
|
|
wxWindowID winid,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(parent, winid, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxMDIParentFrame();
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID winid,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// Cocoa specifics
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
void WindowDidBecomeMain(NSNotification *notification);
|
|
|
|
protected:
|
|
|
|
virtual void CocoaDelegate_windowDidBecomeKey(void);
|
|
|
|
virtual void CocoaDelegate_windowDidResignKey(void);
|
|
|
|
virtual bool Cocoa_canBecomeMainWindow(bool &canBecome);
|
|
|
|
virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win);
|
|
|
|
|
|
|
|
void AddMDIChild(wxMDIChildFrame *child);
|
|
|
|
void RemoveMDIChild(wxMDIChildFrame *child);
|
|
|
|
|
|
|
|
wxMDIParentFrameObserver *m_observer;
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
void SetActiveChild(wxMDIChildFrame *child);
|
|
|
|
|
2008-11-04 02:46:19 +00:00
|
|
|
// implement base class pure virtuals
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
static bool IsTDI() { return false; }
|
|
|
|
|
|
|
|
virtual void ActivateNext() { /* TODO */ }
|
|
|
|
virtual void ActivatePrevious() { /* TODO */ }
|
2003-11-13 16:03:08 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
wxMDIClientWindow *m_clientWindow;
|
|
|
|
wxMDIChildFrame *m_currentChild;
|
|
|
|
wxCocoaMDIChildFrameList m_mdiChildren;
|
|
|
|
};
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
// wxMDIChildFrame
|
|
|
|
// ========================================================================
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame
|
2003-11-13 16:03:08 +00:00
|
|
|
{
|
2007-07-09 10:09:52 +00:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
|
2003-11-13 16:03:08 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// initialization
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
wxMDIChildFrame() { Init(); }
|
|
|
|
wxMDIChildFrame(wxMDIParentFrame *parent,
|
|
|
|
wxWindowID winid,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(parent, winid, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxMDIChildFrame();
|
|
|
|
|
|
|
|
bool Create(wxMDIParentFrame *parent,
|
|
|
|
wxWindowID winid,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// Cocoa specifics
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
protected:
|
|
|
|
virtual void CocoaDelegate_windowDidBecomeKey(void);
|
|
|
|
virtual void CocoaDelegate_windowDidBecomeMain(void);
|
|
|
|
virtual void CocoaDelegate_windowDidResignKey(void);
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
public:
|
|
|
|
virtual void Activate();
|
|
|
|
virtual bool Destroy();
|
|
|
|
protected:
|
|
|
|
wxMDIParentFrame *m_mdiParent;
|
|
|
|
};
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
// wxMDIClientWindow
|
|
|
|
// ========================================================================
|
2008-11-04 02:46:19 +00:00
|
|
|
class wxMDIClientWindow : public wxMDIClientWindowBase
|
2003-11-13 16:03:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-11-04 02:46:19 +00:00
|
|
|
wxMDIClientWindow() { }
|
|
|
|
|
|
|
|
virtual bool CreateClient(wxMDIParentFrame *parent,
|
|
|
|
long style = wxHSCROLL | wxVSCROLL);
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
2003-11-13 16:03:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __WX_COCOA_MDI_H__
|