@code
if (wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32)
@endcode
-
+
There are several different types of tools you can add to a toolbar. These
types are controlled by the ::wxItemKind enumeration.
displays the default dropdown menu set using
wxToolBar::SetDropdownMenu().
@endEventTable
-
+
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
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTB_HORIZONTAL | wxBORDER_NONE,
- const wxString& name = wxPanelNameStr);
+ const wxString& name = wxToolBarNameStr);
/**
Toolbar destructor.
@see AddTool()
*/
- wxToolBarToolBase* AddCheckTool(int toolId,
- const wxString& label,
+ wxToolBarToolBase* AddCheckTool(int toolId, const wxString& label,
const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- const wxString& shortHelpString = "",
- const wxString& longHelpString = "",
+ const wxBitmap& bmpDisabled = wxNullBitmap,
+ const wxString& shortHelp = wxEmptyString,
+ const wxString& longHelp = wxEmptyString,
wxObject* clientData = NULL);
/**
wxMac: labels are only displayed if wxWidgets is built with @c
wxMAC_USE_NATIVE_TOOLBAR set to 1
*/
- bool AddControl(wxControl* control, const wxString label = "");
+ virtual wxToolBarToolBase* AddControl(wxControl* control,
+ const wxString& label = wxEmptyString);
/**
Adds a new radio tool to the toolbar. Consecutive radio tools form a
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.
-
+
By default, the first button in the radio group is initially pressed,
the others are not.
@see AddTool()
*/
- wxToolBarToolBase* AddRadioTool(int toolId,
- const wxString& label,
+ wxToolBarToolBase* AddRadioTool(int toolId, const wxString& label,
const wxBitmap& bitmap1,
- const wxBitmap& bitmap2,
- const wxString& shortHelpString = "",
- const wxString& longHelpString = "",
+ const wxBitmap& bmpDisabled = wxNullBitmap,
+ const wxString& shortHelp = wxEmptyString,
+ const wxString& longHelp = wxEmptyString,
wxObject* clientData = NULL);
/**
@see AddTool(), SetToolSeparation()
*/
- void AddSeparator();
+ virtual wxToolBarToolBase* AddSeparator();
/**
Adds a tool to the toolbar.
virtual wxToolBarToolBase* AddTool(wxToolBarToolBase* tool);
/**
- Adds a tool to the toolbar. This most commonly used version has fewer
+ Adds a tool to the toolbar. This most commonly used version has fewer
parameters than the full version below which specifies the more rarely
used button features.
@param toolId
An integer by which the tool may be identified in subsequent
operations.
- @param label
+ @param label
The string to be displayed with the tool.
@param bitmap
The primary tool bitmap.
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
- a radio group of tools each of which is automatically unchecked
+ a radio group of tools each of which is automatically unchecked
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.
@param toolId
An integer by which the tool may be identified in subsequent
operations.
- @param label
+ @param label
The string to be displayed with the tool.
@param bitmap
The primary tool bitmap.
@param bmpDisabled
The bitmap used when the tool is disabled. If it is equal to
- ::wxNullBitmap (default), the disabled bitmap is automatically
+ ::wxNullBitmap (default), the disabled bitmap is automatically
generated by greying the normal one.
@param shortHelpString
This string is used for the tools tooltip.
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
- a radio group of tools each of which is automatically unchecked
+ a radio group of tools each of which is automatically unchecked
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.
/**
Returns the number of tools in the toolbar.
*/
- int GetToolsCount() const;
+ size_t GetToolsCount() const;
/**
Inserts the control into the toolbar at the given position. You must
@see AddControl(), InsertTool()
*/
- wxToolBarToolBase* InsertControl(size_t pos, wxControl* control);
+ virtual wxToolBarToolBase* InsertControl(size_t pos, wxControl* control,
+ const wxString& label = wxEmptyString);
/**
Inserts the separator into the toolbar at the given position. You must
@see OnMouseEnter(), OnLeftClick()
*/
- void OnRightClick(int toolId, float x, float y);
+ virtual void OnRightClick(int toolId, long x, long y);
/**
This function should be called after you have added tools.
@param packing
The value for packing.
- @remarks The packing is used for spacing in the vertical direction if
+ @remarks The packing is used for spacing in the vertical direction if
the toolbar is horizontal, and for spacing in the horizontal
direction if the toolbar is vertical.