]>
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 | ||
38 | extern const char* wxFrameNameStr; | |
39 | extern const char* wxStatusLineNameStr; | |
40 | ||
41 | //----------------------------------------------------------------------------- | |
42 | // wxMDIParentFrame | |
43 | //----------------------------------------------------------------------------- | |
44 | ||
45 | class wxMDIParentFrame: public wxFrame | |
46 | { | |
47 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) | |
48 | ||
49 | friend class wxMDIChildFrame; | |
50 | ||
51 | public: | |
52 | ||
53 | wxMDIParentFrame(void); | |
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 RR |
67 | void GetClientSize(int *width, int *height) const; |
68 | wxMDIChildFrame *GetActiveChild(void) const; | |
69 | ||
716b7364 RR |
70 | wxMDIClientWindow *GetClientWindow(void) const; |
71 | virtual wxMDIClientWindow *OnCreateClient(void); | |
c801d85f | 72 | |
716b7364 RR |
73 | virtual void Cascade(void) {}; |
74 | virtual void Tile(void) {}; | |
75 | virtual void ArrangeIcons(void) {}; | |
76 | virtual void ActivateNext(void); | |
77 | virtual void ActivatePrevious(void); | |
78 | ||
79 | void OnActivate( wxActivateEvent& event ); | |
80 | void OnSysColourChanged( wxSysColourChangedEvent& event ); | |
81 | ||
58614078 | 82 | // implementation |
716b7364 RR |
83 | |
84 | wxMDIChildFrame *m_currentChild; | |
85 | ||
86 | void SetMDIMenuBar( wxMenuBar *menu_bar ); | |
87 | virtual void GtkOnSize( int x, int y, int width, int height ); | |
c801d85f | 88 | |
716b7364 RR |
89 | private: |
90 | ||
91 | wxMDIClientWindow *m_clientWindow; | |
c801d85f | 92 | bool m_parentFrameActive; |
716b7364 | 93 | wxMenuBar *m_mdiMenuBar; |
c801d85f | 94 | |
716b7364 | 95 | DECLARE_EVENT_TABLE() |
c801d85f KB |
96 | }; |
97 | ||
98 | //----------------------------------------------------------------------------- | |
99 | // wxMDIChildFrame | |
100 | //----------------------------------------------------------------------------- | |
101 | ||
cf4219e7 | 102 | class wxMDIChildFrame: public wxFrame |
c801d85f KB |
103 | { |
104 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
105 | ||
106 | public: | |
107 | ||
108 | wxMDIChildFrame(void); | |
109 | wxMDIChildFrame( 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 ); |
c801d85f KB |
113 | ~wxMDIChildFrame(void); |
114 | bool Create( wxMDIParentFrame *parent, | |
debe6624 | 115 | wxWindowID id, const wxString& title, |
c801d85f | 116 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 117 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
cf4219e7 RR |
118 | |
119 | virtual void SetMenuBar( wxMenuBar *menu_bar ); | |
120 | virtual wxMenuBar *GetMenuBar(); | |
c801d85f | 121 | |
cf4219e7 RR |
122 | virtual void GetClientSize( int *width, int *height ) const; |
123 | virtual void AddChild( wxWindow *child ); | |
debe6624 | 124 | |
cf4219e7 RR |
125 | virtual void Activate(void); |
126 | ||
127 | // no status bars | |
c67daf87 UR |
128 | virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, |
129 | wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } | |
cf4219e7 RR |
130 | virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; } |
131 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {} | |
132 | virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {} | |
133 | ||
134 | // no size hints | |
135 | virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW), | |
136 | int WXUNUSED(maxH), int WXUNUSED(incW) ) {} | |
137 | ||
138 | // no toolbar bars | |
139 | virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), | |
140 | const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } | |
141 | virtual wxToolBar *GetToolBar() { return (wxToolBar*)NULL; } | |
142 | ||
143 | // no icon | |
144 | void SetIcon( const wxIcon &icon ) { m_icon = icon; } | |
145 | ||
146 | // no title | |
147 | void SetTitle( const wxString &title ) { m_title = title; } | |
148 | wxString GetTitle() const { return m_title; } | |
149 | ||
150 | // no maximize etc | |
151 | virtual void Maximize(void) {} | |
152 | virtual void Restore(void) {} | |
c801d85f | 153 | |
c33c4050 | 154 | void OnActivate( wxActivateEvent &event ); |
716b7364 | 155 | |
c801d85f KB |
156 | public: |
157 | ||
716b7364 RR |
158 | wxMenuBar *m_menuBar; |
159 | ||
160 | // private: | |
161 | ||
162 | GtkNotebookPage *m_page; | |
163 | ||
164 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
165 | }; |
166 | ||
167 | //----------------------------------------------------------------------------- | |
168 | // wxMDIClientWindow | |
169 | //----------------------------------------------------------------------------- | |
170 | ||
171 | class wxMDIClientWindow: public wxWindow | |
172 | { | |
173 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
174 | ||
175 | public: | |
176 | ||
177 | wxMDIClientWindow(void); | |
debe6624 | 178 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
c801d85f | 179 | ~wxMDIClientWindow(void); |
debe6624 | 180 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
c801d85f KB |
181 | void AddChild( wxWindow *child ); |
182 | }; | |
183 | ||
184 | #endif // __MDIH__ | |
185 |