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_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
21 #include "wx/notebook.h"
22 #include "wx/aui/auibook.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 class WXDLLEXPORT wxTabMDIParentFrame
;
29 class WXDLLEXPORT wxTabMDIClientWindow
;
30 class WXDLLEXPORT wxTabMDIChildFrame
;
32 //-----------------------------------------------------------------------------
33 // wxTabMDIParentFrame
34 //-----------------------------------------------------------------------------
36 class WXDLLIMPEXP_AUI wxTabMDIParentFrame
: public wxFrame
39 wxTabMDIParentFrame();
40 wxTabMDIParentFrame(wxWindow
*parent
,
42 const wxString
& title
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
46 const wxString
& name
= wxFrameNameStr
);
48 ~wxTabMDIParentFrame();
50 bool Create(wxWindow
*parent
,
52 const wxString
& title
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
55 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
56 const wxString
& name
= wxFrameNameStr
);
59 wxMenu
* GetWindowMenu() const { return m_pWindowMenu
; };
60 void SetWindowMenu(wxMenu
* pMenu
);
62 virtual void SetMenuBar(wxMenuBar
*pMenuBar
);
65 void SetChildMenuBar(wxTabMDIChildFrame
*pChild
);
67 virtual bool ProcessEvent(wxEvent
& event
);
69 wxTabMDIChildFrame
*GetActiveChild() const;
70 inline void SetActiveChild(wxTabMDIChildFrame
* pChildFrame
);
72 wxTabMDIClientWindow
*GetClientWindow() const;
73 virtual wxTabMDIClientWindow
*OnCreateClient();
75 virtual void Cascade() { /* Has no effect */ }
76 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) { }
77 virtual void ArrangeIcons() { /* Has no effect */ }
78 virtual void ActivateNext();
79 virtual void ActivatePrevious();
82 wxTabMDIClientWindow
*m_pClientWindow
;
83 wxTabMDIChildFrame
*m_pActiveChild
;
86 wxMenu
*m_pWindowMenu
;
87 wxMenuBar
*m_pMyMenuBar
;
94 void RemoveWindowMenu(wxMenuBar
*pMenuBar
);
95 void AddWindowMenu(wxMenuBar
*pMenuBar
);
97 void DoHandleMenu(wxCommandEvent
&event
);
100 virtual void DoGetClientSize(int *width
, int *height
) const;
103 DECLARE_EVENT_TABLE()
104 DECLARE_DYNAMIC_CLASS(wxTabMDIParentFrame
)
107 //-----------------------------------------------------------------------------
108 // wxTabMDIChildFrame
109 //-----------------------------------------------------------------------------
111 class WXDLLIMPEXP_AUI wxTabMDIChildFrame
: public wxPanel
114 wxTabMDIChildFrame();
115 wxTabMDIChildFrame(wxTabMDIParentFrame
*parent
,
117 const wxString
& title
,
118 const wxPoint
& pos
= wxDefaultPosition
,
119 const wxSize
& size
= wxDefaultSize
,
120 long style
= wxDEFAULT_FRAME_STYLE
,
121 const wxString
& name
= wxFrameNameStr
);
123 virtual ~wxTabMDIChildFrame();
124 bool Create(wxTabMDIParentFrame
*parent
,
126 const wxString
& title
,
127 const wxPoint
& pos
= wxDefaultPosition
,
128 const wxSize
& size
= wxDefaultSize
,
129 long style
= wxDEFAULT_FRAME_STYLE
,
130 const wxString
& name
= wxFrameNameStr
);
133 virtual void SetMenuBar(wxMenuBar
*menu_bar
);
134 virtual wxMenuBar
*GetMenuBar() const;
135 #endif // wxUSE_MENUS
137 virtual void SetTitle(const wxString
& title
);
138 virtual wxString
GetTitle() const;
140 virtual void Activate();
141 virtual bool Destroy();
145 virtual wxStatusBar
* CreateStatusBar(int WXUNUSED(number
) = 1,
146 long WXUNUSED(style
) = 1,
147 wxWindowID
WXUNUSED(winid
) = 1,
148 const wxString
& WXUNUSED(name
) = wxEmptyString
)
149 { return (wxStatusBar
*)NULL
; }
151 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
152 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
153 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
157 virtual void DoSetSizeHints(int WXUNUSED(minW
),
159 int WXUNUSED(maxW
) = wxDefaultCoord
,
160 int WXUNUSED(maxH
) = wxDefaultCoord
,
161 int WXUNUSED(incW
) = wxDefaultCoord
,
162 int WXUNUSED(incH
) = wxDefaultCoord
) {}
165 virtual wxToolBar
* CreateToolBar(long WXUNUSED(style
),
166 wxWindowID
WXUNUSED(winid
),
167 const wxString
& WXUNUSED(name
))
168 { return (wxToolBar
*)NULL
; }
169 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
173 void SetIcon(const wxIcon
& WXUNUSED(icon
)) { }
174 void SetIcons(const wxIconBundle
& WXUNUSED(icons
)) { }
177 virtual void Maximize(bool WXUNUSED(maximize
) = true) { /* Has no effect */ }
178 virtual void Restore() { /* Has no effect */ }
179 virtual void Iconize(bool WXUNUSED(iconize
) = true) { /* Has no effect */ }
180 virtual bool IsMaximized() const { return true; }
181 virtual bool IsIconized() const { return false; }
182 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
)) { return false; }
183 virtual bool IsFullScreen() const { return false; }
185 virtual bool IsTopLevel() const { return false; }
187 void OnMenuHighlight(wxMenuEvent
& evt
);
188 void OnActivate(wxActivateEvent
& evt
);
189 void OnCloseWindow(wxCloseEvent
& evt
);
191 void SetMDIParentFrame(wxTabMDIParentFrame
* parent
);
192 wxTabMDIParentFrame
* GetMDIParentFrame() const;
195 wxTabMDIParentFrame
*m_pMDIParentFrame
;
196 wxRect m_mdi_newrect
;
197 wxRect m_mdi_currect
;
201 wxMenuBar
*m_pMenuBar
;
202 #endif // wxUSE_MENUS
207 virtual bool Show(bool show
= true);
208 virtual void DoSetSize(int x
, int y
, int width
, int height
, int size_flags
);
209 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
212 // This function needs to be called when a size change is confirmed,
213 // we needed this function to prevent anybody from the outside
214 // changing the panel... it messes the UI layout when we would allow it.
215 void ApplyMDIChildFrameRect();
216 void DoShow(bool show
);
219 DECLARE_DYNAMIC_CLASS(wxTabMDIChildFrame
)
220 DECLARE_EVENT_TABLE()
222 friend class wxTabMDIClientWindow
;
225 //-----------------------------------------------------------------------------
226 // wxTabMDIClientWindow
227 //-----------------------------------------------------------------------------
229 class WXDLLIMPEXP_AUI wxTabMDIClientWindow
: public wxAuiMultiNotebook
232 wxTabMDIClientWindow();
233 wxTabMDIClientWindow(wxTabMDIParentFrame
*parent
, long style
= 0);
234 ~wxTabMDIClientWindow();
236 virtual bool CreateClient(wxTabMDIParentFrame
*parent
,
237 long style
= wxVSCROLL
| wxHSCROLL
);
239 virtual int SetSelection(size_t page
);
243 void PageChanged(int old_selection
, int new_selection
);
244 void OnPageChanged(wxAuiNotebookEvent
& event
);
245 void OnSize(wxSizeEvent
& evt
);
248 DECLARE_DYNAMIC_CLASS(wxTabMDIClientWindow
)
249 DECLARE_EVENT_TABLE()
252 #endif // _WX_AUITABMDI_H_