+
+
+ // first page of the notebook
+ // --------------------------
+
+ m_notebook = new wxNotebook( this, wxID_ANY );
+
+ wxPanel *firstPanel = new wxPanel( m_notebook, wxID_ANY );
+
+ BuildDataViewCtrl(firstPanel, 0); // sets m_ctrl[0]
+
+ wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
+ button_sizer->Add( new wxButton( firstPanel, ID_ADD_MOZART, "Add Mozart"), 0, wxALL, 10 );
+ button_sizer->Add( new wxButton( firstPanel, ID_DELETE_MUSIC,"Delete selected"), 0, wxALL, 10 );
+ button_sizer->Add( new wxButton( firstPanel, ID_DELETE_YEAR, "Delete \"Year\" column"), 0, wxALL, 10 );
+ button_sizer->Add( new wxButton( firstPanel, ID_SELECT_NINTH,"Select ninth symphony"), 0, wxALL, 10 );
+ button_sizer->Add( new wxButton( firstPanel, ID_COLLAPSE, "Collapse"), 0, wxALL, 10 );
+ button_sizer->Add( new wxButton( firstPanel, ID_EXPAND, "Expand"), 0, wxALL, 10 );
+
+ wxSizer *firstPanelSz = new wxBoxSizer( wxVERTICAL );
+ m_ctrl[0]->SetMinSize(wxSize(-1, 200));
+ firstPanelSz->Add(m_ctrl[0], 1, wxGROW|wxALL, 5);
+ firstPanelSz->Add(
+ new wxStaticText(firstPanel, wxID_ANY, "Most of the cells above are editable!"),
+ 0, wxGROW|wxALL, 5);
+ firstPanelSz->Add(button_sizer);
+ firstPanel->SetSizerAndFit(firstPanelSz);
+
+
+ // second page of the notebook
+ // ---------------------------
+
+ wxPanel *secondPanel = new wxPanel( m_notebook, wxID_ANY );
+
+ BuildDataViewCtrl(secondPanel, 1); // sets m_ctrl[1]
+
+ wxBoxSizer *button_sizer2 = new wxBoxSizer( wxHORIZONTAL );
+ button_sizer2->Add( new wxButton( secondPanel, ID_PREPEND_LIST,"Prepend"), 0, wxALL, 10 );
+ button_sizer2->Add( new wxButton( secondPanel, ID_DELETE_LIST, "Delete selected"), 0, wxALL, 10 );
+ button_sizer2->Add( new wxButton( secondPanel, ID_GOTO, "Goto 50"), 0, wxALL, 10 );
+ button_sizer2->Add( new wxButton( secondPanel, ID_ADD_MANY, "Add 1000"), 0, wxALL, 10 );
+
+ wxSizer *secondPanelSz = new wxBoxSizer( wxVERTICAL );
+ secondPanelSz->Add(m_ctrl[1], 1, wxGROW|wxALL, 5);
+ secondPanelSz->Add(button_sizer2);
+ secondPanel->SetSizerAndFit(secondPanelSz);
+
+
+ // third page of the notebook
+ // ---------------------------
+
+ wxPanel *thirdPanel = new wxPanel( m_notebook, wxID_ANY );
+
+ BuildDataViewCtrl(thirdPanel, 2); // sets m_ctrl[2]
+
+ wxSizer *thirdPanelSz = new wxBoxSizer( wxVERTICAL );
+ thirdPanelSz->Add(m_ctrl[2], 1, wxGROW|wxALL, 5);
+ thirdPanel->SetSizerAndFit(thirdPanelSz);
+
+
+ // fourth page of the notebook
+ // ---------------------------
+
+ wxPanel *fourthPanel = new wxPanel( m_notebook, wxID_ANY );
+
+ BuildDataViewCtrl(fourthPanel, 3); // sets m_ctrl[3]
+
+ wxSizer *fourthPanelSz = new wxBoxSizer( wxVERTICAL );
+ fourthPanelSz->Add(m_ctrl[3], 1, wxGROW|wxALL, 5);
+ fourthPanel->SetSizerAndFit(fourthPanelSz);
+
+
+
+ // complete GUI
+ // ------------
+
+ m_notebook->AddPage(firstPanel, "MyMusicTreeModel");
+ m_notebook->AddPage(secondPanel, "MyListModel");
+ m_notebook->AddPage(thirdPanel, "wxDataViewListCtrl");
+ m_notebook->AddPage(fourthPanel, "wxDataViewTreeCtrl");
+
+ wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
+
+ m_log = new wxTextCtrl( this, wxID_ANY, wxString(), wxDefaultPosition,
+ wxDefaultSize, wxTE_MULTILINE );
+ m_log->SetMinSize(wxSize(-1, 100));
+ m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));
+ wxLogMessage( "This is the log window" );
+
+ mainSizer->Add( m_notebook, 1, wxGROW );
+ mainSizer->Add( m_log, 0, wxGROW );