]>
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 | |
f6bcfd97 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | ||
11 | #ifndef __MDIH__ | |
12 | #define __MDIH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
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 | ||
30 | class wxMDIParentFrame; | |
31 | class wxMDIClientWindow; | |
32 | class wxMDIChildFrame; | |
33 | ||
34 | //----------------------------------------------------------------------------- | |
35 | // global data | |
36 | //----------------------------------------------------------------------------- | |
37 | ||
3b90345b OK |
38 | extern const wxChar* wxFrameNameStr; |
39 | extern const wxChar* wxStatusLineNameStr; | |
c801d85f KB |
40 | |
41 | //----------------------------------------------------------------------------- | |
42 | // wxMDIParentFrame | |
43 | //----------------------------------------------------------------------------- | |
44 | ||
45 | class wxMDIParentFrame: public wxFrame | |
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 | ||
8487f887 RR |
62 | ~wxMDIParentFrame(void); |
63 | bool Create( wxWindow *parent, | |
64 | wxWindowID id, const wxString& title, | |
65 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
66 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
67 | const wxString& name = wxFrameNameStr ); | |
c801d85f | 68 | |
716b7364 | 69 | void GetClientSize(int *width, int *height) const; |
ab2b3dd4 | 70 | wxMDIChildFrame *GetActiveChild() const; |
f6bcfd97 BP |
71 | |
72 | wxMDIClientWindow *GetClientWindow() const; | |
ab2b3dd4 | 73 | virtual wxMDIClientWindow *OnCreateClient(); |
f6bcfd97 | 74 | |
ab2b3dd4 RR |
75 | virtual void Cascade() {} |
76 | virtual void Tile() {} | |
77 | virtual void ArrangeIcons() {} | |
78 | virtual void ActivateNext(); | |
79 | virtual void ActivatePrevious(); | |
716b7364 | 80 | |
f6bcfd97 | 81 | // implementation |
ab2b3dd4 RR |
82 | |
83 | wxMDIClientWindow *m_clientWindow; | |
84 | bool m_justInserted; | |
85 | ||
716b7364 | 86 | virtual void GtkOnSize( int x, int y, int width, int height ); |
ab2b3dd4 | 87 | virtual void OnInternalIdle(); |
f6bcfd97 BP |
88 | |
89 | protected: | |
90 | void Init(); | |
91 | ||
8487f887 RR |
92 | private: |
93 | friend class wxMDIChildFrame; | |
f6bcfd97 | 94 | |
8487f887 | 95 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) |
c801d85f KB |
96 | }; |
97 | ||
98 | //----------------------------------------------------------------------------- | |
99 | // wxMDIChildFrame | |
100 | //----------------------------------------------------------------------------- | |
101 | ||
cf4219e7 | 102 | class wxMDIChildFrame: public wxFrame |
c801d85f | 103 | { |
8487f887 | 104 | public: |
ab2b3dd4 | 105 | wxMDIChildFrame(); |
c801d85f | 106 | wxMDIChildFrame( wxMDIParentFrame *parent, |
debe6624 | 107 | wxWindowID id, const wxString& title, |
c801d85f | 108 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 109 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
fd9811b1 | 110 | ~wxMDIChildFrame(); |
c801d85f | 111 | bool Create( wxMDIParentFrame *parent, |
debe6624 | 112 | wxWindowID id, const wxString& title, |
c801d85f | 113 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 114 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
f6bcfd97 | 115 | |
8487f887 RR |
116 | virtual void SetMenuBar( wxMenuBar *menu_bar ); |
117 | virtual wxMenuBar *GetMenuBar() const; | |
c801d85f | 118 | |
8487f887 RR |
119 | virtual void GetClientSize( int *width, int *height ) const; |
120 | virtual void AddChild( wxWindowBase *child ); | |
debe6624 | 121 | |
8487f887 | 122 | virtual void Activate(); |
f6bcfd97 | 123 | |
dcf924a3 | 124 | #if wxUSE_STATUSBAR |
cf4219e7 | 125 | // no status bars |
8487f887 | 126 | virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, |
f6bcfd97 | 127 | long WXUNUSED(style) = 1, |
e90c1d2a VZ |
128 | wxWindowID WXUNUSED(id) = 1, |
129 | const wxString& WXUNUSED(name) = wxEmptyString) | |
8487f887 | 130 | { return (wxStatusBar*)NULL; } |
e90c1d2a | 131 | |
8487f887 RR |
132 | virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } |
133 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} | |
134 | virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} | |
dcf924a3 | 135 | #endif |
cf4219e7 RR |
136 | |
137 | // no size hints | |
8487f887 | 138 | virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), |
0de9b5b2 RR |
139 | int WXUNUSED(maxW), int WXUNUSED(maxH), |
140 | int WXUNUSED(incW), int WXUNUSED(incH) ) {} | |
f6bcfd97 | 141 | |
dcf924a3 | 142 | #if wxUSE_TOOLBAR |
cf4219e7 | 143 | // no toolbar bars |
f6bcfd97 | 144 | virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), |
8487f887 RR |
145 | const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } |
146 | virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } | |
dcf924a3 | 147 | #endif |
f6bcfd97 | 148 | |
cf4219e7 | 149 | // no icon |
8487f887 | 150 | void SetIcon( const wxIcon &icon ) { m_icon = icon; } |
f6bcfd97 BP |
151 | |
152 | // no title | |
153 | void SetTitle( const wxString &title ); | |
8487f887 | 154 | wxString GetTitle() const { return m_title; } |
f6bcfd97 | 155 | |
cf4219e7 | 156 | // no maximize etc |
8487f887 RR |
157 | virtual void Maximize( bool WXUNUSED(maximize) ) {} |
158 | virtual void Restore() {} | |
f6bcfd97 | 159 | |
8487f887 | 160 | virtual bool IsTopLevel() const { return FALSE; } |
f6bcfd97 BP |
161 | |
162 | void OnActivate( wxActivateEvent& event ); | |
163 | void OnMenuHighlight( wxMenuEvent& event ); | |
164 | ||
165 | // implementation | |
166 | ||
716b7364 | 167 | wxMenuBar *m_menuBar; |
716b7364 | 168 | GtkNotebookPage *m_page; |
ab2b3dd4 | 169 | bool m_justInserted; |
f6bcfd97 | 170 | |
8487f887 | 171 | private: |
f6bcfd97 | 172 | DECLARE_EVENT_TABLE() |
8487f887 | 173 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) |
c801d85f KB |
174 | }; |
175 | ||
176 | //----------------------------------------------------------------------------- | |
177 | // wxMDIClientWindow | |
178 | //----------------------------------------------------------------------------- | |
179 | ||
180 | class wxMDIClientWindow: public wxWindow | |
181 | { | |
ab2b3dd4 | 182 | public: |
fd9811b1 | 183 | wxMDIClientWindow(); |
debe6624 | 184 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
fd9811b1 | 185 | ~wxMDIClientWindow(); |
debe6624 | 186 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
8487f887 RR |
187 | |
188 | private: | |
189 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
c801d85f KB |
190 | }; |
191 | ||
192 | #endif // __MDIH__ | |
193 |