Contents Up Previous Next

wxFrame is-a wxWindow

A wxFrame is a window containing text, canvas or panel subwindows. It normally has decorations added by the window manager, such as a system menu, a thick frame, and resize handles. When a wxWindows or wxCLIPS application initializes, a top-level frame must be returned to the system for successful start-up. When a top-level frame and all its children are deleted, the application terminates.

Usually an application will need to override the on-close handler in case the window manager sends the application a close message. If the handler returns TRUE, the frame is deleted by the system (possibly terminating the application).

See wxWindow for message handlers in addition to the ones documented here.

wxFrame create
wxFrame create-status-line
wxFrame iconize
wxFrame set-menu-bar
wxFrame set-icon
wxFrame set-status-text
wxFrame set-title
wxFrame set-tool-bar
wxFrame on-activate
wxFrame on-char-hook
wxFrame on-close
wxFrame on-menu-command
wxFrame on-menu-select
wxFrame on-size


wxFrame create

void ( create)

The following slots may be initialized.

The style parameter may be a combination of the following, using the bitwise 'or' operator.

wxICONIZE Display the frame iconized (minimized) (Windows only).
wxCAPTION Puts a caption on the frame (under XView and Motif this is mandatory).
wxDEFAULT_FRAME Defined as a combination of wxMINIMIZE_BOX, wxMAXIMIZE_BOX, wxTHICK_FRAME, wxSYSTEM_MENU and wxCAPTION.
wxMDI_CHILD Specifies a Windows MDI (multiple document interface) child frame.
wxMDI_PARENT Specifies a Windows MDI (multiple document interface) parent frame.
wxMINIMIZE Identical to wxICONIZE.
wxMINIMIZE_BOX Displays a minimize box on the frame (Windows only).
wxMAXIMIZE Displays the frame maximized (Windows only).
wxMAXIMIZE_BOX Displays a maximize box on the frame (Windows only).
wxSDI Specifies a normal SDI (single document interface) frame.
wxSTAY_ON_TOP Stay on top of other windows (Windows only).
wxSYSTEM_MENU Displays a system menu (manadatory under XView and Motif).
wxTHICK_FRAME Displays a thick frame around the window (manadatory under XView and Motif).

The function show must be called before a new frame is visible.


wxFrame create-status-line

bool ( create-status-line optional long n=1)

Creates a status line at the bottom of the frame. Use set-status-text to write to the status line.

n is a number from 1 to 5 for the number of status areas to create.


wxFrame iconize

bool ( iconize optional bool minimize)

Minimizes the frame if the second argument is TRUE or absent, restores the frame otherwise.


wxFrame set-menu-bar

bool ( set-menu-bar wxMenuBar menu-bar)

Associates a menu bar with the frame. See wxMenuBar. You should not call this more than once for any given frame, and you should also not delete the wxMenuBar object once it has been assigned to a frame. It will be deleted when the wxFrame object is deleted.


wxFrame set-icon

bool ( set-icon wxIcon icon)

Sets the icon of a frame. See wxIcon.


wxFrame set-status-text

bool ( set-status-text string text, optional long i=0)

Sets the text for the status line (previously created with create-status-line).

i is a number from 0 to 4 for the number of the status area to write to.


wxFrame set-title

bool ( set-title string text)

Set the title of a frame.


wxFrame set-tool-bar

bool ( set-tool-bar long toolbar)

Tells the MDI frame to manage the subwindow as a toolbar. Use in Windows MDI mode only.


wxFrame on-activate

void ( on-activate bool active)

Called the frame is activated or deactivated. Under Windows, you may need to intercept this message and set the focus for a subwindow, or the subwindow may not receive character events. By default, wxWindows will set the focus for the first subwindow of a frame.


wxFrame on-char-hook

bool ( on-char-hook wxKeyEvent event)

Under Windows only, all key strokes going to a dialog box or frame can be intercepted before being passed on for normal processing. This handler takes the event object, and should return TRUE to override further processing, or FALSE to do default processing. See also wxKeyEvent.


wxFrame on-close

bool ( on-close)

The function is called when the user dismisses the frame. If the handler returns TRUE, the window is automatically deleted (possibly terminating the application). A return value of FALSE forbids automatic deletion.


wxFrame on-menu-command

void ( on-menu-command long menu-item)

Called with the menu item identifier. Test the menu item identifier and perform an appropriate action.


wxFrame on-menu-select

void ( on-menu-select long menu-item)

Called with a menu item identifier, when the cursor travels over the menu item (but the user does not click). Test the menu item identifier and perform an appropriate action.


wxFrame on-size

void ( on-size long width longheight)

The function is called with the frame width and height when the user resizes the frame. The application should define appropriate subwindow resizing behaviour in this handler, if appropriate.

The default handler performs child window resizing behaviour if there is only one child window. Otherwise, it gives up.