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 wxTabMDIParentFrame
;
31 class WXDLLIMPEXP_AUI wxTabMDIClientWindow
;
32 class WXDLLIMPEXP_AUI wxTabMDIChildFrame
;
34 //-----------------------------------------------------------------------------
35 // wxTabMDIParentFrame
36 //-----------------------------------------------------------------------------
38 class WXDLLIMPEXP_AUI wxTabMDIParentFrame
: public wxFrame
41 wxTabMDIParentFrame();
42 wxTabMDIParentFrame(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 ~wxTabMDIParentFrame();
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(wxTabMDIChildFrame
*pChild
);
69 virtual bool ProcessEvent(wxEvent
& event
);
71 wxTabMDIChildFrame
*GetActiveChild() const;
72 inline void SetActiveChild(wxTabMDIChildFrame
* pChildFrame
);
74 wxTabMDIClientWindow
*GetClientWindow() const;
75 virtual wxTabMDIClientWindow
*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 wxTabMDIClientWindow
*m_pClientWindow
;
85 wxTabMDIChildFrame
*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(wxTabMDIParentFrame
)
109 //-----------------------------------------------------------------------------
110 // wxTabMDIChildFrame
111 //-----------------------------------------------------------------------------
113 class WXDLLIMPEXP_AUI wxTabMDIChildFrame
: public wxPanel
116 wxTabMDIChildFrame();
117 wxTabMDIChildFrame(wxTabMDIParentFrame
*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 ~wxTabMDIChildFrame();
126 bool Create(wxTabMDIParentFrame
*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(wxTabMDIParentFrame
* parent
);
194 wxTabMDIParentFrame
* GetMDIParentFrame() const;
197 wxTabMDIParentFrame
*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(wxTabMDIChildFrame
)
222 DECLARE_EVENT_TABLE()
224 friend class wxTabMDIClientWindow
;
227 //-----------------------------------------------------------------------------
228 // wxTabMDIClientWindow
229 //-----------------------------------------------------------------------------
231 class WXDLLIMPEXP_AUI wxTabMDIClientWindow
: public wxAuiMultiNotebook
234 wxTabMDIClientWindow();
235 wxTabMDIClientWindow(wxTabMDIParentFrame
*parent
, long style
= 0);
236 ~wxTabMDIClientWindow();
238 virtual bool CreateClient(wxTabMDIParentFrame
*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(wxTabMDIClientWindow
)
251 DECLARE_EVENT_TABLE()
255 #endif // _WX_AUITABMDI_H_