1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: MDI (Multiple Document Interface) classes.
4 // Author: Stefan Csomor
5 // Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
7 // Copyright: (c) Stefan Csomor
8 // (c) 2008 Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OSX_CARBON_MDI_H_
13 #define _WX_OSX_CARBON_MDI_H_
15 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxMDIParentFrameBase
18 wxMDIParentFrame() { Init(); }
19 wxMDIParentFrame(wxWindow
*parent
,
21 const wxString
& title
,
22 const wxPoint
& pos
= wxDefaultPosition
,
23 const wxSize
& size
= wxDefaultSize
,
24 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
25 const wxString
& name
= wxFrameNameStr
)
28 Create(parent
, id
, title
, pos
, size
, style
, name
);
31 bool Create(wxWindow
*parent
,
33 const wxString
& title
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
37 const wxString
& name
= wxFrameNameStr
);
39 virtual ~wxMDIParentFrame();
41 // implement/override base class [pure] virtuals
42 // ---------------------------------------------
44 static bool IsTDI() { return false; }
46 virtual void AddChild(wxWindowBase
*child
);
47 virtual void RemoveChild(wxWindowBase
*child
);
49 virtual void ActivateNext() { /* TODO */ }
50 virtual void ActivatePrevious() { /* TODO */ }
52 virtual bool Show(bool show
= true);
55 // Mac-specific implementation from now on
56 // ---------------------------------------
58 // Mac OS activate event
59 virtual void MacActivate(long timestamp
, bool activating
);
61 // wxWidgets activate event
62 void OnActivate(wxActivateEvent
& event
);
63 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
65 void SetMenuBar(wxMenuBar
*menu_bar
);
67 // Get rect to be used to center top-level children
68 virtual void GetRectForTopLevelChildren(int *x
, int *y
, int *w
, int *h
);
71 // common part of all ctors
74 // returns true if this frame has some contents and so should be visible,
75 // false if it's used solely as container for its children
76 bool ShouldBeVisible() const;
81 // true if MDI Frame is intercepting commands, not child
82 bool m_parentFrameActive
;
84 // true if the frame should be shown but is not because it is empty and
85 // useless otherwise than a container for its children
89 friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
92 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
95 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxMDIChildFrameBase
98 wxMDIChildFrame() { Init(); }
99 wxMDIChildFrame(wxMDIParentFrame
*parent
,
101 const wxString
& title
,
102 const wxPoint
& pos
= wxDefaultPosition
,
103 const wxSize
& size
= wxDefaultSize
,
104 long style
= wxDEFAULT_FRAME_STYLE
,
105 const wxString
& name
= wxFrameNameStr
)
108 Create(parent
, id
, title
, pos
, size
, style
, name
);
111 bool Create(wxMDIParentFrame
*parent
,
113 const wxString
& title
,
114 const wxPoint
& pos
= wxDefaultPosition
,
115 const wxSize
& size
= wxDefaultSize
,
116 long style
= wxDEFAULT_FRAME_STYLE
,
117 const wxString
& name
= wxFrameNameStr
);
119 virtual ~wxMDIChildFrame();
121 // un-override the base class override
122 virtual bool IsTopLevel() const { return true; }
124 // implement MDI operations
125 virtual void Activate();
128 // Mac OS activate event
129 virtual void MacActivate(long timestamp
, bool activating
);
132 // common part of all ctors
135 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
138 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
141 wxMDIClientWindow() { }
142 virtual ~wxMDIClientWindow();
144 virtual bool CreateClient(wxMDIParentFrame
*parent
,
145 long style
= wxVSCROLL
| wxHSCROLL
);
148 virtual void DoGetClientSize(int *width
, int *height
) const;
150 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
153 #endif // _WX_OSX_CARBON_MDI_H_