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 SetIcons(const wxIconBundle
& icons
);
148 virtual const wxIconBundle
& GetIcons() const;
150 virtual void SetIcon(const wxIcon
& icon
);
151 virtual const wxIcon
& GetIcon() const;
153 virtual void Activate();
154 virtual bool Destroy();
158 virtual wxStatusBar
* CreateStatusBar(int WXUNUSED(number
) = 1,
159 long WXUNUSED(style
) = 1,
160 wxWindowID
WXUNUSED(winid
) = 1,
161 const wxString
& WXUNUSED(name
) = wxEmptyString
)
162 { return (wxStatusBar
*)NULL
; }
164 virtual wxStatusBar
*GetStatusBar() const { return (wxStatusBar
*)NULL
; }
165 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
)=0 ) {}
166 virtual void SetStatusWidths( int WXUNUSED(n
), const int WXUNUSED(widths_field
)[] ) {}
170 virtual void DoSetSizeHints(int WXUNUSED(minW
),
172 int WXUNUSED(maxW
) = wxDefaultCoord
,
173 int WXUNUSED(maxH
) = wxDefaultCoord
,
174 int WXUNUSED(incW
) = wxDefaultCoord
,
175 int WXUNUSED(incH
) = wxDefaultCoord
) {}
178 virtual wxToolBar
* CreateToolBar(long WXUNUSED(style
),
179 wxWindowID
WXUNUSED(winid
),
180 const wxString
& WXUNUSED(name
))
181 { return (wxToolBar
*)NULL
; }
182 virtual wxToolBar
*GetToolBar() const { return (wxToolBar
*)NULL
; }
187 virtual void Maximize(bool WXUNUSED(maximize
) = true) { /* Has no effect */ }
188 virtual void Restore() { /* Has no effect */ }
189 virtual void Iconize(bool WXUNUSED(iconize
) = true) { /* Has no effect */ }
190 virtual bool IsMaximized() const { return true; }
191 virtual bool IsIconized() const { return false; }
192 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
)) { return false; }
193 virtual bool IsFullScreen() const { return false; }
195 virtual bool IsTopLevel() const { return false; }
197 void OnMenuHighlight(wxMenuEvent
& evt
);
198 void OnActivate(wxActivateEvent
& evt
);
199 void OnCloseWindow(wxCloseEvent
& evt
);
201 void SetMDIParentFrame(wxAuiMDIParentFrame
* parent
);
202 wxAuiMDIParentFrame
* GetMDIParentFrame() const;
206 virtual bool Show(bool show
= true);
207 virtual void DoSetSize(int x
, int y
, int width
, int height
, int size_flags
);
208 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
211 // This function needs to be called when a size change is confirmed,
212 // we needed this function to prevent anybody from the outside
213 // changing the panel... it messes the UI layout when we would allow it.
214 void ApplyMDIChildFrameRect();
215 void DoShow(bool show
);
218 wxAuiMDIParentFrame
* m_pMDIParentFrame
;
219 wxRect m_mdi_newrect
;
220 wxRect m_mdi_currect
;
223 wxIconBundle m_icon_bundle
;
226 wxMenuBar
* m_pMenuBar
;
227 #endif // wxUSE_MENUS
232 DECLARE_DYNAMIC_CLASS(wxAuiMDIChildFrame
)
233 DECLARE_EVENT_TABLE()
235 friend class wxAuiMDIClientWindow
;
238 //-----------------------------------------------------------------------------
239 // wxAuiMDIClientWindow
240 //-----------------------------------------------------------------------------
242 class WXDLLIMPEXP_AUI wxAuiMDIClientWindow
: public wxAuiNotebook
245 wxAuiMDIClientWindow();
246 wxAuiMDIClientWindow(wxAuiMDIParentFrame
*parent
, long style
= 0);
247 ~wxAuiMDIClientWindow();
249 virtual bool CreateClient(wxAuiMDIParentFrame
*parent
,
250 long style
= wxVSCROLL
| wxHSCROLL
);
252 virtual int SetSelection(size_t page
);
256 void PageChanged(int old_selection
, int new_selection
);
257 void OnPageChanged(wxAuiNotebookEvent
& event
);
258 void OnSize(wxSizeEvent
& evt
);
261 DECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow
)
262 DECLARE_EVENT_TABLE()
266 #endif // _WX_AUITABMDI_H_