X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c3ead1d1513a5eb79091a604f4e42b45d1bdf5d..b72ed64277a2b16c6c8681995e5f3f304a8fe38d:/interface/wx/ribbon/buttonbar.h?ds=inline diff --git a/interface/wx/ribbon/buttonbar.h b/interface/wx/ribbon/buttonbar.h index 2b5ed45e4d..dd36d7c1b4 100644 --- a/interface/wx/ribbon/buttonbar.h +++ b/interface/wx/ribbon/buttonbar.h @@ -78,10 +78,15 @@ enum wxRibbonButtonBarButtonState */ 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, }; /** @@ -124,8 +129,11 @@ public: /** 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 @@ -187,6 +195,17 @@ public: 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. @@ -220,6 +239,7 @@ public: @see AddDropdownButton() @see AddHybridButton() + @see AddToggleButton() */ virtual wxRibbonButtonBarButtonBase* AddButton( int button_id, @@ -264,13 +284,25 @@ public: @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.