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.
A frame that has a status bar and toolbar, created via the CreateStatusBar and CreateToolBar functions, manages these windows and adjusts the value returned by GetClientSize to reflect the remaining size available to application windows.
Frame processes the following events:
This class supports the following styles:
The default frame style is for normal, resizable frames. To create a frame which cannot be resized by user, you may use the following combination of styles:
style = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX)
See also the Window Styles. This class supports the following extra styles:
Event macros for events emitted by this class:
Note
An application should normally define an CloseEvent handler for the frame to respond to system close events, for example so that related data and subwindows can be cleaned up.
See also
MDIParentFrame, MDIChildFrame, MiniFrame, Dialog
DocChildFrame, DocParentFrame, HtmlHelpDialog, HtmlHelpFrame, MDIChildFrame, MDIParentFrame, MiniFrame, PreviewFrame, SplashScreen
__init__ | Default constructor. |
Centre | Centres the frame on the display. |
Create | Used in two-step frame construction. |
CreateStatusBar | Creates a status bar at the bottom of the frame. |
CreateToolBar | Creates a toolbar at the top or left of the frame. |
GetClientAreaOrigin | Returns the origin of the frame client area (in client coordinates). |
GetMenuBar | Returns a pointer to the menubar currently associated with the frame (if any). |
GetStatusBar | Returns a pointer to the status bar currently associated with the frame (if any). |
GetStatusBarPane | Returns the status bar pane used to display menu and toolbar help. |
GetToolBar | Returns a pointer to the toolbar currently associated with the frame (if any). |
OnCreateStatusBar | Virtual function called when a status bar is requested by CreateStatusBar . |
OnCreateToolBar | Virtual function called when a toolbar is requested by CreateToolBar . |
PopStatusText | |
ProcessCommand | Simulate a menu command. |
PushStatusText | |
SetMenuBar | Tells the frame to show the given menu bar. |
SetStatusBar | Associates a status bar with the frame. |
SetStatusBarPane | Set the status bar pane used to display menu and toolbar help. |
SetStatusText | Sets the status bar text and redraws the status bar. |
SetStatusWidths | Sets the widths of the fields in the status bar. |
SetToolBar | Associates a toolbar with the frame. |
MenuBar | See GetMenuBar and SetMenuBar |
StatusBar | See GetStatusBar and SetStatusBar |
StatusBarPane | See GetStatusBarPane and SetStatusBarPane |
ToolBar | See GetToolBar and SetToolBar |
A frame is a window whose size and position can (usually) be changed by the user.
Possible constructors:
Frame()
Frame(parent, id=ID_ANY, title='', pos=DefaultPosition,
size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, title=’‘, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
Constructor, creating the window.
Parameters: |
|
---|
Note
For Motif, MWM (the Motif Window Manager) should be running for any window styles to work (otherwise all styles take effect).
See also
Centres the frame on the display.
Parameters: | direction (int) – The parameter may be HORIZONTAL, VERTICAL or BOTH. |
---|
Used in two-step frame construction.
See Frame for further details.
Parameters: | |
---|---|
Return type: | bool |
Creates a status bar at the bottom of the frame.
Parameters: |
|
---|---|
Return type: | |
Returns: | A pointer to the status bar if it was created successfully, None otherwise. |
Note
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.
See also
Creates a toolbar at the top or left of the frame.
Parameters: |
|
---|---|
Return type: | |
Returns: | A pointer to the toolbar if it was created successfully, None otherwise. |
Note
By default, the toolbar is an instance of ToolBar. To use a different class, override OnCreateToolBar . When a toolbar has been created with this function, or made known to the frame with Frame.SetToolBar , the frame will manage the toolbar position and adjust the return value from Window.GetClientSize to reflect the available space for application windows. Under Pocket PC, you should always use this function for creating the toolbar to be managed by the frame, so that wxWidgets can use a combined menubar and toolbar. Where you manage your own toolbars, create a ToolBar as usual.
See also
Returns the origin of the frame client area (in client coordinates).
It may be different from (0, 0) if the frame has a toolbar.
Return type: | Point |
---|
Returns a pointer to the menubar currently associated with the frame (if any).
Return type: | MenuBar |
---|
See also
Returns a pointer to the status bar currently associated with the frame (if any).
Return type: | StatusBar |
---|
See also
Returns the status bar pane used to display menu and toolbar help.
Return type: | int |
---|
See also
Returns a pointer to the toolbar currently associated with the frame (if any).
Return type: | ToolBar |
---|
See also
Virtual function called when a status bar is requested by CreateStatusBar .
Parameters: |
|
---|---|
Return type: | |
Returns: | A status bar object. |
Note
An application can override this function to return a different kind of status bar. The default implementation returns an instance of StatusBar.
See also
Virtual function called when a toolbar is requested by CreateToolBar .
Parameters: |
|
---|---|
Return type: | |
Returns: | A toolbar object. |
Note
An application can override this function to return a different kind of toolbar. The default implementation returns an instance of ToolBar.
See also
Parameters: | number (int) – |
---|
Simulate a menu command.
Parameters: | id (int) – The identifier for a menu item. |
---|---|
Return type: | bool |
Parameters: |
|
---|
Tells the frame to show the given menu bar.
Parameters: | menuBar (MenuBar) – The menu bar to associate with the frame. |
---|
Note
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 None). Under Windows, a size event is generated, so be sure to initialize data members properly before calling SetMenuBar . Note that on some platforms, it is not possible to call this function twice for the same frame object.
See also
GetMenuBar , MenuBar, Menu.
Associates a status bar with the frame.
If statusBar is None, then the status bar, if present, is detached from the frame, but not deleted.
Parameters: | statusBar (StatusBar) – |
---|
See also
Set the status bar pane used to display menu and toolbar help.
Using -1 disables help display.
Parameters: | n (int) – |
---|
Sets the status bar text and redraws the status bar.
Parameters: |
|
---|
Note
Use an empty string to clear the status bar.
See also
Sets the widths of the fields in the status bar.
Parameters: |
|
---|
Note
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.
See GetMenuBar and SetMenuBar
See GetStatusBar and SetStatusBar
See GetStatusBarPane and SetStatusBarPane
See GetToolBar and SetToolBar