AGW Logo

agw_title RibbonButtonBar

hierarchy Inheritance Diagram

Inheritance diagram for: RibbonButtonBar

Inheritance diagram of RibbonButtonBar


supclasses Known Superclasses


appearance Control Appearance


RibbonButtonBar

RibbonButtonBar


method_summary Methods Summary

__init__Default class constructor.
AddButtonAdd a button to the button bar.
AddDropdownButtonAdd a dropdown button to the button bar (simple version).
AddHybridButtonAdd a hybrid button to the button bar (simple version).
AddSimpleButtonAdd a button to the button bar (simple version).
AddToggleButtonAdd a toggle button to the button bar.
ClearButtonsDelete all buttons from the button bar.
CommonInit
DeleteButtonDelete a single button from the button bar.
DoGetBestSize
DoGetNextLargerSize
DoGetNextSmallerSize
EnableButtonEnable or disable a single button on the bar.
FetchButtonSizeInfo
GetDefaultBorder
GetMinSize
IsButtonEnabledReturns whether a button in the bar is enabled or not.
IsSizingContinuous
MakeDisabledBitmap
MakeLayouts
MakeResizedBitmap
OnEraseBackground
OnMouseDown
OnMouseEnter
OnMouseLeave
OnMouseMove
OnMouseUp
OnPaint
OnSize
RealizeCalculate button layouts and positions.
SetArtProvider
ToggleButtonToggles/untoggles a RibbonButtonBar toggle button.
TryCollapseLayout

API Class API

class RibbonButtonBar(RibbonControl)[source]


__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, agwStyle=0)[source]

Default class constructor.

Parameters:
  • parent – pointer to a parent window;
  • id – window identifier. If wx.ID_ANY, will automatically create an identifier;
  • pos – window position. wx.DefaultPosition indicates that wxPython should generate a default position for the window;
  • size – window size. wx.DefaultSize indicates that wxPython should generate a default size for the window. If no suitable size can be found, the window will be sized to 20x20 pixels so that the window is visible but obviously not correctly sized;
  • agwStyle – the AGW-specific window style.


AddButton(button_id, label, bitmap, bitmap_small=wx.NullBitmap, bitmap_disabled=wx.NullBitmap, bitmap_small_disabled=wx.NullBitmap, kind=RIBBON_BUTTON_NORMAL, help_string="", client_data=None)[source]

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 None, 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 None, 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 None, 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.



AddDropdownButton(button_id, label, bitmap, help_string='')[source]

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

Parameters:
  • button_id – ID of the button;
  • 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;
  • help_string – the UI help string to associate with the new button.

See also

AddButton



AddHybridButton(button_id, label, bitmap, help_string='')[source]

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

Parameters:
  • button_id – ID of the button;
  • 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;
  • help_string – the UI help string to associate with the new button.

See also

AddButton



AddSimpleButton(button_id, label, bitmap, help_string, kind=RIBBON_BUTTON_NORMAL)[source]

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

Parameters:
  • button_id – ID of the button;
  • 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;
  • help_string – the UI help string to associate with the new button;
  • kind – The kind of button to add.


AddToggleButton(button_id, label, bitmap, help_string='')[source]

Add a toggle button to the button bar.

Parameters:
  • button_id – ID of the button;
  • 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;
  • help_string – the UI help string to associate with the new button.

See also

AddButton



ClearButtons()[source]

Delete all buttons from the button bar.

See also

DeleteButton



CommonInit(agwStyle)[source]


DeleteButton(button_id)[source]

Delete a single button from the button bar.

Parameters:button_id – ID of the button to delete.

See also

ClearButtons



DoGetBestSize()[source]


DoGetNextLargerSize(direction, _result)[source]


DoGetNextSmallerSize(direction, _result)[source]


EnableButton(button_id, enable=True)[source]

Enable or disable a single button on the bar.

Parameters:
  • button_id – ID of the button to enable or disable;
  • enableTrue to enable the button, False to disable it.


FetchButtonSizeInfo(button, size, dc)[source]


GetDefaultBorder()[source]


GetMinSize()[source]


IsButtonEnabled(button_id)[source]

Returns whether a button in the bar is enabled or not.

Parameters:button_id – ID of the button to check.


IsSizingContinuous()[source]


MakeDisabledBitmap(original)[source]


MakeLayouts()[source]


MakeResizedBitmap(original, size)[source]


OnEraseBackground(event)[source]


OnMouseDown(event)[source]


OnMouseEnter(event)[source]


OnMouseLeave(event)[source]


OnMouseMove(event)[source]


OnMouseUp(event)[source]


OnPaint(event)[source]


OnSize(event)[source]


Realize()[source]

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 RibbonBar.Realize() is called.

Note

Reimplemented from RibbonControl.



SetArtProvider(art)[source]


ToggleButton(button_id, checked=True)[source]

Toggles/untoggles a RibbonButtonBar toggle button.

Parameters:
  • button_id – ID of the button to be toggles/untoggled;
  • checkedTrue to toggle the button, False to untoggle it.


TryCollapseLayout(original, first_btn, last_button=None)[source]
Tree

Table Of Contents

Previous topic

ribbon.buttonbar

Next topic

RibbonButtonBarButtonBase