1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/tabmdi.h
3 // Purpose: Generic MDI (Multiple Document Interface) classes
4 // Author: Hans Van Leemputten
5 // Modified by: Benjamin I. Williams / Kirix Corporation
8 // Copyright: (c) Hans Van Leemputten
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_AUITABMDI_H_
13 #define _WX_AUITABMDI_H_
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
23 #include "wx/notebook.h"
24 #include "wx/aui/auibook.h"
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 class WXDLLIMPEXP_AUI wxAuiMDIParentFrame
;
31 class WXDLLIMPEXP_AUI wxAuiMDIClientWindow
;
32 class WXDLLIMPEXP_AUI wxAuiMDIChildFrame
;
34 //-----------------------------------------------------------------------------
35 // wxAuiMDIParentFrame
36 //-----------------------------------------------------------------------------
38 class WXDLLIMPEXP_AUI wxAuiMDIParentFrame
: public wxFrame
41 wxAuiMDIParentFrame();
42 wxAuiMDIParentFrame(wxWindow
*parent
,
44 const wxString
& title
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
48 const wxString
& name
= wxFrameNameStr
);
50 ~wxAuiMDIParentFrame();
52 bool Create(wxWindow
*parent
,
54 const wxString
& title
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
57 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
58 const wxString
& name
= wxFrameNameStr
);
61 wxMenu
* GetWindowMenu() const { return m_pWindowMenu
; };
62 void SetWindowMenu(wxMenu
* pMenu
);
64 virtual void SetMenuBar(wxMenuBar
*pMenuBar
);
67 void SetChildMenuBar(wxAuiMDIChildFrame
*pChild
);
69 virtual bool ProcessEvent(wxEvent
& event
);
71 wxAuiMDIChildFrame
*GetActiveChild() const;
72 inline void SetActiveChild(wxAuiMDIChildFrame
* pChildFrame
);
74 wxAuiMDIClientWindow
*GetClientWindow() const;
75 virtual wxAuiMDIClientWindow
*OnCreateClient();
77 virtual void Cascade() { /* Has no effect */ }
78 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) { }
79 virtual void ArrangeIcons() { /* Has no effect */ }
80 virtual void ActivateNext();
81 virtual void ActivatePrevious();
84 wxAuiMDIClientWindow
* m_pClientWindow
;
85 wxAuiMDIChildFrame
* m_pActiveChild
;
89 wxMenu
*m_pWindowMenu
;
90 wxMenuBar
*m_pMyMenuBar
;
97 void RemoveWindowMenu(wxMenuBar
*pMenuBar
);
98 void AddWindowMenu(wxMenuBar
*pMenuBar
);
100 void DoHandleMenu(wxCommandEvent
&event
);
101 #endif // wxUSE_MENUS
103 virtual void DoGetClientSize(int *width
, int *height
) const;
106 DECLARE_EVENT_TABLE()
107 DECLARE_DYNAMIC_CLASS(wxAuiMDIParentFrame
)
110 //-----------------------------------------------------------------------------
111 // wxAuiMDIChildFrame
112 //-----------------------------------------------------------------------------
114 class WXDLLIMPEXP_AUI wxAuiMDIChildFrame
: public wxPanel
117 wxAuiMDIChildFrame();
118 wxAuiMDIChildFrame(wxAuiMDIParentFrame
*parent
,
120 const wxString
& title
,
121 const wxPoint
& pos
= wxDefaultPosition
,
122 const wxSize
& size
= wxDefaultSize
,
123 long style
= wxDEFAULT_FRAME_STYLE
,
124 const wxString
& name
= wxFrameNameStr
);
126 virtual ~wxAuiMDIChildFrame();
127 bool Create(wxAuiMDIParentFrame
*parent
,
129 const wxString
& title
,
130 const wxPoint
& pos
= wxDefaultPosition
,
131 const wxSize
& size
= wxDefaultSize
,
132 long style
= wxDEFAULT_FRAME_STYLE
,
133 const wxString
& name
= wxFrameNameStr
);
136 virtual void SetMenuBar(wxMenuBar
*menu_bar
);
137 virtual wxMenuBar
*GetMenuBar() const;
138 #endif // wxUSE_MENUS
140 virtual void SetTitle(const wxString
& title
);
141 virtual wxString
GetTitle() const;
143 virtual void Activate();
144 virtual bool Destroy();
148 virtual wxStatusBar
* CreateStatusBar(int WXUNUSED(number
) = 1,
149 long WXUNUSED(style
) = 1,
150 wxWindowID
WXUNUSED(winid
) = 1,
151 const wxString
& WXUNUSED(name
) = wxEmptyString
)
152 { return (wxStatusBar
*)NULL
; }
154 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
155 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
156 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
160 virtual void DoSetSizeHints(int WXUNUSED(minW
),
162 int WXUNUSED(maxW
) = wxDefaultCoord
,
163 int WXUNUSED(maxH
) = wxDefaultCoord
,
164 int WXUNUSED(incW
) = wxDefaultCoord
,
165 int WXUNUSED(incH
) = wxDefaultCoord
) {}
168 virtual wxToolBar
* CreateToolBar(long WXUNUSED(style
),
169 wxWindowID
WXUNUSED(winid
),
170 const wxString
& WXUNUSED(name
))
171 { return (wxToolBar
*)NULL
; }
172 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
176 void SetIcon(const wxIcon
& WXUNUSED(icon
)) { }
177 void SetIcons(const wxIconBundle
& WXUNUSED(icons
)) { }
180 virtual void Maximize(bool WXUNUSED(maximize
) = true) { /* Has no effect */ }
181 virtual void Restore() { /* Has no effect */ }
182 virtual void Iconize(bool WXUNUSED(iconize
) = true) { /* Has no effect */ }
183 virtual bool IsMaximized() const { return true; }
184 virtual bool IsIconized() const { return false; }
185 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
)) { return false; }
186 virtual bool IsFullScreen() const { return false; }
188 virtual bool IsTopLevel() const { return false; }
190 void OnMenuHighlight(wxMenuEvent
& evt
);
191 void OnActivate(wxActivateEvent
& evt
);
192 void OnCloseWindow(wxCloseEvent
& evt
);
194 void SetMDIParentFrame(wxAuiMDIParentFrame
* parent
);
195 wxAuiMDIParentFrame
* GetMDIParentFrame() const;
198 wxAuiMDIParentFrame
*m_pMDIParentFrame
;
199 wxRect m_mdi_newrect
;
200 wxRect m_mdi_currect
;
204 wxMenuBar
*m_pMenuBar
;
205 #endif // wxUSE_MENUS
210 virtual bool Show(bool show
= true);
211 virtual void DoSetSize(int x
, int y
, int width
, int height
, int size_flags
);
212 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
215 // This function needs to be called when a size change is confirmed,
216 // we needed this function to prevent anybody from the outside
217 // changing the panel... it messes the UI layout when we would allow it.
218 void ApplyMDIChildFrameRect();
219 void DoShow(bool show
);
222 DECLARE_DYNAMIC_CLASS(wxAuiMDIChildFrame
)
223 DECLARE_EVENT_TABLE()
225 friend class wxAuiMDIClientWindow
;
228 //-----------------------------------------------------------------------------
229 // wxAuiMDIClientWindow
230 //-----------------------------------------------------------------------------
232 class WXDLLIMPEXP_AUI wxAuiMDIClientWindow
: public wxAuiNotebook
235 wxAuiMDIClientWindow();
236 wxAuiMDIClientWindow(wxAuiMDIParentFrame
*parent
, long style
= 0);
237 ~wxAuiMDIClientWindow();
239 virtual bool CreateClient(wxAuiMDIParentFrame
*parent
,
240 long style
= wxVSCROLL
| wxHSCROLL
);
242 virtual int SetSelection(size_t page
);
246 void PageChanged(int old_selection
, int new_selection
);
247 void OnPageChanged(wxAuiNotebookEvent
& event
);
248 void OnSize(wxSizeEvent
& evt
);
251 DECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow
)
252 DECLARE_EVENT_TABLE()
256 #endif // _WX_AUITABMDI_H_