#include "wx/colordlg.h"
#include "wx/artprov.h"
#include "wx/combobox.h"
+#include "wx/tglbtn.h"
#include "wx/wrapsizer.h"
// -- application --
ID_POSITION_LEFT,
ID_POSITION_LEFT_LABELS,
ID_POSITION_LEFT_BOTH,
+ ID_TOGGLE_PANELS
};
void OnCircleButton(wxRibbonButtonBarEvent& evt);
void OnPositionLeftBoth(wxCommandEvent& evt);
void OnPositionLeftDropdown(wxRibbonToolBarEvent& evt);
+ void OnTogglePanels(wxCommandEvent& evt);
+
protected:
wxRibbonGallery* PopulateColoursPanel(wxWindow* panel, wxColour def,
int gallery_id);
wxRibbonGallery* m_primary_gallery;
wxRibbonGallery* m_secondary_gallery;
wxTextCtrl* m_logwindow;
+ wxToggleButton* m_togglePanels;
+
wxColourData m_colour_data;
wxColour m_default_primary;
wxColour m_default_secondary;
return false;
wxFrame* frame = new MyFrame;
- SetTopWindow(frame);
frame->Show();
return true;
EVT_MENU(ID_POSITION_TOP, MyFrame::OnPositionTopLabels)
EVT_MENU(ID_POSITION_TOP_ICONS, MyFrame::OnPositionTopIcons)
EVT_MENU(ID_POSITION_TOP_BOTH, MyFrame::OnPositionTopBoth)
+EVT_TOGGLEBUTTON(ID_TOGGLE_PANELS, MyFrame::OnTogglePanels)
END_EVENT_TABLE()
#include "align_center.xpm"
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY |
wxTE_LEFT | wxTE_BESTWRAP | wxBORDER_NONE);
+ m_togglePanels = new wxToggleButton(this, ID_TOGGLE_PANELS, "&Toggle panels");
+ m_togglePanels->SetValue(true);
+
wxSizer *s = new wxBoxSizer(wxVERTICAL);
s->Add(m_ribbon, 0, wxEXPAND);
s->Add(m_logwindow, 1, wxEXPAND);
+ s->Add(m_togglePanels, wxSizerFlags().Border());
SetSizer(s);
}
evt.PopupMenu(&menu);
}
+void MyFrame::OnTogglePanels(wxCommandEvent& WXUNUSED(evt))
+{
+ m_ribbon->ShowPanels(m_togglePanels->GetValue());
+}
+
void MyFrame::AddText(wxString msg)
{
m_logwindow->AppendText(msg);