]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: mdi.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Created: 01/02/97 | |
6 | // Id: | |
7 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | ||
12 | #ifndef __MDIH__ | |
13 | #define __MDIH__ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface | |
17 | #endif | |
18 | ||
19 | #include "wx/defs.h" | |
20 | #include "wx/object.h" | |
21 | #include "wx/list.h" | |
22 | #include "wx/control.h" | |
23 | #include "wx/panel.h" | |
24 | #include "wx/frame.h" | |
716b7364 | 25 | #include "wx/toolbar.h" |
c801d85f KB |
26 | |
27 | //----------------------------------------------------------------------------- | |
28 | // classes | |
29 | //----------------------------------------------------------------------------- | |
30 | ||
31 | class wxMDIParentFrame; | |
32 | class wxMDIClientWindow; | |
33 | class wxMDIChildFrame; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // global data | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | extern const char* wxFrameNameStr; | |
40 | extern const char* wxStatusLineNameStr; | |
41 | ||
42 | //----------------------------------------------------------------------------- | |
43 | // wxMDIParentFrame | |
44 | //----------------------------------------------------------------------------- | |
45 | ||
46 | class wxMDIParentFrame: public wxFrame | |
47 | { | |
48 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) | |
49 | ||
50 | friend class wxMDIChildFrame; | |
51 | ||
52 | public: | |
53 | ||
54 | wxMDIParentFrame(void); | |
55 | wxMDIParentFrame( wxWindow *parent, | |
debe6624 | 56 | wxWindowID id, const wxString& title, |
c801d85f | 57 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 58 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
c801d85f KB |
59 | const wxString& name = wxFrameNameStr ); |
60 | ~wxMDIParentFrame(void); | |
61 | bool Create( wxWindow *parent, | |
debe6624 | 62 | wxWindowID id, const wxString& title, |
c801d85f | 63 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 64 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
c801d85f KB |
65 | const wxString& name = wxFrameNameStr ); |
66 | ||
c801d85f | 67 | |
716b7364 RR |
68 | void GetClientSize(int *width, int *height) const; |
69 | wxMDIChildFrame *GetActiveChild(void) const; | |
70 | ||
716b7364 RR |
71 | wxMDIClientWindow *GetClientWindow(void) const; |
72 | virtual wxMDIClientWindow *OnCreateClient(void); | |
c801d85f | 73 | |
716b7364 RR |
74 | virtual void Cascade(void) {}; |
75 | virtual void Tile(void) {}; | |
76 | virtual void ArrangeIcons(void) {}; | |
77 | virtual void ActivateNext(void); | |
78 | virtual void ActivatePrevious(void); | |
79 | ||
80 | void OnActivate( wxActivateEvent& event ); | |
81 | void OnSysColourChanged( wxSysColourChangedEvent& event ); | |
82 | ||
83 | //private: | |
84 | ||
85 | wxMDIChildFrame *m_currentChild; | |
86 | ||
87 | void SetMDIMenuBar( wxMenuBar *menu_bar ); | |
88 | virtual void GtkOnSize( int x, int y, int width, int height ); | |
c801d85f | 89 | |
716b7364 RR |
90 | private: |
91 | ||
92 | wxMDIClientWindow *m_clientWindow; | |
c801d85f | 93 | bool m_parentFrameActive; |
716b7364 | 94 | wxMenuBar *m_mdiMenuBar; |
c801d85f | 95 | |
716b7364 | 96 | DECLARE_EVENT_TABLE() |
c801d85f KB |
97 | }; |
98 | ||
99 | //----------------------------------------------------------------------------- | |
100 | // wxMDIChildFrame | |
101 | //----------------------------------------------------------------------------- | |
102 | ||
cf4219e7 | 103 | class wxMDIChildFrame: public wxFrame |
c801d85f KB |
104 | { |
105 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
106 | ||
107 | public: | |
108 | ||
109 | wxMDIChildFrame(void); | |
110 | wxMDIChildFrame( wxMDIParentFrame *parent, | |
debe6624 | 111 | wxWindowID id, const wxString& title, |
c801d85f | 112 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 113 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
c801d85f KB |
114 | ~wxMDIChildFrame(void); |
115 | bool Create( wxMDIParentFrame *parent, | |
debe6624 | 116 | wxWindowID id, const wxString& title, |
c801d85f | 117 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 118 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
cf4219e7 RR |
119 | |
120 | virtual void SetMenuBar( wxMenuBar *menu_bar ); | |
121 | virtual wxMenuBar *GetMenuBar(); | |
c801d85f | 122 | |
cf4219e7 RR |
123 | virtual void GetClientSize( int *width, int *height ) const; |
124 | virtual void AddChild( wxWindow *child ); | |
debe6624 | 125 | |
cf4219e7 RR |
126 | virtual void Activate(void); |
127 | ||
128 | // no status bars | |
129 | virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number), long WXUNUSED(style), | |
130 | wxWindowID WXUNUSED(id), const wxString& WXUNUSED(name) ) {return (wxStatusBar*)NULL; } | |
131 | virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; } | |
132 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {} | |
133 | virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {} | |
134 | ||
135 | // no size hints | |
136 | virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW), | |
137 | int WXUNUSED(maxH), int WXUNUSED(incW) ) {} | |
138 | ||
139 | // no toolbar bars | |
140 | virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), | |
141 | const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; } | |
142 | virtual wxToolBar *GetToolBar() { return (wxToolBar*)NULL; } | |
143 | ||
144 | // no icon | |
145 | void SetIcon( const wxIcon &icon ) { m_icon = icon; } | |
146 | ||
147 | // no title | |
148 | void SetTitle( const wxString &title ) { m_title = title; } | |
149 | wxString GetTitle() const { return m_title; } | |
150 | ||
151 | // no maximize etc | |
152 | virtual void Maximize(void) {} | |
153 | virtual void Restore(void) {} | |
c801d85f | 154 | |
c33c4050 | 155 | void OnActivate( wxActivateEvent &event ); |
716b7364 | 156 | |
c801d85f KB |
157 | public: |
158 | ||
716b7364 RR |
159 | wxMenuBar *m_menuBar; |
160 | ||
161 | // private: | |
162 | ||
163 | GtkNotebookPage *m_page; | |
164 | ||
165 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
166 | }; |
167 | ||
168 | //----------------------------------------------------------------------------- | |
169 | // wxMDIClientWindow | |
170 | //----------------------------------------------------------------------------- | |
171 | ||
172 | class wxMDIClientWindow: public wxWindow | |
173 | { | |
174 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
175 | ||
176 | public: | |
177 | ||
178 | wxMDIClientWindow(void); | |
debe6624 | 179 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
c801d85f | 180 | ~wxMDIClientWindow(void); |
debe6624 | 181 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
c801d85f KB |
182 | void AddChild( wxWindow *child ); |
183 | }; | |
184 | ||
185 | #endif // __MDIH__ | |
186 |