]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/mdi.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxMDIClientWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxMDIClientWindow
12 An MDI client window is a child of wxMDIParentFrame, and manages zero or
13 more wxMDIChildFrame objects.
18 @see wxMDIChildFrame, wxMDIParentFrame, wxFrame
20 class wxMDIClientWindow
: public wxWindow
25 Constructor, creating the window.
30 The window style. Currently unused.
32 @remarks The second style of constructor is called within
33 wxMDIParentFrame::OnCreateClient.
35 @see wxMDIParentFrame::wxMDIParentFrame, wxMDIParentFrame::OnCreateClient
38 wxMDIClientWindow(wxMDIParentFrame
* parent
, long style
= 0);
47 Used in two-step frame construction. See wxMDIClientWindow()
50 bool CreateClient(wxMDIParentFrame
* parent
, long style
= 0);
56 @class wxMDIParentFrame
58 An MDI (Multiple Document Interface) parent frame is a window which can contain
59 MDI child frames in its own 'desktop'. It is a convenient way to avoid window
61 and is used in many popular Windows applications, such as Microsoft Word(TM).
65 Puts a caption on the frame.
66 @style{wxDEFAULT_FRAME_STYLE}
67 Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME |
68 wxSYSTEM_MENU | wxCAPTION.
70 Displays a horizontal scrollbar in the client window, allowing the
71 user to view child frames that are off the current view.
73 Display the frame iconized (minimized) (Windows only).
75 Displays the frame maximized (Windows only).
76 @style{wxMAXIMIZE_BOX}
77 Displays a maximize box on the frame (Windows and Motif only).
79 Identical to wxICONIZE.
80 @style{wxMINIMIZE_BOX}
81 Displays a minimize box on the frame (Windows and Motif only).
82 @style{wxRESIZE_BORDER}
83 Displays a resizeable border around the window (Motif only; for
84 Windows, it is implicit in wxTHICK_FRAME).
86 Stay on top of other windows (Windows only).
88 Displays a system menu (Windows and Motif only).
90 Displays a thick frame around the window (Windows and Motif only).
92 Displays a vertical scrollbar in the client window, allowing the
93 user to view child frames that are off the current view.
94 @style{wxFRAME_NO_WINDOW_MENU}
95 Under Windows, removes the Window menu that is normally added
100 @category{managedwnd}
102 @see wxMDIChildFrame, wxMDIClientWindow, wxFrame, wxDialog
104 class wxMDIParentFrame
: public wxFrame
109 Constructor, creating the window.
112 The window parent. This should be @NULL.
114 The window identifier. It may take a value of -1 to indicate a default
117 The caption to be displayed on the frame's title bar.
119 The window position. The value wxDefaultPosition indicates a default position,
121 either the windowing system or wxWidgets, depending on platform.
123 The window size. The value wxDefaultSize indicates a default size, chosen by
124 either the windowing system or wxWidgets, depending on platform.
126 The window style. See wxMDIParentFrame.
128 The name of the window. This parameter is used to associate a name with the
130 allowing the application user to set Motif resource values for
133 @remarks During the construction of the frame, the client window will be
134 created. To use a different class from
135 wxMDIClientWindow, override
138 @see Create(), OnCreateClient()
141 wxMDIParentFrame(wxWindow
* parent
, wxWindowID id
,
142 const wxString
& title
,
143 const wxPoint
& pos
= wxDefaultPosition
,
144 const wxSize
& size
= wxDefaultSize
,
145 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
146 const wxString
& name
= "frame");
150 Destructor. Destroys all child windows and menu bar if present.
155 Activates the MDI child following the currently active one.
157 @see ActivatePrevious()
162 Activates the MDI child preceding the currently active one.
166 void ActivatePrevious();
169 Arranges any iconized (minimized) MDI child windows.
171 @see Cascade(), Tile()
176 Arranges the MDI child windows in a cascade.
178 @see Tile(), ArrangeIcons()
183 Used in two-step frame construction. See wxMDIParentFrame()
186 bool Create(wxWindow
* parent
, wxWindowID id
,
187 const wxString
& title
,
188 const wxPoint
& pos
= wxDefaultPosition
,
189 const wxSize
& size
= wxDefaultSize
,
190 long style
= wxDEFAULT_FRAME_STYLE
| wxVSCROLL
| wxHSCROLL
,
191 const wxString
& name
= "frame");
194 Returns a pointer to the active MDI child, if there is one.
196 wxMDIChildFrame
* GetActiveChild() const;
199 This gets the size of the frame 'client area' in pixels.
202 Receives the client width in pixels.
204 Receives the client height in pixels.
206 @remarks The client area is the area which may be drawn on by the
207 programmer, excluding title bar, border, status bar,
208 and toolbar if present.
210 @see GetToolBar(), SetToolBar(),
213 virtual void GetClientSize(int* width
, int* height
) const;
216 Returns a pointer to the client window.
218 @see OnCreateClient()
220 wxMDIClientWindow
* GetClientWindow() const;
223 Returns the window being used as the toolbar for this frame.
227 virtual wxWindow
* GetToolBar() const;
230 Returns the current Window menu (added by wxWidgets to the menubar). This
232 is available under Windows only.
234 wxMenu
* GetWindowMenu() const;
237 Override this to return a different kind of client window. If you override this
239 you must create your parent frame in two stages, or your function will never be
241 due to the way C++ treats virtual functions called from constructors. For
244 @remarks You might wish to derive from wxMDIClientWindow in order to
245 implement different erase behaviour, for example, such
246 as painting a bitmap on the background.
248 @see GetClientWindow(), wxMDIClientWindow
250 virtual wxMDIClientWindow
* OnCreateClient();
253 Sets the window to be used as a toolbar for this
254 MDI parent window. It saves the application having to manage the positioning
255 of the toolbar MDI client window.
260 @remarks When the frame is resized, the toolbar is resized to be the
261 width of the frame client area, and the toolbar height
264 @see GetToolBar(), GetClientSize()
266 virtual void SetToolBar(wxWindow
* toolbar
);
269 Call this to change the current Window menu. Ownership of the menu object
271 the frame when you call this function.
272 This call is available under Windows only.
273 To remove the window completely, use the wxFRAME_NO_WINDOW_MENU window style.
275 void SetWindowMenu(wxMenu
* menu
);
278 Tiles the MDI child windows either horizontally or vertically depending on
279 whether @a orient is wxHORIZONTAL or wxVERTICAL.
280 Currently only implemented for MSW, does nothing under the other platforms.
282 void Tile(wxOrientation orient
= wxHORIZONTAL
);
288 @class wxMDIChildFrame
290 An MDI child frame is a frame that can only exist on a wxMDIClientWindow,
291 which is itself a child of wxMDIParentFrame.
295 Puts a caption on the frame.
296 @style{wxDEFAULT_FRAME_STYLE}
297 Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME |
298 wxSYSTEM_MENU | wxCAPTION.
300 Display the frame iconized (minimized) (Windows only).
302 Displays the frame maximized (Windows only).
303 @style{wxMAXIMIZE_BOX}
304 Displays a maximize box on the frame (Windows and Motif only).
306 Identical to wxICONIZE.
307 @style{wxMINIMIZE_BOX}
308 Displays a minimize box on the frame (Windows and Motif only).
309 @style{wxRESIZE_BORDER}
310 Displays a resizeable border around the window (Motif only; for
311 Windows, it is implicit in wxTHICK_FRAME).
312 @style{wxSTAY_ON_TOP}
313 Stay on top of other windows (Windows only).
314 @style{wxSYSTEM_MENU}
315 Displays a system menu (Windows and Motif only).
316 @style{wxTHICK_FRAME}
317 Displays a thick frame around the window (Windows and Motif only).
321 @category{managedwnd}
323 @see wxMDIClientWindow, wxMDIParentFrame, wxFrame
325 class wxMDIChildFrame
: public wxFrame
330 Constructor, creating the window.
333 The window parent. This should not be @NULL.
335 The window identifier. It may take a value of -1 to indicate a default
338 The caption to be displayed on the frame's title bar.
340 The window position. The value wxDefaultPosition indicates a default position,
342 either the windowing system or wxWidgets, depending on platform.
344 The window size. The value wxDefaultSize indicates a default size, chosen by
345 either the windowing system or wxWidgets, depending on platform.
347 The window style. See wxMDIChildFrame.
349 The name of the window. This parameter is used to associate a name with the
351 allowing the application user to set Motif resource values for
359 wxMDIChildFrame(wxMDIParentFrame
* parent
, wxWindowID id
,
360 const wxString
& title
,
361 const wxPoint
& pos
= wxDefaultPosition
,
362 const wxSize
& size
= wxDefaultSize
,
363 long style
= wxDEFAULT_FRAME_STYLE
,
364 const wxString
& name
= "frame");
368 Destructor. Destroys all child windows and menu bar if present.
373 Activates this MDI child frame.
375 @see Maximize(), Restore()
380 Used in two-step frame construction. See wxMDIChildFrame()
383 bool Create(wxWindow
* parent
, wxWindowID id
,
384 const wxString
& title
,
385 const wxPoint
& pos
= wxDefaultPosition
,
386 const wxSize
& size
= wxDefaultSize
,
387 long style
= wxDEFAULT_FRAME_STYLE
,
388 const wxString
& name
= "frame");
391 Maximizes this MDI child frame.
393 @see Activate(), Restore()
395 void Maximize(bool maximize
);
398 Restores this MDI child frame (unmaximizes).