]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: mdi.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling | |
c801d85f KB |
7 | // Licence: wxWindows licence |
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 | { | |
47 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) | |
48 | ||
49 | friend class wxMDIChildFrame; | |
50 | ||
ab2b3dd4 | 51 | public: |
c801d85f | 52 | |
fd9811b1 | 53 | wxMDIParentFrame(); |
c801d85f | 54 | wxMDIParentFrame( wxWindow *parent, |
debe6624 | 55 | wxWindowID id, const wxString& title, |
c801d85f | 56 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 57 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
c801d85f KB |
58 | const wxString& name = wxFrameNameStr ); |
59 | ~wxMDIParentFrame(void); | |
60 | bool Create( wxWindow *parent, | |
debe6624 | 61 | wxWindowID id, const wxString& title, |
c801d85f | 62 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 63 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
c801d85f KB |
64 | const wxString& name = wxFrameNameStr ); |
65 | ||
c801d85f | 66 | |
716b7364 | 67 | void GetClientSize(int *width, int *height) const; |
ab2b3dd4 | 68 | wxMDIChildFrame *GetActiveChild() const; |
716b7364 | 69 | |
ab2b3dd4 RR |
70 | wxMDIClientWindow *GetClientWindow() const; |
71 | virtual wxMDIClientWindow *OnCreateClient(); | |
c801d85f | 72 | |
ab2b3dd4 RR |
73 | virtual void Cascade() {} |
74 | virtual void Tile() {} | |
75 | virtual void ArrangeIcons() {} | |
76 | virtual void ActivateNext(); | |
77 | virtual void ActivatePrevious(); | |
716b7364 RR |
78 | |
79 | void OnActivate( wxActivateEvent& event ); | |
80 | void OnSysColourChanged( wxSysColourChangedEvent& event ); | |
81 | ||
ab2b3dd4 RR |
82 | // implementation |
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(); |
c801d85f | 89 | |
716b7364 | 90 | DECLARE_EVENT_TABLE() |
c801d85f KB |
91 | }; |
92 | ||
93 | //----------------------------------------------------------------------------- | |
94 | // wxMDIChildFrame | |
95 | //----------------------------------------------------------------------------- | |
96 | ||
cf4219e7 | 97 | class wxMDIChildFrame: public wxFrame |
c801d85f KB |
98 | { |
99 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
100 | ||
101 | public: | |
102 | ||
ab2b3dd4 | 103 | wxMDIChildFrame(); |
c801d85f | 104 | wxMDIChildFrame( wxMDIParentFrame *parent, |
debe6624 | 105 | wxWindowID id, const wxString& title, |
c801d85f | 106 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 107 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
fd9811b1 | 108 | ~wxMDIChildFrame(); |
c801d85f | 109 | bool Create( wxMDIParentFrame *parent, |
debe6624 | 110 | wxWindowID id, const wxString& title, |
c801d85f | 111 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 112 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
cf4219e7 RR |
113 | |
114 | virtual void SetMenuBar( wxMenuBar *menu_bar ); | |
33b64e6f | 115 | virtual wxMenuBar *GetMenuBar() const; |
c801d85f | 116 | |
cf4219e7 | 117 | virtual void GetClientSize( int *width, int *height ) const; |
7a903311 | 118 | virtual void AddChild( wxWindowBase *child ); |
debe6624 | 119 | |
ab2b3dd4 | 120 | virtual void Activate(); |
cf4219e7 | 121 | |
dcf924a3 | 122 | #if wxUSE_STATUSBAR |
cf4219e7 | 123 | // no status bars |
e90c1d2a VZ |
124 | virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, |
125 | long WXUNUSED(style) = 1, | |
126 | wxWindowID WXUNUSED(id) = 1, | |
127 | const wxString& WXUNUSED(name) = wxEmptyString) | |
128 | { return (wxStatusBar*)NULL; } | |
129 | ||
0de9b5b2 | 130 | virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } |
ddb6bc71 | 131 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} |
0de9b5b2 | 132 | virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} |
dcf924a3 | 133 | #endif |
cf4219e7 RR |
134 | |
135 | // no size hints | |
bfc6fde4 | 136 | virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), |
0de9b5b2 RR |
137 | int WXUNUSED(maxW), int WXUNUSED(maxH), |
138 | int WXUNUSED(incW), int WXUNUSED(incH) ) {} | |
cf4219e7 | 139 | |
dcf924a3 | 140 | #if wxUSE_TOOLBAR |
cf4219e7 RR |
141 | // no toolbar bars |
142 | virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), | |
143 | const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } | |
b8ecf3e9 | 144 | virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } |
dcf924a3 | 145 | #endif |
cf4219e7 RR |
146 | |
147 | // no icon | |
148 | void SetIcon( const wxIcon &icon ) { m_icon = icon; } | |
149 | ||
150 | // no title | |
151 | void SetTitle( const wxString &title ) { m_title = title; } | |
152 | wxString GetTitle() const { return m_title; } | |
153 | ||
154 | // no maximize etc | |
ab2b3dd4 RR |
155 | virtual void Maximize( bool WXUNUSED(maximize) ) {} |
156 | virtual void Restore() {} | |
c801d85f | 157 | |
c33c4050 | 158 | void OnActivate( wxActivateEvent &event ); |
716b7364 | 159 | |
ab2b3dd4 | 160 | // implementation |
c801d85f | 161 | |
716b7364 | 162 | wxMenuBar *m_menuBar; |
716b7364 | 163 | GtkNotebookPage *m_page; |
ab2b3dd4 | 164 | bool m_justInserted; |
716b7364 RR |
165 | |
166 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
167 | }; |
168 | ||
169 | //----------------------------------------------------------------------------- | |
170 | // wxMDIClientWindow | |
171 | //----------------------------------------------------------------------------- | |
172 | ||
173 | class wxMDIClientWindow: public wxWindow | |
174 | { | |
175 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
176 | ||
ab2b3dd4 | 177 | public: |
c801d85f | 178 | |
fd9811b1 | 179 | wxMDIClientWindow(); |
debe6624 | 180 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
fd9811b1 | 181 | ~wxMDIClientWindow(); |
debe6624 | 182 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
c801d85f KB |
183 | }; |
184 | ||
185 | #endif // __MDIH__ | |
186 |