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
);
60 void SetArtProvider(wxAuiTabArt
* provider
);
61 wxAuiTabArt
* GetArtProvider();
62 wxAuiNotebook
* GetNotebook() const;
65 wxMenu
* GetWindowMenu() const { return m_pWindowMenu
; };
66 void SetWindowMenu(wxMenu
* pMenu
);
68 virtual void SetMenuBar(wxMenuBar
*pMenuBar
);
71 void SetChildMenuBar(wxAuiMDIChildFrame
*pChild
);
73 virtual bool ProcessEvent(wxEvent
& event
);
75 wxAuiMDIChildFrame
*GetActiveChild() const;
76 inline void SetActiveChild(wxAuiMDIChildFrame
* pChildFrame
);
78 wxAuiMDIClientWindow
*GetClientWindow() const;
79 virtual wxAuiMDIClientWindow
*OnCreateClient();
81 virtual void Cascade() { /* Has no effect */ }
82 virtual void Tile(wxOrientation
WXUNUSED(orient
) = wxHORIZONTAL
) { }
83 virtual void ArrangeIcons() { /* Has no effect */ }
84 virtual void ActivateNext();
85 virtual void ActivatePrevious();
88 wxAuiMDIClientWindow
* m_pClientWindow
;
89 wxAuiMDIChildFrame
* m_pActiveChild
;
93 wxMenu
*m_pWindowMenu
;
94 wxMenuBar
*m_pMyMenuBar
;
101 void RemoveWindowMenu(wxMenuBar
*pMenuBar
);
102 void AddWindowMenu(wxMenuBar
*pMenuBar
);
104 void DoHandleMenu(wxCommandEvent
&event
);
105 #endif // wxUSE_MENUS
107 virtual void DoGetClientSize(int *width
, int *height
) const;
110 DECLARE_EVENT_TABLE()
111 DECLARE_DYNAMIC_CLASS(wxAuiMDIParentFrame
)
114 //-----------------------------------------------------------------------------
115 // wxAuiMDIChildFrame
116 //-----------------------------------------------------------------------------
118 class WXDLLIMPEXP_AUI wxAuiMDIChildFrame
: public wxPanel
121 wxAuiMDIChildFrame();
122 wxAuiMDIChildFrame(wxAuiMDIParentFrame
*parent
,
124 const wxString
& title
,
125 const wxPoint
& pos
= wxDefaultPosition
,
126 const wxSize
& size
= wxDefaultSize
,
127 long style
= wxDEFAULT_FRAME_STYLE
,
128 const wxString
& name
= wxFrameNameStr
);
130 virtual ~wxAuiMDIChildFrame();
131 bool Create(wxAuiMDIParentFrame
*parent
,
133 const wxString
& title
,
134 const wxPoint
& pos
= wxDefaultPosition
,
135 const wxSize
& size
= wxDefaultSize
,
136 long style
= wxDEFAULT_FRAME_STYLE
,
137 const wxString
& name
= wxFrameNameStr
);
140 virtual void SetMenuBar(wxMenuBar
*menu_bar
);
141 virtual wxMenuBar
*GetMenuBar() const;
142 #endif // wxUSE_MENUS
144 virtual void SetTitle(const wxString
& title
);
145 virtual wxString
GetTitle() const;
147 virtual void Activate();
148 virtual bool Destroy();
152 virtual wxStatusBar
* CreateStatusBar(int WXUNUSED(number
) = 1,
153 long WXUNUSED(style
) = 1,
154 wxWindowID
WXUNUSED(winid
) = 1,
155 const wxString
& WXUNUSED(name
) = wxEmptyString
)
156 { return (wxStatusBar
*)NULL
; }
158 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
159 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
160 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
164 virtual void DoSetSizeHints(int WXUNUSED(minW
),
166 int WXUNUSED(maxW
) = wxDefaultCoord
,
167 int WXUNUSED(maxH
) = wxDefaultCoord
,
168 int WXUNUSED(incW
) = wxDefaultCoord
,
169 int WXUNUSED(incH
) = wxDefaultCoord
) {}
172 virtual wxToolBar
* CreateToolBar(long WXUNUSED(style
),
173 wxWindowID
WXUNUSED(winid
),
174 const wxString
& WXUNUSED(name
))
175 { return (wxToolBar
*)NULL
; }
176 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
180 void SetIcon(const wxIcon
& WXUNUSED(icon
)) { }
181 void SetIcons(const wxIconBundle
& WXUNUSED(icons
)) { }
184 virtual void Maximize(bool WXUNUSED(maximize
) = true) { /* Has no effect */ }
185 virtual void Restore() { /* Has no effect */ }
186 virtual void Iconize(bool WXUNUSED(iconize
) = true) { /* Has no effect */ }
187 virtual bool IsMaximized() const { return true; }
188 virtual bool IsIconized() const { return false; }
189 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
)) { return false; }
190 virtual bool IsFullScreen() const { return false; }
192 virtual bool IsTopLevel() const { return false; }
194 void OnMenuHighlight(wxMenuEvent
& evt
);
195 void OnActivate(wxActivateEvent
& evt
);
196 void OnCloseWindow(wxCloseEvent
& evt
);
198 void SetMDIParentFrame(wxAuiMDIParentFrame
* parent
);
199 wxAuiMDIParentFrame
* GetMDIParentFrame() const;
202 wxAuiMDIParentFrame
*m_pMDIParentFrame
;
203 wxRect m_mdi_newrect
;
204 wxRect m_mdi_currect
;
208 wxMenuBar
*m_pMenuBar
;
209 #endif // wxUSE_MENUS
214 virtual bool Show(bool show
= true);
215 virtual void DoSetSize(int x
, int y
, int width
, int height
, int size_flags
);
216 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
219 // This function needs to be called when a size change is confirmed,
220 // we needed this function to prevent anybody from the outside
221 // changing the panel... it messes the UI layout when we would allow it.
222 void ApplyMDIChildFrameRect();
223 void DoShow(bool show
);
226 DECLARE_DYNAMIC_CLASS(wxAuiMDIChildFrame
)
227 DECLARE_EVENT_TABLE()
229 friend class wxAuiMDIClientWindow
;
232 //-----------------------------------------------------------------------------
233 // wxAuiMDIClientWindow
234 //-----------------------------------------------------------------------------
236 class WXDLLIMPEXP_AUI wxAuiMDIClientWindow
: public wxAuiNotebook
239 wxAuiMDIClientWindow();
240 wxAuiMDIClientWindow(wxAuiMDIParentFrame
*parent
, long style
= 0);
241 ~wxAuiMDIClientWindow();
243 virtual bool CreateClient(wxAuiMDIParentFrame
*parent
,
244 long style
= wxVSCROLL
| wxHSCROLL
);
246 virtual int SetSelection(size_t page
);
250 void PageChanged(int old_selection
, int new_selection
);
251 void OnPageChanged(wxAuiNotebookEvent
& event
);
252 void OnSize(wxSizeEvent
& evt
);
255 DECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow
)
256 DECLARE_EVENT_TABLE()
260 #endif // _WX_AUITABMDI_H_