Version: 2.9.4
Public Member Functions
wxRibbonToolBar Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/ribbon/toolbar.h>

Inheritance diagram for wxRibbonToolBar:

Detailed Description

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.

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxRibbonToolBarEvent& event)

Event macros for events emitted by this class:

Library:  wxRibbon
Category:  Ribbon User Interface

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 wxObjectGetToolClientData (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.

List of all members.


Constructor & Destructor Documentation

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.

Parameters:
parentParent window for the tool bar (typically a wxRibbonPanel).
idAn identifier for the toolbar. wxID_ANY is taken to mean a default.
posInitial position of the tool bar.
sizeInitial size of the tool bar.
styleTool bar style, currently unused.
virtual wxRibbonToolBar::~wxRibbonToolBar ( ) [virtual]

Destructor.


Member Function Documentation

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).

参照:
AddTool()
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).

参照:
AddTool()
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::AddToggleTool ( int  tool_id,
const wxBitmap bitmap,
const wxString help_string 
) [virtual]

Add a toggle tool to the tool bar (simple version).

Since:
2.9.4
参照:
AddTool()
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.

Parameters:
tool_idID of the new tool (used for event callbacks).
bitmapBitmap 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_disabledBitmap to use when the tool is disabled. If left as wxNullBitmap, then a bitmap will be automatically generated from bitmap.
help_stringThe UI help string to associate with the new tool.
kindThe kind of tool to add.
client_dataClient data to associate with the new tool.
Returns:
An opaque pointer which can be used only with other tool bar methods.
参照:
AddDropdownTool(), AddHybridTool(), AddSeparator(), InsertTool()
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.

Since:
2.9.4
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.

Parameters:
tool_idID of the tool to delete.
Returns:
true if the tool was deleted, false otherwise.
Since:
2.9.4
参照:
DeleteToolByPos()
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.

Since:
2.9.4
virtual void wxRibbonToolBar::EnableTool ( int  tool_id,
bool  enable = true 
) [virtual]

Enable or disable a single tool on the bar.

Parameters:
tool_idID of the tool to enable or disable.
enabletrue to enable the tool, false to disable it.
Since:
2.9.4
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.

Since:
2.9.4
wxRibbonToolBarToolBase* wxRibbonToolBar::GetToolByPos ( size_t  pos) const

Return the opaque pointer corresponding to the given tool.

Returns:
an opaque pointer, NULL if is a separator or not found.
Since:
2.9.4 Returns the number of tools in the toolbar.
2.9.4
virtual wxObject* wxRibbonToolBar::GetToolClientData ( int  tool_id) const [virtual]

Get any client data associated with the tool.

Parameters:
toolIdID of the tool in question, as passed to AddTool().
Returns:
Client data, or NULL if there is none.
Since:
2.9.4
virtual bool wxRibbonToolBar::GetToolEnabled ( int  tool_id) const [virtual]

Called to determine whether a tool is enabled (responds to user input).

Parameters:
toolIdID of the tool in question, as passed to AddTool().
Returns:
true if the tool is enabled, false otherwise.
Since:
2.9.4
参照:
EnableTool()
virtual wxString wxRibbonToolBar::GetToolHelpString ( int  tool_id) const [virtual]

Returns the help string for the given tool.

Parameters:
toolIdID of the tool in question, as passed to AddTool().
Since:
2.9.4
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.

Since:
2.9.4
virtual wxRibbonButtonKind wxRibbonToolBar::GetToolKind ( int  tool_id) const [virtual]

Return the kind of the given tool.

Parameters:
toolIdID of the tool in question, as passed to AddTool().
Since:
2.9.4
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.

Parameters:
toolIdID of the tool in question, as passed to AddTool().
Since:
2.9.4
virtual bool wxRibbonToolBar::GetToolState ( int  tool_id) const [virtual]

Gets the on/off state of a toggle tool.

Parameters:
toolIdID of the tool in question, as passed to AddTool().
Returns:
true if the tool is toggled on, false otherwise.
参照:
ToggleTool()
Since:
2.9.4
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.

Since:
2.9.4
参照:
AddDropdownTool(), InsertTool()
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.

Since:
2.9.4
参照:
AddHybridTool(), InsertTool()
virtual wxRibbonToolBarToolBase* wxRibbonToolBar::InsertSeparator ( size_t  pos) [virtual]

Insert a separator to the tool bar at the specified position.

Since:
2.9.4
参照:
AddSeparator(), InsertTool()
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.

Since:
2.9.4
参照:
AddToggleTool(), InsertTool()
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.

Since:
2.9.4
参照:
InsertTool()
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.

Parameters:
posPosition of the new tool (number of tools and separators from the beginning of the toolbar).
tool_idID of the new tool (used for event callbacks).
bitmapBitmap 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_disabledBitmap to use when the tool is disabled. If left as wxNullBitmap, then a bitmap will be automatically generated from bitmap.
help_stringThe UI help string to associate with the new tool.
kindThe kind of tool to add.
client_dataClient data to associate with the new tool.
Returns:
An opaque pointer which can be used only with other tool bar methods.
Since:
2.9.4
参照:
InsertDropdownTool(), InsertHybridTool(), InsertSeparator()
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.

Parameters:
nMinThe minimum number of rows to use.
nMaxThe 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.

Parameters:
idID of the tool in question, as passed to AddTool().
Since:
2.9.4
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.

Parameters:
tool_idID of the tool in question, as passed to AddTool().
Since:
2.9.4
virtual void wxRibbonToolBar::SetToolHelpString ( int  tool_id,
const wxString helpString 
) [virtual]

Sets the help string shown in tooltip for the given tool.

Parameters:
tool_IdID of the tool in question, as passed to AddTool().
helpStringA string for the help.
参照:
GetToolHelpString()
Since:
2.9.4
virtual void wxRibbonToolBar::SetToolNormalBitmap ( int  tool_id,
const wxBitmap bitmap 
) [virtual]

Sets the bitmap to be used by the tool with the given ID.

Parameters:
tool_idID of the tool in question, as passed to AddTool().
Since:
2.9.4
virtual void wxRibbonToolBar::ToggleTool ( int  tool_id,
bool  checked 
) [virtual]

Set a toggle tool to the checked or unchecked state.

Parameters:
tool_idID of the toggle tool to manipulate.
checkedtrue to set the tool to the toggled/pressed/checked state, false to set it to the untoggled/unpressed/unchecked state.
Since:
2.9.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines