-// -------------------------------------
-// MyFrame
-// -------------------------------------
-
-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))
-{
- SetIcon(wxICON(sample));
-
- wxMenu *file_menu = new wxMenu;
-
- file_menu->Append(DYNAMIC_ABOUT, _T("&About"));
- file_menu->Append(DYNAMIC_QUIT, _T("E&xit"));
- wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- SetMenuBar(menu_bar);
-
- // You used to have to do some casting for param 4, but now there are type-safe handlers
- Connect( DYNAMIC_QUIT, wxID_ANY,
- wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit) );
- Connect( DYNAMIC_ABOUT, wxID_ANY,
- wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout) );
-
- CreateStatusBar();
-
- wxPanel *panel = new wxPanel( this, wxID_ANY );
-
-
- // Left wxDataViewCtrl
- dataview_left = new wxDataViewCtrl( panel, wxID_ANY );
-
- MyTextModel *model = new MyTextModel;
- dataview_left->AssociateModel( model );
-
- dataview_left->AppendTextColumn( wxT("first"), 0 );
- dataview_left->AppendTextColumn( wxT("second"), 1 );
-
- wxDataViewTextRenderer *text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
- wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_renderer, 2 );
- dataview_left->AppendColumn( column );
-
- dataview_left->AppendToggleColumn( wxT("fourth"), 3 );
-
- MyCustomRenderer *custom_renderer = new MyCustomRenderer;
- column = new wxDataViewColumn( wxT("custom"), custom_renderer, 4 );
- dataview_left->AppendColumn( column );
-
- dataview_left->AppendProgressColumn( wxT("progress"), 5 );
-
- dataview_left->AppendDateColumn( wxT("date"), 6 );
-
- // Right wxDataViewCtrl using the same model
- dataview_right = new wxDataViewCtrl( panel, wxID_ANY );
- dataview_right->AssociateModel( model );
-
- text_renderer = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
- column = new wxDataViewColumn( wxT("editable"), text_renderer, 2 );
- dataview_right->AppendColumn( column );
- dataview_right->AppendTextColumn( wxT("first"), 0 );
- dataview_right->AppendTextColumn( wxT("second"), 1 );
- wxDataViewToggleRenderer *toggle_renderer = new wxDataViewToggleRenderer( wxT("bool"), wxDATAVIEW_CELL_ACTIVATABLE );
- column = new wxDataViewColumn( wxT("bool"), toggle_renderer, 3, 30 );
- dataview_right->AppendColumn( column );
-
- dataview_right->AppendDateColumn( wxT("date"), 6 );
-
- // layout dataview controls.
-
- wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
- sizer->Add( dataview_left, 3, wxGROW );
- sizer->Add(10,10);
- sizer->Add( dataview_right, 2, wxGROW );
- panel->SetSizer( sizer );
-}
-
-void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )