]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/carbon/mdi.h
need to overload assertEquals(int,short) too to resolve ambiguity
[wxWidgets.git] / include / wx / osx / carbon / mdi.h
CommitLineData
5c6eb3a8 1/////////////////////////////////////////////////////////////////////////////
d2824cdb 2// Name: wx/osx/carbon/mdi.h
5c6eb3a8 3// Purpose: MDI (Multiple Document Interface) classes.
5c6eb3a8 4// Author: Stefan Csomor
d2824cdb 5// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
5c6eb3a8
SC
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
d2824cdb 9// (c) 2008 Vadim Zeitlin
5c6eb3a8
SC
10// Licence: wxWindows licence
11/////////////////////////////////////////////////////////////////////////////
12
d2824cdb
VZ
13#ifndef _WX_OSX_CARBON_MDI_H_
14#define _WX_OSX_CARBON_MDI_H_
5c6eb3a8 15
d2824cdb
VZ
16class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
17{
18public:
19 wxMDIParentFrame() { Init(); }
20 wxMDIParentFrame(wxWindow *parent,
21 wxWindowID id,
22 const wxString& title,
23 const wxPoint& pos = wxDefaultPosition,
24 const wxSize& size = wxDefaultSize,
25 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
26 const wxString& name = wxFrameNameStr)
27 {
28 Init();
29 Create(parent, id, title, pos, size, style, name);
30 }
5c6eb3a8 31
d2824cdb
VZ
32 bool Create(wxWindow *parent,
33 wxWindowID id,
34 const wxString& title,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
38 const wxString& name = wxFrameNameStr);
5c6eb3a8 39
d2824cdb 40 virtual ~wxMDIParentFrame();
5c6eb3a8 41
d2824cdb
VZ
42 // implement/override base class [pure] virtuals
43 // ---------------------------------------------
5c6eb3a8 44
d2824cdb
VZ
45 static bool IsTDI() { return false; }
46
47 virtual void AddChild(wxWindowBase *child);
48 virtual void RemoveChild(wxWindowBase *child);
49
50 virtual void ActivateNext() { /* TODO */ }
51 virtual void ActivatePrevious() { /* TODO */ }
52
53 virtual bool Show(bool show = true);
54
55
56 // Mac-specific implementation from now on
57 // ---------------------------------------
58
59 // Mac OS activate event
60 virtual void MacActivate(long timestamp, bool activating);
5c6eb3a8 61
d2824cdb
VZ
62 // wxWidgets activate event
63 void OnActivate(wxActivateEvent& event);
64 void OnSysColourChanged(wxSysColourChangedEvent& event);
65
66 void SetMenuBar(wxMenuBar *menu_bar);
67
68 // Get rect to be used to center top-level children
69 virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h);
5c6eb3a8
SC
70
71protected:
72 // common part of all ctors
73 void Init();
74
75 // returns true if this frame has some contents and so should be visible,
76 // false if it's used solely as container for its children
77 bool ShouldBeVisible() const;
78
79
5c6eb3a8
SC
80 wxMenu *m_windowMenu;
81
82 // true if MDI Frame is intercepting commands, not child
83 bool m_parentFrameActive;
84
85 // true if the frame should be shown but is not because it is empty and
86 // useless otherwise than a container for its children
87 bool m_shouldBeShown;
88
89private:
90 friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
d2824cdb 91
5c6eb3a8 92 DECLARE_EVENT_TABLE()
d2824cdb 93 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
5c6eb3a8
SC
94};
95
d2824cdb 96class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxMDIChildFrameBase
5c6eb3a8 97{
5c6eb3a8 98public:
d2824cdb
VZ
99 wxMDIChildFrame() { Init(); }
100 wxMDIChildFrame(wxMDIParentFrame *parent,
101 wxWindowID id,
102 const wxString& title,
103 const wxPoint& pos = wxDefaultPosition,
104 const wxSize& size = wxDefaultSize,
105 long style = wxDEFAULT_FRAME_STYLE,
106 const wxString& name = wxFrameNameStr)
107 {
108 Init() ;
109 Create(parent, id, title, pos, size, style, name);
110 }
111
112 bool Create(wxMDIParentFrame *parent,
113 wxWindowID id,
114 const wxString& title,
115 const wxPoint& pos = wxDefaultPosition,
116 const wxSize& size = wxDefaultSize,
117 long style = wxDEFAULT_FRAME_STYLE,
118 const wxString& name = wxFrameNameStr);
119
120 virtual ~wxMDIChildFrame();
121
122 // un-override the base class override
123 virtual bool IsTopLevel() const { return true; }
124
125 // implement MDI operations
126 virtual void Activate();
127
128
129 // Mac OS activate event
130 virtual void MacActivate(long timestamp, bool activating);
5c6eb3a8 131
5c6eb3a8 132protected:
5c6eb3a8
SC
133 // common part of all ctors
134 void Init();
5c6eb3a8 135
d2824cdb
VZ
136 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
137};
5c6eb3a8 138
d2824cdb 139class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
5c6eb3a8 140{
d2824cdb
VZ
141public:
142 wxMDIClientWindow() { }
143 virtual ~wxMDIClientWindow();
5c6eb3a8 144
d2824cdb
VZ
145 virtual bool CreateClient(wxMDIParentFrame *parent,
146 long style = wxVSCROLL | wxHSCROLL);
5c6eb3a8
SC
147
148protected:
d2824cdb 149 virtual void DoGetClientSize(int *width, int *height) const;
5c6eb3a8 150
d2824cdb 151 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
5c6eb3a8
SC
152};
153
d2824cdb 154#endif // _WX_OSX_CARBON_MDI_H_