+
+void MyFrame::OnRibbonBarToggled(wxRibbonBarEvent& WXUNUSED(evt))
+{
+ AddText(wxString::Format("Ribbon bar %s.",
+ m_ribbon->ArePanelsShown()
+ ? "expanded"
+ : "collapsed"));
+}
+
+void MyFrame::OnRibbonBarHelpClicked(wxRibbonBarEvent& WXUNUSED(evt))
+{
+ AddText("Ribbon bar help clicked");
+}
+
+// This shows how to hide ribbon dynamically if there is not enough space.
+void MyFrame::OnSizeEvent(wxSizeEvent& evt)
+{
+ if ( evt.GetSize().GetWidth() < 200 )
+ m_ribbon->Hide();
+ else
+ m_ribbon->Show();
+
+ evt.Skip();
+}