]>
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 | |
bc7e0c92 | 27 | \twocolitem{\windowstyle{wxDEFAULT\_FRAME\_STYLE}}{Defined as {\bf wxMINIMIZE\_BOX \pipe wxMAXIMIZE\_BOX \pipe wxRESIZE\_BORDER \pipe wxSYSTEM\_MENU \pipe wxCAPTION}.} |
6453876e | 28 | \twocolitem{\windowstyle{wxICONIZE}}{Display the frame iconized (minimized). Windows only. } |
a660d684 | 29 | \twocolitem{\windowstyle{wxCAPTION}}{Puts a caption on the frame.} |
f6bcfd97 BP |
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.} | |
9dfef5ac VZ |
34 | \twocolitem{\windowstyle{wxSTAY\_ON\_TOP}}{Stay on top of all other windows, |
35 | see also wxFRAME\_FLOAT\_ON\_PARENT. Windows only.} | |
f6bcfd97 BP |
36 | \twocolitem{\windowstyle{wxSYSTEM\_MENU}}{Displays a system menu.} |
37 | \twocolitem{\windowstyle{wxSIMPLE\_BORDER}}{Displays no border or decorations. GTK and Windows only.} | |
b3daa5a3 VZ |
38 | \twocolitem{\windowstyle{wxRESIZE\_BORDER}}{Displays a resizeable border around the window.} |
39 | \twocolitem{\windowstyle{wxFRAME\_TOOL\_WINDOW}}{Causes a frame with a small | |
40 | titlebar to be created; the frame does not appear in the taskbar under Windows.} | |
9dfef5ac VZ |
41 | \twocolitem{\windowstyle{wxFRAME\_NO\_TASKBAR}}{Creates an otherwise normal |
42 | frame but it does not appear in the taskbar under Windows (note that it will | |
43 | minimize to the desktop window which may seem strange to the users and thus it | |
44 | might be better to use this style only without wxMINIMIZE\_BOX style). | |
45 | Has no effect under other platforms.} | |
46 | \twocolitem{\windowstyle{wxFRAME\_FLOAT\_ON\_PARENT}}{The frame will always be | |
47 | on top of its parent (unlike wxSTAY\_ON\_TOP). A frame created with this style | |
48 | must have a non-NULL parent.} | |
26a80c22 JS |
49 | \twocolitem{\windowstyle{wxFRAME\_EX\_CONTEXTHELP}}{Under Windows, puts a query button on the |
50 | caption. When pressed, Windows will go into a context-sensitive help mode and wxWindows will send | |
51 | a wxEVT\_HELP event if the user clicked on an application window. {\it Note} that this is an extended | |
52 | style and must be set by calling \helpref{SetExtraStyle}{wxwindowsetextrastyle} before Create is called (two-step construction). | |
335c9e32 VZ |
53 | You cannot use this style together with wxMAXIMIZE\_BOX or wxMINIMIZE\_BOX, so |
54 | you should use | |
e480a80a | 55 | {\tt wxDEFAULT\_FRAME\_STYLE \& \~ (wxMINIMIZE\_BOX | wxMAXIMIZE\_BOX)} for the |
335c9e32 VZ |
56 | frames having this style (the dialogs don't have minimize nor maximize box by |
57 | default)} | |
a660d684 KB |
58 | \end{twocollist} |
59 | ||
f6bcfd97 BP |
60 | The default frame style is for normal, resizeable frames. To create a frame |
61 | which can not be resized by user, you may use the following combination of | |
62 | styles: {\tt wxDEFAULT\_FRAME\_STYLE \& \~ (wxRESIZE\_BORDER \pipe wxRESIZE\_BOX \pipe wxMAXIMIZE\_BOX)}. | |
63 | % Note: the space after the tilde is necessary or Tex2RTF complains. | |
64 | ||
6453876e | 65 | See also \helpref{window styles overview}{windowstyles}. |
a660d684 KB |
66 | |
67 | \wxheading{Remarks} | |
68 | ||
f4fcc291 | 69 | An application should normally define an \helpref{wxCloseEvent}{wxcloseevent} handler for the |
a660d684 KB |
70 | frame to respond to system close events, for example so that related data and subwindows can be cleaned up. |
71 | ||
72 | \wxheading{See also} | |
73 | ||
74 | \helpref{wxMDIParentFrame}{wxmdiparentframe}, \helpref{wxMDIChildFrame}{wxmdichildframe},\rtfsp | |
75 | \helpref{wxMiniFrame}{wxminiframe}, \helpref{wxDialog}{wxdialog} | |
76 | ||
77 | \latexignore{\rtfignore{\wxheading{Members}}} | |
78 | ||
79 | \membersection{wxFrame::wxFrame}\label{wxframeconstr} | |
80 | ||
81 | \func{}{wxFrame}{\void} | |
82 | ||
83 | Default constructor. | |
84 | ||
eaaa6a06 | 85 | \func{}{wxFrame}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp |
a660d684 KB |
86 | \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},\rtfsp |
87 | \param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = wxDEFAULT\_FRAME\_STYLE},\rtfsp | |
88 | \param{const wxString\& }{name = ``frame"}} | |
89 | ||
90 | Constructor, creating the window. | |
91 | ||
92 | \wxheading{Parameters} | |
93 | ||
94 | \docparam{parent}{The window parent. This may be NULL. If it is non-NULL, the frame will | |
95 | always be displayed on top of the parent window on Windows.} | |
96 | ||
97 | \docparam{id}{The window identifier. It may take a value of -1 to indicate a default value.} | |
98 | ||
99 | \docparam{title}{The caption to be displayed on the frame's title bar.} | |
100 | ||
101 | \docparam{pos}{The window position. A value of (-1, -1) indicates a default position, chosen by | |
102 | either the windowing system or wxWindows, depending on platform.} | |
103 | ||
104 | \docparam{size}{The window size. A value of (-1, -1) indicates a default size, chosen by | |
105 | either the windowing system or wxWindows, depending on platform.} | |
106 | ||
107 | \docparam{style}{The window style. See \helpref{wxFrame}{wxframe}.} | |
108 | ||
109 | \docparam{name}{The name of the window. This parameter is used to associate a name with the item, | |
110 | allowing the application user to set Motif resource values for | |
111 | individual windows.} | |
112 | ||
113 | \wxheading{Remarks} | |
114 | ||
115 | For Motif, MWM (the Motif Window Manager) should be running for any window styles to work | |
116 | (otherwise all styles take effect). | |
117 | ||
118 | \wxheading{See also} | |
119 | ||
120 | \helpref{wxFrame::Create}{wxframecreate} | |
121 | ||
122 | \membersection{wxFrame::\destruct{wxFrame}} | |
123 | ||
124 | \func{void}{\destruct{wxFrame}}{\void} | |
125 | ||
126 | Destructor. Destroys all child windows and menu bar if present. | |
127 | ||
128 | \membersection{wxFrame::Centre}\label{wxframecentre} | |
129 | ||
eaaa6a06 | 130 | \func{void}{Centre}{\param{int}{ direction = wxBOTH}} |
a660d684 KB |
131 | |
132 | Centres the frame on the display. | |
133 | ||
134 | \wxheading{Parameters} | |
135 | ||
136 | \docparam{direction}{The parameter may be {\tt wxHORIZONTAL}, {\tt wxVERTICAL} or {\tt wxBOTH}.} | |
137 | ||
138 | \membersection{wxFrame::Command}\label{wxframecommand} | |
139 | ||
140 | \func{void}{Command}{\param{int }{id}} | |
141 | ||
142 | Simulate a menu command. | |
143 | ||
144 | \wxheading{Parameters} | |
145 | ||
146 | \docparam{id}{The identifier for a menu item.} | |
147 | ||
148 | \membersection{wxFrame::Create}\label{wxframecreate} | |
149 | ||
eaaa6a06 | 150 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp |
a660d684 KB |
151 | \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},\rtfsp |
152 | \param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = wxDEFAULT\_FRAME\_STYLE},\rtfsp | |
153 | \param{const wxString\& }{name = ``frame"}} | |
154 | ||
155 | Used in two-step frame construction. See \helpref{wxFrame::wxFrame}{wxframeconstr}\rtfsp | |
156 | for further details. | |
157 | ||
158 | \membersection{wxFrame::CreateStatusBar}\label{wxframecreatestatusbar} | |
159 | ||
81d66cf3 JS |
160 | \func{virtual wxStatusBar*}{CreateStatusBar}{\param{int}{ number = 1}, |
161 | \param{long}{ style = 0}, | |
162 | \param{wxWindowID}{ id = -1}, \param{const wxString\&}{ name = "statusBar"}} | |
a660d684 KB |
163 | |
164 | Creates a status bar at the bottom of the frame. | |
165 | ||
166 | \wxheading{Parameters} | |
167 | ||
168 | \docparam{number}{The number of fields to create. Specify a | |
169 | value greater than 1 to create a multi-field status bar.} | |
170 | ||
81d66cf3 JS |
171 | \docparam{style}{The status bar style. See \helpref{wxStatusBar}{wxstatusbar} for a list |
172 | of valid styles.} | |
173 | ||
174 | \docparam{id}{The status bar window identifier. If -1, an identifier will be chosen by | |
175 | wxWindows.} | |
176 | ||
177 | \docparam{name}{The status bar window name.} | |
178 | ||
a660d684 KB |
179 | \wxheading{Return value} |
180 | ||
81d66cf3 | 181 | A pointer to the the status bar if it was created successfully, NULL otherwise. |
a660d684 KB |
182 | |
183 | \wxheading{Remarks} | |
184 | ||
185 | The width of the status bar is the whole width of the frame (adjusted automatically when | |
186 | resizing), and the height and text size are chosen by the host windowing system. | |
187 | ||
188 | By default, the status bar is an instance of wxStatusBar. To use a different class, | |
189 | override \helpref{wxFrame::OnCreateStatusBar}{wxframeoncreatestatusbar}. | |
190 | ||
191 | Note that you can put controls and other windows on the status bar if you wish. | |
192 | ||
193 | \wxheading{See also} | |
194 | ||
195 | \helpref{wxFrame::SetStatusText}{wxframesetstatustext},\rtfsp | |
196 | \helpref{wxFrame::OnCreateStatusBar}{wxframeoncreatestatusbar},\rtfsp | |
197 | \helpref{wxFrame::GetStatusBar}{wxframegetstatusbar} | |
198 | ||
81d66cf3 JS |
199 | \membersection{wxFrame::CreateToolBar}\label{wxframecreatetoolbar} |
200 | ||
201 | \func{virtual wxToolBar*}{CreateToolBar}{\param{long}{ style = wxNO\_BORDER \pipe wxTB\_HORIZONTAL}, | |
202 | \param{wxWindowID}{ id = -1}, \param{const wxString\&}{ name = "toolBar"}} | |
203 | ||
204 | Creates a toolbar at the top or left of the frame. | |
205 | ||
206 | \wxheading{Parameters} | |
207 | ||
208 | \docparam{style}{The toolbar style. See \helpref{wxToolBar}{wxtoolbar} for a list | |
209 | of valid styles.} | |
210 | ||
211 | \docparam{id}{The toolbar window identifier. If -1, an identifier will be chosen by | |
212 | wxWindows.} | |
213 | ||
214 | \docparam{name}{The toolbar window name.} | |
215 | ||
216 | \wxheading{Return value} | |
217 | ||
218 | A pointer to the the toolbar if it was created successfully, NULL otherwise. | |
219 | ||
220 | \wxheading{Remarks} | |
221 | ||
222 | By default, the toolbar is an instance of wxToolBar (which is defined to be | |
223 | a suitable toolbar class on each platform, such as wxToolBar95). To use a different class, | |
224 | override \helpref{wxFrame::OnCreateToolBar}{wxframeoncreatetoolbar}. | |
225 | ||
226 | When a toolbar has been created with this function, or made known to the frame | |
227 | with \helpref{wxFrame::SetToolBar}{wxframesettoolbar}, the frame will manage the toolbar | |
228 | position and adjust the return value from \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize} to | |
229 | reflect the available space for application windows. | |
230 | ||
231 | \wxheading{See also} | |
232 | ||
233 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar},\rtfsp | |
234 | \helpref{wxFrame::OnCreateToolBar}{wxframeoncreatetoolbar},\rtfsp | |
235 | \helpref{wxFrame::SetToolBar}{wxframesettoolbar},\rtfsp | |
236 | \helpref{wxFrame::GetToolBar}{wxframegettoolbar} | |
237 | ||
1c4f8f8d VZ |
238 | \membersection{wxFrame::GetClientAreaOrigin}\label{wxframegetclientareaorigin} |
239 | ||
240 | \constfunc{wxPoint}{GetClientAreaOrigin}{\void} | |
241 | ||
242 | Returns the origin of the frame client area (in client coordinates). It may be | |
243 | different from (0, 0) if the frame has a toolbar. | |
244 | ||
a660d684 KB |
245 | \membersection{wxFrame::GetMenuBar}\label{wxframegetmenubar} |
246 | ||
247 | \constfunc{wxMenuBar*}{GetMenuBar}{\void} | |
248 | ||
249 | Returns a pointer to the menubar currently associated with the frame (if any). | |
250 | ||
251 | \wxheading{See also} | |
252 | ||
253 | \helpref{wxFrame::SetMenuBar}{wxframesetmenubar}, \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu} | |
254 | ||
255 | \membersection{wxFrame::GetStatusBar}\label{wxframegetstatusbar} | |
256 | ||
fa482912 | 257 | \constfunc{wxStatusBar*}{GetStatusBar}{\void} |
a660d684 KB |
258 | |
259 | Returns a pointer to the status bar currently associated with the frame (if any). | |
260 | ||
261 | \wxheading{See also} | |
262 | ||
263 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar} | |
264 | ||
265 | \membersection{wxFrame::GetTitle}\label{wxframegettitle} | |
266 | ||
fa482912 | 267 | \constfunc{wxString}{GetTitle}{\void} |
a660d684 | 268 | |
fa482912 | 269 | Gets a string containing the frame title. See \helpref{wxFrame::SetTitle}{wxframesettitle}. |
a660d684 | 270 | |
81d66cf3 JS |
271 | \membersection{wxFrame::GetToolBar}\label{wxframegettoolbar} |
272 | ||
fa482912 | 273 | \constfunc{wxToolBar*}{GetToolBar}{\void} |
81d66cf3 JS |
274 | |
275 | Returns a pointer to the toolbar currently associated with the frame (if any). | |
276 | ||
277 | \wxheading{See also} | |
278 | ||
279 | \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar},\rtfsp | |
280 | \helpref{wxFrame::SetToolBar}{wxframesettoolbar} | |
281 | ||
a660d684 KB |
282 | \membersection{wxFrame::Iconize}\label{wxframeiconize} |
283 | ||
fa482912 | 284 | \func{void}{Iconize}{\param{bool}{ iconize}} |
a660d684 | 285 | |
3dd9b88a | 286 | Iconizes or restores the frame. |
a660d684 KB |
287 | |
288 | \wxheading{Parameters} | |
289 | ||
2edb0bde | 290 | \docparam{iconize}{If TRUE, iconizes the frame; if FALSE, shows and restores it.} |
a660d684 KB |
291 | |
292 | \wxheading{See also} | |
293 | ||
294 | \helpref{wxFrame::IsIconized}{wxframeisiconized}, \helpref{wxFrame::Maximize}{wxframemaximize}. | |
295 | ||
0133d06b VS |
296 | \membersection{wxFrame::IsFullScreen}\label{wxframeisfullscreen} |
297 | ||
298 | \func{bool}{IsFullScreen}{\void} | |
299 | ||
300 | Returns TRUE if the frame is in fullscreen mode. | |
301 | ||
302 | \wxheading{See also} | |
303 | ||
304 | \helpref{wxFrame::ShowFullScreen}{wxframeshowfullscreen} | |
305 | ||
a660d684 KB |
306 | \membersection{wxFrame::IsIconized}\label{wxframeisiconized} |
307 | ||
94b49b93 | 308 | \constfunc{bool}{IsIconized}{\void} |
a660d684 | 309 | |
3dd9b88a | 310 | Returns TRUE if the frame is iconized. |
a660d684 | 311 | |
94b49b93 JS |
312 | \membersection{wxFrame::IsMaximized}\label{wxframeismaximized} |
313 | ||
314 | \constfunc{bool}{IsMaximized}{\void} | |
315 | ||
316 | Returns TRUE if the frame is maximized. | |
317 | ||
a660d684 KB |
318 | \membersection{wxFrame::Maximize}\label{wxframemaximize} |
319 | ||
fa482912 | 320 | \func{void}{Maximize}{\param{bool }{maximize}} |
a660d684 KB |
321 | |
322 | Maximizes or restores the frame. | |
323 | ||
324 | \wxheading{Parameters} | |
325 | ||
fa482912 | 326 | \docparam{maximize}{If TRUE, maximizes the frame, otherwise it restores it.} |
a660d684 KB |
327 | |
328 | \wxheading{Remarks} | |
329 | ||
330 | This function only works under Windows. | |
331 | ||
332 | \wxheading{See also} | |
333 | ||
334 | \helpref{wxFrame::Iconize}{wxframeiconize} | |
335 | ||
336 | \membersection{wxFrame::OnActivate} | |
337 | ||
8cbd2bde | 338 | \func{void}{OnActivate}{\param{wxActivateEvent\&}{ event}} |
a660d684 KB |
339 | |
340 | Called when a window is activated or deactivated (MS Windows | |
8cbd2bde | 341 | only). See also \helpref{wxActivateEvent}{wxactivateevent}. |
a660d684 KB |
342 | |
343 | \membersection{wxFrame::OnCreateStatusBar}\label{wxframeoncreatestatusbar} | |
344 | ||
dbdb39b2 | 345 | \func{virtual wxStatusBar*}{OnCreateStatusBar}{\param{int }{number}, |
81d66cf3 JS |
346 | \param{long}{ style}, |
347 | \param{wxWindowID}{ id}, \param{const wxString\&}{ name}} | |
a660d684 KB |
348 | |
349 | Virtual function called when a status bar is requested by \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}. | |
350 | ||
351 | \wxheading{Parameters} | |
352 | ||
353 | \docparam{number}{The number of fields to create.} | |
354 | ||
81d66cf3 JS |
355 | \docparam{style}{The window style. See \helpref{wxStatusBar}{wxstatusbar} for a list |
356 | of valid styles.} | |
357 | ||
358 | \docparam{id}{The window identifier. If -1, an identifier will be chosen by | |
359 | wxWindows.} | |
360 | ||
361 | \docparam{name}{The window name.} | |
362 | ||
a660d684 KB |
363 | \wxheading{Return value} |
364 | ||
365 | A status bar object. | |
366 | ||
367 | \wxheading{Remarks} | |
368 | ||
369 | An application can override this function to return a different kind of status bar. The default | |
370 | implementation returns an instance of \helpref{wxStatusBar}{wxstatusbar}. | |
371 | ||
372 | \wxheading{See also} | |
373 | ||
374 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar}. | |
375 | ||
81d66cf3 JS |
376 | \membersection{wxFrame::OnCreateToolBar}\label{wxframeoncreatetoolbar} |
377 | ||
378 | \func{virtual wxToolBar*}{OnCreateToolBar}{\param{long}{ style}, | |
379 | \param{wxWindowID}{ id}, \param{const wxString\&}{ name}} | |
380 | ||
381 | Virtual function called when a toolbar is requested by \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}. | |
382 | ||
383 | \wxheading{Parameters} | |
384 | ||
385 | \docparam{style}{The toolbar style. See \helpref{wxToolBar}{wxtoolbar} for a list | |
386 | of valid styles.} | |
387 | ||
388 | \docparam{id}{The toolbar window identifier. If -1, an identifier will be chosen by | |
389 | wxWindows.} | |
390 | ||
391 | \docparam{name}{The toolbar window name.} | |
392 | ||
393 | \wxheading{Return value} | |
394 | ||
395 | A toolbar object. | |
396 | ||
397 | \wxheading{Remarks} | |
398 | ||
399 | An application can override this function to return a different kind of toolbar. The default | |
400 | implementation returns an instance of \helpref{wxToolBar}{wxtoolbar}. | |
401 | ||
402 | \wxheading{See also} | |
403 | ||
404 | \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar}. | |
405 | ||
a660d684 KB |
406 | \membersection{wxFrame::OnMenuHighlight}\label{wxframeonmenuhighlight} |
407 | ||
408 | \func{void}{OnMenuHighlight}{\param{wxMenuEvent\&}{ event}} | |
409 | ||
f4fcc291 JS |
410 | The default implementation displays an appropriate help string |
411 | in the status bar, if there is one. | |
412 | ||
413 | See \helpref{wxMenuEvent}{wxmenuevent}. | |
a660d684 KB |
414 | |
415 | \membersection{wxFrame::OnSize}\label{wxframeonsize} | |
416 | ||
417 | \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} | |
418 | ||
a660d684 KB |
419 | The default {\bf wxFrame::OnSize} implementation looks for a single subwindow, |
420 | and if one is found, resizes it to fit | |
421 | inside the frame. Override this member if more complex behaviour | |
422 | is required (for example, if there are several subwindows). | |
423 | ||
f4fcc291 JS |
424 | See \helpref{wxSizeEvent}{wxsizeevent}. |
425 | ||
a4f25aef VZ |
426 | \membersection{wxFrame::SendSizeEvent}\label{wxframesendsizeevent} |
427 | ||
428 | \func{void}{SendSizeEvent}{\void} | |
429 | ||
430 | This function sends a dummy \helpref{size event}{wxsizeevent} to the frame | |
431 | forcing it to reevaluate its children positions. It is sometimes useful to call | |
432 | this function after adding or deleting a children after the frame creation or | |
433 | if a child size changes. | |
434 | ||
435 | Note that if the frame is using either sizers or constraints for the children | |
436 | layout, it is enough to call \helpref{Layout()}{wxwindowlayout} directly and | |
437 | this function should not be used in this case. | |
438 | ||
a660d684 KB |
439 | \membersection{wxFrame::SetIcon}\label{wxframeseticon} |
440 | ||
441 | \func{void}{SetIcon}{\param{const wxIcon\& }{icon}} | |
442 | ||
443 | Sets the icon for this frame. | |
444 | ||
445 | \wxheading{Parameters} | |
446 | ||
447 | \docparam{icon}{The icon to associate with this frame.} | |
448 | ||
449 | \wxheading{Remarks} | |
450 | ||
451 | The frame takes a `copy' of {\it icon}, but since it uses reference | |
452 | counting, the copy is very quick. It is safe to delete {\it icon} after | |
453 | calling this function. | |
454 | ||
9a6a5530 MB |
455 | See also \helpref{wxIcon}{wxicon}. |
456 | ||
457 | \membersection{wxFrame::SetIcons}\label{wxframeseticons} | |
458 | ||
459 | \func{void}{SetIcons}{\param{const wxIconBundle\& }{icons}} | |
460 | ||
461 | Sets the icons for this frame. | |
462 | ||
463 | \wxheading{Parameters} | |
464 | ||
465 | \docparam{icons}{The icons to associate with this frame.} | |
466 | ||
467 | See also \helpref{wxIconBundle}{wxiconbundle}. | |
468 | ||
d9b815ac VZ |
469 | % VZ: we don't have all this any more (18.08.00) |
470 | % | |
471 | %Under Windows, instead of using {\bf SetIcon}, you can add the | |
472 | %following lines to your MS Windows resource file: | |
473 | % | |
474 | %\begin{verbatim} | |
475 | %wxSTD_MDIPARENTFRAME ICON icon1.ico | |
476 | %wxSTD_MDICHILDFRAME ICON icon2.ico | |
477 | %wxSTD_FRAME ICON icon3.ico | |
478 | %\end{verbatim} | |
479 | % | |
480 | %where icon1.ico will be used for the MDI parent frame, icon2.ico | |
481 | %will be used for MDI child frames, and icon3.ico will be used for | |
482 | %non-MDI frames. | |
483 | % | |
484 | %If these icons are not supplied, and {\bf SetIcon} is not called either, | |
485 | %then the following defaults apply if you have included wx.rc. | |
486 | % | |
487 | %\begin{verbatim} | |
488 | %wxDEFAULT_FRAME ICON std.ico | |
489 | %wxDEFAULT_MDIPARENTFRAME ICON mdi.ico | |
490 | %wxDEFAULT_MDICHILDFRAME ICON child.ico | |
491 | %\end{verbatim} | |
492 | % | |
493 | %You can replace std.ico, mdi.ico and child.ico with your own defaults | |
494 | %for all your wxWindows application. Currently they show the same icon. | |
a660d684 | 495 | |
a660d684 KB |
496 | \membersection{wxFrame::SetMenuBar}\label{wxframesetmenubar} |
497 | ||
498 | \func{void}{SetMenuBar}{\param{wxMenuBar* }{menuBar}} | |
499 | ||
500 | Tells the frame to show the given menu bar. | |
501 | ||
502 | \wxheading{Parameters} | |
503 | ||
504 | \docparam{menuBar}{The menu bar to associate with the frame.} | |
505 | ||
506 | \wxheading{Remarks} | |
507 | ||
508 | If the frame is destroyed, the | |
509 | menu bar and its menus will be destroyed also, so do not delete the menu | |
510 | bar explicitly (except by resetting the frame's menu bar to another | |
511 | frame or NULL). | |
512 | ||
513 | Under Windows, a call to \helpref{wxFrame::OnSize}{wxframeonsize} is generated, so be sure to initialize | |
514 | data members properly before calling {\bf SetMenuBar}. | |
515 | ||
516 | Note that it is not possible to call this function twice for the same frame object. | |
517 | ||
518 | \wxheading{See also} | |
519 | ||
520 | \helpref{wxFrame::GetMenuBar}{wxframegetmenubar}, \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu}. | |
521 | ||
81d66cf3 JS |
522 | \membersection{wxFrame::SetStatusBar}\label{wxframesetstatusbar} |
523 | ||
524 | \func{void}{SetStatusBar}{\param{wxStatusBar*}{ statusBar}} | |
525 | ||
526 | Associates a status bar with the frame. | |
527 | ||
528 | \wxheading{See also} | |
529 | ||
530 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar},\rtfsp | |
531 | \helpref{wxFrame::GetStatusBar}{wxframegetstatusbar} | |
532 | ||
a660d684 KB |
533 | \membersection{wxFrame::SetStatusText}\label{wxframesetstatustext} |
534 | ||
eaaa6a06 | 535 | \func{virtual void}{SetStatusText}{\param{const wxString\& }{ text}, \param{int}{ number = 0}} |
a660d684 KB |
536 | |
537 | Sets the status bar text and redraws the status bar. | |
538 | ||
539 | \wxheading{Parameters} | |
540 | ||
541 | \docparam{text}{The text for the status field.} | |
542 | ||
543 | \docparam{number}{The status field (starting from zero).} | |
544 | ||
545 | \wxheading{Remarks} | |
546 | ||
547 | Use an empty string to clear the status bar. | |
548 | ||
549 | \wxheading{See also} | |
550 | ||
551 | \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar} | |
552 | ||
553 | \membersection{wxFrame::SetStatusWidths}\label{wxframesetstatuswidths} | |
554 | ||
eaaa6a06 | 555 | \func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}} |
a660d684 KB |
556 | |
557 | Sets the widths of the fields in the status bar. | |
558 | ||
559 | \wxheading{Parameters} | |
560 | ||
561 | \wxheading{n}{The number of fields in the status bar. It must be the | |
562 | same used in \helpref{CreateStatusBar}{wxframecreatestatusbar}.} | |
563 | ||
564 | \docparam{widths}{Must contain an array of {\it n} integers, each of which is a status field width | |
565 | in pixels. A value of -1 indicates that the field is variable width; at least one | |
566 | field must be -1. You should delete this array after calling {\bf SetStatusWidths}.} | |
567 | ||
568 | \wxheading{Remarks} | |
569 | ||
570 | The widths of the variable fields are calculated from the total width of all fields, | |
564747ee | 571 | minus the sum of widths of the non-variable fields, divided by the number of |
a660d684 KB |
572 | variable fields. |
573 | ||
564747ee RD |
574 | \pythonnote{Only a single parameter is required, a Python list of |
575 | integers.} | |
576 | ||
f3539882 | 577 | \perlnote{In wxPerl this method takes the field widths as parameters.} |
5873607e | 578 | |
81d66cf3 JS |
579 | \membersection{wxFrame::SetToolBar}\label{wxframesettoolbar} |
580 | ||
581 | \func{void}{SetToolBar}{\param{wxToolBar*}{ toolBar}} | |
582 | ||
583 | Associates a toolbar with the frame. | |
584 | ||
585 | \wxheading{See also} | |
586 | ||
587 | \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar},\rtfsp | |
588 | \helpref{wxFrame::GetToolBar}{wxframegettoolbar} | |
589 | ||
a660d684 KB |
590 | \membersection{wxFrame::SetTitle}\label{wxframesettitle} |
591 | ||
592 | \func{virtual void}{SetTitle}{\param{const wxString\& }{ title}} | |
593 | ||
594 | Sets the frame title. | |
595 | ||
596 | \wxheading{Parameters} | |
597 | ||
598 | \docparam{title}{The frame title.} | |
599 | ||
600 | \wxheading{See also} | |
601 | ||
602 | \helpref{wxFrame::GetTitle}{wxframegettitle} | |
603 | ||
bf4d9b2b JS |
604 | \membersection{wxFrame::ShowFullScreen}\label{wxframeshowfullscreen} |
605 | ||
606 | \func{bool}{ShowFullScreen}{\param{bool}{ show}, \param{long}{ style = wxFULLSCREEN\_ALL}} | |
607 | ||
608 | Passing TRUE to {\it shows} shows the frame full-screen, and passing FALSE restores the frame | |
609 | again. {\it style} is a bit list containing some or all of the following values, which | |
610 | indicate what elements of the frame to hide in full-screen mode: | |
611 | ||
612 | \begin{itemize}\itemsep=0pt | |
613 | \item wxFULLSCREEN\_NOMENUBAR | |
614 | \item wxFULLSCREEN\_NOTOOLBAR | |
615 | \item wxFULLSCREEN\_NOSTATUSBAR | |
616 | \item wxFULLSCREEN\_NOBORDER | |
617 | \item wxFULLSCREEN\_NOCAPTION | |
618 | \item wxFULLSCREEN\_ALL (all of the above) | |
619 | \end{itemize} | |
620 | ||
0133d06b VS |
621 | This function has not been tested with MDI frames. |
622 | ||
623 | \wxheading{See also} | |
bf4d9b2b | 624 | |
0133d06b | 625 | \helpref{wxFrame::IsFullScreen}{wxframeisfullscreen} |
4d2c67a9 | 626 | |
d1f1e77a MB |
627 | \membersection{wxFrame::SetStatusBarPane}\label{wxframesetstatusbarpane} |
628 | ||
629 | \func{void}{SetStatusBarPane}{\param{int}{ n}} | |
630 | ||
631 | Set the status bar pane used to display menu and toolbar help. | |
632 | Using -1 disables help display. | |
633 | ||
634 | \membersection{wxFrame::GetStatusBarPane}\label{wxframegetstatusbarpane} | |
635 | ||
636 | \func{int}{GetStatusBarPane}{\void} | |
637 | ||
638 | Returns the status bar pane used to display menu and toolbar help. | |
639 | ||
640 | \wxheading{See also} | |
641 | ||
642 | \helpref{wxFrame::SetStatusBarPane}{wxframesetstatusbarpane} | |
643 | ||
644 | \membersection{wxFrame::SetStatusBarPane}\label{wxframesetstatusbarpane} | |
645 | ||
646 | \func{void}{SetStatusBarPane}{\param{int}{ n}} | |
647 | ||
648 | Set the status bar pane used to display menu and toolbar help. | |
649 | Using -1 disables help display. | |
650 | ||
651 | \membersection{wxFrame::GetStatusBarPane}\label{wxframegetstatusbarpane} | |
652 | ||
653 | \func{int}{GetStatusBarPane}{\void} | |
654 | ||
655 | Returns the status bar pane used to display menu and toolbar help. | |
656 | ||
657 | \wxheading{See also} | |
658 | ||
659 | \helpref{wxFrame::SetStatusBarPane}{wxframesetstatusbarpane} | |
660 | ||
661 | ||
662 |