- main_sizer->Add( data_sizer, 2, wxGROW );
-
- wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
-
- button_sizer->Add( new wxButton( this, ID_ADD_MOZART, _("Add Mozart")), 0, wxALL, 10 );
- button_sizer->Add( new wxButton( this, ID_DELETE_MUSIC,_("Delete selected")), 0, wxALL, 10 );
- button_sizer->Add( new wxButton( this, ID_DELETE_YEAR, _("Delete \"Year\" column")), 0, wxALL, 10 );
- button_sizer->Add( 10, 10, 1 );
- wxFlexGridSizer *grid_sizer = new wxFlexGridSizer( 2, 2 );
- grid_sizer->Add( new wxButton( this, ID_PREPEND_LIST,_("Prepend")), 0, wxALL, 2 );
- grid_sizer->Add( new wxButton( this, ID_DELETE_LIST, _("Delete selected")), 0, wxALL, 2 );
- grid_sizer->Add( new wxButton( this, ID_GOTO, _("Goto 50")), 0, wxALL, 2 );
- grid_sizer->Add( new wxButton( this, ID_ADD_MANY, _("Add 1000")), 0, wxALL, 2 );
- button_sizer->Add( grid_sizer, 0, wxALL, 10 );
-
- main_sizer->Add( button_sizer, 0, wxGROW, 0 );
-
- wxBoxSizer *bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
-
- m_log = new wxTextCtrl( this, -1, wxString(), wxDefaultPosition, wxSize(100,200), wxTE_MULTILINE );
- m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));
- wxLogMessage(_("This is the log window"));
-
- bottom_sizer->Add( m_log, 1, wxGROW );
-
- // wxDataViewTreeStore
-
- wxDataViewCtrl *treectrl = new wxDataViewCtrl( this, -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 );
-
- // wxDataViewTreeCtrl
-
- wxDataViewTreeCtrl *treectrl2 = new wxDataViewTreeCtrl( this, -1, wxDefaultPosition, wxSize(100,200) );
-
- wxImageList *ilist = new wxImageList( 16, 16 );
- 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 );
-
- bottom_sizer->Add( treectrl2, 1 );
-
- // main sizer
-
- main_sizer->Add( bottom_sizer, 0, wxGROW );
-
- SetSizer( main_sizer );
+ lc->AppendItem( data );
+ }
+ }
+ break;
+
+ case 3:
+ {
+ wxASSERT(!m_ctrl[3]);
+ wxDataViewTreeCtrl* tc =
+ new wxDataViewTreeCtrl( parent, wxID_ANY, wxDefaultPosition,
+ wxDefaultSize, style );
+ m_ctrl[3] = tc;
+
+ wxImageList *ilist = new wxImageList( 16, 16 );
+ ilist->Add( wxIcon(wx_small_xpm) );
+ tc->SetImageList( ilist );
+
+ wxDataViewItem parent =
+ tc->AppendContainer( wxDataViewItem(0), "The Root", 0 );
+ tc->AppendItem( parent, "Child 1", 0 );
+ tc->AppendItem( parent, "Child 2", 0 );
+ tc->AppendItem( parent, "Child 3, very long, long, long, long", 0 );
+
+ wxDataViewItem cont =
+ tc->AppendContainer( parent, "Container child", 0 );
+ tc->AppendItem( cont, "Child 4", 0 );
+ tc->AppendItem( cont, "Child 5", 0 );
+
+ tc->Expand(cont);
+ }
+ break;
+ }