Added PrependColumn methods and short cuts. Added test for DeleteColumn to sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-10-18 20:56:38 +00:00
parent 383144c756
commit 736fe67c66
7 changed files with 227 additions and 2 deletions

View File

@@ -497,6 +497,7 @@ public:
void OnAddMozart(wxCommandEvent& event);
void OnDeleteMusic(wxCommandEvent& event);
void OnDeleteYear(wxCommandEvent& event);
void OnPrependList(wxCommandEvent& event);
void OnDeleteList(wxCommandEvent& event);
@@ -578,6 +579,7 @@ enum
ID_ADD_MOZART = 100,
ID_DELETE_MUSIC = 101,
ID_DELETE_YEAR = 102,
ID_PREPEND_LIST = 200,
ID_DELETE_LIST = 201,
@@ -590,6 +592,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU( ID_EXIT, MyFrame::OnQuit )
EVT_BUTTON( ID_ADD_MOZART, MyFrame::OnAddMozart )
EVT_BUTTON( ID_DELETE_MUSIC, MyFrame::OnDeleteMusic )
EVT_BUTTON( ID_DELETE_YEAR, MyFrame::OnDeleteYear )
EVT_BUTTON( ID_PREPEND_LIST, MyFrame::OnPrependList )
EVT_BUTTON( ID_DELETE_LIST, MyFrame::OnDeleteList )
EVT_BUTTON( ID_GOTO, MyFrame::OnGoto)
@@ -689,6 +692,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
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 );
button_sizer->Add( new wxButton( this, ID_PREPEND_LIST, "Prepend"), 0, wxALL, 10 );
button_sizer->Add( new wxButton( this, ID_DELETE_LIST, "Delete selected"), 0, wxALL, 10 );
@@ -786,6 +790,12 @@ void MyFrame::OnDeleteMusic(wxCommandEvent& WXUNUSED(event) )
m_music_model->Delete( items[i] );
}
void MyFrame::OnDeleteYear( wxCommandEvent& WXUNUSED(event) )
{
m_musicCtrl->DeleteColumn( m_musicCtrl->GetColumn( 2 ) );
FindWindow( ID_DELETE_YEAR )->Disable();
}
void MyFrame::OnPrependList( wxCommandEvent& WXUNUSED(event) )
{
m_list_model->Prepend( "Test" );