for (i = 0; i < 1000; i++)
{ m_progress.Add( i/10 ); }
for (i = 0; i < 1000; i++)
for (i = 0; i < 1000; i++)
{ m_progress.Add( i/10 ); }
for (i = 0; i < 1000; i++)
- wxDataViewCustomCell( wxT("string"), wxDATAVIEW_CELL_ACTIVATABLE )
- {
- m_colour = wxT("black");
+ wxDataViewCustomCell( wxT("string"), wxDATAVIEW_CELL_ACTIVATABLE )
+ {
+ m_colour = wxT("black");
dc->SetPen( *wxBLACK_PEN );
if (m_colour == wxT("red"))
dc->SetBrush( *wxRED_BRUSH );
else if (m_colour == wxT("green"))
dc->SetBrush( *wxGREEN_BRUSH );
dc->SetPen( *wxBLACK_PEN );
if (m_colour == wxT("red"))
dc->SetBrush( *wxRED_BRUSH );
else if (m_colour == wxT("green"))
dc->SetBrush( *wxGREEN_BRUSH );
- bool Activate( wxRect rect,
- wxDataViewListModel *model, size_t col, size_t row )
+ bool Activate( wxRect WXUNUSED(rect),
+ wxDataViewListModel *WXUNUSED(model),
+ size_t WXUNUSED(col),
+ size_t WXUNUSED(row) )
virtual size_t GetNumberOfRows() { return m_list.GetCount(); }
virtual size_t GetNumberOfCols() { return 2; }
virtual size_t GetNumberOfRows() { return m_list.GetCount(); }
virtual size_t GetNumberOfCols() { return 2; }
- virtual wxString GetColType( size_t col ) { return wxT("string"); }
- virtual wxVariant GetValue( size_t col, size_t row )
+ virtual wxString GetColType( size_t WXUNUSED(col) ) { return wxT("string"); }
+ virtual void GetValue( wxVariant &variant, size_t col, size_t row )
void OnAppendRowLeft(wxCommandEvent& event);
void OnPrependRowLeft(wxCommandEvent& event);
void OnInsertRowLeft(wxCommandEvent& event);
void OnDeleteRowLeft(wxCommandEvent& event);
void OnEditRowLeft(wxCommandEvent& event);
void OnAppendRowLeft(wxCommandEvent& event);
void OnPrependRowLeft(wxCommandEvent& event);
void OnInsertRowLeft(wxCommandEvent& event);
void OnDeleteRowLeft(wxCommandEvent& event);
void OnEditRowLeft(wxCommandEvent& event);
void OnAppendRowRight(wxCommandEvent& event);
void OnPrependRowRight(wxCommandEvent& event);
void OnInsertRowRight(wxCommandEvent& event);
void OnDeleteRowRight(wxCommandEvent& event);
void OnEditRowRight(wxCommandEvent& event);
void OnAppendRowRight(wxCommandEvent& event);
void OnPrependRowRight(wxCommandEvent& event);
void OnInsertRowRight(wxCommandEvent& event);
void OnDeleteRowRight(wxCommandEvent& event);
void OnEditRowRight(wxCommandEvent& event);
dataview_left->AppendTextColumn( wxT("first"), 0 );
dataview_left->AppendTextColumn( wxT("second"), 1 );
wxDataViewTextCell *text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_cell, 2 );
dataview_left->AppendColumn( column );
dataview_left->AppendTextColumn( wxT("first"), 0 );
dataview_left->AppendTextColumn( wxT("second"), 1 );
wxDataViewTextCell *text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_cell, 2 );
dataview_left->AppendColumn( column );
MyCustomCell *custom_cell = new MyCustomCell;
column = new wxDataViewColumn( wxT("custom"), custom_cell, 4 );
dataview_left->AppendColumn( column );
MyCustomCell *custom_cell = new MyCustomCell;
column = new wxDataViewColumn( wxT("custom"), custom_cell, 4 );
dataview_left->AppendColumn( column );
dataview_right->AssociateModel( model );
text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
dataview_right->AssociateModel( model );
text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
dataview_right->AppendColumn( column );
dataview_right->AppendTextColumn( wxT("first"), 0 );
dataview_right->AppendTextColumn( wxT("second"), 1 );
dataview_right->AppendColumn( column );
dataview_right->AppendTextColumn( wxT("first"), 0 );
dataview_right->AppendTextColumn( wxT("second"), 1 );
- wxDataViewToggleCell *toggle_cell = new wxDataViewToggleCell( wxT("bool"), wxDATAVIEW_CELL_EDITABLE );
- column = new wxDataViewColumn( wxT("bool"), toggle_cell, 3 );
+ wxDataViewToggleCell *toggle_cell = new wxDataViewToggleCell( wxT("bool"), wxDATAVIEW_CELL_ACTIVATABLE );
+ column = new wxDataViewColumn( wxT("bool"), toggle_cell, 3, 30 );
dataview_right->AppendColumn( column );
dataview_right->AppendDateColumn( wxT("date"), 6 );
dataview_right->AppendColumn( column );
dataview_right->AppendDateColumn( wxT("date"), 6 );
wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
sizer->Add( dataview_left, 3, wxGROW );
sizer->Add(10,10);
sizer->Add( dataview_right, 2, wxGROW );
wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
sizer->Add( dataview_left, 3, wxGROW );
sizer->Add(10,10);
sizer->Add( dataview_right, 2, wxGROW );
- dataview_left = new wxDataViewCtrl( this, -1 );
+ dataview_left = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE );
wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_cell, 0 );
dataview_left->AppendColumn( column );
dataview_left->AppendTextColumn( wxT("second"), 1 );
wxDataViewColumn *column = new wxDataViewColumn( wxT("editable"), text_cell, 0 );
dataview_left->AppendColumn( column );
dataview_left->AppendTextColumn( wxT("second"), 1 );
- dataview_right = new wxDataViewCtrl( this, -1 );
- wxDataViewSortedListModel *sorted_model =
+ dataview_right = new wxDataViewCtrl( this, wxID_ANY );
+ wxDataViewSortedListModel *sorted_model =
new wxDataViewSortedListModel( model );
dataview_right->AssociateModel( sorted_model );
text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
new wxDataViewSortedListModel( model );
dataview_right->AssociateModel( sorted_model );
text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
dataview_right->AppendTextColumn( wxT("second"), 1 );
// layout dataview controls.
dataview_right->AppendTextColumn( wxT("second"), 1 );
// layout dataview controls.
wxBoxSizer *top_sizer = new wxBoxSizer( wxHORIZONTAL );
top_sizer->Add( dataview_left, 1, wxGROW );
top_sizer->Add(10,10);
top_sizer->Add( dataview_right, 1, wxGROW );
wxBoxSizer *top_sizer = new wxBoxSizer( wxHORIZONTAL );
top_sizer->Add( dataview_left, 1, wxGROW );
top_sizer->Add(10,10);
top_sizer->Add( dataview_right, 1, wxGROW );
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( 10, 10, 1 );
wxFlexGridSizer *left_sizer = new wxFlexGridSizer( 2 );
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( 10, 10, 1 );
wxFlexGridSizer *left_sizer = new wxFlexGridSizer( 2 );
right_sizer->Add( new wxButton( this, ID_EDIT_ROW_RIGHT, wxT("Edit") ), 0, wxALL, 5 );
button_sizer->Add( right_sizer );
button_sizer->Add( 10, 10, 1 );
right_sizer->Add( new wxButton( this, ID_EDIT_ROW_RIGHT, wxT("Edit") ), 0, wxALL, 5 );
button_sizer->Add( right_sizer );
button_sizer->Add( 10, 10, 1 );
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
main_sizer->Add( top_sizer, 1, wxGROW );
main_sizer->Add( button_sizer, 0, wxGROW );
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
main_sizer->Add( top_sizer, 1, wxGROW );
main_sizer->Add( button_sizer, 0, wxGROW );