#include </home/zeitlin/src/wx/github/interface/wx/ribbon/toolbar.h>
A ribbon tool bar is similar to a traditional toolbar which has no labels.
It contains one or more tool groups, each of which contains one or more tools. Each tool is represented by a (generally small, i.e. 16x15) bitmap.
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
Public Member Functions | |
wxRibbonToolBar () | |
Default constructor. | |
wxRibbonToolBar (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) | |
Construct a ribbon tool bar with the given parameters. | |
virtual | ~wxRibbonToolBar () |
Destructor. | |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) |
Create a tool bar in two-step tool bar construction. | |
virtual wxRibbonToolBarToolBase * | AddTool (int tool_id, const wxBitmap &bitmap, const wxString &help_string, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL) |
Add a tool to the tool bar (simple version). | |
virtual wxRibbonToolBarToolBase * | AddDropdownTool (int tool_id, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Add a dropdown tool to the tool bar (simple version). | |
virtual wxRibbonToolBarToolBase * | AddHybridTool (int tool_id, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Add a hybrid tool to the tool bar (simple version). | |
virtual wxRibbonToolBarToolBase * | AddToggleTool (int tool_id, const wxBitmap &bitmap, const wxString &help_string) |
Add a toggle tool to the tool bar (simple version). | |
virtual wxRibbonToolBarToolBase * | AddTool (int tool_id, const wxBitmap &bitmap, const wxBitmap &bitmap_disabled=wxNullBitmap, const wxString &help_string=wxEmptyString, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL, wxObject *client_data=NULL) |
Add a tool to the tool bar. | |
virtual wxRibbonToolBarToolBase * | AddSeparator () |
Add a separator to the tool bar. | |
virtual wxRibbonToolBarToolBase * | InsertTool (size_t pos, int tool_id, const wxBitmap &bitmap, const wxString &help_string, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL) |
Insert a tool to the tool bar (simple version) as the specified position. | |
virtual wxRibbonToolBarToolBase * | InsertDropdownTool (size_t pos, int tool_id, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Insert a dropdown tool to the tool bar (simple version) as the specified position. | |
virtual wxRibbonToolBarToolBase * | InsertHybridTool (size_t pos, int tool_id, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Insert a hybrid tool to the tool bar (simple version) as the specified position. | |
virtual wxRibbonToolBarToolBase * | InsertToggleTool (size_t pos, int tool_id, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Insert a toggle tool to the tool bar (simple version) as the specified position. | |
virtual wxRibbonToolBarToolBase * | InsertTool (size_t pos, int tool_id, const wxBitmap &bitmap, const wxBitmap &bitmap_disabled=wxNullBitmap, const wxString &help_string=wxEmptyString, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL, wxObject *client_data=NULL) |
Insert a tool to the tool bar at the specified position. | |
virtual wxRibbonToolBarToolBase * | InsertSeparator (size_t pos) |
Insert a separator to the tool bar at the specified position. | |
virtual void | ClearTools () |
Deletes all the tools in the toolbar. | |
virtual bool | DeleteTool (int tool_id) |
Removes the specified tool from the toolbar and deletes it. | |
virtual bool | DeleteToolByPos (size_t pos) |
This function behaves like DeleteTool() but it deletes the tool at the specified position and not the one with the given id. | |
virtual wxRibbonToolBarToolBase * | FindById (int tool_id) const |
Returns a pointer to the tool opaque structure by id or NULL if no corresponding tool is found. | |
wxRibbonToolBarToolBase * | GetToolByPos (size_t pos) const virtual size_t GetToolCount() const |
Return the opaque pointer corresponding to the given tool. | |
virtual int | GetToolId (const wxRibbonToolBarToolBase *tool) const |
Return the id assciated to the tool opaque structure. | |
virtual wxObject * | GetToolClientData (int tool_id) const |
Get any client data associated with the tool. | |
virtual bool | GetToolEnabled (int tool_id) const |
Called to determine whether a tool is enabled (responds to user input). | |
virtual wxString | GetToolHelpString (int tool_id) const |
Returns the help string for the given tool. | |
virtual wxRibbonButtonKind | GetToolKind (int tool_id) const |
Return the kind of the given tool. | |
virtual int | GetToolPos (int tool_id) const |
Returns the tool position in the toolbar, or wxNOT_FOUND if the tool is not found. | |
virtual bool | GetToolState (int tool_id) const |
Gets the on/off state of a toggle tool. | |
virtual bool | Realize () |
Calculate tool layouts and positions. | |
virtual void | SetRows (int nMin, int nMax=-1) |
Set the number of rows to distribute tool groups over. | |
virtual void | SetToolClientData (int tool_id, wxObject *clientData) |
Sets the client data associated with the tool. | |
virtual void | SetToolDisabledBitmap (int tool_id, const wxBitmap &bitmap) |
Sets the bitmap to be used by the tool with the given ID when the tool is in a disabled state. | |
virtual void | SetToolHelpString (int tool_id, const wxString &helpString) |
Sets the help string shown in tooltip for the given tool. | |
virtual void | SetToolNormalBitmap (int tool_id, const wxBitmap &bitmap) |
Sets the bitmap to be used by the tool with the given ID. | |
virtual void | EnableTool (int tool_id, bool enable=true) |
Enable or disable a single tool on the bar. | |
virtual void | ToggleTool (int tool_id, bool checked) |
Set a toggle tool to the checked or unchecked state. |
wxRibbonToolBar::wxRibbonToolBar | ( | ) |
Default constructor.
With this constructor, Create() should be called in order to create the tool bar.
wxRibbonToolBar::wxRibbonToolBar | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = 0 |
||
) |
Construct a ribbon tool bar with the given parameters.
parent | Parent window for the tool bar (typically a wxRibbonPanel). |
id | An identifier for the toolbar. wxID_ANY is taken to mean a default. |
pos | Initial position of the tool bar. |
size | Initial size of the tool bar. |
style | Tool bar style, currently unused. |
virtual wxRibbonToolBar::~wxRibbonToolBar | ( | ) | [virtual] |
Destructor.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::AddDropdownTool | ( | int | tool_id, |
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Add a dropdown tool to the tool bar (simple version).
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::AddHybridTool | ( | int | tool_id, |
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Add a hybrid tool to the tool bar (simple version).
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::AddSeparator | ( | ) | [virtual] |
Add a separator to the tool bar.
Separators are used to separate tools into groups. As such, a separator is not explicitly drawn, but is visually seen as the gap between tool groups.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::AddTool | ( | int | tool_id, |
const wxBitmap & | bitmap, | ||
const wxBitmap & | bitmap_disabled = wxNullBitmap , |
||
const wxString & | help_string = wxEmptyString , |
||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL , |
||
wxObject * | client_data = NULL |
||
) | [virtual] |
Add a tool to the tool bar.
tool_id | ID of the new tool (used for event callbacks). |
bitmap | Bitmap to use as the foreground for the new tool. Does not have to be the same size as other tool bitmaps, but should be similar as otherwise it will look visually odd. |
bitmap_disabled | Bitmap to use when the tool is disabled. If left as wxNullBitmap, then a bitmap will be automatically generated from bitmap. |
help_string | The UI help string to associate with the new tool. |
kind | The kind of tool to add. |
client_data | Client data to associate with the new tool. |
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::AddTool | ( | int | tool_id, |
const wxBitmap & | bitmap, | ||
const wxString & | help_string, | ||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL |
||
) | [virtual] |
Add a tool to the tool bar (simple version).
virtual void wxRibbonToolBar::ClearTools | ( | ) | [virtual] |
Deletes all the tools in the toolbar.
bool wxRibbonToolBar::Create | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = 0 |
||
) |
Create a tool bar in two-step tool bar construction.
Should only be called when the default constructor is used, and arguments have the same meaning as in the full constructor.
virtual bool wxRibbonToolBar::DeleteTool | ( | int | tool_id | ) | [virtual] |
Removes the specified tool from the toolbar and deletes it.
tool_id | ID of the tool to delete. |
virtual bool wxRibbonToolBar::DeleteToolByPos | ( | size_t | pos | ) | [virtual] |
This function behaves like DeleteTool() but it deletes the tool at the specified position and not the one with the given id.
Useful to delete separators.
virtual void wxRibbonToolBar::EnableTool | ( | int | tool_id, |
bool | enable = true |
||
) | [virtual] |
Enable or disable a single tool on the bar.
tool_id | ID of the tool to enable or disable. |
enable | true to enable the tool, false to disable it. |
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::FindById | ( | int | tool_id | ) | const [virtual] |
Returns a pointer to the tool opaque structure by id or NULL if no corresponding tool is found.
wxRibbonToolBarToolBase* wxRibbonToolBar::GetToolByPos | ( | size_t | pos | ) | const |
Return the opaque pointer corresponding to the given tool.
virtual wxObject* wxRibbonToolBar::GetToolClientData | ( | int | tool_id | ) | const [virtual] |
Get any client data associated with the tool.
toolId | ID of the tool in question, as passed to AddTool(). |
virtual bool wxRibbonToolBar::GetToolEnabled | ( | int | tool_id | ) | const [virtual] |
Called to determine whether a tool is enabled (responds to user input).
toolId | ID of the tool in question, as passed to AddTool(). |
virtual wxString wxRibbonToolBar::GetToolHelpString | ( | int | tool_id | ) | const [virtual] |
Returns the help string for the given tool.
toolId | ID of the tool in question, as passed to AddTool(). |
virtual int wxRibbonToolBar::GetToolId | ( | const wxRibbonToolBarToolBase * | tool | ) | const [virtual] |
Return the id assciated to the tool opaque structure.
The structure pointer must not be NULL.
virtual wxRibbonButtonKind wxRibbonToolBar::GetToolKind | ( | int | tool_id | ) | const [virtual] |
Return the kind of the given tool.
toolId | ID of the tool in question, as passed to AddTool(). |
virtual int wxRibbonToolBar::GetToolPos | ( | int | tool_id | ) | const [virtual] |
Returns the tool position in the toolbar, or wxNOT_FOUND
if the tool is not found.
toolId | ID of the tool in question, as passed to AddTool(). |
virtual bool wxRibbonToolBar::GetToolState | ( | int | tool_id | ) | const [virtual] |
Gets the on/off state of a toggle tool.
toolId | ID of the tool in question, as passed to AddTool(). |
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertDropdownTool | ( | size_t | pos, |
int | tool_id, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Insert a dropdown tool to the tool bar (simple version) as the specified position.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertHybridTool | ( | size_t | pos, |
int | tool_id, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Insert a hybrid tool to the tool bar (simple version) as the specified position.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertSeparator | ( | size_t | pos | ) | [virtual] |
Insert a separator to the tool bar at the specified position.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertToggleTool | ( | size_t | pos, |
int | tool_id, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Insert a toggle tool to the tool bar (simple version) as the specified position.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertTool | ( | size_t | pos, |
int | tool_id, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string, | ||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL |
||
) | [virtual] |
Insert a tool to the tool bar (simple version) as the specified position.
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertTool | ( | size_t | pos, |
int | tool_id, | ||
const wxBitmap & | bitmap, | ||
const wxBitmap & | bitmap_disabled = wxNullBitmap , |
||
const wxString & | help_string = wxEmptyString , |
||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL , |
||
wxObject * | client_data = NULL |
||
) | [virtual] |
Insert a tool to the tool bar at the specified position.
pos | Position of the new tool (number of tools and separators from the beginning of the toolbar). |
tool_id | ID of the new tool (used for event callbacks). |
bitmap | Bitmap to use as the foreground for the new tool. Does not have to be the same size as other tool bitmaps, but should be similar as otherwise it will look visually odd. |
bitmap_disabled | Bitmap to use when the tool is disabled. If left as wxNullBitmap, then a bitmap will be automatically generated from bitmap. |
help_string | The UI help string to associate with the new tool. |
kind | The kind of tool to add. |
client_data | Client data to associate with the new tool. |
virtual bool wxRibbonToolBar::Realize | ( | ) | [virtual] |
Calculate tool layouts and positions.
Must be called after tools are added to the tool bar, as otherwise the newly added tools will not be displayed.
Reimplemented from wxRibbonControl.
virtual void wxRibbonToolBar::SetRows | ( | int | nMin, |
int | nMax = -1 |
||
) | [virtual] |
Set the number of rows to distribute tool groups over.
Tool groups can be distributed over a variable number of rows. The way in which groups are assigned to rows is not specified, and the order of groups may change, but they will be distributed in such a way as to minimise the overall size of the tool bar.
nMin | The minimum number of rows to use. |
nMax | The maximum number of rows to use (defaults to nMin). |
virtual void wxRibbonToolBar::SetToolClientData | ( | int | tool_id, |
wxObject * | clientData | ||
) | [virtual] |
Sets the client data associated with the tool.
id | ID of the tool in question, as passed to AddTool(). |
virtual void wxRibbonToolBar::SetToolDisabledBitmap | ( | int | tool_id, |
const wxBitmap & | bitmap | ||
) | [virtual] |
Sets the bitmap to be used by the tool with the given ID when the tool is in a disabled state.
tool_id | ID of the tool in question, as passed to AddTool(). |
virtual void wxRibbonToolBar::SetToolHelpString | ( | int | tool_id, |
const wxString & | helpString | ||
) | [virtual] |
Sets the help string shown in tooltip for the given tool.
tool_Id | ID of the tool in question, as passed to AddTool(). |
helpString | A string for the help. |
virtual void wxRibbonToolBar::SetToolNormalBitmap | ( | int | tool_id, |
const wxBitmap & | bitmap | ||
) | [virtual] |
Sets the bitmap to be used by the tool with the given ID.
tool_id | ID of the tool in question, as passed to AddTool(). |
virtual void wxRibbonToolBar::ToggleTool | ( | int | tool_id, |
bool | checked | ||
) | [virtual] |
Set a toggle tool to the checked or unchecked state.
tool_id | ID of the toggle tool to manipulate. |
checked | true to set the tool to the toggled/pressed/checked state, false to set it to the untoggled/unpressed/unchecked state. |