X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2fa73716ca5cf002bdd570a86da5d1cb09d7e3b0..8019a673052f9257fa31ae42a26f2920454093f7:/samples/dataview/dataview.cpp?ds=sidebyside diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 7132c5d9ca..0d488672aa 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -134,6 +134,12 @@ public: } return true; } + + virtual void GetAttr( wxListItemAttr &attr, unsigned int col, unsigned int row ) + { + if (row == 4) + attr.SetBackgroundColour( *wxGREEN ); + } wxArrayString m_list; wxArrayInt m_bools; @@ -1005,7 +1011,7 @@ MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int dataview_left = new wxDataViewCtrl( main, ID_UNSORTED, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE ); - m_unsorted_model.reset(new MyUnsortedTextModel); + m_unsorted_model = new MyUnsortedTextModel; dataview_left->AssociateModel( m_unsorted_model.get() ); wxDataViewTextRenderer *text_renderer = @@ -1021,7 +1027,7 @@ MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int // Right wxDataViewCtrl using the sorting model dataview_right = new wxDataViewCtrl( main, ID_SORTED ); - m_sorted_model.reset(new wxDataViewSortedListModel( m_unsorted_model.get() )); + m_sorted_model = new wxDataViewSortedListModel( m_unsorted_model.get() ); dataview_right->AssociateModel( m_sorted_model.get() ); text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );