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