Minor API changes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-08-24 11:21:52 +00:00
parent daf5b37afd
commit fbda518cb7
7 changed files with 129 additions and 57 deletions

View File

@@ -240,12 +240,11 @@ public:
MyMusicModelNode *node = (MyMusicModelNode*) item.GetID();
switch (col)
{
case 0: node->m_title = variant.GetString(); return true;
case 1: node->m_artist = variant.GetString(); return true;
case 2: node->m_year = variant.GetString(); return true;
case 0: node->m_title = variant.GetString(); break;
case 1: node->m_artist = variant.GetString(); break;
case 2: node->m_year = variant.GetString(); break;
default: wxLogError( "MyMusicModel::SetValue: wrong column" );
}
return false;
}
virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const
@@ -454,6 +453,8 @@ private:
wxDataViewCtrl* m_listCtrl;
wxObjectDataPtr<MyListModel> m_list_model;
wxDataViewColumn * m_col;
wxTextCtrl * m_log;
wxLog *m_logOld;
@@ -540,6 +541,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
m_log = NULL;
m_col = NULL;
SetIcon(wxICON(sample));
@@ -594,7 +596,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
m_listCtrl->AssociateModel( m_list_model.get() );
m_listCtrl->AppendTextColumn( "editable string", 0, wxDATAVIEW_CELL_EDITABLE, 120 );
m_listCtrl->AppendTextColumn( "index", 1, wxDATAVIEW_CELL_INERT, 120 );
m_col = m_listCtrl->AppendTextColumn( "index", 1, wxDATAVIEW_CELL_INERT, 120 );
data_sizer->Add( m_listCtrl, 2, wxGROW );
@@ -762,7 +764,7 @@ void MyFrame::OnRightClick( wxMouseEvent &event )
void MyFrame::OnGoto( wxCommandEvent &event)
{
wxDataViewItem item = m_list_model->GetItem( 50 );
m_listCtrl->EnsureVisible(item);
m_listCtrl->EnsureVisible(item,m_col);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )