- 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_musicCtrl->AppendColumn( column1 );
-
- 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_musicCtrl->AppendColumn( column2 );
-
- 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_musicCtrl->AppendColumn( column3 );
-
- m_musicCtrl->AppendProgressColumn( wxT("popularity"), 4, wxDATAVIEW_CELL_INERT, 80 );
-
- MyCustomRenderer *cr = new MyCustomRenderer( wxDATAVIEW_CELL_ACTIVATABLE, wxALIGN_RIGHT );
- wxDataViewColumn *column4 = new wxDataViewColumn( wxT("custom"), cr, 5, -1, wxALIGN_LEFT,
- wxDATAVIEW_COL_RESIZABLE );
- m_musicCtrl->AppendColumn( column4 );
-
- data_sizer->Add( m_musicCtrl, 3, wxGROW );
-
- // MyList
-
- m_listCtrl = new wxDataViewCtrl( panel, wxID_ANY, wxDefaultPosition,
- wxSize(400,200), wxDV_MULTIPLE | wxDV_ROW_LINES);
-
- m_list_model = new MyListModel;
- m_listCtrl->AssociateModel( m_list_model.get() );
-
-#if 1
- m_listCtrl->AppendTextColumn (wxT("editable string"), 0, wxDATAVIEW_CELL_EDITABLE, 120 );
- m_listCtrl->AppendIconTextColumn(wxIcon(small1_xpm), 1, wxDATAVIEW_CELL_INERT )->SetTitle( wxT("icon") );
-#else
- m_listCtrl->AppendTextColumn (wxT("editable string"), 0, wxDATAVIEW_CELL_EDITABLE );
- m_listCtrl->AppendIconTextColumn(wxT("icon"), 1, wxDATAVIEW_CELL_INERT );
-#endif