1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/mdig.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 extern WXDLLEXPORT_DATA(const wxChar
) wxFrameNameStr
[];
25 extern WXDLLEXPORT_DATA(const wxChar
) wxStatusLineNameStr
[];
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 class WXDLLEXPORT wxTabMDIParentFrame
;
32 class WXDLLEXPORT wxTabMDIClientWindow
;
33 class WXDLLEXPORT wxTabMDIChildFrame
;
35 //-----------------------------------------------------------------------------
36 // wxTabMDIParentFrame
37 //-----------------------------------------------------------------------------
39 class WXDLLEXPORT wxTabMDIParentFrame
: public wxFrame
42 wxTabMDIParentFrame();
43 wxTabMDIParentFrame(wxWindow
*parent
,
45 const wxString
& title
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
49 const wxString
& name
= wxFrameNameStr
);
51 ~wxTabMDIParentFrame();
53 bool Create(wxWindow
*parent
,
55 const wxString
& title
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
59 const wxString
& name
= wxFrameNameStr
);
62 wxMenu
* GetWindowMenu() const { return m_pWindowMenu
; };
63 void SetWindowMenu(wxMenu
* pMenu
);
65 virtual void SetMenuBar(wxMenuBar
*pMenuBar
);
68 void SetChildMenuBar(wxTabMDIChildFrame
*pChild
);
70 virtual bool ProcessEvent(wxEvent
& event
);
72 wxTabMDIChildFrame
*GetActiveChild() const;
73 inline void SetActiveChild(wxTabMDIChildFrame
* pChildFrame
);
75 wxTabMDIClientWindow
*GetClientWindow() const;
76 virtual wxTabMDIClientWindow
*OnCreateClient();
78 virtual void Cascade() { /* Has no effect */ }
79 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) { }
80 virtual void ArrangeIcons() { /* Has no effect */ }
81 virtual void ActivateNext();
82 virtual void ActivatePrevious();
85 wxTabMDIClientWindow
*m_pClientWindow
;
86 wxTabMDIChildFrame
*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(wxTabMDIParentFrame
)
110 //-----------------------------------------------------------------------------
111 // wxTabMDIChildFrame
112 //-----------------------------------------------------------------------------
114 class WXDLLEXPORT wxTabMDIChildFrame
: public wxPanel
117 wxTabMDIChildFrame();
118 wxTabMDIChildFrame(wxTabMDIParentFrame
*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 ~wxTabMDIChildFrame();
127 bool Create(wxTabMDIParentFrame
*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(wxTabMDIParentFrame
* parent
);
195 wxTabMDIParentFrame
* GetMDIParentFrame() const;
198 wxTabMDIParentFrame
*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(wxTabMDIChildFrame
)
223 DECLARE_EVENT_TABLE()
225 friend class wxTabMDIClientWindow
;
228 //-----------------------------------------------------------------------------
229 // wxTabMDIClientWindow
230 //-----------------------------------------------------------------------------
232 class WXDLLEXPORT wxTabMDIClientWindow
: public wxAuiMultiNotebook
235 wxTabMDIClientWindow();
236 wxTabMDIClientWindow(wxTabMDIParentFrame
*parent
, long style
= 0);
237 ~wxTabMDIClientWindow();
239 virtual bool CreateClient(wxTabMDIParentFrame
*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(wxTabMDIClientWindow
)
252 DECLARE_EVENT_TABLE()
255 #endif // _WX_AUITABMDI_H_