+ tr = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
+ wxDataViewColumn *column1 =
+ new wxDataViewColumn( wxT("artist"), tr, 1, 150, wxALIGN_LEFT,
+ wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE |
+ wxDATAVIEW_COL_RESIZABLE );
+ column1->SetMinWidth(150); // this column can't be resized to be smaller
+ m_myMusicModelViewCtrl->AppendColumn( column1 );
+
+ // column 2 of the view control:
+
+ wxDataViewSpinRenderer *sr =
+ new wxDataViewSpinRenderer( 0, 2010, wxDATAVIEW_CELL_EDITABLE, wxALIGN_RIGHT );
+ wxDataViewColumn *column2 =
+ new wxDataViewColumn( wxT("year"), sr, 2, 60, wxALIGN_LEFT,
+ wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE );
+ m_myMusicModelViewCtrl->AppendColumn( column2 );
+
+ // column 3 of the view control:
+
+ wxArrayString choices;
+ choices.Add( "good" );
+ choices.Add( "bad" );
+ choices.Add( "lousy" );
+ wxDataViewChoiceRenderer *c =
+ new wxDataViewChoiceRenderer( choices, wxDATAVIEW_CELL_EDITABLE, wxALIGN_RIGHT );
+ wxDataViewColumn *column3 =
+ new wxDataViewColumn( wxT("rating"), c, 3, 100, wxALIGN_LEFT,
+ wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE );
+ m_myMusicModelViewCtrl->AppendColumn( column3 );
+
+ // column 4 of the view control:
+
+ m_myMusicModelViewCtrl->AppendProgressColumn( wxT("popularity"), 4, wxDATAVIEW_CELL_INERT, 80 );
+
+ // column 5 of the view control:
+
+ MyCustomRenderer *cr = new MyCustomRenderer( wxDATAVIEW_CELL_ACTIVATABLE, wxALIGN_RIGHT );
+ wxDataViewColumn *column5 =
+ new wxDataViewColumn( wxT("custom"), cr, 5, -1, wxALIGN_LEFT,
+ wxDATAVIEW_COL_RESIZABLE );
+ m_myMusicModelViewCtrl->AppendColumn( column5 );
+
+ // complete this page:
+
+ 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")), 0, wxALL, 10 );
+
+ wxSizer *firstPanelSz = new wxBoxSizer( wxVERTICAL );
+ m_myMusicModelViewCtrl->SetMinSize(wxSize(-1, 200));
+ firstPanelSz->Add(m_myMusicModelViewCtrl, 1, wxGROW|wxALL, 5);
+ firstPanelSz->Add(button_sizer);
+ firstPanel->SetSizerAndFit(firstPanelSz);
+
+
+ // second page of the notebook
+ // ---------------------------
+
+ wxPanel *secondPanel = new wxPanel( m_notebook, wxID_ANY );
+
+ m_myListModelViewCtrl = new wxDataViewCtrl( secondPanel, wxID_ANY, wxDefaultPosition,
+ wxDefaultSize, wxDV_MULTIPLE | wxDV_ROW_LINES);