return m_array.GetCount();
}
- virtual void GetValue( wxVariant &variant,
+ virtual void GetValueByRow( wxVariant &variant,
unsigned int row, unsigned int col ) const
{
if (col==0)
}
}
- virtual bool GetAttr( unsigned int row, unsigned int col, wxDataViewItemAttr &attr )
+ virtual bool GetAttrByRow( unsigned int row, unsigned int col, wxDataViewItemAttr &attr )
{
if (col != 2)
return false;
return true;
}
- virtual bool SetValue( const wxVariant &variant,
+ virtual bool SetValueByRow( const wxVariant &variant,
unsigned int row, unsigned int col )
{
if (col == 0)
bottom_sizer->Add( m_log, 1, wxGROW );
-#if 1
- // wxDataViewTreeStore
-
- wxDataViewCtrl *treectrl = new wxDataViewCtrl( panel, -1,
- wxDefaultPosition, wxSize(100,200), wxDV_NO_HEADER );
-
- wxDataViewTreeStore *store = new wxDataViewTreeStore;
- wxDataViewItem parent = store->AppendContainer( wxDataViewItem(0),wxT("Root 1"), wxIcon(small1_xpm) );
- wxDataViewItem child = store->AppendItem( parent,wxT("Child 1"), wxIcon(small1_xpm) );
- child = store->AppendItem( parent,wxT("Child 2"), wxIcon(small1_xpm) );
- child = store->AppendItem( parent,wxT("Child 3, very long, long, long, long"), wxIcon(small1_xpm) );
- treectrl->AssociateModel( store );
- store->DecRef();
-
- treectrl->AppendIconTextColumn( wxT("no label"), 0, wxDATAVIEW_CELL_INERT, -1, (wxAlignment) 0,
- wxDATAVIEW_COL_RESIZABLE );
-
- bottom_sizer->Add( treectrl, 1 );
+ // wxDataViewListCtrl
+
+ wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( panel, -1,
+ wxDefaultPosition, wxSize(100,200) );
+
+ listctrl->AppendToggleCol( wxT("Toggle") );
+ listctrl->AppendTextCol( wxT("Text") );
+
+ wxVector<wxVariant> data;
+ data.push_back( true );
+ data.push_back( "row 1" );
+ listctrl->AppendItem( data );
+
+ data.clear();
+ data.push_back( false );
+ data.push_back( "row 3" );
+ listctrl->AppendItem( data );
+
+ bottom_sizer->Add( listctrl, 1 );
+
// wxDataViewTreeCtrl
ilist->Add( wxIcon(small1_xpm) );
treectrl2->SetImageList( ilist );
- parent = treectrl2->AppendContainer( wxDataViewItem(0),wxT("Root 1"), 0 );
- child = treectrl2->AppendItem( parent,wxT("Child 1"), 0 );
- child = treectrl2->AppendItem( parent,wxT("Child 2"), 0 );
- child = treectrl2->AppendItem( parent,wxT("Child 3, very long, long, long, long"), 0 );
+ wxDataViewItem parent2 = treectrl2->AppendContainer( wxDataViewItem(0),wxT("Root 1"), 0 );
+ wxDataViewItem child2 = treectrl2->AppendItem( parent2, wxT("Child 1"), 0 );
+ child2 = treectrl2->AppendItem( parent2, wxT("Child 2"), 0 );
+ child2 = treectrl2->AppendItem( parent2, wxT("Child 3, very long, long, long, long"), 0 );
bottom_sizer->Add( treectrl2, 1 );
-#endif
// main sizer