Version: 2.9.4
Public Member Functions
wxRibbonButtonBar Class Reference

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

Inheritance diagram for wxRibbonButtonBar:

Detailed Description

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:

Events emitted by this class

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

void handlerFuncName(wxRibbonButtonBarEvent& event)

Event macros for events emitted by this class:

Library:  wxRibbon
Category:  Ribbon User Interface

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.

List of all members.


Constructor & Destructor Documentation

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.

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

Destructor.


Member Function Documentation

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.

Parameters:
button_idID of the new button (used for event callbacks).
labelLabel of the new button.
bitmapLarge bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar.
bitmap_smallSmall 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_disabledLarge bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap.
bitmap_small_disabledSmall bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small.
kindThe kind of button to add.
help_stringThe UI help string to associate with the new button.
client_dataClient data to associate with the new button.
Returns:
An opaque pointer which can be used only with other button bar methods.
参照:
AddDropdownButton()
AddHybridButton()
AddToggleButton()
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).

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

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

参照:
AddButton()
virtual void wxRibbonButtonBar::ClearButtons ( ) [virtual]

Delete all buttons from the button bar.

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

参照:
ClearButtons()
virtual void wxRibbonButtonBar::EnableButton ( int  button_id,
bool  enable = true 
) [virtual]

Enable or disable a single button on the bar.

Parameters:
button_idID of the button to enable or disable.
enabletrue to enable the button, false to disable it.
virtual size_t wxRibbonButtonBar::GetButtonCount ( ) const [virtual]

Returns the number of buttons in this button bar.

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

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

Parameters:
posPosition of the new button in the button bar.
button_idID of the new button (used for event callbacks).
labelLabel of the new button.
bitmapLarge bitmap of the new button. Must be the same size as all other large bitmaps used on the button bar.
bitmap_smallSmall 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_disabledLarge bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap.
bitmap_small_disabledSmall bitmap of the new button when it is disabled. If left as null, then a bitmap will be automatically generated from bitmap_small.
kindThe kind of button to add.
help_stringThe UI help string to associate with the new button.
client_dataClient data to associate with the new button.
Returns:
An opaque pointer which can be used only with other button bar methods.
参照:
InsertDropdownButton()
InsertHybridButton()
InsertToggleButton()
AddButton()
Since:
2.9.4
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.

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

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

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

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