+
+ wxPoint position = evt.GetPosition();
+
+ if(position.x >= 0 && position.y >= 0)
+ {
+ wxSize size = GetSize();
+ if(position.x < size.GetWidth() && position.y < size.GetHeight())
+ {
+ if(m_toggle_button_rect.Contains(position))
+ {
+ bool pshown = ArePanelsShown();
+ ShowPanels(!pshown);
+ if ( pshown )
+ m_ribbon_state = wxRIBBON_BAR_MINIMIZED;
+ else
+ m_ribbon_state = wxRIBBON_BAR_PINNED;
+ wxRibbonBarEvent event(wxEVT_RIBBONBAR_TOGGLED, GetId());
+ event.SetEventObject(this);
+ ProcessWindowEvent(event);
+ }
+ if ( m_help_button_rect.Contains(position) )
+ {
+ wxRibbonBarEvent event(wxEVT_RIBBONBAR_HELP_CLICK, GetId());
+ event.SetEventObject(this);
+ ProcessWindowEvent(event);
+ }
+ }
+ }