X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f554a14b8989125033f32fd9bfc4ef877664eb39..c7e4ff14979261fc37380c7fbfae837eaffb6c71:/samples/dataview/dataview.cpp diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index fdb2c9abeb..0f96a10c0d 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -17,13 +17,13 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" #endif #include "wx/datetime.h" #ifndef __WXMSW__ -#include "mondrian.xpm" + #include "../sample.xpm" #endif #include "wx/dataview.h" @@ -325,11 +325,7 @@ bool MyApp::OnInit(void) 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)) { -#ifdef __WXMSW__ - SetIcon(wxIcon(_T("mondrian"))); -#else - SetIcon(wxIcon(mondrian_xpm)); -#endif + SetIcon(wxICON(sample)); wxMenu *file_menu = new wxMenu; @@ -347,9 +343,11 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): CreateStatusBar(); + wxPanel *panel = new wxPanel( this, wxID_ANY ); + // Left wxDataViewCtrl - dataview_left = new wxDataViewCtrl( this, wxID_ANY ); + dataview_left = new wxDataViewCtrl( panel, wxID_ANY ); MyTextModel *model = new MyTextModel; dataview_left->AssociateModel( model ); @@ -372,7 +370,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): dataview_left->AppendDateColumn( wxT("date"), 6 ); // Right wxDataViewCtrl using the same model - dataview_right = new wxDataViewCtrl( this, wxID_ANY ); + dataview_right = new wxDataViewCtrl( panel, wxID_ANY ); dataview_right->AssociateModel( model ); text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE ); @@ -381,7 +379,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): dataview_right->AppendTextColumn( wxT("first"), 0 ); dataview_right->AppendTextColumn( wxT("second"), 1 ); wxDataViewToggleCell *toggle_cell = new wxDataViewToggleCell( wxT("bool"), wxDATAVIEW_CELL_ACTIVATABLE ); - column = new wxDataViewColumn( wxT("bool"), toggle_cell, 3 ); + column = new wxDataViewColumn( wxT("bool"), toggle_cell, 3, 30 ); dataview_right->AppendColumn( column ); dataview_right->AppendDateColumn( wxT("date"), 6 ); @@ -392,7 +390,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): sizer->Add( dataview_left, 3, wxGROW ); sizer->Add(10,10); sizer->Add( dataview_right, 2, wxGROW ); - SetSizer( sizer ); + panel->SetSizer( sizer ); } void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) @@ -419,11 +417,7 @@ END_EVENT_TABLE() MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { -#ifdef __WXMSW__ - SetIcon(wxIcon(_T("mondrian"))); -#else - SetIcon(wxIcon(mondrian_xpm)); -#endif + SetIcon(wxICON(sample)); wxMenu *file_menu = new wxMenu; @@ -443,7 +437,7 @@ MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int // Left wxDataViewCtrl - dataview_left = new wxDataViewCtrl( this, wxID_ANY ); + dataview_left = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE ); MyUnsortedTextModel *model = new MyUnsortedTextModel; dataview_left->AssociateModel( model );