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
;
88 wxMenu
*m_pWindowMenu
;
89 wxMenuBar
*m_pMyMenuBar
;
96 void RemoveWindowMenu(wxMenuBar
*pMenuBar
);
97 void AddWindowMenu(wxMenuBar
*pMenuBar
);
99 void DoHandleMenu(wxCommandEvent
&event
);
100 #endif // wxUSE_MENUS
102 virtual void DoGetClientSize(int *width
, int *height
) const;
105 DECLARE_EVENT_TABLE()
106 DECLARE_DYNAMIC_CLASS(wxAuiMDIParentFrame
)
109 //-----------------------------------------------------------------------------
110 // wxAuiMDIChildFrame
111 //-----------------------------------------------------------------------------
113 class WXDLLIMPEXP_AUI wxAuiMDIChildFrame
: public wxPanel
116 wxAuiMDIChildFrame();
117 wxAuiMDIChildFrame(wxAuiMDIParentFrame
*parent
,
119 const wxString
& title
,
120 const wxPoint
& pos
= wxDefaultPosition
,
121 const wxSize
& size
= wxDefaultSize
,
122 long style
= wxDEFAULT_FRAME_STYLE
,
123 const wxString
& name
= wxFrameNameStr
);
125 virtual ~wxAuiMDIChildFrame();
126 bool Create(wxAuiMDIParentFrame
*parent
,
128 const wxString
& title
,
129 const wxPoint
& pos
= wxDefaultPosition
,
130 const wxSize
& size
= wxDefaultSize
,
131 long style
= wxDEFAULT_FRAME_STYLE
,
132 const wxString
& name
= wxFrameNameStr
);
135 virtual void SetMenuBar(wxMenuBar
*menu_bar
);
136 virtual wxMenuBar
*GetMenuBar() const;
137 #endif // wxUSE_MENUS
139 virtual void SetTitle(const wxString
& title
);
140 virtual wxString
GetTitle() const;
142 virtual void Activate();
143 virtual bool Destroy();
147 virtual wxStatusBar
* CreateStatusBar(int WXUNUSED(number
) = 1,
148 long WXUNUSED(style
) = 1,
149 wxWindowID
WXUNUSED(winid
) = 1,
150 const wxString
& WXUNUSED(name
) = wxEmptyString
)
151 { return (wxStatusBar
*)NULL
; }
153 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
154 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
155 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
159 virtual void DoSetSizeHints(int WXUNUSED(minW
),
161 int WXUNUSED(maxW
) = wxDefaultCoord
,
162 int WXUNUSED(maxH
) = wxDefaultCoord
,
163 int WXUNUSED(incW
) = wxDefaultCoord
,
164 int WXUNUSED(incH
) = wxDefaultCoord
) {}
167 virtual wxToolBar
* CreateToolBar(long WXUNUSED(style
),
168 wxWindowID
WXUNUSED(winid
),
169 const wxString
& WXUNUSED(name
))
170 { return (wxToolBar
*)NULL
; }
171 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
175 void SetIcon(const wxIcon
& WXUNUSED(icon
)) { }
176 void SetIcons(const wxIconBundle
& WXUNUSED(icons
)) { }
179 virtual void Maximize(bool WXUNUSED(maximize
) = true) { /* Has no effect */ }
180 virtual void Restore() { /* Has no effect */ }
181 virtual void Iconize(bool WXUNUSED(iconize
) = true) { /* Has no effect */ }
182 virtual bool IsMaximized() const { return true; }
183 virtual bool IsIconized() const { return false; }
184 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
)) { return false; }
185 virtual bool IsFullScreen() const { return false; }
187 virtual bool IsTopLevel() const { return false; }
189 void OnMenuHighlight(wxMenuEvent
& evt
);
190 void OnActivate(wxActivateEvent
& evt
);
191 void OnCloseWindow(wxCloseEvent
& evt
);
193 void SetMDIParentFrame(wxAuiMDIParentFrame
* parent
);
194 wxAuiMDIParentFrame
* GetMDIParentFrame() const;
197 wxAuiMDIParentFrame
*m_pMDIParentFrame
;
198 wxRect m_mdi_newrect
;
199 wxRect m_mdi_currect
;
203 wxMenuBar
*m_pMenuBar
;
204 #endif // wxUSE_MENUS
209 virtual bool Show(bool show
= true);
210 virtual void DoSetSize(int x
, int y
, int width
, int height
, int size_flags
);
211 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
214 // This function needs to be called when a size change is confirmed,
215 // we needed this function to prevent anybody from the outside
216 // changing the panel... it messes the UI layout when we would allow it.
217 void ApplyMDIChildFrameRect();
218 void DoShow(bool show
);
221 DECLARE_DYNAMIC_CLASS(wxAuiMDIChildFrame
)
222 DECLARE_EVENT_TABLE()
224 friend class wxAuiMDIClientWindow
;
227 //-----------------------------------------------------------------------------
228 // wxAuiMDIClientWindow
229 //-----------------------------------------------------------------------------
231 class WXDLLIMPEXP_AUI wxAuiMDIClientWindow
: public wxAuiNotebook
234 wxAuiMDIClientWindow();
235 wxAuiMDIClientWindow(wxAuiMDIParentFrame
*parent
, long style
= 0);
236 ~wxAuiMDIClientWindow();
238 virtual bool CreateClient(wxAuiMDIParentFrame
*parent
,
239 long style
= wxVSCROLL
| wxHSCROLL
);
241 virtual int SetSelection(size_t page
);
245 void PageChanged(int old_selection
, int new_selection
);
246 void OnPageChanged(wxAuiNotebookEvent
& event
);
247 void OnSize(wxSizeEvent
& evt
);
250 DECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow
)
251 DECLARE_EVENT_TABLE()
255 #endif // _WX_AUITABMDI_H_