1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629
|
<HTML>
<head><title>wxFrame</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxframe"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx103.htm#wxfontlist"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx105.htm#wxftp"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxFrame</H2>
<P>
A frame is a window whose size and position can (usually) be changed by the user. It usually has
thick borders and a title bar, and can optionally contain a menu bar, toolbar and
status bar. A frame can contain any window that is not a frame or dialog.<P>
A frame that has a status bar and toolbar created via the CreateStatusBar/CreateToolBar functions
manages these windows, and adjusts the value returned by GetClientSize to reflect
the remaining size available to application windows.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>
<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/frame.h><P>
<B><FONT COLOR="#FF0000">Window styles</FONT></B><P>
<TABLE>
<TR><TD VALIGN=TOP>
<B>wxICONIZE</B>
</TD>
<TD VALIGN=TOP>
Display the frame iconized (minimized) (Windows only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxCAPTION</B>
</TD>
<TD VALIGN=TOP>
Puts a caption on the frame.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxDEFAULT_FRAME_STYLE</B>
</TD>
<TD VALIGN=TOP>
Defined as <B>wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION</B>.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMINIMIZE</B>
</TD>
<TD VALIGN=TOP>
Identical to <B>wxICONIZE</B>.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMINIMIZE_BOX</B>
</TD>
<TD VALIGN=TOP>
Displays a minimize box on the frame (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMAXIMIZE</B>
</TD>
<TD VALIGN=TOP>
Displays the frame maximized (Windows only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMAXIMIZE_BOX</B>
</TD>
<TD VALIGN=TOP>
Displays a maximize box on the frame (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxSTAY_ON_TOP</B>
</TD>
<TD VALIGN=TOP>
Stay on top of other windows (Windows only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxSYSTEM_MENU</B>
</TD>
<TD VALIGN=TOP>
Displays a system menu (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxTHICK_FRAME</B>
</TD>
<TD VALIGN=TOP>
Displays a thick frame around the window (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxRESIZE_BORDER</B>
</TD>
<TD VALIGN=TOP>
Displays a resizeable border around the window (Motif only).
</TD></TR>
</TABLE>
<P>
See also <A HREF="wx305.htm#windowstyles">window styles overview</A>. Currently the GTK port of wxWindows
ignores all the window styles listed above as there is no standard way (yet) to inform the
window manager about such options. Therefore, the only relevant window style flag which
the GTK port recognizes is <B>wxSIMPLE_BORDER</B> which brings up a frame without
any window decorations. This can be used for a splash screen or specialized tooltip etc.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
An application should normally define an <A HREF="wx260.htm#wxwindowonclosewindow">OnCloseWindow</A> handler for the
frame to respond to system close events, for example so that related data and subwindows can be cleaned up.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframe">wxMDIParentFrame</A>, <A HREF="wx134.htm#wxmdichildframe">wxMDIChildFrame</A>,
<A HREF="wx148.htm#wxminiframe">wxMiniFrame</A>, <A HREF="wx71.htm#wxdialog">wxDialog</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxframeconstr">wxFrame::wxFrame</A><BR>
<A HREF="#topic411">wxFrame::~wxFrame</A><BR>
<A HREF="#wxframecentre">wxFrame::Centre</A><BR>
<A HREF="#wxframecommand">wxFrame::Command</A><BR>
<A HREF="#wxframecreate">wxFrame::Create</A><BR>
<A HREF="#wxframecreatestatusbar">wxFrame::CreateStatusBar</A><BR>
<A HREF="#wxframecreatetoolbar">wxFrame::CreateToolBar</A><BR>
<A HREF="#wxframegetmenubar">wxFrame::GetMenuBar</A><BR>
<A HREF="#wxframegetstatusbar">wxFrame::GetStatusBar</A><BR>
<A HREF="#wxframegettitle">wxFrame::GetTitle</A><BR>
<A HREF="#wxframegettoolbar">wxFrame::GetToolBar</A><BR>
<A HREF="#wxframeiconize">wxFrame::Iconize</A><BR>
<A HREF="#wxframeisiconized">wxFrame::IsIconized</A><BR>
<A HREF="#wxframeismaximized">wxFrame::IsMaximized</A><BR>
<A HREF="#wxframemaximize">wxFrame::Maximize</A><BR>
<A HREF="#topic412">wxFrame::OnActivate</A><BR>
<A HREF="#wxframeoncreatestatusbar">wxFrame::OnCreateStatusBar</A><BR>
<A HREF="#wxframeoncreatetoolbar">wxFrame::OnCreateToolBar</A><BR>
<A HREF="#wxframeonmenucommand">wxFrame::OnMenuCommand</A><BR>
<A HREF="#wxframeonmenuhighlight">wxFrame::OnMenuHighlight</A><BR>
<A HREF="#wxframeonsize">wxFrame::OnSize</A><BR>
<A HREF="#wxframeseticon">wxFrame::SetIcon</A><BR>
<A HREF="#wxframesetmenubar">wxFrame::SetMenuBar</A><BR>
<A HREF="#wxframesetstatusbar">wxFrame::SetStatusBar</A><BR>
<A HREF="#wxframesetstatustext">wxFrame::SetStatusText</A><BR>
<A HREF="#wxframesetstatuswidths">wxFrame::SetStatusWidths</A><BR>
<A HREF="#wxframesettoolbar">wxFrame::SetToolBar</A><BR>
<A HREF="#wxframesettitle">wxFrame::SetTitle</A><BR>
<P>
<HR>
<A NAME="wxframeconstr"></A>
<H3>wxFrame::wxFrame</H3>
<P>
<B></B> <B>wxFrame</B>()<P>
Default constructor.<P>
<B></B> <B>wxFrame</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxString& </B><I>title</I>, <B>const wxPoint&</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&</B><I> size = wxDefaultSize</I>, <B>long</B><I> style = wxDEFAULT_FRAME_STYLE</I>,
<B>const wxString& </B><I>name = "frame"</I>)<P>
Constructor, creating the window.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>parent</I><UL><UL>
The window parent. This may be NULL. If it is non-NULL, the frame will
always be displayed on top of the parent window on Windows.</UL></UL>
<P>
<I>id</I><UL><UL>
The window identifier. It may take a value of -1 to indicate a default value.</UL></UL>
<P>
<I>title</I><UL><UL>
The caption to be displayed on the frame's title bar.</UL></UL>
<P>
<I>pos</I><UL><UL>
The window position. A value of (-1, -1) indicates a default position, chosen by
either the windowing system or wxWindows, depending on platform.</UL></UL>
<P>
<I>size</I><UL><UL>
The window size. A value of (-1, -1) indicates a default size, chosen by
either the windowing system or wxWindows, depending on platform.</UL></UL>
<P>
<I>style</I><UL><UL>
The window style. See <A HREF="wx104.htm#wxframe">wxFrame</A>.</UL></UL>
<P>
<I>name</I><UL><UL>
The name of the window. This parameter is used to associate a name with the item,
allowing the application user to set Motif resource values for
individual windows.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
For Motif, MWM (the Motif Window Manager) should be running for any window styles to work
(otherwise all styles take effect).<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreate">wxFrame::Create</A><P>
<HR>
<A NAME="topic411"></A>
<H3>wxFrame::~wxFrame</H3>
<P>
<B>void</B> <B>~wxFrame</B>()<P>
Destructor. Destroys all child windows and menu bar if present.<P>
<HR>
<A NAME="wxframecentre"></A>
<H3>wxFrame::Centre</H3>
<P>
<B>void</B> <B>Centre</B>(<B>int</B><I> direction = wxBOTH</I>)<P>
Centres the frame on the display.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>direction</I><UL><UL>
The parameter may be <TT>wxHORIZONTAL</TT>, <TT>wxVERTICAL</TT> or <TT>wxBOTH</TT>.</UL></UL>
<P>
<HR>
<A NAME="wxframecommand"></A>
<H3>wxFrame::Command</H3>
<P>
<B>void</B> <B>Command</B>(<B>int </B><I>id</I>)<P>
Simulate a menu command.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>id</I><UL><UL>
The identifier for a menu item.</UL></UL>
<P>
<HR>
<A NAME="wxframecreate"></A>
<H3>wxFrame::Create</H3>
<P>
<B>bool</B> <B>Create</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxString& </B><I>title</I>, <B>const wxPoint&</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&</B><I> size = wxDefaultSize</I>, <B>long</B><I> style = wxDEFAULT_FRAME_STYLE</I>,
<B>const wxString& </B><I>name = "frame"</I>)<P>
Used in two-step frame construction. See <A HREF="wx104.htm#wxframeconstr">wxFrame::wxFrame</A>
for further details.<P>
<HR>
<A NAME="wxframecreatestatusbar"></A>
<H3>wxFrame::CreateStatusBar</H3>
<P>
<B>virtual wxStatusBar*</B> <B>CreateStatusBar</B>(<B>int</B><I> number = 1</I>,
<B>long</B><I> style = 0</I>,
<B>wxWindowID</B><I> id = -1</I>, <B>const wxString&</B><I> name = "statusBar"</I>)<P>
Creates a status bar at the bottom of the frame.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>number</I><UL><UL>
The number of fields to create. Specify a
value greater than 1 to create a multi-field status bar.</UL></UL>
<P>
<I>style</I><UL><UL>
The status bar style. See <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A> for a list
of valid styles.</UL></UL>
<P>
<I>id</I><UL><UL>
The status bar window identifier. If -1, an identifier will be chosen by
wxWindows.</UL></UL>
<P>
<I>name</I><UL><UL>
The status bar window name.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
A pointer to the the status bar if it was created successfully, NULL otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
The width of the status bar is the whole width of the frame (adjusted automatically when
resizing), and the height and text size are chosen by the host windowing system.<P>
By default, the status bar is an instance of wxStatusBar. To use a different class,
override <A HREF="wx104.htm#wxframeoncreatestatusbar">wxFrame::OnCreateStatusBar</A>.<P>
Note that you can put controls and other windows on the status bar if you wish.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframesetstatustext">wxFrame::SetStatusText</A>,
<A HREF="wx104.htm#wxframeoncreatestatusbar">wxFrame::OnCreateStatusBar</A>,
<A HREF="wx104.htm#wxframegetstatusbar">wxFrame::GetStatusBar</A><P>
<HR>
<A NAME="wxframecreatetoolbar"></A>
<H3>wxFrame::CreateToolBar</H3>
<P>
<B>virtual wxToolBar*</B> <B>CreateToolBar</B>(<B>long</B><I> style = wxNO_BORDER | wxTB_HORIZONTAL</I>,
<B>wxWindowID</B><I> id = -1</I>, <B>const wxString&</B><I> name = "toolBar"</I>)<P>
Creates a toolbar at the top or left of the frame.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>style</I><UL><UL>
The toolbar style. See <A HREF="wx249.htm#wxtoolbar">wxToolBar</A> for a list
of valid styles.</UL></UL>
<P>
<I>id</I><UL><UL>
The toolbar window identifier. If -1, an identifier will be chosen by
wxWindows.</UL></UL>
<P>
<I>name</I><UL><UL>
The toolbar window name.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
A pointer to the the toolbar if it was created successfully, NULL otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
By default, the toolbar is an instance of wxToolBar (which is defined to be
a suitable toolbar class on each platform, such as wxToolBar95). To use a different class,
override <A HREF="wx104.htm#wxframeoncreatetoolbar">wxFrame::OnCreateToolBar</A>.<P>
When a toolbar has been created with this function, or made known to the frame
with <A HREF="wx104.htm#wxframesettoolbar">wxFrame::SetToolBar</A>, the frame will manage the toolbar
position and adjust the return value from <A HREF="wx260.htm#wxwindowgetclientsize">wxWindow::GetClientSize</A> to
reflect the available space for application windows.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatestatusbar">wxFrame::CreateStatusBar</A>,
<A HREF="wx104.htm#wxframeoncreatetoolbar">wxFrame::OnCreateToolBar</A>,
<A HREF="wx104.htm#wxframesettoolbar">wxFrame::SetToolBar</A>,
<A HREF="wx104.htm#wxframegettoolbar">wxFrame::GetToolBar</A><P>
<HR>
<A NAME="wxframegetmenubar"></A>
<H3>wxFrame::GetMenuBar</H3>
<P>
<B>wxMenuBar*</B> <B>GetMenuBar</B>() <B>const</B><P>
Returns a pointer to the menubar currently associated with the frame (if any).<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframesetmenubar">wxFrame::SetMenuBar</A>, <A HREF="wx141.htm#wxmenubar">wxMenuBar</A>, <A HREF="wx140.htm#wxmenu">wxMenu</A><P>
<HR>
<A NAME="wxframegetstatusbar"></A>
<H3>wxFrame::GetStatusBar</H3>
<P>
<B>wxStatusBar*</B> <B>GetStatusBar</B>()<P>
Returns a pointer to the status bar currently associated with the frame (if any).<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatestatusbar">wxFrame::CreateStatusBar</A>, <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A><P>
<HR>
<A NAME="wxframegettitle"></A>
<H3>wxFrame::GetTitle</H3>
<P>
<B>wxString&</B> <B>GetTitle</B>()<P>
Gets a temporary pointer to the frame title. See
<A HREF="wx104.htm#wxframesettitle">wxFrame::SetTitle</A>.<P>
<HR>
<A NAME="wxframegettoolbar"></A>
<H3>wxFrame::GetToolBar</H3>
<P>
<B>wxToolBar*</B> <B>GetToolBar</B>()<P>
Returns a pointer to the toolbar currently associated with the frame (if any).<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatetoolbar">wxFrame::CreateToolBar</A>, <A HREF="wx249.htm#wxtoolbar">wxToolBar</A>,
<A HREF="wx104.htm#wxframesettoolbar">wxFrame::SetToolBar</A><P>
<HR>
<A NAME="wxframeiconize"></A>
<H3>wxFrame::Iconize</H3>
<P>
<B>void</B> <B>Iconize</B>(<B>const bool</B><I> iconize</I>)<P>
Iconizes or restores the frame.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>izonize</I><UL><UL>
If TRUE, iconizes the frame; if FALSE, shows and restores it.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframeisiconized">wxFrame::IsIconized</A>, <A HREF="wx104.htm#wxframemaximize">wxFrame::Maximize</A>.<P>
<HR>
<A NAME="wxframeisiconized"></A>
<H3>wxFrame::IsIconized</H3>
<P>
<B>bool</B> <B>IsIconized</B>() <B>const</B><P>
Returns TRUE if the frame is iconized.<P>
<HR>
<A NAME="wxframeismaximized"></A>
<H3>wxFrame::IsMaximized</H3>
<P>
<B>bool</B> <B>IsMaximized</B>() <B>const</B><P>
Returns TRUE if the frame is maximized.<P>
<HR>
<A NAME="wxframemaximize"></A>
<H3>wxFrame::Maximize</H3>
<P>
<B>void</B> <B>Maximize</B>(<B>const bool </B><I>maximize</I>)<P>
Maximizes or restores the frame.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>maximize</I><UL><UL>
If TRUE, maximizes the frame, otherwise it restores it</UL></UL>
.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
This function only works under Windows.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframeiconize">wxFrame::Iconize</A><P>
<HR>
<A NAME="topic412"></A>
<H3>wxFrame::OnActivate</H3>
<P>
<B>void</B> <B>OnActivate</B>(<B>wxActivateEvent&</B><I> event</I>)<P>
Called when a window is activated or deactivated (MS Windows
only). See also <A HREF="wx25.htm#wxactivateevent">wxActivateEvent</A>.<P>
<HR>
<A NAME="wxframeoncreatestatusbar"></A>
<H3>wxFrame::OnCreateStatusBar</H3>
<P>
<B>virtual wxStatusBar*</B> <B>OnCreateStatusBar</B>(<B>int </B><I>number</I>,
<B>long</B><I> style</I>,
<B>wxWindowID</B><I> id</I>, <B>const wxString&</B><I> name</I>)<P>
Virtual function called when a status bar is requested by <A HREF="wx104.htm#wxframecreatestatusbar">wxFrame::CreateStatusBar</A>.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>number</I><UL><UL>
The number of fields to create.</UL></UL>
<P>
<I>style</I><UL><UL>
The window style. See <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A> for a list
of valid styles.</UL></UL>
<P>
<I>id</I><UL><UL>
The window identifier. If -1, an identifier will be chosen by
wxWindows.</UL></UL>
<P>
<I>name</I><UL><UL>
The window name.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
A status bar object.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
An application can override this function to return a different kind of status bar. The default
implementation returns an instance of <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A>.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatestatusbar">wxFrame::CreateStatusBar</A>, <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A>.<P>
<HR>
<A NAME="wxframeoncreatetoolbar"></A>
<H3>wxFrame::OnCreateToolBar</H3>
<P>
<B>virtual wxToolBar*</B> <B>OnCreateToolBar</B>(<B>long</B><I> style</I>,
<B>wxWindowID</B><I> id</I>, <B>const wxString&</B><I> name</I>)<P>
Virtual function called when a toolbar is requested by <A HREF="wx104.htm#wxframecreatetoolbar">wxFrame::CreateToolBar</A>.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>style</I><UL><UL>
The toolbar style. See <A HREF="wx249.htm#wxtoolbar">wxToolBar</A> for a list
of valid styles.</UL></UL>
<P>
<I>id</I><UL><UL>
The toolbar window identifier. If -1, an identifier will be chosen by
wxWindows.</UL></UL>
<P>
<I>name</I><UL><UL>
The toolbar window name.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
A toolbar object.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
An application can override this function to return a different kind of toolbar. The default
implementation returns an instance of <A HREF="wx249.htm#wxtoolbar">wxToolBar</A>.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatetoolbar">wxFrame::CreateToolBar</A>, <A HREF="wx249.htm#wxtoolbar">wxToolBar</A>.<P>
<HR>
<A NAME="wxframeonmenucommand"></A>
<H3>wxFrame::OnMenuCommand</H3>
<P>
<B>void</B> <B>OnMenuCommand</B>(<B>wxCommandEvent&</B><I> event</I>)<P>
See <A HREF="wx260.htm#wxwindowonmenucommand">wxWindow::OnMenuCommand</A>.<P>
<HR>
<A NAME="wxframeonmenuhighlight"></A>
<H3>wxFrame::OnMenuHighlight</H3>
<P>
<B>void</B> <B>OnMenuHighlight</B>(<B>wxMenuEvent&</B><I> event</I>)<P>
See <A HREF="wx260.htm#wxwindowonmenuhighlight">wxWindow::OnMenuHighlight</A>.<P>
<HR>
<A NAME="wxframeonsize"></A>
<H3>wxFrame::OnSize</H3>
<P>
<B>void</B> <B>OnSize</B>(<B>wxSizeEvent& </B><I>event</I>)<P>
See <A HREF="wx260.htm#wxwindowonsize">wxWindow::OnSize</A>.<P>
The default <B>wxFrame::OnSize</B> implementation looks for a single subwindow,
and if one is found, resizes it to fit
inside the frame. Override this member if more complex behaviour
is required (for example, if there are several subwindows).<P>
<HR>
<A NAME="wxframeseticon"></A>
<H3>wxFrame::SetIcon</H3>
<P>
<B>void</B> <B>SetIcon</B>(<B>const wxIcon& </B><I>icon</I>)<P>
Sets the icon for this frame.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>icon</I><UL><UL>
The icon to associate with this frame.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
The frame takes a 'copy' of <I>icon</I>, but since it uses reference
counting, the copy is very quick. It is safe to delete <I>icon</I> after
calling this function.<P>
Under Windows, instead of using <B>SetIcon</B>, you can add the
following lines to your MS Windows resource file:<P>
<PRE>
wxSTD_MDIPARENTFRAME ICON icon1.ico
wxSTD_MDICHILDFRAME ICON icon2.ico
wxSTD_FRAME ICON icon3.ico
</PRE>
where icon1.ico will be used for the MDI parent frame, icon2.ico
will be used for MDI child frames, and icon3.ico will be used for
non-MDI frames.<P>
If these icons are not supplied, and <B>SetIcon</B> is not called either,
then the following defaults apply if you have included wx.rc.<P>
<PRE>
wxDEFAULT_FRAME ICON std.ico
wxDEFAULT_MDIPARENTFRAME ICON mdi.ico
wxDEFAULT_MDICHILDFRAME ICON child.ico
</PRE>
You can replace std.ico, mdi.ico and child.ico with your own defaults
for all your wxWindows application. Currently they show the same icon.<P>
<I>Note:</I> a wxWindows application linked with subsystem equal to 4.0
(i.e. marked as a Windows 95 application) doesn't respond properly
to wxFrame::SetIcon. To work around this until a solution is found,
mark your program as a 3.5 application. This will also ensure
that Windows provides small icons for the application automatically.<P>
See also <A HREF="wx114.htm#wxicon">wxIcon</A>.<P>
<HR>
<A NAME="wxframesetmenubar"></A>
<H3>wxFrame::SetMenuBar</H3>
<P>
<B>void</B> <B>SetMenuBar</B>(<B>wxMenuBar* </B><I>menuBar</I>)<P>
Tells the frame to show the given menu bar.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>menuBar</I><UL><UL>
The menu bar to associate with the frame.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
If the frame is destroyed, the
menu bar and its menus will be destroyed also, so do not delete the menu
bar explicitly (except by resetting the frame's menu bar to another
frame or NULL).<P>
Under Windows, a call to <A HREF="wx104.htm#wxframeonsize">wxFrame::OnSize</A> is generated, so be sure to initialize
data members properly before calling <B>SetMenuBar</B>.<P>
Note that it is not possible to call this function twice for the same frame object.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframegetmenubar">wxFrame::GetMenuBar</A>, <A HREF="wx141.htm#wxmenubar">wxMenuBar</A>, <A HREF="wx140.htm#wxmenu">wxMenu</A>.<P>
<HR>
<A NAME="wxframesetstatusbar"></A>
<H3>wxFrame::SetStatusBar</H3>
<P>
<B>void</B> <B>SetStatusBar</B>(<B>wxStatusBar*</B><I> statusBar</I>)<P>
Associates a status bar with the frame.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatestatusbar">wxFrame::CreateStatusBar</A>, <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A>,
<A HREF="wx104.htm#wxframegetstatusbar">wxFrame::GetStatusBar</A><P>
<HR>
<A NAME="wxframesetstatustext"></A>
<H3>wxFrame::SetStatusText</H3>
<P>
<B>virtual void</B> <B>SetStatusText</B>(<B>const wxString& </B><I> text</I>, <B>int</B><I> number = 0</I>)<P>
Sets the status bar text and redraws the status bar.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>text</I><UL><UL>
The text for the status field.</UL></UL>
<P>
<I>number</I><UL><UL>
The status field (starting from zero).</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
Use an empty string to clear the status bar.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatestatusbar">wxFrame::CreateStatusBar</A>, <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A><P>
<HR>
<A NAME="wxframesetstatuswidths"></A>
<H3>wxFrame::SetStatusWidths</H3>
<P>
<B>virtual void</B> <B>SetStatusWidths</B>(<B>int</B><I> n</I>, <B>int *</B><I>widths</I>)<P>
Sets the widths of the fields in the status bar.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<B><FONT COLOR="#FF0000">n</FONT></B>The number of fields in the status bar. It must be the
same used in <A HREF="wx104.htm#wxframecreatestatusbar">CreateStatusBar</A>.<P>
<I>widths</I><UL><UL>
Must contain an array of <I>n</I> integers, each of which is a status field width
in pixels. A value of -1 indicates that the field is variable width; at least one
field must be -1. You should delete this array after calling <B>SetStatusWidths</B>.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
The widths of the variable fields are calculated from the total width of all fields,
minus the sum of widths of the non-variable fields, divided by the number of
variable fields.<P>
<HR>
<A NAME="wxframesettoolbar"></A>
<H3>wxFrame::SetToolBar</H3>
<P>
<B>void</B> <B>SetToolBar</B>(<B>wxToolBar*</B><I> toolBar</I>)<P>
Associates a toolbar with the frame.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframecreatetoolbar">wxFrame::CreateToolBar</A>, <A HREF="wx249.htm#wxtoolbar">wxToolBar</A>,
<A HREF="wx104.htm#wxframegettoolbar">wxFrame::GetToolBar</A><P>
<HR>
<A NAME="wxframesettitle"></A>
<H3>wxFrame::SetTitle</H3>
<P>
<B>virtual void</B> <B>SetTitle</B>(<B>const wxString& </B><I> title</I>)<P>
Sets the frame title.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>title</I><UL><UL>
The frame title.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframegettitle">wxFrame::GetTitle</A><P>
</BODY></HTML>
|