Contents Up Previous Next

wxPanel is-a wxCanvas

A panel is a subwindow for placing panel items, such as the wxButton and wxText item. Its parent must be a wxFrame. A panel inherits most properties from canvas, except for scrollbar functionality.

Note that a wxDialogBox may be used in a similar way to a panel.

The following event handlers are valid for the panel class:

on-default-action
Override this to intercept double clicks in listboxes.
on-command
Override this to intercept panel item commands (such as button presses). See wxCommandEvent for a list of event types associated with wxCommandEvent.
on-event
Called with a wxMouseEvent identifier. This can only be guaranteed only when the panel is in user edit mode (to be implemented).
on-paint
Called with no arguments when the panel receives a repaint event from the window manager.
on-size
The function is called with the window width and height.

wxPanel resource
wxPanel create
wxPanel on-command
wxPanel set-button-font
wxPanel set-label-font
wxPanel set-label-position
wxPanel new-line


wxPanel resource

string resource

The name of the resource the panel or dialog is to be loaded from, if any. Initially the empty string.


wxPanel create

void ( create)

Creates a panel.

The following slots may be initialized if not loading from a resource.

The following slots should be initialized if loading from a resource (see Resource overview for further details).

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

wxABSOLUTE_POSITIONING A hint to the windowing system not to try native Windowing system layout (Motif only). This is the recommended style for all Motif panels and dialog boxes.
wxBORDER Draws a thin border around the panel.
wxVSCROLL Gives the dialog box a vertical scrollbar (XView only).

void ( on-default-action wxItem item)

A panel receives this message in response to a double click in a listbox.


wxPanel on-command

void ( on-command wxItem item wxCommandEvent command-event)

A panel or dialog box receives this message in response to a command (such as a button press), if the item has not overriden on-command. See wxCommandEvent for a list of event types associated with wxCommandEvent.


wxPanel set-button-font

bool ( set-button-font wxFont font)

Sets the font used for panel or dialog box item buttons (or contents). See also set-label-font.


wxPanel set-label-font

bool ( set-label-font wxFont font)

Sets the font used for panel or dialog box item labels. See also set-button-font.


wxPanel set-label-position

bool ( set-label-position string position)

Change the current label orientation for panel items: position may be wxVERTICAL or wxHORIZONTAL.


wxPanel new-line

bool ( new-line)

Insert a new line, that is, make subsequent panel items appear at the start of the next line.