+void wxRibbonButtonBar::ToggleButton(int button_id, bool checked)
+{
+ size_t count = m_buttons.GetCount();
+ size_t i;
+ for(i = 0; i < count; ++i)
+ {
+ wxRibbonButtonBarButtonBase* button = m_buttons.Item(i);
+ if(button->id == button_id)
+ {
+ if(checked)
+ {
+ if((button->state & wxRIBBON_BUTTONBAR_BUTTON_TOGGLED) == 0)
+ {
+ button->state |= wxRIBBON_BUTTONBAR_BUTTON_TOGGLED;
+ Refresh();
+ }
+ }
+ else
+ {
+ if(button->state & wxRIBBON_BUTTONBAR_BUTTON_TOGGLED)
+ {
+ button->state &= ~wxRIBBON_BUTTONBAR_BUTTON_TOGGLED;
+ Refresh();
+ }
+ }
+ return;
+ }
+ }
+}
+