-MyFrame::MyFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos,
- const wxSize& size, long style):
- wxFrame(parent, id, title, pos, size, style)
+MyFrame::MyFrame(wxFrame* parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style)
+ : wxFrame(parent, id, title, pos, size, style)
+{
+ m_textWindow = new wxTextCtrl(this, -1, "", wxPoint(0, 0), wxSize(-1, -1), wxTE_MULTILINE);
+ m_smallToolbar = FALSE;
+
+ // Give it a status line
+ CreateStatusBar();
+
+ // Give it an icon
+ SetIcon(wxICON(mondrian));
+
+ // Make a menubar
+ wxMenu *tbarMenu = new wxMenu;
+ tbarMenu->Append(IDM_TOOLBAR_TOGGLETOOLBAR, "&Toggle toolbar", "Change the toolbar kind");
+ tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, "&Enable print button", "");
+ tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, "Toggle &help button", "");
+
+ wxMenu *fileMenu = new wxMenu;
+ fileMenu->Append(wxID_EXIT, "E&xit", "Quit toolbar sample" );
+
+ wxMenu *helpMenu = new wxMenu;
+ helpMenu->Append(wxID_HELP, "&About", "About toolbar sample");
+
+ wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE );
+
+ menuBar->Append(fileMenu, "&File");
+ menuBar->Append(tbarMenu, "&Toolbar");
+ menuBar->Append(helpMenu, "&Help");
+
+ // Associate the menu bar with the frame
+ SetMenuBar(menuBar);
+
+ // Create the toolbar
+ wxToolBar *tbar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL |
+ wxTB_FLAT | wxTB_DOCKABLE,
+ ID_TOOLBAR);
+
+ tbar->SetMargins( 4, 4 );
+
+ wxGetApp().InitToolbar(tbar);
+}
+
+void MyFrame::OnToggleToolbar(wxCommandEvent& WXUNUSED(event))