]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxFrame}}\label{wxframe} |
2 | ||
1c4f8f8d VZ |
3 | A frame is a window whose size and position can (usually) be changed by the |
4 | user. It usually has thick borders and a title bar, and can optionally contain | |
5 | a menu bar, toolbar and status bar. A frame can contain any window that is not | |
6 | a frame or dialog. | |
a660d684 | 7 | |
1c4f8f8d VZ |
8 | A frame that has a status bar and toolbar created via the |
9 | CreateStatusBar/CreateToolBar functions manages these windows, and adjusts the | |
10 | value returned by GetClientSize to reflect the remaining size available to | |
11 | application windows. | |
81d66cf3 | 12 | |
a660d684 KB |
13 | \wxheading{Derived from} |
14 | ||
15 | \helpref{wxWindow}{wxwindow}\\ | |
16 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
17 | \helpref{wxObject}{wxobject} | |
18 | ||
954b8ae6 JS |
19 | \wxheading{Include files} |
20 | ||
21 | <wx/frame.h> | |
22 | ||
a660d684 KB |
23 | \wxheading{Window styles} |
24 | ||
25 | \twocolwidtha{5cm} | |
26 | \begin{twocollist}\itemsep=0pt | |
6453876e | 27 | \twocolitem{\windowstyle{wxICONIZE}}{Display the frame iconized (minimized). Windows only. } |
a660d684 KB |
28 | \twocolitem{\windowstyle{wxCAPTION}}{Puts a caption on the frame.} |
29 | \twocolitem{\windowstyle{wxDEFAULT\_FRAME\_STYLE}}{Defined as {\bf wxMINIMIZE\_BOX \pipe wxMAXIMIZE\_BOX \pipe wxTHICK\_FRAME \pipe wxSYSTEM\_MENU \pipe wxCAPTION}.} | |
6453876e RR |
30 | \twocolitem{\windowstyle{wxMINIMIZE}}{Identical to {\bf wxICONIZE}. Windows only. } |
31 | \twocolitem{\windowstyle{wxMINIMIZE\_BOX}}{Displays a minimize box on the frame. } | |
32 | \twocolitem{\windowstyle{wxMAXIMIZE}}{Displays the frame maximized. Windows only. } | |
33 | \twocolitem{\windowstyle{wxMAXIMIZE\_BOX}}{Displays a maximize box on the frame. } | |
34 | \twocolitem{\windowstyle{wxSTAY\_ON\_TOP}}{Stay on top of other windows. Windows only. } | |
35 | \twocolitem{\windowstyle{wxSYSTEM\_MENU}}{Displays a system menu. } | |
36 | \twocolitem{\windowstyle{wxTHICK\_FRAME}}{Displays a thick frame around the window. Windows and Motif only.} | |
37 | \twocolitem{\windowstyle{wxSIMPLE\_BORDER}}{Displays no border or decorations. GTK and Windows only (?). } | |
38 | \twocolitem{\windowstyle{wxRESIZE\_BORDER}}{Displays a resizeable border around the window (Unix only).} | |
39 | \twocolitem{\windowstyle{wxFRAME\_FLOAT\_ON\_PARENT}}{Causes the frame to be above the parent window in the | |
aeab10d0 | 40 | z-order and not shown in the taskbar. Without this style, frames are created as top-level windows that may be obscured by |
80629c8b | 41 | the parent window, and frame titles are shown in the taskbar. Windows and GTK. } |
1c4f8f8d | 42 | \twocolitem{\windowstyle{wxFRAME\_TOOL\_WINDOW}}{Causes a frame with a small titlebar to be created; |
6453876e | 43 | the frame title does not appear in the taskbar. Windows only. } |
a660d684 KB |
44 | \end{twocollist} |
45 | ||
6453876e | 46 | See also \helpref{window styles overview}{windowstyles}. |
a660d684 KB |
47 | |
48 | \wxheading{Remarks} | |
49 | ||
50 | An application should normally define an \helpref{OnCloseWindow}{wxwindowonclosewindow} handler for the | |
51 | frame to respond to system close events, for example so that related data and subwindows can be cleaned up. | |
52 | ||
53 | \wxheading{See also} | |
54 | ||
55 | \helpref{wxMDIParentFrame}{wxmdiparentframe}, \helpref{wxMDIChildFrame}{wxmdichildframe},\rtfsp | |
56 | \helpref{wxMiniFrame}{wxminiframe}, \helpref{wxDialog}{wxdialog} | |
57 | ||
58 | \latexignore{\rtfignore{\wxheading{Members}}} | |
59 | ||
60 | \membersection{wxFrame::wxFrame}\label{wxframeconstr} | |
61 | ||
62 | \func{}{wxFrame}{\void} | |
63 | ||
64 | Default constructor. | |
65 | ||
eaaa6a06 | 66 | \func{}{wxFrame}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp |
a660d684 KB |
67 | \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},\rtfsp |
68 | \param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = wxDEFAULT\_FRAME\_STYLE},\rtfsp | |
69 | \param{const wxString\& }{name = ``frame"}} | |
70 | ||
71 | Constructor, creating the window. | |
72 | ||
73 | \wxheading{Parameters} | |
74 | ||
75 | \docparam{parent}{The window parent. This may be NULL. If it is non-NULL, the frame will | |
76 | always be displayed on top of the parent window on Windows.} | |
77 | ||
78 | \docparam{id}{The window identifier. It may take a value of -1 to indicate a default value.} | |
79 | ||
80 | \docparam{title}{The caption to be displayed on the frame's title bar.} | |
81 | ||
82 | \docparam{pos}{The window position. A value of (-1, -1) indicates a default position, chosen by | |
83 | either the windowing system or wxWindows, depending on platform.} | |
84 | ||
85 | \docparam{size}{The window size. A value of (-1, -1) indicates a default size, chosen by | |
86 | either the windowing system or wxWindows, depending on platform.} | |
87 | ||
88 | \docparam{style}{The window style. See \helpref{wxFrame}{wxframe}.} | |
89 | ||
90 | \docparam{name}{The name of the window. This parameter is used to associate a name with the item, | |
91 | allowing the application user to set Motif resource values for | |
92 | individual windows.} | |
93 | ||
94 | \wxheading{Remarks} | |
95 | ||
96 | For Motif, MWM (the Motif Window Manager) should be running for any window styles to work | |
97 | (otherwise all styles take effect). | |
98 | ||
99 | \wxheading{See also} | |
100 | ||
101 | \helpref{wxFrame::Create}{wxframecreate} | |
102 | ||
103 | \membersection{wxFrame::\destruct{wxFrame}} | |
104 | ||
105 | \func{void}{\destruct{wxFrame}}{\void} | |
106 | ||
107 | Destructor. Destroys all child windows and menu bar if present. | |
108 | ||
109 | \membersection{wxFrame::Centre}\label{wxframecentre} | |
110 | ||
eaaa6a06 | 111 | \func{void}{Centre}{\param{int}{ direction = wxBOTH}} |
a660d684 KB |
112 | |
113 | Centres the frame on the display. | |
114 | ||
115 | \wxheading{Parameters} | |
116 | ||
117 | \docparam{direction}{The parameter may be {\tt wxHORIZONTAL}, {\tt wxVERTICAL} or {\tt wxBOTH}.} | |
118 | ||
119 | \membersection{wxFrame::Command}\label{wxframecommand} | |
120 | ||
121 | \func{void}{Command}{\param{int }{id}} | |
122 | ||
123 | Simulate a menu command. | |
124 | ||
125 | \wxheading{Parameters} | |
126 | ||
127 | \docparam{id}{The identifier for a menu item.} | |
128 | ||
129 | \membersection{wxFrame::Create}\label{wxframecreate} | |
130 | ||
eaaa6a06 | 131 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp |
a660d684 KB |
132 | \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},\rtfsp |
133 | \param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = wxDEFAULT\_FRAME\_STYLE},\rtfsp | |
134 | \param{const wxString\& }{name = ``frame"}} | |
135 | ||
136 | Used in two-step frame construction. See \helpref{wxFrame::wxFrame}{wxframeconstr}\rtfsp | |
137 | for further details. | |
138 | ||
139 | \membersection{wxFrame::CreateStatusBar}\label{wxframecreatestatusbar} | |
140 | ||
81d66cf3 JS |
141 | \func{virtual wxStatusBar*}{CreateStatusBar}{\param{int}{ number = 1}, |
142 | \param{long}{ style = 0}, | |
143 | \param{wxWindowID}{ id = -1}, \param{const wxString\&}{ name = "statusBar"}} | |
a660d684 KB |
144 | |
145 | Creates a status bar at the bottom of the frame. | |
146 | ||
147 | \wxheading{Parameters} | |
148 | ||
149 | \docparam{number}{The number of fields to create. Specify a | |
150 | value greater than 1 to create a multi-field status bar.} | |
151 | ||
81d66cf3 JS |
152 | \docparam{style}{The status bar style. See \helpref{wxStatusBar}{wxstatusbar} for a list |
153 | of valid styles.} | |
154 | ||
155 | \docparam{id}{The status bar window identifier. If -1, an identifier will be chosen by | |
156 | wxWindows.} | |
157 | ||
158 | \docparam{name}{The status bar window name.} | |
159 | ||
a660d684 KB |
160 | \wxheading{Return value} |
161 | ||
81d66cf3 | 162 | A pointer to the the status bar if it was created successfully, NULL otherwise. |
a660d684 KB |
163 | |
164 | \wxheading{Remarks} | |
165 | ||
166 | The width of the status bar is the whole width of the frame (adjusted automatically when | |
167 | resizing), and the height and text size are chosen by the host windowing system. | |
168 | ||
169 | By default, the status bar is an instance of wxStatusBar. To use a different class, | |
170 | override \helpref{wxFrame::OnCreateStatusBar}{wxframeoncreatestatusbar}. | |
171 | ||
172 | Note that you can put controls and other windows on the status bar if you wish. | |
173 | ||
174 | \wxheading{See also} | |
175 | ||
176 | \helpref{wxFrame::SetStatusText}{wxframesetstatustext},\rtfsp | |
177 | \helpref{wxFrame::OnCreateStatusBar}{wxframeoncreatestatusbar},\rtfsp | |
178 | \helpref{wxFrame::GetStatusBar}{wxframegetstatusbar} | |
179 | ||
81d66cf3 JS |
180 | \membersection{wxFrame::CreateToolBar}\label{wxframecreatetoolbar} |
181 | ||
182 | \func{virtual wxToolBar*}{CreateToolBar}{\param{long}{ style = wxNO\_BORDER \pipe wxTB\_HORIZONTAL}, | |
183 | \param{wxWindowID}{ id = -1}, \param{const wxString\&}{ name = "toolBar"}} | |
184 | ||
185 | Creates a toolbar at the top or left of the frame. | |
186 | ||
187 | \wxheading{Parameters} | |
188 | ||
189 | \docparam{style}{The toolbar style. See \helpref{wxToolBar}{wxtoolbar} for a list | |
190 | of valid styles.} | |
191 | ||
192 | \docparam{id}{The toolbar window identifier. If -1, an identifier will be chosen by | |
193 | wxWindows.} | |
194 | ||
195 | \docparam{name}{The toolbar window name.} | |
196 | ||
197 | \wxheading{Return value} | |
198 | ||
199 | A pointer to the the toolbar if it was created successfully, NULL otherwise. | |
200 | ||
201 | \wxheading{Remarks} | |
202 | ||
203 | By default, the toolbar is an instance of wxToolBar (which is defined to be | |
204 | a suitable toolbar class on each platform, such as wxToolBar95). To use a different class, | |
205 | override \helpref{wxFrame::OnCreateToolBar}{wxframeoncreatetoolbar}. | |
206 | ||
207 | When a toolbar has been created with this function, or made known to the frame | |
208 | with \helpref{wxFrame::SetToolBar}{wxframesettoolbar}, the frame will manage the toolbar | |
209 | position and adjust the return value from \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize} to | |
210 | reflect the available space for application windows. | |
211 | ||
212 | \wxheading{See also} | |
213 | ||
214 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar},\rtfsp | |
215 | \helpref{wxFrame::OnCreateToolBar}{wxframeoncreatetoolbar},\rtfsp | |
216 | \helpref{wxFrame::SetToolBar}{wxframesettoolbar},\rtfsp | |
217 | \helpref{wxFrame::GetToolBar}{wxframegettoolbar} | |
218 | ||
1c4f8f8d VZ |
219 | \membersection{wxFrame::GetClientAreaOrigin}\label{wxframegetclientareaorigin} |
220 | ||
221 | \constfunc{wxPoint}{GetClientAreaOrigin}{\void} | |
222 | ||
223 | Returns the origin of the frame client area (in client coordinates). It may be | |
224 | different from (0, 0) if the frame has a toolbar. | |
225 | ||
a660d684 KB |
226 | \membersection{wxFrame::GetMenuBar}\label{wxframegetmenubar} |
227 | ||
228 | \constfunc{wxMenuBar*}{GetMenuBar}{\void} | |
229 | ||
230 | Returns a pointer to the menubar currently associated with the frame (if any). | |
231 | ||
232 | \wxheading{See also} | |
233 | ||
234 | \helpref{wxFrame::SetMenuBar}{wxframesetmenubar}, \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu} | |
235 | ||
236 | \membersection{wxFrame::GetStatusBar}\label{wxframegetstatusbar} | |
237 | ||
fa482912 | 238 | \constfunc{wxStatusBar*}{GetStatusBar}{\void} |
a660d684 KB |
239 | |
240 | Returns a pointer to the status bar currently associated with the frame (if any). | |
241 | ||
242 | \wxheading{See also} | |
243 | ||
244 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar} | |
245 | ||
246 | \membersection{wxFrame::GetTitle}\label{wxframegettitle} | |
247 | ||
fa482912 | 248 | \constfunc{wxString}{GetTitle}{\void} |
a660d684 | 249 | |
fa482912 | 250 | Gets a string containing the frame title. See \helpref{wxFrame::SetTitle}{wxframesettitle}. |
a660d684 | 251 | |
81d66cf3 JS |
252 | \membersection{wxFrame::GetToolBar}\label{wxframegettoolbar} |
253 | ||
fa482912 | 254 | \constfunc{wxToolBar*}{GetToolBar}{\void} |
81d66cf3 JS |
255 | |
256 | Returns a pointer to the toolbar currently associated with the frame (if any). | |
257 | ||
258 | \wxheading{See also} | |
259 | ||
260 | \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar},\rtfsp | |
261 | \helpref{wxFrame::SetToolBar}{wxframesettoolbar} | |
262 | ||
a660d684 KB |
263 | \membersection{wxFrame::Iconize}\label{wxframeiconize} |
264 | ||
fa482912 | 265 | \func{void}{Iconize}{\param{bool}{ iconize}} |
a660d684 | 266 | |
6453876e | 267 | Iconizes or restores the frame. Windows only. |
a660d684 KB |
268 | |
269 | \wxheading{Parameters} | |
270 | ||
271 | \docparam{izonize}{If TRUE, iconizes the frame; if FALSE, shows and restores it.} | |
272 | ||
273 | \wxheading{See also} | |
274 | ||
275 | \helpref{wxFrame::IsIconized}{wxframeisiconized}, \helpref{wxFrame::Maximize}{wxframemaximize}. | |
276 | ||
277 | \membersection{wxFrame::IsIconized}\label{wxframeisiconized} | |
278 | ||
94b49b93 | 279 | \constfunc{bool}{IsIconized}{\void} |
a660d684 | 280 | |
6453876e | 281 | Returns TRUE if the frame is iconized. Windows only. |
a660d684 | 282 | |
94b49b93 JS |
283 | \membersection{wxFrame::IsMaximized}\label{wxframeismaximized} |
284 | ||
285 | \constfunc{bool}{IsMaximized}{\void} | |
286 | ||
287 | Returns TRUE if the frame is maximized. | |
288 | ||
a660d684 KB |
289 | \membersection{wxFrame::Maximize}\label{wxframemaximize} |
290 | ||
fa482912 | 291 | \func{void}{Maximize}{\param{bool }{maximize}} |
a660d684 KB |
292 | |
293 | Maximizes or restores the frame. | |
294 | ||
295 | \wxheading{Parameters} | |
296 | ||
fa482912 | 297 | \docparam{maximize}{If TRUE, maximizes the frame, otherwise it restores it.} |
a660d684 KB |
298 | |
299 | \wxheading{Remarks} | |
300 | ||
301 | This function only works under Windows. | |
302 | ||
303 | \wxheading{See also} | |
304 | ||
305 | \helpref{wxFrame::Iconize}{wxframeiconize} | |
306 | ||
307 | \membersection{wxFrame::OnActivate} | |
308 | ||
8cbd2bde | 309 | \func{void}{OnActivate}{\param{wxActivateEvent\&}{ event}} |
a660d684 KB |
310 | |
311 | Called when a window is activated or deactivated (MS Windows | |
8cbd2bde | 312 | only). See also \helpref{wxActivateEvent}{wxactivateevent}. |
a660d684 KB |
313 | |
314 | \membersection{wxFrame::OnCreateStatusBar}\label{wxframeoncreatestatusbar} | |
315 | ||
dbdb39b2 | 316 | \func{virtual wxStatusBar*}{OnCreateStatusBar}{\param{int }{number}, |
81d66cf3 JS |
317 | \param{long}{ style}, |
318 | \param{wxWindowID}{ id}, \param{const wxString\&}{ name}} | |
a660d684 KB |
319 | |
320 | Virtual function called when a status bar is requested by \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}. | |
321 | ||
322 | \wxheading{Parameters} | |
323 | ||
324 | \docparam{number}{The number of fields to create.} | |
325 | ||
81d66cf3 JS |
326 | \docparam{style}{The window style. See \helpref{wxStatusBar}{wxstatusbar} for a list |
327 | of valid styles.} | |
328 | ||
329 | \docparam{id}{The window identifier. If -1, an identifier will be chosen by | |
330 | wxWindows.} | |
331 | ||
332 | \docparam{name}{The window name.} | |
333 | ||
a660d684 KB |
334 | \wxheading{Return value} |
335 | ||
336 | A status bar object. | |
337 | ||
338 | \wxheading{Remarks} | |
339 | ||
340 | An application can override this function to return a different kind of status bar. The default | |
341 | implementation returns an instance of \helpref{wxStatusBar}{wxstatusbar}. | |
342 | ||
343 | \wxheading{See also} | |
344 | ||
345 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar}. | |
346 | ||
81d66cf3 JS |
347 | \membersection{wxFrame::OnCreateToolBar}\label{wxframeoncreatetoolbar} |
348 | ||
349 | \func{virtual wxToolBar*}{OnCreateToolBar}{\param{long}{ style}, | |
350 | \param{wxWindowID}{ id}, \param{const wxString\&}{ name}} | |
351 | ||
352 | Virtual function called when a toolbar is requested by \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}. | |
353 | ||
354 | \wxheading{Parameters} | |
355 | ||
356 | \docparam{style}{The toolbar style. See \helpref{wxToolBar}{wxtoolbar} for a list | |
357 | of valid styles.} | |
358 | ||
359 | \docparam{id}{The toolbar window identifier. If -1, an identifier will be chosen by | |
360 | wxWindows.} | |
361 | ||
362 | \docparam{name}{The toolbar window name.} | |
363 | ||
364 | \wxheading{Return value} | |
365 | ||
366 | A toolbar object. | |
367 | ||
368 | \wxheading{Remarks} | |
369 | ||
370 | An application can override this function to return a different kind of toolbar. The default | |
371 | implementation returns an instance of \helpref{wxToolBar}{wxtoolbar}. | |
372 | ||
373 | \wxheading{See also} | |
374 | ||
375 | \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar}. | |
376 | ||
a660d684 KB |
377 | \membersection{wxFrame::OnMenuCommand}\label{wxframeonmenucommand} |
378 | ||
379 | \func{void}{OnMenuCommand}{\param{wxCommandEvent\&}{ event}} | |
380 | ||
381 | See \helpref{wxWindow::OnMenuCommand}{wxwindowonmenucommand}. | |
382 | ||
383 | \membersection{wxFrame::OnMenuHighlight}\label{wxframeonmenuhighlight} | |
384 | ||
385 | \func{void}{OnMenuHighlight}{\param{wxMenuEvent\&}{ event}} | |
386 | ||
387 | See \helpref{wxWindow::OnMenuHighlight}{wxwindowonmenuhighlight}. | |
388 | ||
389 | \membersection{wxFrame::OnSize}\label{wxframeonsize} | |
390 | ||
391 | \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} | |
392 | ||
393 | See \helpref{wxWindow::OnSize}{wxwindowonsize}. | |
394 | ||
395 | The default {\bf wxFrame::OnSize} implementation looks for a single subwindow, | |
396 | and if one is found, resizes it to fit | |
397 | inside the frame. Override this member if more complex behaviour | |
398 | is required (for example, if there are several subwindows). | |
399 | ||
400 | \membersection{wxFrame::SetIcon}\label{wxframeseticon} | |
401 | ||
402 | \func{void}{SetIcon}{\param{const wxIcon\& }{icon}} | |
403 | ||
404 | Sets the icon for this frame. | |
405 | ||
406 | \wxheading{Parameters} | |
407 | ||
408 | \docparam{icon}{The icon to associate with this frame.} | |
409 | ||
410 | \wxheading{Remarks} | |
411 | ||
412 | The frame takes a `copy' of {\it icon}, but since it uses reference | |
413 | counting, the copy is very quick. It is safe to delete {\it icon} after | |
414 | calling this function. | |
415 | ||
416 | Under Windows, instead of using {\bf SetIcon}, you can add the | |
417 | following lines to your MS Windows resource file: | |
418 | ||
419 | \begin{verbatim} | |
420 | wxSTD_MDIPARENTFRAME ICON icon1.ico | |
421 | wxSTD_MDICHILDFRAME ICON icon2.ico | |
422 | wxSTD_FRAME ICON icon3.ico | |
423 | \end{verbatim} | |
424 | ||
425 | where icon1.ico will be used for the MDI parent frame, icon2.ico | |
426 | will be used for MDI child frames, and icon3.ico will be used for | |
427 | non-MDI frames. | |
428 | ||
429 | If these icons are not supplied, and {\bf SetIcon} is not called either, | |
430 | then the following defaults apply if you have included wx.rc. | |
431 | ||
432 | \begin{verbatim} | |
433 | wxDEFAULT_FRAME ICON std.ico | |
434 | wxDEFAULT_MDIPARENTFRAME ICON mdi.ico | |
435 | wxDEFAULT_MDICHILDFRAME ICON child.ico | |
436 | \end{verbatim} | |
437 | ||
438 | You can replace std.ico, mdi.ico and child.ico with your own defaults | |
439 | for all your wxWindows application. Currently they show the same icon. | |
440 | ||
441 | {\it Note:} a wxWindows application linked with subsystem equal to 4.0 | |
442 | (i.e. marked as a Windows 95 application) doesn't respond properly | |
443 | to wxFrame::SetIcon. To work around this until a solution is found, | |
444 | mark your program as a 3.5 application. This will also ensure | |
445 | that Windows provides small icons for the application automatically. | |
446 | ||
447 | See also \helpref{wxIcon}{wxicon}. | |
448 | ||
449 | \membersection{wxFrame::SetMenuBar}\label{wxframesetmenubar} | |
450 | ||
451 | \func{void}{SetMenuBar}{\param{wxMenuBar* }{menuBar}} | |
452 | ||
453 | Tells the frame to show the given menu bar. | |
454 | ||
455 | \wxheading{Parameters} | |
456 | ||
457 | \docparam{menuBar}{The menu bar to associate with the frame.} | |
458 | ||
459 | \wxheading{Remarks} | |
460 | ||
461 | If the frame is destroyed, the | |
462 | menu bar and its menus will be destroyed also, so do not delete the menu | |
463 | bar explicitly (except by resetting the frame's menu bar to another | |
464 | frame or NULL). | |
465 | ||
466 | Under Windows, a call to \helpref{wxFrame::OnSize}{wxframeonsize} is generated, so be sure to initialize | |
467 | data members properly before calling {\bf SetMenuBar}. | |
468 | ||
469 | Note that it is not possible to call this function twice for the same frame object. | |
470 | ||
471 | \wxheading{See also} | |
472 | ||
473 | \helpref{wxFrame::GetMenuBar}{wxframegetmenubar}, \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu}. | |
474 | ||
81d66cf3 JS |
475 | \membersection{wxFrame::SetStatusBar}\label{wxframesetstatusbar} |
476 | ||
477 | \func{void}{SetStatusBar}{\param{wxStatusBar*}{ statusBar}} | |
478 | ||
479 | Associates a status bar with the frame. | |
480 | ||
481 | \wxheading{See also} | |
482 | ||
483 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar},\rtfsp | |
484 | \helpref{wxFrame::GetStatusBar}{wxframegetstatusbar} | |
485 | ||
a660d684 KB |
486 | \membersection{wxFrame::SetStatusText}\label{wxframesetstatustext} |
487 | ||
eaaa6a06 | 488 | \func{virtual void}{SetStatusText}{\param{const wxString\& }{ text}, \param{int}{ number = 0}} |
a660d684 KB |
489 | |
490 | Sets the status bar text and redraws the status bar. | |
491 | ||
492 | \wxheading{Parameters} | |
493 | ||
494 | \docparam{text}{The text for the status field.} | |
495 | ||
496 | \docparam{number}{The status field (starting from zero).} | |
497 | ||
498 | \wxheading{Remarks} | |
499 | ||
500 | Use an empty string to clear the status bar. | |
501 | ||
502 | \wxheading{See also} | |
503 | ||
504 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar} | |
505 | ||
506 | \membersection{wxFrame::SetStatusWidths}\label{wxframesetstatuswidths} | |
507 | ||
eaaa6a06 | 508 | \func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}} |
a660d684 KB |
509 | |
510 | Sets the widths of the fields in the status bar. | |
511 | ||
512 | \wxheading{Parameters} | |
513 | ||
514 | \wxheading{n}{The number of fields in the status bar. It must be the | |
515 | same used in \helpref{CreateStatusBar}{wxframecreatestatusbar}.} | |
516 | ||
517 | \docparam{widths}{Must contain an array of {\it n} integers, each of which is a status field width | |
518 | in pixels. A value of -1 indicates that the field is variable width; at least one | |
519 | field must be -1. You should delete this array after calling {\bf SetStatusWidths}.} | |
520 | ||
521 | \wxheading{Remarks} | |
522 | ||
523 | The widths of the variable fields are calculated from the total width of all fields, | |
564747ee | 524 | minus the sum of widths of the non-variable fields, divided by the number of |
a660d684 KB |
525 | variable fields. |
526 | ||
564747ee RD |
527 | \pythonnote{Only a single parameter is required, a Python list of |
528 | integers.} | |
529 | ||
81d66cf3 JS |
530 | \membersection{wxFrame::SetToolBar}\label{wxframesettoolbar} |
531 | ||
532 | \func{void}{SetToolBar}{\param{wxToolBar*}{ toolBar}} | |
533 | ||
534 | Associates a toolbar with the frame. | |
535 | ||
536 | \wxheading{See also} | |
537 | ||
538 | \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar},\rtfsp | |
539 | \helpref{wxFrame::GetToolBar}{wxframegettoolbar} | |
540 | ||
a660d684 KB |
541 | \membersection{wxFrame::SetTitle}\label{wxframesettitle} |
542 | ||
543 | \func{virtual void}{SetTitle}{\param{const wxString\& }{ title}} | |
544 | ||
545 | Sets the frame title. | |
546 | ||
547 | \wxheading{Parameters} | |
548 | ||
549 | \docparam{title}{The frame title.} | |
550 | ||
551 | \wxheading{See also} | |
552 | ||
553 | \helpref{wxFrame::GetTitle}{wxframegettitle} | |
554 | ||
bf4d9b2b JS |
555 | \membersection{wxFrame::ShowFullScreen}\label{wxframeshowfullscreen} |
556 | ||
557 | \func{bool}{ShowFullScreen}{\param{bool}{ show}, \param{long}{ style = wxFULLSCREEN\_ALL}} | |
558 | ||
559 | Passing TRUE to {\it shows} shows the frame full-screen, and passing FALSE restores the frame | |
560 | again. {\it style} is a bit list containing some or all of the following values, which | |
561 | indicate what elements of the frame to hide in full-screen mode: | |
562 | ||
563 | \begin{itemize}\itemsep=0pt | |
564 | \item wxFULLSCREEN\_NOMENUBAR | |
565 | \item wxFULLSCREEN\_NOTOOLBAR | |
566 | \item wxFULLSCREEN\_NOSTATUSBAR | |
567 | \item wxFULLSCREEN\_NOBORDER | |
568 | \item wxFULLSCREEN\_NOCAPTION | |
569 | \item wxFULLSCREEN\_ALL (all of the above) | |
570 | \end{itemize} | |
571 | ||
572 | This function only works on Windows and has not been tested with MDI frames. | |
573 |