2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxFrame
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxFrame
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-05-10 09:44:43 +00: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 13:52:38 +00:00
|
|
|
a frame or dialog.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-05-10 09:44:43 +00: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 20:00:31 +00:00
|
|
|
@section frame_defaultevent Default event processing
|
2008-05-10 09:44:43 +00: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 23:53:45 +00:00
|
|
|
by manually handling @c wxEVT_SIZE or using sizers;
|
2008-05-10 09:44:43 +00: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 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxDEFAULT_FRAME_STYLE}
|
2008-03-08 14:43:31 +00:00
|
|
|
Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER |
|
2008-03-08 13:52:38 +00:00
|
|
|
wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxICONIZE}
|
2008-03-08 13:52:38 +00:00
|
|
|
Display the frame iconized (minimized). Windows only.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxCAPTION}
|
2010-07-22 12:08:45 +00: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 14:43:04 +00:00
|
|
|
@style{wxMINIMIZE}
|
2008-03-08 13:52:38 +00:00
|
|
|
Identical to wxICONIZE. Windows only.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxMINIMIZE_BOX}
|
2008-03-08 13:52:38 +00:00
|
|
|
Displays a minimize box on the frame.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxMAXIMIZE}
|
2010-01-16 04:14:18 +00:00
|
|
|
Displays the frame maximized. Windows and GTK+ only.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxMAXIMIZE_BOX}
|
2010-07-22 12:08:45 +00: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 14:43:04 +00:00
|
|
|
@style{wxCLOSE_BOX}
|
2008-03-08 13:52:38 +00:00
|
|
|
Displays a close box on the frame.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxSTAY_ON_TOP}
|
2008-03-08 13:52:38 +00:00
|
|
|
Stay on top of all other windows, see also wxFRAME_FLOAT_ON_PARENT.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxSYSTEM_MENU}
|
2010-07-22 12:08:45 +00: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 14:43:04 +00:00
|
|
|
@style{wxRESIZE_BORDER}
|
2011-04-03 20:31:32 +00:00
|
|
|
Displays a resizable border around the window.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFRAME_TOOL_WINDOW}
|
2010-07-22 12:08:45 +00:00
|
|
|
Causes a frame with a small title bar to be created; the frame does
|
2008-03-08 13:52:38 +00:00
|
|
|
not appear in the taskbar under Windows or GTK+.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFRAME_NO_TASKBAR}
|
2008-03-08 13:52:38 +00: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 12:08:45 +00: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 14:43:04 +00:00
|
|
|
@style{wxFRAME_FLOAT_ON_PARENT}
|
2008-05-10 09:44:43 +00: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 12:08:45 +00:00
|
|
|
Windows with this style are allowed to have their shape changed
|
2008-05-10 09:44:43 +00:00
|
|
|
with the SetShape() method.
|
|
|
|
@endStyleTable
|
|
|
|
|
2011-04-03 20:31:32 +00:00
|
|
|
The default frame style is for normal, resizable frames.
|
2011-03-22 14:17:38 +00:00
|
|
|
To create a frame which cannot be resized by user, you may use the following
|
2008-05-10 09:44:43 +00:00
|
|
|
combination of styles:
|
|
|
|
|
|
|
|
@code
|
2008-07-15 13:50:37 +00:00
|
|
|
wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)
|
2008-05-10 09:44:43 +00:00
|
|
|
@endcode
|
|
|
|
|
|
|
|
See also the @ref overview_windowstyles.
|
|
|
|
|
|
|
|
@beginExtraStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFRAME_EX_CONTEXTHELP}
|
2008-03-08 13:52:38 +00: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 19:52:14 +00:00
|
|
|
will send a @c wxEVT_HELP event if the user clicked on an application
|
2008-03-08 13:52:38 +00: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 14:43:04 +00:00
|
|
|
@style{wxFRAME_EX_METAL}
|
2008-03-08 13:52:38 +00:00
|
|
|
On Mac OS X, frames with this style will be shown with a metallic
|
|
|
|
look. This is an extra style.
|
2008-05-10 09:44:43 +00:00
|
|
|
@endExtraStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2009-02-18 17:58:51 +00:00
|
|
|
@beginEventEmissionTable
|
2008-11-23 23:53:45 +00:00
|
|
|
@event{EVT_CLOSE(func)}
|
2012-02-22 13:41:15 +00: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 23:53:45 +00: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 17:58:51 +00: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 23:53:45 +00:00
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{managedwnd}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxMDIParentFrame, wxMDIChildFrame, wxMiniFrame, wxDialog
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxFrame : public wxTopLevelWindow
|
|
|
|
{
|
|
|
|
public:
|
2008-09-25 20:00:31 +00:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxFrame();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Constructor, creating the window.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00: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 14:43:31 +00:00
|
|
|
@param id
|
2008-09-25 20:00:31 +00:00
|
|
|
The window identifier. It may take a value of -1 to indicate a default value.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param title
|
2008-03-09 12:33:59 +00:00
|
|
|
The caption to be displayed on the frame's title bar.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
The window position. The value wxDefaultPosition indicates a default position,
|
2008-09-25 20:00:31 +00:00
|
|
|
chosen by either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-09 12:33:59 +00: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 14:43:31 +00:00
|
|
|
@param style
|
2008-09-25 20:00:31 +00:00
|
|
|
The window style. See wxFrame class description.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-09-25 20:00:31 +00: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 12:33:59 +00:00
|
|
|
individual windows.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks For Motif, MWM (the Motif Window Manager) should be running for
|
2008-09-25 20:00:31 +00:00
|
|
|
any window styles to work (otherwise all styles take effect).
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see Create()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00: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 15:17:16 +00:00
|
|
|
const wxString& name = wxFrameNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Destroys all child windows and menu bar if present.
|
2008-11-25 00:24:58 +00:00
|
|
|
|
|
|
|
See @ref overview_windowdeletion for more info.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxFrame();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Centres the frame on the display.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param direction
|
2008-03-09 12:33:59 +00:00
|
|
|
The parameter may be wxHORIZONTAL, wxVERTICAL or wxBOTH.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void Centre(int direction = wxBOTH);
|
|
|
|
|
|
|
|
/**
|
2008-09-25 20:00:31 +00:00
|
|
|
Used in two-step frame construction.
|
|
|
|
See wxFrame() for further details.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxString& title,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& name = wxFrameNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates a status bar at the bottom of the frame.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param number
|
2008-03-09 12:33:59 +00:00
|
|
|
The number of fields to create. Specify a
|
|
|
|
value greater than 1 to create a multi-field status bar.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-09-25 20:00:31 +00:00
|
|
|
The status bar style. See wxStatusBar for a list of valid styles.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-09-25 20:00:31 +00:00
|
|
|
The status bar window identifier. If -1, an identifier will be chosen
|
|
|
|
by wxWidgets.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
The status bar window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return A pointer to the status bar if it was created successfully, @NULL
|
2008-09-25 20:00:31 +00:00
|
|
|
otherwise.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks The width of the status bar is the whole width of the frame
|
2008-03-09 12:33:59 +00:00
|
|
|
(adjusted automatically when resizing), and the height
|
|
|
|
and text size are chosen by the host windowing system.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetStatusText(), OnCreateStatusBar(), GetStatusBar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-04-25 12:59:09 +00:00
|
|
|
virtual wxStatusBar* CreateStatusBar(int number = 1, long style = wxSTB_DEFAULT_STYLE,
|
2008-10-28 15:36:26 +00:00
|
|
|
wxWindowID id = 0,
|
2012-02-08 00:22:21 +00:00
|
|
|
const wxString& name = wxStatusBarNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates a toolbar at the top or left of the frame.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-09-25 20:00:31 +00:00
|
|
|
The toolbar style. See wxToolBar for a list of valid styles.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-09-25 20:00:31 +00:00
|
|
|
The toolbar window identifier. If -1, an identifier will be chosen
|
|
|
|
by wxWidgets.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
The toolbar window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return A pointer to the toolbar if it was created successfully, @NULL
|
2008-09-25 20:00:31 +00:00
|
|
|
otherwise.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-11-22 00:21:10 +00: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 20:00:31 +00:00
|
|
|
|
|
|
|
@see CreateStatusBar(), OnCreateToolBar(), SetToolBar(), GetToolBar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
virtual wxToolBar* CreateToolBar(long style = wxBORDER_NONE | wxTB_HORIZONTAL,
|
2008-10-28 15:36:26 +00:00
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 20:00:31 +00: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 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual wxPoint GetClientAreaOrigin() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a pointer to the menubar currently associated with the frame (if any).
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetMenuBar(), wxMenuBar, wxMenu
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual wxMenuBar* GetMenuBar() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 20:00:31 +00:00
|
|
|
Returns a pointer to the status bar currently associated with the frame
|
|
|
|
(if any).
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see CreateStatusBar(), wxStatusBar
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual wxStatusBar* GetStatusBar() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the status bar pane used to display menu and toolbar help.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see SetStatusBarPane()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
int GetStatusBarPane() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a pointer to the toolbar currently associated with the frame (if any).
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see CreateToolBar(), wxToolBar, SetToolBar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual wxToolBar* GetToolBar() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Virtual function called when a status bar is requested by CreateStatusBar().
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param number
|
2008-03-09 12:33:59 +00:00
|
|
|
The number of fields to create.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
The window style. See wxStatusBar for a list
|
|
|
|
of valid styles.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
The window identifier. If -1, an identifier will be chosen by
|
|
|
|
wxWidgets.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
The window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return A status bar object.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks An application can override this function to return a different
|
2008-03-09 12:33:59 +00:00
|
|
|
kind of status bar. The default implementation returns
|
|
|
|
an instance of wxStatusBar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see CreateStatusBar(), wxStatusBar.
|
2008-03-08 13:52:38 +00: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 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
The toolbar style. See wxToolBar for a list
|
|
|
|
of valid styles.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
The toolbar window identifier. If -1, an identifier will be chosen by
|
|
|
|
wxWidgets.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
The toolbar window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return A toolbar object.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks An application can override this function to return a different
|
2008-03-09 12:33:59 +00:00
|
|
|
kind of toolbar. The default implementation returns an
|
|
|
|
instance of wxToolBar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see CreateToolBar(), wxToolBar.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual wxToolBar* OnCreateToolBar(long style, wxWindowID id,
|
|
|
|
const wxString& name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Simulate a menu command.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
The identifier for a menu item.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-11-09 16:46:52 +00:00
|
|
|
bool ProcessCommand(int id);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the frame to show the given menu bar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param menuBar
|
2008-03-09 12:33:59 +00:00
|
|
|
The menu bar to associate with the frame.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks If the frame is destroyed, the menu bar and its menus will be
|
2008-03-09 12:33:59 +00: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 20:00:31 +00: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 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see GetMenuBar(), wxMenuBar, wxMenu.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void SetMenuBar(wxMenuBar* menuBar);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Associates a status bar with the frame.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2009-04-25 12:59:09 +00:00
|
|
|
If @a statusBar is @NULL, then the status bar, if present, is detached from
|
|
|
|
the frame, but @e not deleted.
|
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see CreateStatusBar(), wxStatusBar, GetStatusBar()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void SetStatusBar(wxStatusBar* statusBar);
|
2008-03-08 13:52:38 +00: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 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param text
|
2008-03-09 12:33:59 +00:00
|
|
|
The text for the status field.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param number
|
2008-03-09 12:33:59 +00:00
|
|
|
The status field (starting from zero).
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks Use an empty string to clear the status bar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see CreateStatusBar(), wxStatusBar
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the widths of the fields in the status bar.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param n
|
2008-03-09 12:33:59 +00:00
|
|
|
The number of fields in the status bar. It must be the
|
|
|
|
same used in CreateStatusBar.
|
2008-11-03 11:57:07 +00:00
|
|
|
@param widths_field
|
2008-03-09 12:33:59 +00: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 20:00:31 +00:00
|
|
|
least one field must be -1. You should delete this array after calling
|
|
|
|
SetStatusWidths().
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@remarks The widths of the variable fields are calculated from the total
|
2008-03-09 12:33:59 +00:00
|
|
|
width of all fields, minus the sum of widths of the
|
2008-09-25 20:00:31 +00:00
|
|
|
non-variable fields, divided by the number of variable fields.
|
2009-10-18 17:47:01 +00:00
|
|
|
|
|
|
|
@beginWxPerlOnly
|
|
|
|
In wxPerl this method takes the field widths as parameters.
|
|
|
|
@endWxPerlOnly
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
virtual void SetStatusWidths(int n, const int* widths_field);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Associates a toolbar with the frame.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void SetToolBar(wxToolBar* toolBar);
|
2010-12-27 20:47:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
void PushStatusText(const wxString &text, int number = 0);
|
|
|
|
void PopStatusText(int number = 0);
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|