]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
cb8cc250 | 2 | // Name: wx/gtk/mdi.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
58614078 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling | |
65571936 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __MDIH__ |
11 | #define __MDIH__ | |
12 | ||
c801d85f KB |
13 | #include "wx/defs.h" |
14 | #include "wx/object.h" | |
15 | #include "wx/list.h" | |
16 | #include "wx/control.h" | |
17 | #include "wx/panel.h" | |
18 | #include "wx/frame.h" | |
716b7364 | 19 | #include "wx/toolbar.h" |
c801d85f KB |
20 | |
21 | //----------------------------------------------------------------------------- | |
22 | // classes | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
20123d49 MW |
25 | class WXDLLIMPEXP_CORE wxMDIParentFrame; |
26 | class WXDLLIMPEXP_CORE wxMDIClientWindow; | |
27 | class WXDLLIMPEXP_CORE wxMDIChildFrame; | |
c801d85f KB |
28 | |
29 | //----------------------------------------------------------------------------- | |
30 | // global data | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
63ec432b MR |
33 | extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[]; |
34 | extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[]; | |
c801d85f KB |
35 | |
36 | //----------------------------------------------------------------------------- | |
37 | // wxMDIParentFrame | |
38 | //----------------------------------------------------------------------------- | |
39 | ||
20123d49 | 40 | class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame |
c801d85f | 41 | { |
ab2b3dd4 | 42 | public: |
f6bcfd97 BP |
43 | wxMDIParentFrame() { Init(); } |
44 | wxMDIParentFrame(wxWindow *parent, | |
45 | wxWindowID id, | |
46 | const wxString& title, | |
47 | const wxPoint& pos = wxDefaultPosition, | |
48 | const wxSize& size = wxDefaultSize, | |
49 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
50 | const wxString& name = wxFrameNameStr) | |
51 | { | |
52 | Init(); | |
53 | ||
54 | (void)Create(parent, id, title, pos, size, style, name); | |
55 | } | |
56 | ||
40d432c4 | 57 | ~wxMDIParentFrame(); |
8487f887 | 58 | bool Create( wxWindow *parent, |
40d432c4 VZ |
59 | wxWindowID id, |
60 | const wxString& title, | |
61 | const wxPoint& pos = wxDefaultPosition, | |
62 | const wxSize& size = wxDefaultSize, | |
63 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
64 | const wxString& name = wxFrameNameStr ); | |
c801d85f | 65 | |
ab2b3dd4 | 66 | wxMDIChildFrame *GetActiveChild() const; |
f6bcfd97 BP |
67 | |
68 | wxMDIClientWindow *GetClientWindow() const; | |
ab2b3dd4 | 69 | virtual wxMDIClientWindow *OnCreateClient(); |
f6bcfd97 | 70 | |
ab2b3dd4 | 71 | virtual void Cascade() {} |
0d97c090 | 72 | virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {} |
ab2b3dd4 RR |
73 | virtual void ArrangeIcons() {} |
74 | virtual void ActivateNext(); | |
75 | virtual void ActivatePrevious(); | |
716b7364 | 76 | |
f6bcfd97 | 77 | // implementation |
ab2b3dd4 RR |
78 | |
79 | wxMDIClientWindow *m_clientWindow; | |
80 | bool m_justInserted; | |
81 | ||
716b7364 | 82 | virtual void GtkOnSize( int x, int y, int width, int height ); |
ab2b3dd4 | 83 | virtual void OnInternalIdle(); |
f6bcfd97 BP |
84 | |
85 | protected: | |
86 | void Init(); | |
87 | ||
885df446 VZ |
88 | virtual void DoGetClientSize(int *width, int *height) const; |
89 | ||
8487f887 RR |
90 | private: |
91 | friend class wxMDIChildFrame; | |
f6bcfd97 | 92 | |
8487f887 | 93 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) |
c801d85f KB |
94 | }; |
95 | ||
96 | //----------------------------------------------------------------------------- | |
97 | // wxMDIChildFrame | |
98 | //----------------------------------------------------------------------------- | |
99 | ||
20123d49 | 100 | class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame |
c801d85f | 101 | { |
8487f887 | 102 | public: |
ab2b3dd4 | 103 | wxMDIChildFrame(); |
c801d85f | 104 | wxMDIChildFrame( wxMDIParentFrame *parent, |
885df446 VZ |
105 | wxWindowID id, |
106 | const wxString& title, | |
107 | const wxPoint& pos = wxDefaultPosition, | |
108 | const wxSize& size = wxDefaultSize, | |
109 | long style = wxDEFAULT_FRAME_STYLE, | |
110 | const wxString& name = wxFrameNameStr ); | |
111 | ||
112 | virtual ~wxMDIChildFrame(); | |
c801d85f | 113 | bool Create( wxMDIParentFrame *parent, |
885df446 VZ |
114 | wxWindowID id, |
115 | const wxString& title, | |
116 | const wxPoint& pos = wxDefaultPosition, | |
117 | const wxSize& size = wxDefaultSize, | |
118 | long style = wxDEFAULT_FRAME_STYLE, | |
119 | const wxString& name = wxFrameNameStr ); | |
f6bcfd97 | 120 | |
8487f887 RR |
121 | virtual void SetMenuBar( wxMenuBar *menu_bar ); |
122 | virtual wxMenuBar *GetMenuBar() const; | |
c801d85f | 123 | |
8487f887 | 124 | virtual void AddChild( wxWindowBase *child ); |
debe6624 | 125 | |
8487f887 | 126 | virtual void Activate(); |
f6bcfd97 | 127 | |
dcf924a3 | 128 | #if wxUSE_STATUSBAR |
cf4219e7 | 129 | // no status bars |
8487f887 | 130 | virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, |
f6bcfd97 | 131 | long WXUNUSED(style) = 1, |
e90c1d2a VZ |
132 | wxWindowID WXUNUSED(id) = 1, |
133 | const wxString& WXUNUSED(name) = wxEmptyString) | |
8487f887 | 134 | { return (wxStatusBar*)NULL; } |
e90c1d2a | 135 | |
8487f887 RR |
136 | virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } |
137 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} | |
138 | virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} | |
dcf924a3 | 139 | #endif |
cf4219e7 RR |
140 | |
141 | // no size hints | |
571f6981 | 142 | virtual void DoSetSizeHints( int WXUNUSED(minW), |
cb8cc250 WS |
143 | int WXUNUSED(minH), |
144 | int WXUNUSED(maxW) = wxDefaultCoord, | |
145 | int WXUNUSED(maxH) = wxDefaultCoord, | |
146 | int WXUNUSED(incW) = wxDefaultCoord, | |
147 | int WXUNUSED(incH) = wxDefaultCoord) {} | |
f6bcfd97 | 148 | |
dcf924a3 | 149 | #if wxUSE_TOOLBAR |
05c3f0fc | 150 | // no toolbar |
885df446 VZ |
151 | virtual wxToolBar* CreateToolBar( long WXUNUSED(style), |
152 | wxWindowID WXUNUSED(id), | |
153 | const wxString& WXUNUSED(name) ) | |
154 | { return (wxToolBar*)NULL; } | |
8487f887 | 155 | virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } |
d11e8786 | 156 | #endif // wxUSE_TOOLBAR |
f6bcfd97 | 157 | |
cf4219e7 | 158 | // no icon |
05c3f0fc VZ |
159 | virtual void SetIcon(const wxIcon& icon) |
160 | { wxTopLevelWindowBase::SetIcon(icon); } | |
161 | virtual void SetIcons(const wxIconBundle& icons ) | |
162 | { wxTopLevelWindowBase::SetIcons(icons); } | |
f6bcfd97 BP |
163 | |
164 | // no title | |
cb8cc250 | 165 | virtual void SetTitle( const wxString &title ); |
f6bcfd97 | 166 | |
cf4219e7 | 167 | // no maximize etc |
d11e8786 VZ |
168 | virtual void Maximize( bool WXUNUSED(maximize) = true ) { } |
169 | virtual bool IsMaximized() const { return true; } | |
170 | virtual void Iconize(bool WXUNUSED(iconize) = true) { } | |
171 | virtual bool IsIconized() const { return false; } | |
8487f887 | 172 | virtual void Restore() {} |
f6bcfd97 | 173 | |
d11e8786 | 174 | virtual bool IsTopLevel() const { return false; } |
f6bcfd97 BP |
175 | |
176 | void OnActivate( wxActivateEvent& event ); | |
177 | void OnMenuHighlight( wxMenuEvent& event ); | |
178 | ||
179 | // implementation | |
180 | ||
716b7364 | 181 | wxMenuBar *m_menuBar; |
716b7364 | 182 | GtkNotebookPage *m_page; |
ab2b3dd4 | 183 | bool m_justInserted; |
f6bcfd97 | 184 | |
885df446 | 185 | protected: |
ac0c857a RR |
186 | // override wxFrame methods to not do anything |
187 | virtual void DoSetSize(int x, int y, | |
188 | int width, int height, | |
189 | int sizeFlags = wxSIZE_AUTO); | |
190 | virtual void DoSetClientSize(int width, int height); | |
885df446 VZ |
191 | virtual void DoGetClientSize( int *width, int *height ) const; |
192 | ||
8487f887 | 193 | private: |
f6bcfd97 | 194 | DECLARE_EVENT_TABLE() |
8487f887 | 195 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) |
c801d85f KB |
196 | }; |
197 | ||
198 | //----------------------------------------------------------------------------- | |
199 | // wxMDIClientWindow | |
200 | //----------------------------------------------------------------------------- | |
201 | ||
20123d49 | 202 | class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow |
c801d85f | 203 | { |
ab2b3dd4 | 204 | public: |
fd9811b1 | 205 | wxMDIClientWindow(); |
debe6624 | 206 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
fd9811b1 | 207 | ~wxMDIClientWindow(); |
debe6624 | 208 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
8487f887 RR |
209 | |
210 | private: | |
211 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
c801d85f KB |
212 | }; |
213 | ||
214 | #endif // __MDIH__ |