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