wxRibbonButtonBar Class Reference
[Ribbon User Interface]

#include <wx/ribbon/buttonbar.h>

Inheritance diagram for wxRibbonButtonBar:
Inheritance graph
[legend]

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, wxRibbonButtonBarButtonKind kind=wxRIBBON_BUTTONBAR_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 * 
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, wxRibbonButtonBarButtonKind kind=wxRIBBON_BUTTONBAR_BUTTON_NORMAL, const wxString &help_string=wxEmptyString, wxObject *client_data=NULL)
 Add a button to the 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.

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


Member Function Documentation

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,
wxRibbonButtonBarButtonKind  kind = wxRIBBON_BUTTONBAR_BUTTON_NORMAL,
const wxString help_string = wxEmptyString,
wxObject client_data = NULL 
) [virtual]

Add a button to the button bar.

Parameters:
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.
Returns:
An opaque pointer which can be used only with other button bar methods.
See also:
AddDropdownButton()
AddHybridButton()
virtual wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddButton ( int  button_id,
const wxString label,
const wxBitmap bitmap,
const wxString help_string,
wxRibbonButtonBarButtonKind  kind = wxRIBBON_BUTTONBAR_BUTTON_NORMAL 
) [virtual]

Add a button to the button bar (simple version).

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

See also:
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).

See also:
AddButton()
virtual void wxRibbonButtonBar::ClearButtons (  )  [virtual]

Delete all buttons from the button bar.

See also:
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.

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

Enable or disable a single button on the bar.

Parameters:
button_id ID of the button to enable or disable.
enable true to enable the button, false to disable it.
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.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]