]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk/mdi.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_GTK_MDI_H_ | |
11 | #define _WX_GTK_MDI_H_ | |
12 | ||
13 | #include "wx/frame.h" | |
14 | ||
15 | class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; | |
16 | class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; | |
17 | ||
18 | //----------------------------------------------------------------------------- | |
19 | // wxMDIParentFrame | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
22 | class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame | |
23 | { | |
24 | public: | |
25 | wxMDIParentFrame() { Init(); } | |
26 | wxMDIParentFrame(wxWindow *parent, | |
27 | wxWindowID id, | |
28 | const wxString& title, | |
29 | const wxPoint& pos = wxDefaultPosition, | |
30 | const wxSize& size = wxDefaultSize, | |
31 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
32 | const wxString& name = wxFrameNameStr) | |
33 | { | |
34 | Init(); | |
35 | ||
36 | (void)Create(parent, id, title, pos, size, style, name); | |
37 | } | |
38 | ||
39 | virtual ~wxMDIParentFrame(); | |
40 | bool Create( wxWindow *parent, | |
41 | wxWindowID id, | |
42 | const wxString& title, | |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, | |
45 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
46 | const wxString& name = wxFrameNameStr ); | |
47 | ||
48 | wxMDIChildFrame *GetActiveChild() const; | |
49 | ||
50 | wxMDIClientWindow *GetClientWindow() const; | |
51 | virtual wxMDIClientWindow *OnCreateClient(); | |
52 | ||
53 | virtual void Cascade() {} | |
54 | virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {} | |
55 | virtual void ArrangeIcons() {} | |
56 | virtual void ActivateNext(); | |
57 | virtual void ActivatePrevious(); | |
58 | ||
59 | // implementation | |
60 | ||
61 | wxMDIClientWindow *m_clientWindow; | |
62 | bool m_justInserted; | |
63 | ||
64 | virtual void OnInternalIdle(); | |
65 | ||
66 | protected: | |
67 | void Init(); | |
68 | virtual void DoGetClientSize(int* width, int* height) const; | |
69 | ||
70 | private: | |
71 | friend class wxMDIChildFrame; | |
72 | ||
73 | DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) | |
74 | }; | |
75 | ||
76 | //----------------------------------------------------------------------------- | |
77 | // wxMDIChildFrame | |
78 | //----------------------------------------------------------------------------- | |
79 | ||
80 | class WXDLLIMPEXP_CORE wxMDIChildFrame: public wxFrame | |
81 | { | |
82 | public: | |
83 | wxMDIChildFrame(); | |
84 | wxMDIChildFrame( wxMDIParentFrame *parent, | |
85 | wxWindowID id, | |
86 | const wxString& title, | |
87 | const wxPoint& pos = wxDefaultPosition, | |
88 | const wxSize& size = wxDefaultSize, | |
89 | long style = wxDEFAULT_FRAME_STYLE, | |
90 | const wxString& name = wxFrameNameStr ); | |
91 | ||
92 | virtual ~wxMDIChildFrame(); | |
93 | bool Create( wxMDIParentFrame *parent, | |
94 | wxWindowID id, | |
95 | const wxString& title, | |
96 | const wxPoint& pos = wxDefaultPosition, | |
97 | const wxSize& size = wxDefaultSize, | |
98 | long style = wxDEFAULT_FRAME_STYLE, | |
99 | const wxString& name = wxFrameNameStr ); | |
100 | ||
101 | virtual void SetMenuBar( wxMenuBar *menu_bar ); | |
102 | virtual wxMenuBar *GetMenuBar() const; | |
103 | ||
104 | virtual void AddChild( wxWindowBase *child ); | |
105 | ||
106 | virtual void Activate(); | |
107 | ||
108 | #if wxUSE_STATUSBAR | |
109 | // no status bars | |
110 | virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, | |
111 | long WXUNUSED(style) = 1, | |
112 | wxWindowID WXUNUSED(id) = 1, | |
113 | const wxString& WXUNUSED(name) = wxEmptyString) | |
114 | { return (wxStatusBar*)NULL; } | |
115 | ||
116 | virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } | |
117 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} | |
118 | virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} | |
119 | #endif | |
120 | ||
121 | #if wxUSE_TOOLBAR | |
122 | // no toolbar | |
123 | virtual wxToolBar* CreateToolBar( long WXUNUSED(style), | |
124 | wxWindowID WXUNUSED(id), | |
125 | const wxString& WXUNUSED(name) ) | |
126 | { return (wxToolBar*)NULL; } | |
127 | virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } | |
128 | #endif // wxUSE_TOOLBAR | |
129 | ||
130 | // no icon | |
131 | virtual void SetIcons(const wxIconBundle& icons ) | |
132 | { wxTopLevelWindowBase::SetIcons(icons); } | |
133 | ||
134 | // no title | |
135 | virtual void SetTitle( const wxString &title ); | |
136 | ||
137 | // no maximize etc | |
138 | virtual void Maximize( bool WXUNUSED(maximize) = true ) { } | |
139 | virtual bool IsMaximized() const { return true; } | |
140 | virtual void Iconize(bool WXUNUSED(iconize) = true) { } | |
141 | virtual bool IsIconized() const { return false; } | |
142 | virtual void Restore() {} | |
143 | ||
144 | virtual bool IsTopLevel() const { return false; } | |
145 | ||
146 | virtual bool Destroy(); | |
147 | ||
148 | void OnActivate( wxActivateEvent& event ); | |
149 | void OnMenuHighlight( wxMenuEvent& event ); | |
150 | ||
151 | // implementation | |
152 | ||
153 | wxMenuBar *m_menuBar; | |
154 | GtkNotebookPage *m_page; | |
155 | bool m_justInserted; | |
156 | ||
157 | protected: | |
158 | // override wxFrame methods to not do anything | |
159 | virtual void DoSetSize(int x, int y, | |
160 | int width, int height, | |
161 | int sizeFlags = wxSIZE_AUTO); | |
162 | ||
163 | // no size hints | |
164 | virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH), | |
165 | int WXUNUSED(maxW), int WXUNUSED(maxH), | |
166 | int WXUNUSED(incW), int WXUNUSED(incH)) {} | |
167 | ||
168 | private: | |
169 | DECLARE_EVENT_TABLE() | |
170 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
171 | }; | |
172 | ||
173 | //----------------------------------------------------------------------------- | |
174 | // wxMDIClientWindow | |
175 | //----------------------------------------------------------------------------- | |
176 | ||
177 | class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow | |
178 | { | |
179 | public: | |
180 | wxMDIClientWindow(); | |
181 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); | |
182 | virtual ~wxMDIClientWindow(); | |
183 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); | |
184 | ||
185 | private: | |
186 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
187 | }; | |
188 | ||
189 | #endif // _WX_GTK_MDI_H_ |