2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: toolbar.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxToolBar
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxToolBar
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-11-21 19:21:10 -05:00
|
|
|
A toolbar is a bar of buttons and/or other controls usually placed below
|
|
|
|
the menu bar in a wxFrame.
|
2008-05-20 03:48:30 -04:00
|
|
|
|
2008-11-22 10:53:10 -05:00
|
|
|
You may create a toolbar that is managed by a frame calling
|
2008-05-20 03:48:30 -04:00
|
|
|
wxFrame::CreateToolBar(). 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
|
2008-11-22 10:53:10 -05:00
|
|
|
own toolbars, create wxToolBar as usual.
|
2008-05-20 03:48:30 -04:00
|
|
|
|
2008-11-22 10:53:10 -05:00
|
|
|
There are several different types of tools you can add to a toolbar.
|
|
|
|
These types are controlled by the ::wxItemKind enumeration.
|
|
|
|
|
|
|
|
Note that many methods in wxToolBar such as wxToolBar::AddTool return a
|
|
|
|
@c wxToolBarToolBase* object.
|
|
|
|
This should be regarded as an opaque handle representing the newly added
|
|
|
|
toolbar item, providing access to its id and position within the toolbar.
|
|
|
|
Changes to the item's state should be made through calls to wxToolBar methods,
|
|
|
|
for example wxToolBar::EnableTool.
|
|
|
|
Calls to @c wxToolBarToolBase methods (undocumented by purpose) will not change
|
|
|
|
the visible state of the item within the the tool bar.
|
2008-05-20 03:48:30 -04:00
|
|
|
|
2008-11-21 19:21:10 -05:00
|
|
|
<b>wxMSW note</b>: Note that under wxMSW toolbar paints tools to reflect
|
|
|
|
system-wide colours. If you use more than 16 colours in your tool bitmaps,
|
|
|
|
you may wish to suppress this behaviour, otherwise system colours in your
|
|
|
|
bitmaps will inadvertently be mapped to system colours.
|
2008-05-20 03:48:30 -04:00
|
|
|
To do this, set the msw.remap system option before creating the toolbar:
|
|
|
|
@code
|
|
|
|
wxSystemOptions::SetOption(wxT("msw.remap"), 0);
|
|
|
|
@endcode
|
|
|
|
If you wish to use 32-bit images (which include an alpha channel for
|
|
|
|
transparency) use:
|
|
|
|
@code
|
|
|
|
wxSystemOptions::SetOption(wxT("msw.remap"), 2);
|
|
|
|
@endcode
|
|
|
|
Then colour remapping is switched off, and a transparent background
|
|
|
|
used. But only use this option under Windows XP with true colour:
|
|
|
|
@code
|
|
|
|
if (wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32)
|
|
|
|
@endcode
|
2008-11-08 10:17:16 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_FLAT}
|
2008-05-20 03:48:30 -04:00
|
|
|
Gives the toolbar a flat look (Windows and GTK only).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_DOCKABLE}
|
2008-05-20 03:48:30 -04:00
|
|
|
Makes the toolbar floatable and dockable (GTK only).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_HORIZONTAL}
|
2008-05-20 03:48:30 -04:00
|
|
|
Specifies horizontal layout (default).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_VERTICAL}
|
2008-05-20 03:48:30 -04:00
|
|
|
Specifies vertical layout.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_TEXT}
|
2008-05-20 03:48:30 -04:00
|
|
|
Shows the text in the toolbar buttons; by default only icons are shown.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_NOICONS}
|
2008-05-20 03:48:30 -04:00
|
|
|
Specifies no icons in the toolbar buttons; by default they are shown.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_NODIVIDER}
|
2008-05-20 03:48:30 -04:00
|
|
|
Specifies no divider (border) above the toolbar (Windows only)
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_NOALIGN}
|
2008-05-20 03:48:30 -04:00
|
|
|
Specifies no alignment with the parent window (Windows only, not very
|
|
|
|
useful).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_HORZ_LAYOUT}
|
2008-05-20 03:48:30 -04:00
|
|
|
Shows the text and the icons alongside, not vertically stacked (Windows
|
|
|
|
and GTK 2 only). This style must be used with @c wxTB_TEXT.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_HORZ_TEXT}
|
2008-05-20 03:48:30 -04:00
|
|
|
Combination of @c wxTB_HORZ_LAYOUT and @c wxTB_TEXT.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_NO_TOOLTIPS}
|
2008-05-20 03:48:30 -04:00
|
|
|
Don't show the short help tooltips for the tools when the mouse hovers
|
|
|
|
over them.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_BOTTOM}
|
2008-05-20 03:48:30 -04:00
|
|
|
Align the toolbar at the bottom of parent window.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTB_RIGHT}
|
2008-05-20 03:48:30 -04:00
|
|
|
Align the toolbar at the right side of parent window.
|
2008-03-08 08:52:38 -05:00
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-11-22 10:53:10 -05:00
|
|
|
See also @ref overview_windowstyles. Note that the wxMSW native toolbar
|
2008-05-20 03:48:30 -04:00
|
|
|
ignores @c wxTB_NOICONS style. Also, toggling the @c wxTB_TEXT works only
|
|
|
|
if the style was initially on.
|
|
|
|
|
|
|
|
@beginEventTable{wxCommandEvent}
|
|
|
|
@event{EVT_TOOL(id, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_TOOL_CLICKED event (a synonym for @c
|
|
|
|
wxEVT_COMMAND_MENU_SELECTED). Pass the id of the tool.
|
|
|
|
@event{EVT_MENU(id, func)}
|
|
|
|
The same as EVT_TOOL().
|
|
|
|
@event{EVT_TOOL_RANGE(id1, id2, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_TOOL_CLICKED event for a range of
|
|
|
|
identifiers. Pass the ids of the tools.
|
|
|
|
@event{EVT_MENU_RANGE(id1, id2, func)}
|
|
|
|
The same as EVT_TOOL_RANGE().
|
|
|
|
@event{EVT_TOOL_RCLICKED(id, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_TOOL_RCLICKED event. Pass the id of the
|
|
|
|
tool.
|
|
|
|
@event{EVT_TOOL_RCLICKED_RANGE(id1, id2, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_TOOL_RCLICKED event for a range of ids. Pass
|
|
|
|
the ids of the tools.
|
|
|
|
@event{EVT_TOOL_ENTER(id, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_TOOL_ENTER event. Pass the id of the toolbar
|
|
|
|
itself. The value of wxCommandEvent::GetSelection() is the tool id, or
|
|
|
|
-1 if the mouse cursor has moved off a tool.
|
|
|
|
@event{EVT_TOOL_DROPDOWN(id, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED event. If unhandled,
|
|
|
|
displays the default dropdown menu set using
|
|
|
|
wxToolBar::SetDropdownMenu().
|
|
|
|
@endEventTable
|
2008-11-08 10:17:16 -05:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
The toolbar class emits menu commands in the same way that a frame menubar
|
|
|
|
does, so you can use one EVT_MENU() macro for both a menu item and a toolbar
|
|
|
|
button. The event handler functions take a wxCommandEvent argument. For most
|
|
|
|
event macros, the identifier of the tool is passed, but for EVT_TOOL_ENTER()
|
|
|
|
the toolbar window identifier is passed and the tool identifier is retrieved
|
2008-11-22 10:53:10 -05:00
|
|
|
from the wxCommandEvent. This is because the identifier may be @c wxID_ANY when the
|
|
|
|
mouse moves off a tool, and @c wxID_ANY is not allowed as an identifier in the event
|
2008-05-20 03:48:30 -04:00
|
|
|
system.
|
|
|
|
|
|
|
|
@library{wxcore}
|
2008-03-08 08:52:38 -05:00
|
|
|
@category{miscwnd}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-17 03:06:20 -04:00
|
|
|
@see @ref overview_toolbar
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxToolBar : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
2008-05-20 03:48:30 -04:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxToolBar();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructs a toolbar.
|
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
|
|
|
Pointer to a parent window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Window identifier. If -1, will automatically create an identifier.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-11-22 10:53:10 -05:00
|
|
|
Window position. ::wxDefaultPosition indicates that wxWidgets should
|
|
|
|
generate a default position for the window.
|
|
|
|
If using the wxWindow class directly, supply an actual position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-11-22 10:53:10 -05:00
|
|
|
Window size. ::wxDefaultSize indicates that wxWidgets should generate
|
|
|
|
a default size for the window.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-11-22 10:53:10 -05:00
|
|
|
Window style. See wxToolBar initial description for details.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
@remarks After a toolbar is created, you use AddTool() and perhaps
|
2008-11-22 10:53:10 -05:00
|
|
|
AddSeparator(), and then you must call Realize() to construct
|
|
|
|
and display the toolbar tools.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxToolBar(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-03-09 08:33:59 -04:00
|
|
|
long style = wxTB_HORIZONTAL | wxBORDER_NONE,
|
2008-11-08 10:17:16 -05:00
|
|
|
const wxString& name = wxToolBarNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Toolbar destructor.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxToolBar();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Adds a new check (or toggle) tool to the toolbar. The parameters are the
|
|
|
|
same as in AddTool().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
wxToolBarToolBase* AddCheckTool(int toolId, const wxString& label,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxBitmap& bitmap1,
|
2008-10-28 11:36:26 -04:00
|
|
|
const wxBitmap& bmpDisabled = wxNullBitmap,
|
|
|
|
const wxString& shortHelp = wxEmptyString,
|
|
|
|
const wxString& longHelp = wxEmptyString,
|
2008-03-09 08:33:59 -04:00
|
|
|
wxObject* clientData = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Adds any control to the toolbar, typically e.g. a wxComboBox.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param control
|
2008-03-09 08:33:59 -04:00
|
|
|
The control to be added.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param label
|
2008-03-09 08:33:59 -04:00
|
|
|
Text to be displayed near the control.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
@remarks
|
|
|
|
wxMSW: the label is only displayed if there is enough space
|
|
|
|
available below the embedded control.
|
|
|
|
|
|
|
|
@remarks
|
|
|
|
wxMac: labels are only displayed if wxWidgets is built with @c
|
|
|
|
wxMAC_USE_NATIVE_TOOLBAR set to 1
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
virtual wxToolBarToolBase* AddControl(wxControl* control,
|
|
|
|
const wxString& label = wxEmptyString);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Adds a new radio tool to the toolbar. Consecutive radio tools form a
|
|
|
|
radio group such that exactly one button in the group is pressed at any
|
|
|
|
moment, in other words whenever a button in the group is pressed the
|
|
|
|
previously pressed button is automatically released. You should avoid
|
|
|
|
having the radio groups of only one element as it would be impossible
|
|
|
|
for the user to use such button.
|
2008-11-08 10:17:16 -05:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
By default, the first button in the radio group is initially pressed,
|
|
|
|
the others are not.
|
|
|
|
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
wxToolBarToolBase* AddRadioTool(int toolId, const wxString& label,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxBitmap& bitmap1,
|
2008-10-28 11:36:26 -04:00
|
|
|
const wxBitmap& bmpDisabled = wxNullBitmap,
|
|
|
|
const wxString& shortHelp = wxEmptyString,
|
|
|
|
const wxString& longHelp = wxEmptyString,
|
2008-03-09 08:33:59 -04:00
|
|
|
wxObject* clientData = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a separator for spacing groups of tools.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-11-22 10:53:10 -05:00
|
|
|
Note that the meaning of a "separator" is a vertical line under wxMSW and
|
|
|
|
a simple space under wxGTK.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddTool(), SetToolSeparation()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
virtual wxToolBarToolBase* AddSeparator();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-11-23 12:45:16 -05:00
|
|
|
//@{
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-06-27 02:31:46 -04:00
|
|
|
Adds a tool to the toolbar.
|
|
|
|
|
|
|
|
@param tool
|
|
|
|
The tool to be added.
|
|
|
|
|
|
|
|
@remarks After you have added tools to a toolbar, you must call
|
|
|
|
Realize() in order to have the tools appear.
|
|
|
|
|
|
|
|
@see AddSeparator(), AddCheckTool(), AddRadioTool(),
|
|
|
|
InsertTool(), DeleteTool(), Realize(), SetDropdownMenu()
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxToolBarToolBase* AddTool(wxToolBarToolBase* tool);
|
2008-06-27 02:31:46 -04:00
|
|
|
|
|
|
|
/**
|
2008-11-08 10:17:16 -05:00
|
|
|
Adds a tool to the toolbar. This most commonly used version has fewer
|
2008-06-27 02:31:46 -04:00
|
|
|
parameters than the full version below which specifies the more rarely
|
|
|
|
used button features.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-05-20 03:48:30 -04:00
|
|
|
An integer by which the tool may be identified in subsequent
|
|
|
|
operations.
|
2008-11-08 10:17:16 -05:00
|
|
|
@param label
|
2008-06-27 02:31:46 -04:00
|
|
|
The string to be displayed with the tool.
|
|
|
|
@param bitmap
|
|
|
|
The primary tool bitmap.
|
|
|
|
@param shortHelp
|
|
|
|
This string is used for the tools tooltip.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param kind
|
2008-05-20 03:48:30 -04:00
|
|
|
May be ::wxITEM_NORMAL for a normal button (default), ::wxITEM_CHECK
|
|
|
|
for a checkable tool (such tool stays pressed after it had been
|
|
|
|
toggled) or ::wxITEM_RADIO for a checkable tool which makes part of
|
2008-11-08 10:17:16 -05:00
|
|
|
a radio group of tools each of which is automatically unchecked
|
2008-05-21 03:34:47 -04:00
|
|
|
whenever another button in the group is checked. ::wxITEM_DROPDOWN
|
|
|
|
specifies that a drop-down menu button will appear next to the
|
|
|
|
tool button (only GTK+ and MSW). Call SetDropdownMenu() afterwards.
|
2008-06-27 02:31:46 -04:00
|
|
|
|
|
|
|
@remarks After you have added tools to a toolbar, you must call
|
|
|
|
Realize() in order to have the tools appear.
|
|
|
|
|
|
|
|
@see AddSeparator(), AddCheckTool(), AddRadioTool(),
|
|
|
|
InsertTool(), DeleteTool(), Realize(), SetDropdownMenu()
|
|
|
|
*/
|
|
|
|
wxToolBarToolBase* AddTool(int toolId, const wxString& label,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxString& shortHelp = wxEmptyString,
|
|
|
|
wxItemKind kind = wxITEM_NORMAL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds a tool to the toolbar.
|
|
|
|
|
|
|
|
@param toolId
|
|
|
|
An integer by which the tool may be identified in subsequent
|
|
|
|
operations.
|
2008-11-08 10:17:16 -05:00
|
|
|
@param label
|
2008-06-27 02:31:46 -04:00
|
|
|
The string to be displayed with the tool.
|
|
|
|
@param bitmap
|
2008-03-09 08:33:59 -04:00
|
|
|
The primary tool bitmap.
|
2008-06-27 02:31:46 -04:00
|
|
|
@param bmpDisabled
|
2008-03-09 08:33:59 -04:00
|
|
|
The bitmap used when the tool is disabled. If it is equal to
|
2008-11-08 10:17:16 -05:00
|
|
|
::wxNullBitmap (default), the disabled bitmap is automatically
|
2008-06-27 02:31:46 -04:00
|
|
|
generated by greying the normal one.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param shortHelpString
|
2008-05-20 03:48:30 -04:00
|
|
|
This string is used for the tools tooltip.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param longHelpString
|
2008-05-20 03:48:30 -04:00
|
|
|
This string is shown in the statusbar (if any) of the parent frame
|
|
|
|
when the mouse pointer is inside the tool.
|
2008-06-27 02:31:46 -04:00
|
|
|
@param kind
|
|
|
|
May be ::wxITEM_NORMAL for a normal button (default), ::wxITEM_CHECK
|
|
|
|
for a checkable tool (such tool stays pressed after it had been
|
|
|
|
toggled) or ::wxITEM_RADIO for a checkable tool which makes part of
|
2008-11-08 10:17:16 -05:00
|
|
|
a radio group of tools each of which is automatically unchecked
|
2008-06-27 02:31:46 -04:00
|
|
|
whenever another button in the group is checked. ::wxITEM_DROPDOWN
|
|
|
|
specifies that a drop-down menu button will appear next to the
|
|
|
|
tool button (only GTK+ and MSW). Call SetDropdownMenu() afterwards.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param clientData
|
2008-05-20 03:48:30 -04:00
|
|
|
An optional pointer to client data which can be retrieved later
|
|
|
|
using GetToolClientData().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks After you have added tools to a toolbar, you must call
|
2008-05-20 03:48:30 -04:00
|
|
|
Realize() in order to have the tools appear.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddSeparator(), AddCheckTool(), AddRadioTool(),
|
2008-05-21 03:34:47 -04:00
|
|
|
InsertTool(), DeleteTool(), Realize(), SetDropdownMenu()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxToolBarToolBase* AddTool(int toolId, const wxString& label,
|
2008-06-27 02:31:46 -04:00
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxBitmap& bmpDisabled = wxNullBitmap,
|
2008-03-08 09:43:31 -05:00
|
|
|
wxItemKind kind = wxITEM_NORMAL,
|
2008-06-27 02:31:46 -04:00
|
|
|
const wxString& shortHelpString = wxEmptyString,
|
|
|
|
const wxString& longHelpString = wxEmptyString,
|
2008-03-09 08:33:59 -04:00
|
|
|
wxObject* clientData = NULL);
|
2008-11-23 12:45:16 -05:00
|
|
|
//@}
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Deletes all the tools in the toolbar.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void ClearTools();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Removes the specified tool from the toolbar and deletes it. If you don't
|
|
|
|
want to delete the tool, but just to remove it from the toolbar (to
|
|
|
|
possibly add it back later), you may use RemoveTool() instead.
|
|
|
|
|
|
|
|
@note It is unnecessary to call Realize() for the change to take
|
|
|
|
place, it will happen immediately.
|
|
|
|
|
|
|
|
@returns @true if the tool was deleted, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see DeleteToolByPos()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool DeleteTool(int toolId);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
This function behaves like DeleteTool() but it deletes the tool at the
|
|
|
|
specified position and not the one with the given id.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool DeleteToolByPos(size_t pos);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Enables or disables the tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
Tool to enable or disable.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param enable
|
2008-03-09 08:33:59 -04:00
|
|
|
If @true, enables the tool, otherwise disables it.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks Some implementations will change the visible state of the tool
|
2008-05-20 03:48:30 -04:00
|
|
|
to indicate that it is disabled.
|
|
|
|
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolEnabled(), ToggleTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void EnableTool(int toolId, bool enable);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Returns a pointer to the tool identified by @a id or @NULL if no
|
|
|
|
corresponding tool is found.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
wxToolBarToolBase* FindById(int id) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Returns a pointer to the control identified by @a id or @NULL if no
|
|
|
|
corresponding control is found.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxControl* FindControl(int id);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Finds a tool for the given mouse position.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x
|
2008-03-09 08:33:59 -04:00
|
|
|
X position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param y
|
2008-03-09 08:33:59 -04:00
|
|
|
Y position.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return A pointer to a tool if a tool is found, or @NULL otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
@remarks Currently not implemented in wxGTK (always returns @NULL
|
|
|
|
there).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxToolBarToolBase* FindToolForPosition(wxCoord x, wxCoord y) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the left/right and top/bottom margins, which are also used for
|
|
|
|
inter-toolspacing.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetMargins()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxSize GetMargins() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Returns the size of bitmap that the toolbar expects to have. The default
|
|
|
|
bitmap size is 16 by 15 pixels.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
@remarks Note that this is the size of the bitmap you pass to AddTool(),
|
|
|
|
and not the eventual size of the tool button.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetToolBitmapSize(), GetToolSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxSize GetToolBitmapSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get any client data associated with the tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
Id of the tool, as passed to AddTool().
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return Client data, or @NULL if there is none.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxObject* GetToolClientData(int toolId) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Called to determine whether a tool is enabled (responds to user input).
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
Id of the tool in question.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return @true if the tool is enabled, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see EnableTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool GetToolEnabled(int toolId) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the long help for the given tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The tool in question.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetToolLongHelp(), SetToolShortHelp()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxString GetToolLongHelp(int toolId) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the value used for packing tools.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetToolPacking()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetToolPacking() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Returns the tool position in the toolbar, or @c wxNOT_FOUND if the tool
|
|
|
|
is not found.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetToolPos(int toolId) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the default separator size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetToolSeparation()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual int GetToolSeparation() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the short help for the given tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The tool in question.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolLongHelp(), SetToolShortHelp()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxString GetToolShortHelp(int toolId) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Returns the size of a whole button, which is usually larger than a tool
|
|
|
|
bitmap because of added 3D effects.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetToolBitmapSize(), GetToolBitmapSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxSize GetToolSize() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the on/off state of a toggle tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The tool in question.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return @true if the tool is toggled on, @false otherwise.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see ToggleTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool GetToolState(int toolId) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the number of tools in the toolbar.
|
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
size_t GetToolsCount() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Inserts the control into the toolbar at the given position. You must
|
|
|
|
call Realize() for the change to take place.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddControl(), InsertTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
virtual wxToolBarToolBase* InsertControl(size_t pos, wxControl* control,
|
|
|
|
const wxString& label = wxEmptyString);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Inserts the separator into the toolbar at the given position. You must
|
|
|
|
call Realize() for the change to take place.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddSeparator(), InsertTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxToolBarToolBase* InsertSeparator(size_t pos);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Inserts the tool with the specified attributes into the toolbar at the
|
|
|
|
given position.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
You must call Realize() for the change to take place.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddTool(), InsertControl(), InsertSeparator()
|
|
|
|
*/
|
|
|
|
wxToolBarToolBase* InsertTool(size_t pos, int toolId,
|
|
|
|
const wxBitmap& bitmap1,
|
|
|
|
const wxBitmap& bitmap2 = wxNullBitmap,
|
|
|
|
bool isToggle = false,
|
|
|
|
wxObject* clientData = NULL,
|
2008-11-23 12:45:16 -05:00
|
|
|
const wxString& shortHelpString = wxEmptyString,
|
|
|
|
const wxString& longHelpString = wxEmptyString);
|
2008-03-09 08:33:59 -04:00
|
|
|
wxToolBarToolBase* InsertTool(size_t pos,
|
|
|
|
wxToolBarToolBase* tool);
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Called when the user clicks on a tool with the left mouse button. This
|
|
|
|
is the old way of detecting tool clicks; although it will still work,
|
|
|
|
you should use the EVT_MENU() or EVT_TOOL() macro instead.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The identifier passed to AddTool().
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toggleDown
|
2008-05-20 03:48:30 -04:00
|
|
|
@true if the tool is a toggle and the toggle is down, otherwise is
|
|
|
|
@false.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return If the tool is a toggle and this function returns @false, the
|
2008-05-20 03:48:30 -04:00
|
|
|
toggle state (internal and visual) will not be changed. This
|
|
|
|
provides a way of specifying that toggle operations are not
|
|
|
|
permitted in some circumstances.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see OnMouseEnter(), OnRightClick()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool OnLeftClick(int toolId, bool toggleDown);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
This is called when the mouse cursor moves into a tool or out of the
|
|
|
|
toolbar. This is the old way of detecting mouse enter events;
|
|
|
|
although it will still work, you should use the EVT_TOOL_ENTER()
|
|
|
|
macro instead.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-05-20 03:48:30 -04:00
|
|
|
Greater than -1 if the mouse cursor has moved into the tool, or -1
|
|
|
|
if the mouse cursor has moved. The programmer can override this to
|
|
|
|
provide extra information about the tool, such as a short
|
|
|
|
description on the status line.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks With some derived toolbar classes, if the mouse moves quickly
|
2008-05-20 03:48:30 -04:00
|
|
|
out of the toolbar, wxWidgets may not be able to detect it.
|
|
|
|
Therefore this function may not always be called when expected.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void OnMouseEnter(int toolId);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
@deprecated This is the old way of detecting tool right clicks;
|
|
|
|
although it will still work, you should use the
|
|
|
|
EVT_TOOL_RCLICKED() macro instead.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Called when the user clicks on a tool with the right mouse button. The
|
|
|
|
programmer should override this function to detect right tool clicks.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The identifier passed to AddTool().
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x
|
2008-03-09 08:33:59 -04:00
|
|
|
The x position of the mouse cursor.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param y
|
2008-03-09 08:33:59 -04:00
|
|
|
The y position of the mouse cursor.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks A typical use of this member might be to pop up a menu.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see OnMouseEnter(), OnLeftClick()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-28 11:36:26 -04:00
|
|
|
virtual void OnRightClick(int toolId, long x, long y);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
This function should be called after you have added tools.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool Realize();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Removes the given tool from the toolbar but doesn't delete it. This
|
|
|
|
allows to insert/add this tool back to this (or another) toolbar later.
|
|
|
|
|
|
|
|
@note It is unnecessary to call Realize() for the change to take place,
|
|
|
|
it will happen immediately.
|
|
|
|
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see DeleteTool()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxToolBarToolBase* RemoveTool(int id);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Sets the bitmap resource identifier for specifying tool bitmaps as
|
|
|
|
indices into a custom bitmap. Windows CE only.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetBitmapResource(int resourceId);
|
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Sets the dropdown menu for the tool given by its @e id. The tool itself
|
2008-05-21 03:34:47 -04:00
|
|
|
will delete the menu when it's no longer needed. Only supported under
|
|
|
|
GTK+ und MSW.
|
2008-05-20 03:48:30 -04:00
|
|
|
|
|
|
|
If you define a EVT_TOOL_DROPDOWN() handler in your program, you must
|
|
|
|
call wxEvent::Skip() from it or the menu won't be displayed.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool SetDropdownMenu(int id, wxMenu* menu);
|
|
|
|
|
2008-11-23 12:45:16 -05:00
|
|
|
//@{
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Set the values to be used as margins for the toolbar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x
|
2008-03-09 08:33:59 -04:00
|
|
|
Left margin, right margin and inter-tool separation value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param y
|
2008-03-09 08:33:59 -04:00
|
|
|
Top margin, bottom margin and inter-tool separation value.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks This must be called before the tools are added if absolute
|
2008-05-20 03:48:30 -04:00
|
|
|
positioning is to be used, and the default (zero-size) margins are
|
|
|
|
to be overridden.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-06-27 02:31:46 -04:00
|
|
|
@see GetMargins()
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetMargins(int x, int y);
|
2008-06-27 02:31:46 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set the margins for the toolbar.
|
|
|
|
|
|
|
|
@param size
|
|
|
|
Margin size.
|
|
|
|
|
|
|
|
@remarks This must be called before the tools are added if absolute
|
|
|
|
positioning is to be used, and the default (zero-size) margins are
|
|
|
|
to be overridden.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetMargins(), wxSize
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetMargins(const wxSize& size);
|
2008-11-23 12:45:16 -05:00
|
|
|
//@}
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Sets the default size of each tool bitmap. The default bitmap size is 16
|
|
|
|
by 15 pixels.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
The size of the bitmaps in the toolbar.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks This should be called to tell the toolbar what the tool bitmap
|
2008-05-20 03:48:30 -04:00
|
|
|
size is. Call it before you add tools.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolBitmapSize(), GetToolSize()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolBitmapSize(const wxSize& size);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the client data associated with the tool.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolClientData(int id, wxObject* clientData);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the bitmap to be used by the tool with the given ID when the tool
|
2008-05-20 03:48:30 -04:00
|
|
|
is in a disabled state. This can only be used on Button tools, not
|
|
|
|
controls.
|
|
|
|
|
|
|
|
@note The native toolbar classes on the main platforms all synthesize
|
|
|
|
the disabled bitmap from the normal bitmap, so this function will
|
|
|
|
have no effect on those platforms.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the long help for the given tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The tool in question.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param helpString
|
2008-03-09 08:33:59 -04:00
|
|
|
A string for the long help.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks You might use the long help for displaying the tool purpose on
|
2008-05-20 03:48:30 -04:00
|
|
|
the status line.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolLongHelp(), SetToolShortHelp(),
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolLongHelp(int toolId, const wxString& helpString);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-20 03:48:30 -04:00
|
|
|
Sets the bitmap to be used by the tool with the given ID. This can only
|
|
|
|
be used on Button tools, not controls.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the value used for spacing tools. The default value is 1.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param packing
|
2008-03-09 08:33:59 -04:00
|
|
|
The value for packing.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-11-08 10:17:16 -05:00
|
|
|
@remarks The packing is used for spacing in the vertical direction if
|
2008-05-20 03:48:30 -04:00
|
|
|
the toolbar is horizontal, and for spacing in the horizontal
|
|
|
|
direction if the toolbar is vertical.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolPacking()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolPacking(int packing);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the default separator size. The default value is 5.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param separation
|
2008-03-09 08:33:59 -04:00
|
|
|
The separator size.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see AddSeparator()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolSeparation(int separation);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the short help for the given tool.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
The tool in question.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param helpString
|
2008-03-09 08:33:59 -04:00
|
|
|
The string for the short help.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@remarks An application might use short help for identifying the tool
|
2008-05-20 03:48:30 -04:00
|
|
|
purpose in a tooltip.
|
|
|
|
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetToolShortHelp(), SetToolLongHelp()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetToolShortHelp(int toolId, const wxString& helpString);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Toggles a tool on or off. This does not cause any event to get emitted.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toolId
|
2008-03-09 08:33:59 -04:00
|
|
|
Tool in question.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param toggle
|
2008-03-09 08:33:59 -04:00
|
|
|
If @true, toggles the tool on, otherwise toggles it off.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-05-20 03:48:30 -04:00
|
|
|
@remarks Only applies to a tool that has been specified as a toggle
|
|
|
|
tool.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void ToggleTool(int toolId, bool toggle);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|