2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxFrame
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-05-29 23:13:27 -04:00
|
|
|
/**
|
|
|
|
Frame specific styles
|
|
|
|
*/
|
|
|
|
#define wxFRAME_NO_TASKBAR 0x0002 // No taskbar button (MSW only)
|
|
|
|
#define wxFRAME_TOOL_WINDOW 0x0004 // No taskbar button, no system menu
|
|
|
|
#define wxFRAME_FLOAT_ON_PARENT 0x0008 // Always above its parent
|
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxFrame
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-10 05:44:43 -04:00
|
|
|
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
|
2008-03-08 08:52:38 -05:00
|
|
|
a frame or dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-10 05:44:43 -04:00
|
|
|
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.
|
|
|
|
|
|
|
|
@remarks An application should normally define an wxCloseEvent handler for the
|
|
|
|
frame to respond to system close events, for example so that related
|
|
|
|
data and subwindows can be cleaned up.
|
|
|
|
|
|
|
|
|
2008-09-25 16:00:31 -04:00
|
|
|
@section frame_defaultevent Default event processing
|
2008-05-10 05:44:43 -04:00
|
|
|
|
|
|
|
wxFrame processes the following events:
|
|
|
|
|
|
|
|
@li @c wxEVT_SIZE: if the frame has exactly one child window, not counting the
|
|
|
|
status and toolbar, this child is resized to take the entire frame client area.
|
|
|
|
If two or more windows are present, they should be laid out explicitly either
|
2008-11-23 18:53:45 -05:00
|
|
|
by manually handling @c wxEVT_SIZE or using sizers;
|
2008-05-10 05:44:43 -04:00
|
|
|
@li @c wxEVT_MENU_HIGHLIGHT: the default implementation displays the help string
|
|
|
|
associated with the selected item in the first pane of the status bar, if there is one.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxDEFAULT_FRAME_STYLE}
|
2008-03-08 09:43:31 -05:00
|
|
|
Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER |
|
2008-03-08 08:52:38 -05:00
|
|
|
wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxICONIZE}
|
2008-03-08 08:52:38 -05:00
|
|
|
Display the frame iconized (minimized). Windows only.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCAPTION}
|
2010-07-22 08:08:45 -04:00
|
|
|
Puts a caption on the frame. Notice that this flag is required by
|
|
|
|
wxMINIMIZE_BOX, wxMAXIMIZE_BOX and wxCLOSE_BOX on most systems as
|
|
|
|
the corresponding buttons cannot be shown if the window has no title
|
|
|
|
bar at all. I.e. if wxCAPTION is not specified those styles would be
|
|
|
|
simply ignored.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxMINIMIZE}
|
2008-03-08 08:52:38 -05:00
|
|
|
Identical to wxICONIZE. Windows only.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxMINIMIZE_BOX}
|
2008-03-08 08:52:38 -05:00
|
|
|
Displays a minimize box on the frame.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxMAXIMIZE}
|
2010-01-15 23:14:18 -05:00
|
|
|
Displays the frame maximized. Windows and GTK+ only.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxMAXIMIZE_BOX}
|
2010-07-22 08:08:45 -04:00
|
|
|
Displays a maximize box on the frame. Notice that under wxGTK
|
|
|
|
wxRESIZE_BORDER must be used as well or this style is ignored.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxCLOSE_BOX}
|
2008-03-08 08:52:38 -05:00
|
|
|
Displays a close box on the frame.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSTAY_ON_TOP}
|
2008-03-08 08:52:38 -05:00
|
|
|
Stay on top of all other windows, see also wxFRAME_FLOAT_ON_PARENT.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxSYSTEM_MENU}
|
2010-07-22 08:08:45 -04:00
|
|
|
Displays a system menu containing the list of various windows
|
|
|
|
commands in the window title bar. Unlike wxMINIMIZE_BOX,
|
|
|
|
wxMAXIMIZE_BOX and wxCLOSE_BOX styles this style can be used without
|
|
|
|
wxCAPTION, at least under Windows, and makes the system menu
|
|
|
|
available without showing it on screen in this case. However it is
|
|
|
|
recommended to only use it together with wxCAPTION for consistent
|
|
|
|
behaviour under all platforms.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxRESIZE_BORDER}
|
2011-04-03 16:31:32 -04:00
|
|
|
Displays a resizable border around the window.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxFRAME_TOOL_WINDOW}
|
2010-07-22 08:08:45 -04:00
|
|
|
Causes a frame with a small title bar to be created; the frame does
|
2008-03-08 08:52:38 -05:00
|
|
|
not appear in the taskbar under Windows or GTK+.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxFRAME_NO_TASKBAR}
|
2008-03-08 08:52:38 -05:00
|
|
|
Creates an otherwise normal frame but it does not appear in the
|
|
|
|
taskbar under Windows or GTK+ (note that it will minimize to the
|
|
|
|
desktop window under Windows which may seem strange to the users
|
|
|
|
and thus it might be better to use this style only without
|
2010-07-22 08:08:45 -04:00
|
|
|
wxMINIMIZE_BOX style). In wxGTK, the flag is respected only if the
|
|
|
|
window manager supports _NET_WM_STATE_SKIP_TASKBAR hint.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxFRAME_FLOAT_ON_PARENT}
|
2008-05-10 05:44:43 -04:00
|
|
|
The frame will always be on top of its parent (unlike wxSTAY_ON_TOP).
|
|
|
|
A frame created with this style must have a non-@NULL parent.
|
|
|
|
@style{wxFRAME_SHAPED}
|
2010-07-22 08:08:45 -04:00
|
|
|
Windows with this style are allowed to have their shape changed
|
2008-05-10 05:44:43 -04:00
|
|
|
with the SetShape() method.
|
|
|
|
@endStyleTable
|
|
|
|
|
2011-04-03 16:31:32 -04:00
|
|
|
The default frame style is for normal, resizable frames.
|
2011-03-22 10:17:38 -04:00
|
|
|
To create a frame which cannot be resized by user, you may use the following
|
2008-05-10 05:44:43 -04:00
|
|
|
combination of styles:
|
|
|
|
|
|
|
|
@code
|
2008-07-15 09:50:37 -04:00
|
|
|
wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)
|
2008-05-10 05:44:43 -04:00
|
|
|
@endcode
|
|
|
|
|
|
|
|
See also the @ref overview_windowstyles.
|
|
|
|
|
|
|
|
@beginExtraStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxFRAME_EX_CONTEXTHELP}
|
2008-03-08 08:52:38 -05:00
|
|
|
Under Windows, puts a query button on the caption. When pressed,
|
|
|
|
Windows will go into a context-sensitive help mode and wxWidgets
|
2011-01-06 14:52:14 -05:00
|
|
|
will send a @c wxEVT_HELP event if the user clicked on an application
|
2008-03-08 08:52:38 -05:00
|
|
|
window. Note that this is an extended style and must be set by
|
|
|
|
calling SetExtraStyle before Create is called (two-step
|
|
|
|
construction). You cannot use this style together with
|
|
|
|
wxMAXIMIZE_BOX or wxMINIMIZE_BOX, so you should use
|
|
|
|
wxDEFAULT_FRAME_STYLE ~ (wxMINIMIZE_BOX | wxMAXIMIZE_BOX) for the
|
|
|
|
frames having this style (the dialogs don't have a minimize or a
|
|
|
|
maximize box by default)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxFRAME_EX_METAL}
|
2008-03-08 08:52:38 -05:00
|
|
|
On Mac OS X, frames with this style will be shown with a metallic
|
|
|
|
look. This is an extra style.
|
2008-05-10 05:44:43 -04:00
|
|
|
@endExtraStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable
|
2008-11-23 18:53:45 -05:00
|
|
|
@event{EVT_CLOSE(func)}
|
2012-02-22 08:41:15 -05:00
|
|
|
Process a @c wxEVT_CLOSE_WINDOW event when the frame is being
|
|
|
|
closed by the user or programmatically (see wxWindow::Close).
|
2008-11-23 18:53:45 -05:00
|
|
|
The user may generate this event clicking the close button
|
|
|
|
(typically the 'X' on the top-right of the title bar) if it's present
|
2009-02-18 12:58:51 -05:00
|
|
|
(see the @c wxCLOSE_BOX style). See wxCloseEvent.
|
|
|
|
@event{EVT_ICONIZE(func)}
|
|
|
|
Process a @c wxEVT_ICONIZE event. See wxIconizeEvent.
|
|
|
|
@event{EVT_MENU_OPEN(func)}
|
|
|
|
A menu is about to be opened. See wxMenuEvent.
|
|
|
|
@event{EVT_MENU_CLOSE(func)}
|
|
|
|
A menu has been just closed. See wxMenuEvent.
|
|
|
|
@event{EVT_MENU_HIGHLIGHT(id, func)}
|
|
|
|
The menu item with the specified id has been highlighted: used to show
|
|
|
|
help prompts in the status bar by wxFrame. See wxMenuEvent.
|
|
|
|
@event{EVT_MENU_HIGHLIGHT_ALL(func)}
|
|
|
|
A menu item has been highlighted, i.e. the currently selected menu item has changed.
|
|
|
|
See wxMenuEvent.
|
2008-11-23 18:53:45 -05:00
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{managedwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxMDIParentFrame, wxMDIChildFrame, wxMiniFrame, wxDialog
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxFrame : public wxTopLevelWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-09-25 16:00:31 -04:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxFrame();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor, creating the window.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
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.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-09-25 16:00:31 -04:00
|
|
|
The window identifier. It may take a value of -1 to indicate a default value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param title
|
2008-03-09 08:33:59 -04:00
|
|
|
The caption to be displayed on the frame's title bar.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
The window position. The value wxDefaultPosition indicates a default position,
|
2008-09-25 16:00:31 -04:00
|
|
|
chosen by either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
The window size. The value wxDefaultSize indicates a default size, chosen by
|
|
|
|
either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-09-25 16:00:31 -04:00
|
|
|
The window style. See wxFrame class description.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-09-25 16:00:31 -04:00
|
|
|
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
|
2008-03-09 08:33:59 -04:00
|
|
|
individual windows.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks For Motif, MWM (the Motif Window Manager) should be running for
|
2008-09-25 16:00:31 -04:00
|
|
|
any window styles to work (otherwise all styles take effect).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Create()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxFrame(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
2008-11-08 10:17:16 -05:00
|
|
|
const wxString& name = wxFrameNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Destroys all child windows and menu bar if present.
|
2008-11-24 19:24:58 -05:00
|
|
|
|
|
|
|
See @ref overview_windowdeletion for more info.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxFrame();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Centres the frame on the display.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param direction
|
2008-03-09 08:33:59 -04:00
|
|
|
The parameter may be wxHORIZONTAL, wxVERTICAL or wxBOTH.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void Centre(int direction = wxBOTH);
|
|
|
|
|
|
|
|
/**
|
2008-09-25 16:00:31 -04:00
|
|
|
Used in two-step frame construction.
|
|
|
|
See wxFrame() for further details.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxString& title,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
2008-10-28 11:36:26 -04:00
|
|
|
const wxString& name = wxFrameNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates a status bar at the bottom of the frame.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param number
|
2008-03-09 08:33:59 -04:00
|
|
|
The number of fields to create. Specify a
|
|
|
|
value greater than 1 to create a multi-field status bar.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-09-25 16:00:31 -04:00
|
|
|
The status bar style. See wxStatusBar for a list of valid styles.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-09-25 16:00:31 -04:00
|
|
|
The status bar window identifier. If -1, an identifier will be chosen
|
|
|
|
by wxWidgets.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
The status bar window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return A pointer to the status bar if it was created successfully, @NULL
|
2008-09-25 16:00:31 -04:00
|
|
|
otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks The width of the status bar is the whole width of the frame
|
2008-03-09 08:33:59 -04:00
|
|
|
(adjusted automatically when resizing), and the height
|
|
|
|
and text size are chosen by the host windowing system.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetStatusText(), OnCreateStatusBar(), GetStatusBar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-04-25 08:59:09 -04:00
|
|
|
virtual wxStatusBar* CreateStatusBar(int number = 1, long style = wxSTB_DEFAULT_STYLE,
|
2008-10-28 11:36:26 -04:00
|
|
|
wxWindowID id = 0,
|
2012-02-07 19:22:21 -05:00
|
|
|
const wxString& name = wxStatusBarNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates a toolbar at the top or left of the frame.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-09-25 16:00:31 -04:00
|
|
|
The toolbar style. See wxToolBar for a list of valid styles.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-09-25 16:00:31 -04:00
|
|
|
The toolbar window identifier. If -1, an identifier will be chosen
|
|
|
|
by wxWidgets.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
The toolbar window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return A pointer to the toolbar if it was created successfully, @NULL
|
2008-09-25 16:00:31 -04:00
|
|
|
otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-11-21 19:21:10 -05:00
|
|
|
@remarks
|
|
|
|
By default, the toolbar is an instance of wxToolBar.
|
|
|
|
To use a different class, override OnCreateToolBar().
|
|
|
|
When a toolbar has been created with this function, or made
|
|
|
|
known to the frame with wxFrame::SetToolBar(), the frame will
|
|
|
|
manage the toolbar position and adjust the return value from
|
|
|
|
wxWindow::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 wxToolBar as usual.
|
2008-09-25 16:00:31 -04:00
|
|
|
|
|
|
|
@see CreateStatusBar(), OnCreateToolBar(), SetToolBar(), GetToolBar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual wxToolBar* CreateToolBar(long style = wxBORDER_NONE | wxTB_HORIZONTAL,
|
2008-10-28 11:36:26 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-25 16:00:31 -04:00
|
|
|
Returns the origin of the frame client area (in client coordinates).
|
|
|
|
It may be different from (0, 0) if the frame has a toolbar.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxPoint GetClientAreaOrigin() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a pointer to the menubar currently associated with the frame (if any).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetMenuBar(), wxMenuBar, wxMenu
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxMenuBar* GetMenuBar() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-09-25 16:00:31 -04:00
|
|
|
Returns a pointer to the status bar currently associated with the frame
|
|
|
|
(if any).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CreateStatusBar(), wxStatusBar
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxStatusBar* GetStatusBar() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the status bar pane used to display menu and toolbar help.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetStatusBarPane()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
int GetStatusBarPane() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a pointer to the toolbar currently associated with the frame (if any).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CreateToolBar(), wxToolBar, SetToolBar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxToolBar* GetToolBar() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Virtual function called when a status bar is requested by CreateStatusBar().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param number
|
2008-03-09 08:33:59 -04:00
|
|
|
The number of fields to create.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
The window style. See wxStatusBar for a list
|
|
|
|
of valid styles.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
The window identifier. If -1, an identifier will be chosen by
|
|
|
|
wxWidgets.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
The window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return A status bar object.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks An application can override this function to return a different
|
2008-03-09 08:33:59 -04:00
|
|
|
kind of status bar. The default implementation returns
|
|
|
|
an instance of wxStatusBar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CreateStatusBar(), wxStatusBar.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual wxStatusBar* OnCreateStatusBar(int number, long style,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Virtual function called when a toolbar is requested by CreateToolBar().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
The toolbar style. See wxToolBar for a list
|
|
|
|
of valid styles.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
The toolbar window identifier. If -1, an identifier will be chosen by
|
|
|
|
wxWidgets.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
The toolbar window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return A toolbar object.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks An application can override this function to return a different
|
2008-03-09 08:33:59 -04:00
|
|
|
kind of toolbar. The default implementation returns an
|
|
|
|
instance of wxToolBar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CreateToolBar(), wxToolBar.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual wxToolBar* OnCreateToolBar(long style, wxWindowID id,
|
|
|
|
const wxString& name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Simulate a menu command.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
The identifier for a menu item.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-09 11:46:52 -05:00
|
|
|
bool ProcessCommand(int id);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the frame to show the given menu bar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param menuBar
|
2008-03-09 08:33:59 -04:00
|
|
|
The menu bar to associate with the frame.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks If the frame is destroyed, the menu bar and its menus will be
|
2008-03-09 08:33:59 -04:00
|
|
|
destroyed also, so do not delete the menu bar
|
|
|
|
explicitly (except by resetting the frame's menu bar to
|
|
|
|
another frame or @NULL).
|
2008-09-25 16:00:31 -04:00
|
|
|
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.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetMenuBar(), wxMenuBar, wxMenu.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetMenuBar(wxMenuBar* menuBar);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Associates a status bar with the frame.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2009-04-25 08:59:09 -04:00
|
|
|
If @a statusBar is @NULL, then the status bar, if present, is detached from
|
|
|
|
the frame, but @e not deleted.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CreateStatusBar(), wxStatusBar, GetStatusBar()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetStatusBar(wxStatusBar* statusBar);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set the status bar pane used to display menu and toolbar help.
|
|
|
|
Using -1 disables help display.
|
|
|
|
*/
|
|
|
|
void SetStatusBarPane(int n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the status bar text and redraws the status bar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param text
|
2008-03-09 08:33:59 -04:00
|
|
|
The text for the status field.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param number
|
2008-03-09 08:33:59 -04:00
|
|
|
The status field (starting from zero).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Use an empty string to clear the status bar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see CreateStatusBar(), wxStatusBar
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the widths of the fields in the status bar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param n
|
2008-03-09 08:33:59 -04:00
|
|
|
The number of fields in the status bar. It must be the
|
|
|
|
same used in CreateStatusBar.
|
2008-11-03 06:57:07 -05:00
|
|
|
@param widths_field
|
2008-03-09 08:33:59 -04:00
|
|
|
Must contain an array of n integers, each of which is a status field width
|
|
|
|
in pixels. A value of -1 indicates that the field is variable width; at
|
2008-09-25 16:00:31 -04:00
|
|
|
least one field must be -1. You should delete this array after calling
|
|
|
|
SetStatusWidths().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks The widths of the variable fields are calculated from the total
|
2008-03-09 08:33:59 -04:00
|
|
|
width of all fields, minus the sum of widths of the
|
2008-09-25 16:00:31 -04:00
|
|
|
non-variable fields, divided by the number of variable fields.
|
2009-10-18 13:47:01 -04:00
|
|
|
|
|
|
|
@beginWxPerlOnly
|
|
|
|
In wxPerl this method takes the field widths as parameters.
|
|
|
|
@endWxPerlOnly
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
virtual void SetStatusWidths(int n, const int* widths_field);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Associates a toolbar with the frame.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolBar(wxToolBar* toolBar);
|
2010-12-27 15:47:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
void PushStatusText(const wxString &text, int number = 0);
|
|
|
|
void PopStatusText(int number = 0);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|