]>
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 | ||
71 | virtual void SetToolBar( wxToolBar *toolbar ); | |
72 | virtual wxWindow *GetToolBar(void) const; | |
c801d85f | 73 | |
716b7364 RR |
74 | wxMDIClientWindow *GetClientWindow(void) const; |
75 | virtual wxMDIClientWindow *OnCreateClient(void); | |
c801d85f | 76 | |
716b7364 RR |
77 | virtual void Cascade(void) {}; |
78 | virtual void Tile(void) {}; | |
79 | virtual void ArrangeIcons(void) {}; | |
80 | virtual void ActivateNext(void); | |
81 | virtual void ActivatePrevious(void); | |
82 | ||
83 | void OnActivate( wxActivateEvent& event ); | |
84 | void OnSysColourChanged( wxSysColourChangedEvent& event ); | |
85 | ||
86 | //private: | |
87 | ||
88 | wxMDIChildFrame *m_currentChild; | |
89 | ||
90 | void SetMDIMenuBar( wxMenuBar *menu_bar ); | |
91 | virtual void GtkOnSize( int x, int y, int width, int height ); | |
c801d85f | 92 | |
716b7364 RR |
93 | private: |
94 | ||
95 | wxMDIClientWindow *m_clientWindow; | |
c801d85f | 96 | bool m_parentFrameActive; |
716b7364 RR |
97 | wxMenuBar *m_mdiMenuBar; |
98 | wxToolBar *m_toolBar; | |
c801d85f | 99 | |
716b7364 | 100 | DECLARE_EVENT_TABLE() |
c801d85f KB |
101 | }; |
102 | ||
103 | //----------------------------------------------------------------------------- | |
104 | // wxMDIChildFrame | |
105 | //----------------------------------------------------------------------------- | |
106 | ||
107 | class wxMDIChildFrame: public wxPanel | |
108 | { | |
109 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
110 | ||
111 | public: | |
112 | ||
113 | wxMDIChildFrame(void); | |
114 | wxMDIChildFrame( 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 ); |
c801d85f KB |
118 | ~wxMDIChildFrame(void); |
119 | bool Create( wxMDIParentFrame *parent, | |
debe6624 | 120 | wxWindowID id, const wxString& title, |
c801d85f | 121 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 122 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
c801d85f KB |
123 | void SetMenuBar( wxMenuBar *menu_bar ); |
124 | ||
125 | // no status bars in wxGTK | |
debe6624 JS |
126 | virtual bool CreateStatusBar( int WXUNUSED(number) = 1 ) { return FALSE; }; |
127 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}; | |
128 | virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}; | |
129 | ||
c801d85f KB |
130 | virtual void Maximize(void) {}; |
131 | virtual void Restore(void) {}; | |
132 | virtual void Activate(void); | |
133 | ||
716b7364 RR |
134 | bool Destroy(void); |
135 | void OnCloseWindow( wxCloseEvent& event ); | |
136 | ||
c801d85f KB |
137 | public: |
138 | ||
716b7364 RR |
139 | wxString m_title; |
140 | wxMenuBar *m_menuBar; | |
141 | ||
142 | // private: | |
143 | ||
144 | GtkNotebookPage *m_page; | |
145 | ||
146 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
147 | }; |
148 | ||
149 | //----------------------------------------------------------------------------- | |
150 | // wxMDIClientWindow | |
151 | //----------------------------------------------------------------------------- | |
152 | ||
153 | class wxMDIClientWindow: public wxWindow | |
154 | { | |
155 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
156 | ||
157 | public: | |
158 | ||
159 | wxMDIClientWindow(void); | |
debe6624 | 160 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
c801d85f | 161 | ~wxMDIClientWindow(void); |
debe6624 | 162 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
c801d85f KB |
163 | void AddChild( wxWindow *child ); |
164 | }; | |
165 | ||
166 | #endif // __MDIH__ | |
167 |