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
8 // Copyright: (c) Stefan Csomor
9 // (c) 2008 Vadim Zeitlin
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_OSX_CARBON_MDI_H_
14 #define _WX_OSX_CARBON_MDI_H_
16 class WXDLLIMPEXP_CORE wxMDIParentFrame
: public wxMDIParentFrameBase
19 wxMDIParentFrame() { Init(); }
20 wxMDIParentFrame(wxWindow
*parent
,
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
)
29 Create(parent
, id
, title
, pos
, size
, style
, name
);
32 bool Create(wxWindow
*parent
,
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
);
40 virtual ~wxMDIParentFrame();
42 // implement/override base class [pure] virtuals
43 // ---------------------------------------------
45 static bool IsTDI() { return false; }
47 virtual void AddChild(wxWindowBase
*child
);
48 virtual void RemoveChild(wxWindowBase
*child
);
50 virtual void ActivateNext() { /* TODO */ }
51 virtual void ActivatePrevious() { /* TODO */ }
53 virtual bool Show(bool show
= true);
56 // Mac-specific implementation from now on
57 // ---------------------------------------
59 // Mac OS activate event
60 virtual void MacActivate(long timestamp
, bool activating
);
62 // wxWidgets activate event
63 void OnActivate(wxActivateEvent
& event
);
64 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
66 void SetMenuBar(wxMenuBar
*menu_bar
);
68 // Get rect to be used to center top-level children
69 virtual void GetRectForTopLevelChildren(int *x
, int *y
, int *w
, int *h
);
72 // common part of all ctors
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;
82 // true if MDI Frame is intercepting commands, not child
83 bool m_parentFrameActive
;
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
90 friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame
;
93 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
96 class WXDLLIMPEXP_CORE wxMDIChildFrame
: public wxMDIChildFrameBase
99 wxMDIChildFrame() { Init(); }
100 wxMDIChildFrame(wxMDIParentFrame
*parent
,
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
)
109 Create(parent
, id
, title
, pos
, size
, style
, name
);
112 bool Create(wxMDIParentFrame
*parent
,
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
);
120 virtual ~wxMDIChildFrame();
122 // un-override the base class override
123 virtual bool IsTopLevel() const { return true; }
125 // implement MDI operations
126 virtual void Activate();
129 // Mac OS activate event
130 virtual void MacActivate(long timestamp
, bool activating
);
133 // common part of all ctors
136 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
139 class WXDLLIMPEXP_CORE wxMDIClientWindow
: public wxMDIClientWindowBase
142 wxMDIClientWindow() { }
143 virtual ~wxMDIClientWindow();
145 virtual bool CreateClient(wxMDIParentFrame
*parent
,
146 long style
= wxVSCROLL
| wxHSCROLL
);
149 virtual void DoGetClientSize(int *width
, int *height
) const;
151 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
154 #endif // _WX_OSX_CARBON_MDI_H_