*/
wxRIBBON_BUTTONBAR_BUTTON_DISABLED = 1 << 7,
+ /**
+ The button is a toggle button which is currently in the toggled state.
+ */
+ wxRIBBON_BUTTONBAR_BUTTON_TOGGLED = 1 << 8,
+
/**
A mask to extract button state from a combination of flags.
*/
- wxRIBBON_BUTTONBAR_BUTTON_STATE_MASK = 0xF8,
+ wxRIBBON_BUTTONBAR_BUTTON_STATE_MASK = 0x1F8,
};
/**
/**
Construct a ribbon button bar with the given parameters.
+
@param parent
Parent window for the button bar (typically a wxRibbonPanel).
+ @param id
+ An identifier for the button bar. @c wxID_ANY is taken to mean a default.
@param pos
Initial position of the button bar.
@param size
const wxBitmap& bitmap,
const wxString& help_string = wxEmptyString);
+ /**
+ Add a toggle button to the button bar (simple version).
+
+ @see AddButton()
+ */
+ virtual wxRibbonButtonBarButtonBase* AddToggleButton(
+ int button_id,
+ const wxString& label,
+ const wxBitmap& bitmap,
+ const wxString& help_string = wxEmptyString);
+
/**
Add a button to the button bar.
@see AddDropdownButton()
@see AddHybridButton()
+ @see AddToggleButton()
*/
virtual wxRibbonButtonBarButtonBase* AddButton(
int button_id,
@true to enable the button, @false to disable it.
*/
virtual void EnableButton(int button_id, bool enable = true);
+
+ /**
+ Set a toggle button to the checked or unchecked state.
+
+ @param button_id
+ ID of the toggle button to manipulate.
+ @param checked
+ @true to set the button to the toggled/pressed/checked state,
+ @false to set it to the untoggled/unpressed/unchecked state.
+ */
+ virtual void ToggleButton(int button_id, bool checked);
};
/**
@class wxRibbonButtonBarEvent
Event used to indicate various actions relating to a button on a
- wxRibbonButtonBar.
+ wxRibbonButtonBar. For toggle buttons, IsChecked() can be used to test
+ the state of the button.
See wxRibbonButtonBar for available event types.