+
+void MyFrame::OnHidePages(wxRibbonButtonBarEvent& WXUNUSED(evt))
+{
+ m_ribbon->HidePage(1);
+ m_ribbon->HidePage(2);
+ m_ribbon->HidePage(3);
+ m_ribbon->Realize();
+}
+
+void MyFrame::OnShowPages(wxRibbonButtonBarEvent& WXUNUSED(evt))
+{
+ m_ribbon->ShowPage(1);
+ m_ribbon->ShowPage(2);
+ m_ribbon->ShowPage(3);
+ m_ribbon->Realize();
+}
+
+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();
+}