#include </home/zeitlin/src/wx/github/interface/wx/ribbon/buttonbar.h>
A ribbon button bar is similar to a traditional toolbar.
It contains one or more buttons (button bar buttons, not wxButtons), each of which has a label and an icon. It differs from a wxRibbonToolBar in several ways:
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 | |
wxRibbonButtonBar () | |
Default constructor. | |
wxRibbonButtonBar (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) | |
Construct a ribbon button bar with the given parameters. | |
virtual | ~wxRibbonButtonBar () |
Destructor. | |
bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) |
Create a button bar in two-step button bar construction. | |
virtual wxRibbonButtonBarButtonBase * | AddButton (int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL) |
Add a button to the button bar (simple version). | |
virtual wxRibbonButtonBarButtonBase * | AddDropdownButton (int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Add a dropdown button to the button bar (simple version). | |
virtual wxRibbonButtonBarButtonBase * | AddHybridButton (int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Add a hybrid button to the button bar (simple version). | |
virtual wxRibbonButtonBarButtonBase * | AddToggleButton (int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Add a toggle button to the button bar (simple version). | |
virtual wxRibbonButtonBarButtonBase * | AddButton (int button_id, const wxString &label, const wxBitmap &bitmap, const wxBitmap &bitmap_small=wxNullBitmap, const wxBitmap &bitmap_disabled=wxNullBitmap, const wxBitmap &bitmap_small_disabled=wxNullBitmap, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL, const wxString &help_string=wxEmptyString, wxObject *client_data=NULL) |
Add a button to the button bar. | |
virtual wxRibbonButtonBarButtonBase * | InsertButton (size_t pos, int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL) |
Inserts a button to the button bar (simple version) at the given position. | |
virtual wxRibbonButtonBarButtonBase * | InsertDropdownButton (size_t pos, int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Inserts a dropdown button to the button bar (simple version) at the given position. | |
virtual wxRibbonButtonBarButtonBase * | InsertHybridButton (size_t pos, int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Inserts a hybrid button to the button bar (simple version) at the given position. | |
virtual wxRibbonButtonBarButtonBase * | InsertToggleButton (size_t pos, int button_id, const wxString &label, const wxBitmap &bitmap, const wxString &help_string=wxEmptyString) |
Inserts a toggle button to the button bar (simple version) at the given position. | |
virtual wxRibbonButtonBarButtonBase * | InsertButton (size_t pos, int button_id, const wxString &label, const wxBitmap &bitmap, const wxBitmap &bitmap_small=wxNullBitmap, const wxBitmap &bitmap_disabled=wxNullBitmap, const wxBitmap &bitmap_small_disabled=wxNullBitmap, wxRibbonButtonKind kind=wxRIBBON_BUTTON_NORMAL, const wxString &help_string=wxEmptyString, wxObject *client_data=NULL) |
Insert a button to the button bar at the given position. | |
virtual size_t | GetButtonCount () const |
Returns the number of buttons in this button bar. | |
virtual bool | Realize () |
Calculate button layouts and positions. | |
virtual void | ClearButtons () |
Delete all buttons from the button bar. | |
virtual bool | DeleteButton (int button_id) |
Delete a single button from the button bar. | |
virtual void | EnableButton (int button_id, bool enable=true) |
Enable or disable a single button on the bar. | |
virtual void | ToggleButton (int button_id, bool checked) |
Set a toggle button to the checked or unchecked state. |
wxRibbonButtonBar::wxRibbonButtonBar | ( | ) |
Default constructor.
With this constructor, Create() should be called in order to create the button bar.
wxRibbonButtonBar::wxRibbonButtonBar | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = 0 |
||
) |
Construct a ribbon button bar with the given parameters.
parent | Parent window for the button bar (typically a wxRibbonPanel). |
id | An identifier for the button bar. wxID_ANY is taken to mean a default. |
pos | Initial position of the button bar. |
size | Initial size of the button bar. |
style | Button bar style, currently unused. |
virtual wxRibbonButtonBar::~wxRibbonButtonBar | ( | ) | [virtual] |
Destructor.
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddButton | ( | int | button_id, |
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string, | ||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL |
||
) | [virtual] |
Add a button to the button bar (simple version).
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddButton | ( | int | button_id, |
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxBitmap & | bitmap_small = wxNullBitmap , |
||
const wxBitmap & | bitmap_disabled = wxNullBitmap , |
||
const wxBitmap & | bitmap_small_disabled = wxNullBitmap , |
||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL , |
||
const wxString & | help_string = wxEmptyString , |
||
wxObject * | client_data = NULL |
||
) | [virtual] |
Add a button to the button bar.
button_id | ID of the new button (used for event callbacks). |
label | Label of the new button. |
bitmap | Large bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar. |
bitmap_small | Small bitmap of the new button. If left as null, then a small bitmap will be automatically generated. Must be the same size as all other small bitmaps used on the button bar. |
bitmap_disabled | Large bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap. |
bitmap_small_disabled | Small bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small. |
kind | The kind of button to add. |
help_string | The UI help string to associate with the new button. |
client_data | Client data to associate with the new button. |
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddDropdownButton | ( | int | button_id, |
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Add a dropdown button to the button bar (simple version).
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddHybridButton | ( | int | button_id, |
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Add a hybrid button to the button bar (simple version).
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddToggleButton | ( | int | button_id, |
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Add a toggle button to the button bar (simple version).
virtual void wxRibbonButtonBar::ClearButtons | ( | ) | [virtual] |
Delete all buttons from the button bar.
bool wxRibbonButtonBar::Create | ( | wxWindow * | parent, |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = 0 |
||
) |
Create a button bar in two-step button 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 wxRibbonButtonBar::DeleteButton | ( | int | button_id | ) | [virtual] |
Delete a single button from the button bar.
virtual void wxRibbonButtonBar::EnableButton | ( | int | button_id, |
bool | enable = true |
||
) | [virtual] |
Enable or disable a single button on the bar.
button_id | ID of the button to enable or disable. |
enable | true to enable the button, false to disable it. |
virtual size_t wxRibbonButtonBar::GetButtonCount | ( | ) | const [virtual] |
Returns the number of buttons in this button bar.
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::InsertButton | ( | size_t | pos, |
int | button_id, | ||
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string, | ||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL |
||
) | [virtual] |
Inserts a button to the button bar (simple version) at the given position.
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::InsertButton | ( | size_t | pos, |
int | button_id, | ||
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxBitmap & | bitmap_small = wxNullBitmap , |
||
const wxBitmap & | bitmap_disabled = wxNullBitmap , |
||
const wxBitmap & | bitmap_small_disabled = wxNullBitmap , |
||
wxRibbonButtonKind | kind = wxRIBBON_BUTTON_NORMAL , |
||
const wxString & | help_string = wxEmptyString , |
||
wxObject * | client_data = NULL |
||
) | [virtual] |
Insert a button to the button bar at the given position.
pos | Position of the new button in the button bar. |
button_id | ID of the new button (used for event callbacks). |
label | Label of the new button. |
bitmap | Large bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar. |
bitmap_small | Small bitmap of the new button. If left as null, then a small bitmap will be automatically generated. Must be the same size as all other small bitmaps used on the button bar. |
bitmap_disabled | Large bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap. |
bitmap_small_disabled | Small bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small. |
kind | The kind of button to add. |
help_string | The UI help string to associate with the new button. |
client_data | Client data to associate with the new button. |
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::InsertDropdownButton | ( | size_t | pos, |
int | button_id, | ||
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Inserts a dropdown button to the button bar (simple version) at the given position.
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::InsertHybridButton | ( | size_t | pos, |
int | button_id, | ||
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Inserts a hybrid button to the button bar (simple version) at the given position.
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::InsertToggleButton | ( | size_t | pos, |
int | button_id, | ||
const wxString & | label, | ||
const wxBitmap & | bitmap, | ||
const wxString & | help_string = wxEmptyString |
||
) | [virtual] |
Inserts a toggle button to the button bar (simple version) at the given position.
virtual bool wxRibbonButtonBar::Realize | ( | ) | [virtual] |
Calculate button layouts and positions.
Must be called after buttons are added to the button bar, as otherwise the newly added buttons will not be displayed. In normal situations, it will be called automatically when wxRibbonBar::Realize() is called.
Reimplemented from wxRibbonControl.
virtual void wxRibbonButtonBar::ToggleButton | ( | int | button_id, |
bool | checked | ||
) | [virtual] |
Set a toggle button to the checked or unchecked state.
button_id | ID of the toggle button to manipulate. |
checked | true to set the button to the toggled/pressed/checked state, false to set it to the untoggled/unpressed/unchecked state. |