1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDataViewCtrl wxWidgets sample
4 // Author: Robert Roebling
5 // Modified by: Francesco Montorsi, Bo Yang
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
23 #include "wx/datetime.h"
24 #include "wx/splitter.h"
25 #include "wx/aboutdlg.h"
26 #include "wx/choicdlg.h"
27 #include "wx/numdlg.h"
28 #include "wx/dataview.h"
29 #include "wx/spinctrl.h"
32 #include "../sample.xpm"
38 #define DEFAULT_ALIGN wxALIGN_LEFT
39 #define DATAVIEW_DEFAULT_STYLE (wxDV_MULTIPLE|wxDV_HORIZ_RULES|wxDV_VERT_RULES)
42 // -------------------------------------
43 // MySpinCtrlInPlaceRenderer
44 // -------------------------------------
46 class MySpinCtrlInPlaceRenderer
: public wxDataViewCustomRenderer
49 MySpinCtrlInPlaceRenderer() :
50 wxDataViewCustomRenderer( wxT("long"), wxDATAVIEW_CELL_EDITABLE
) { }
53 virtual bool HasEditorCtrl()
57 virtual wxControl
* CreateEditorCtrl( wxWindow
*parent
, wxRect labelRect
, const wxVariant
&value
)
60 return new wxSpinCtrl( parent
, wxID_ANY
, wxEmptyString
,
61 labelRect
.GetTopLeft(), labelRect
.GetSize(), -0, -1, 2010, l
);
63 virtual bool GetValueFromEditorCtrl( wxControl
* editor
, wxVariant
&value
)
65 wxSpinCtrl
*sc
= (wxSpinCtrl
*) editor
;
66 long l
= sc
->GetValue();
71 bool Render( wxRect rect
, wxDC
*dc
, int WXUNUSED(state
) )
74 str
.Printf( wxT("%d"), (int) m_data
);
75 dc
->SetTextForeground( *wxBLACK
);
76 dc
->DrawText( str
, rect
.x
, rect
.y
);
79 wxSize
GetSize() const
83 bool SetValue( const wxVariant
&value
)
85 m_data
= value
.GetLong();
88 bool GetValue( wxVariant
&value
) const
100 // -------------------------------------
102 // -------------------------------------
105 Implement this data model
107 -------------------------------------------------------------
110 3: You are not alone Michael Jackson 1995
111 4: Take a bow Madonna 1994
113 6: Ninth Symphony Ludwig v. Beethoven 1824
114 7: German Requiem Johannes Brahms 1868
119 class MyMusicModelNode
;
120 WX_DEFINE_ARRAY_PTR( MyMusicModelNode
*, MyMusicModelNodes
);
122 class MyMusicModelNode
125 MyMusicModelNode( MyMusicModelNode
* parent
,
126 const wxString
&title
, const wxString
&artist
, int year
)
132 m_isContainer
= false;
135 MyMusicModelNode( MyMusicModelNode
* parent
,
136 const wxString
&branch
)
141 m_isContainer
= true;
146 size_t count
= m_children
.GetCount();
148 for (i
= 0; i
< count
; i
++)
150 MyMusicModelNode
*child
= m_children
[i
];
155 bool IsContainer() { return m_isContainer
; }
157 MyMusicModelNode
* GetParent() { return m_parent
; }
158 MyMusicModelNodes
&GetChildren() { return m_children
; }
159 MyMusicModelNode
* GetNthChild( unsigned int n
) { return m_children
.Item( n
); }
160 void Insert( MyMusicModelNode
* child
, unsigned int n
) { m_children
.Insert( child
, n
); }
161 void Append( MyMusicModelNode
* child
) { m_children
.Add( child
); }
162 unsigned int GetChildCount() { return m_children
.GetCount(); }
170 MyMusicModelNode
*m_parent
;
171 MyMusicModelNodes m_children
;
176 class MyMusicModel
: public wxDataViewModel
184 m_root
= new MyMusicModelNode( NULL
, "My Music" );
185 m_pop
= new MyMusicModelNode( m_root
, "Pop music" );
186 m_root
->Append( m_pop
);
187 m_pop
->Append( new MyMusicModelNode( m_pop
,
188 "You are not alone", "Michael Jackson", 1995 ) );
189 m_pop
->Append( new MyMusicModelNode( m_pop
,
190 "Take a bow", "Madonna", 1994 ) );
191 m_classical
= new MyMusicModelNode( m_root
, "Classical music" );
192 m_root
->Append( m_classical
);
193 m_classical
->Append( new MyMusicModelNode( m_classical
,
194 "Ninth symphony", "Ludwig van Beethoven", 1824 ) );
195 m_classical
->Append( new MyMusicModelNode( m_classical
,
196 "German Requiem", "Johannes Brahms", 1868 ) );
197 m_classicalMusicIsKnownToControl
= false;
200 // helper method for wxLog
202 wxString
GetTitle( const wxDataViewItem
&item
)
204 MyMusicModelNode
*node
= (MyMusicModelNode
*) item
.GetID();
206 return wxEmptyString
;
208 return node
->m_title
;
211 // helper methods to change the model
213 void AddToClassical( const wxString
&title
, const wxString
&artist
, int year
)
216 MyMusicModelNode
*child_node
=
217 new MyMusicModelNode( m_classical
, title
, artist
, year
);
219 m_classical
->Append( child_node
);
221 if (m_classicalMusicIsKnownToControl
)
224 wxDataViewItem
child( (void*) child_node
);
225 wxDataViewItem
parent( (void*) m_classical
);
226 ItemAdded( parent
, child
);
230 void Delete( const wxDataViewItem
&item
)
232 MyMusicModelNode
*node
= (MyMusicModelNode
*) item
.GetID();
233 wxDataViewItem
parent( node
->GetParent() );
235 node
->GetParent()->GetChildren().Remove( node
);
239 ItemDeleted( parent
, item
);
242 // override sorting to always sort branches ascendingly
244 int Compare( const wxDataViewItem
&item1
, const wxDataViewItem
&item2
,
245 unsigned int column
, bool ascending
)
247 if (IsContainer(item1
) && IsContainer(item2
))
249 wxVariant value1
,value2
;
250 GetValue( value1
, item1
, 0 );
251 GetValue( value2
, item2
, 0 );
253 wxString str1
= value1
.GetString();
254 wxString str2
= value2
.GetString();
255 int res
= str1
.Cmp( str2
);
258 // items must be different
259 unsigned long litem1
= (unsigned long) item1
.GetID();
260 unsigned long litem2
= (unsigned long) item2
.GetID();
262 return litem1
-litem2
;
265 return wxDataViewModel::Compare( item1
, item2
, column
, ascending
);
268 // implementation of base class virtuals to define model
270 virtual unsigned int GetColumnCount() const
275 virtual wxString
GetColumnType( unsigned int col
) const
283 virtual void GetValue( wxVariant
&variant
,
284 const wxDataViewItem
&item
, unsigned int col
) const
286 MyMusicModelNode
*node
= (MyMusicModelNode
*) item
.GetID();
289 case 0: variant
= node
->m_title
; break;
290 case 1: variant
= node
->m_artist
; break;
291 case 2: variant
= (long) node
->m_year
; break;
294 wxLogError( "MyMusicModel::GetValue: wrong column" );
296 // provoke a crash when mouse button down
297 wxMouseState state
= wxGetMouseState();
298 if (state
.ShiftDown())
307 virtual bool SetValue( const wxVariant
&variant
,
308 const wxDataViewItem
&item
, unsigned int col
)
310 MyMusicModelNode
*node
= (MyMusicModelNode
*) item
.GetID();
313 case 0: node
->m_title
= variant
.GetString(); return true;
314 case 1: node
->m_artist
= variant
.GetString(); return true;
315 case 2: node
->m_year
= variant
.GetLong(); return true;
316 default: wxLogError( "MyMusicModel::SetValue: wrong column" );
321 virtual wxDataViewItem
GetParent( const wxDataViewItem
&item
) const
323 // the invisble root node has no parent
325 return wxDataViewItem(0);
327 MyMusicModelNode
*node
= (MyMusicModelNode
*) item
.GetID();
329 // "MyMusic" also has no parent
331 return wxDataViewItem(0);
333 return wxDataViewItem( (void*) node
->GetParent() );
336 virtual bool IsContainer( const wxDataViewItem
&item
) const
338 // the invisble root node can have children (in
339 // our model always "MyMusic")
343 MyMusicModelNode
*node
= (MyMusicModelNode
*) item
.GetID();
344 return node
->IsContainer();
347 virtual unsigned int GetChildren( const wxDataViewItem
&parent
, wxDataViewItemArray
&array
) const
349 MyMusicModelNode
*node
= (MyMusicModelNode
*) parent
.GetID();
352 array
.Add( wxDataViewItem( (void*) m_root
) );
356 if (node
== m_classical
)
358 MyMusicModel
*model
= (MyMusicModel
*)(const MyMusicModel
*) this;
359 model
->m_classicalMusicIsKnownToControl
= true;
362 if (node
->GetChildCount() == 0)
367 unsigned int count
= node
->GetChildren().GetCount();
369 for (pos
= 0; pos
< count
; pos
++)
371 MyMusicModelNode
*child
= node
->GetChildren().Item( pos
);
372 array
.Add( wxDataViewItem( (void*) child
) );
378 MyMusicModelNode
* m_root
;
379 MyMusicModelNode
* m_pop
;
380 MyMusicModelNode
* m_classical
;
381 bool m_classicalMusicIsKnownToControl
;
384 class MyListModel
: public wxDataViewIndexListModel
388 wxDataViewIndexListModel( 100 )
391 for (i
= 0; i
< 100; i
++)
394 str
.Printf( "row number %d", i
);
398 m_icon
= wxIcon( null_xpm
);
401 // helper methods to change the model
403 void Prepend( const wxString
&text
)
405 m_array
.Insert( text
, 0 );
409 void DeleteItem( const wxDataViewItem
&item
)
411 unsigned int row
= GetRow( item
);
412 m_array
.RemoveAt( row
);
416 // implementation of base class virtuals to define model
418 virtual unsigned int GetColumnCount() const
423 virtual wxString
GetColumnType( unsigned int col
) const
426 return "wxDataViewIconText";
431 virtual unsigned int GetRowCount()
433 return m_array
.GetCount();
436 virtual void GetValue( wxVariant
&variant
,
437 unsigned int row
, unsigned int col
) const
441 variant
= m_array
[ row
];
445 wxDataViewIconText
data( "test", m_icon
);
451 str
.Printf( "row %d col %d", row
, col
);
456 virtual bool SetValue( const wxVariant
&variant
,
457 unsigned int row
, unsigned int col
)
461 m_array
[row
] = variant
.GetString();
468 wxArrayString m_array
;
472 // -------------------------------------
474 // -------------------------------------
476 class MyApp
: public wxApp
483 // -------------------------------------
485 // -------------------------------------
487 class MyFrame
: public wxFrame
490 MyFrame(wxFrame
*frame
, wxChar
*title
, int x
, int y
, int w
, int h
);
493 void OnQuit(wxCommandEvent
& event
);
494 void OnAbout(wxCommandEvent
& event
);
496 void OnAddMozart(wxCommandEvent
& event
);
497 void OnDeleteMusic(wxCommandEvent
& event
);
499 void OnPrependList(wxCommandEvent
& event
);
500 void OnDeleteList(wxCommandEvent
& event
);
502 void OnValueChanged( wxDataViewEvent
&event
);
504 void OnActivated( wxDataViewEvent
&event
);
505 void OnExpanding( wxDataViewEvent
&event
);
506 void OnExpanded( wxDataViewEvent
&event
);
507 void OnCollapsing( wxDataViewEvent
&event
);
508 void OnCollapsed( wxDataViewEvent
&event
);
509 void OnSelectionChanged( wxDataViewEvent
&event
);
511 void OnEditingStarted( wxDataViewEvent
&event
);
512 void OnEditingDone( wxDataViewEvent
&event
);
514 void OnHeaderClick( wxDataViewEvent
&event
);
515 void OnHeaderRightClick( wxDataViewEvent
&event
);
516 void OnSorted( wxDataViewEvent
&event
);
518 void OnRightClick( wxMouseEvent
&event
);
519 void OnGoto( wxCommandEvent
&event
);
522 wxDataViewCtrl
* m_musicCtrl
;
523 wxObjectDataPtr
<MyMusicModel
> m_music_model
;
525 wxDataViewCtrl
* m_listCtrl
;
526 wxObjectDataPtr
<MyListModel
> m_list_model
;
528 wxDataViewColumn
* m_col
;
534 DECLARE_EVENT_TABLE()
537 // -------------------------------------
539 // -------------------------------------
543 bool MyApp::OnInit(void)
545 if ( !wxApp::OnInit() )
548 // build the first frame
550 new MyFrame(NULL
, wxT("wxDataViewCtrl feature test"), 40, 40, 800, 440);
563 // -------------------------------------
565 // -------------------------------------
570 ID_ABOUT
= wxID_ABOUT
,
576 ID_DELETE_MUSIC
= 101,
578 ID_PREPEND_LIST
= 200,
579 ID_DELETE_LIST
= 201,
583 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
584 EVT_MENU( ID_ABOUT
, MyFrame::OnAbout
)
585 EVT_MENU( ID_EXIT
, MyFrame::OnQuit
)
586 EVT_BUTTON( ID_ADD_MOZART
, MyFrame::OnAddMozart
)
587 EVT_BUTTON( ID_DELETE_MUSIC
, MyFrame::OnDeleteMusic
)
588 EVT_BUTTON( ID_PREPEND_LIST
, MyFrame::OnPrependList
)
589 EVT_BUTTON( ID_DELETE_LIST
, MyFrame::OnDeleteList
)
590 EVT_BUTTON( ID_GOTO
, MyFrame::OnGoto
)
592 EVT_DATAVIEW_ITEM_VALUE_CHANGED( ID_MUSIC_CTRL
, MyFrame::OnValueChanged
)
594 EVT_DATAVIEW_ITEM_ACTIVATED(ID_MUSIC_CTRL
, MyFrame::OnActivated
)
595 EVT_DATAVIEW_ITEM_EXPANDING(ID_MUSIC_CTRL
, MyFrame::OnExpanding
)
596 EVT_DATAVIEW_ITEM_EXPANDED(ID_MUSIC_CTRL
, MyFrame::OnExpanded
)
597 EVT_DATAVIEW_ITEM_COLLAPSING(ID_MUSIC_CTRL
, MyFrame::OnCollapsing
)
598 EVT_DATAVIEW_ITEM_COLLAPSED(ID_MUSIC_CTRL
, MyFrame::OnCollapsed
)
599 EVT_DATAVIEW_SELECTION_CHANGED(ID_MUSIC_CTRL
, MyFrame::OnSelectionChanged
)
601 EVT_DATAVIEW_ITEM_EDITING_STARTED(ID_MUSIC_CTRL
, MyFrame::OnEditingStarted
)
602 EVT_DATAVIEW_ITEM_EDITING_DONE(ID_MUSIC_CTRL
, MyFrame::OnEditingDone
)
604 EVT_DATAVIEW_COLUMN_HEADER_CLICK(ID_MUSIC_CTRL
, MyFrame::OnHeaderClick
)
605 EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(ID_MUSIC_CTRL
, MyFrame::OnHeaderRightClick
)
606 EVT_DATAVIEW_COLUMN_SORTED(ID_MUSIC_CTRL
, MyFrame::OnSorted
)
608 EVT_RIGHT_UP(MyFrame::OnRightClick
)
611 MyFrame::MyFrame(wxFrame
*frame
, wxChar
*title
, int x
, int y
, int w
, int h
):
612 wxFrame(frame
, wxID_ANY
, title
, wxPoint(x
, y
), wxSize(w
, h
))
617 SetIcon(wxICON(sample
));
621 wxMenu
*file_menu
= new wxMenu
;
622 file_menu
->Append(ID_ABOUT
, "&About");
623 file_menu
->AppendSeparator();
624 file_menu
->Append(ID_EXIT
, "E&xit");
626 wxMenuBar
*menu_bar
= new wxMenuBar
;
627 menu_bar
->Append(file_menu
, "&File");
629 SetMenuBar(menu_bar
);
632 wxBoxSizer
*main_sizer
= new wxBoxSizer( wxVERTICAL
);
634 wxBoxSizer
*data_sizer
= new wxBoxSizer( wxHORIZONTAL
);
638 m_musicCtrl
= new wxDataViewCtrl( this, ID_MUSIC_CTRL
, wxDefaultPosition
,
639 wxDefaultSize
, wxDV_MULTIPLE
);
641 m_music_model
= new MyMusicModel
;
642 m_musicCtrl
->AssociateModel( m_music_model
.get() );
644 wxDataViewColumn
*col
= m_musicCtrl
->AppendTextColumn( "Title", 0, wxDATAVIEW_CELL_INERT
, 200,
645 DEFAULT_ALIGN
, wxDATAVIEW_COL_SORTABLE
);
647 // Call this and sorting is enabled
648 // immediatly upon start up.
649 col
->SetSortOrder( true );
652 m_musicCtrl
->AppendTextColumn( "Artist", 1, wxDATAVIEW_CELL_EDITABLE
, 150,
653 DEFAULT_ALIGN
, wxDATAVIEW_COL_SORTABLE
);
655 MySpinCtrlInPlaceRenderer
*sr
= new MySpinCtrlInPlaceRenderer
;
656 wxDataViewColumn
*column
= new wxDataViewColumn( "year", sr
, 2, -1, wxALIGN_CENTRE
, wxDATAVIEW_COL_SORTABLE
);
657 m_musicCtrl
->AppendColumn( column
);
659 data_sizer
->Add( m_musicCtrl
, 3, wxGROW
);
665 m_listCtrl
= new wxDataViewCtrl( this, wxID_ANY
, wxDefaultPosition
,
666 wxDefaultSize
, wxDV_MULTIPLE
);
668 m_list_model
= new MyListModel
;
669 m_listCtrl
->AssociateModel( m_list_model
.get() );
671 m_listCtrl
->AppendTextColumn( "editable string", 0, wxDATAVIEW_CELL_EDITABLE
, 120 );
672 m_listCtrl
->AppendIconTextColumn( "icon", 1, wxDATAVIEW_CELL_INERT
, 60 );
673 m_listCtrl
->AppendTextColumn( "index", 2, wxDATAVIEW_CELL_INERT
, 120 );
675 data_sizer
->Add( m_listCtrl
, 2, wxGROW
);
679 main_sizer
->Add( data_sizer
, 2, wxGROW
);
681 wxBoxSizer
*button_sizer
= new wxBoxSizer( wxHORIZONTAL
);
683 button_sizer
->Add( new wxButton( this, ID_ADD_MOZART
, "Add Mozart"), 0, wxALL
, 10 );
684 button_sizer
->Add( new wxButton( this, ID_DELETE_MUSIC
, "Delete selected"), 0, wxALL
, 10 );
685 button_sizer
->Add( 10, 10, 1 );
686 button_sizer
->Add( new wxButton( this, ID_PREPEND_LIST
, "Prepend"), 0, wxALL
, 10 );
687 button_sizer
->Add( new wxButton( this, ID_DELETE_LIST
, "Delete selected"), 0, wxALL
, 10 );
688 button_sizer
->Add( new wxButton( this, ID_GOTO
, "Goto 50"), 0, wxALL
, 10 );
690 main_sizer
->Add( button_sizer
, 0, wxGROW
, 0 );
692 m_log
= new wxTextCtrl( this, -1, "", wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
);
693 m_logOld
= wxLog::SetActiveTarget(new wxLogTextCtrl(m_log
));
694 wxLogMessage("This is the log window");
696 main_sizer
->Add( m_log
, 1, wxGROW
);
698 SetSizer( main_sizer
);
701 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
) )
706 void MyFrame::OnAddMozart(wxCommandEvent
& WXUNUSED(event
) )
708 m_music_model
->AddToClassical( "Kleine Nachtmusik", "Wolfgang Mozart", 1787 );
711 void MyFrame::OnDeleteMusic(wxCommandEvent
& WXUNUSED(event
) )
713 wxDataViewItemArray items
;
714 int len
= m_musicCtrl
->GetSelections( items
);
715 for( int i
= 0; i
< len
; i
++ )
717 m_music_model
->Delete( items
[i
] );
720 void MyFrame::OnPrependList( wxCommandEvent
& WXUNUSED(event
) )
722 m_list_model
->Prepend( "Test" );
725 void MyFrame::OnDeleteList( wxCommandEvent
& WXUNUSED(event
) )
727 wxDataViewItemArray items
;
728 int len
= m_listCtrl
->GetSelections( items
);
729 for( int i
= 0; i
< len
; i
++ )
731 m_list_model
->DeleteItem( items
[i
] );
734 void MyFrame::OnValueChanged( wxDataViewEvent
&event
)
739 wxLogMessage( "EVT_DATAVIEW_ITEM_VALUE_CHANGED, Item Id: %d; Column: %d", event
.GetItem().GetID(), event
.GetColumn() );
742 void MyFrame::OnActivated( wxDataViewEvent
&event
)
747 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
748 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, Item: %s", title
);
751 void MyFrame::OnSelectionChanged( wxDataViewEvent
&event
)
756 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
760 wxLogMessage("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, First selected Item: %s", title
);
763 void MyFrame::OnExpanding( wxDataViewEvent
&event
)
768 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
769 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, Item: %s", title
);
773 void MyFrame::OnEditingStarted( wxDataViewEvent
&event
)
778 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
779 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED, Item: %s", title
);
782 void MyFrame::OnEditingDone( wxDataViewEvent
&event
)
787 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
788 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, Item: %s", title
);
791 void MyFrame::OnExpanded( wxDataViewEvent
&event
)
796 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
797 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, Item: %s", title
);
800 void MyFrame::OnCollapsing( wxDataViewEvent
&event
)
805 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
806 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, Item: %s", title
);
809 void MyFrame::OnCollapsed( wxDataViewEvent
&event
)
814 wxString title
= m_music_model
->GetTitle( event
.GetItem() );
815 wxLogMessage("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, Item: %s", title
);
818 void MyFrame::OnHeaderClick( wxDataViewEvent
&event
)
823 int pos
= m_musicCtrl
->GetColumnPosition( event
.GetDataViewColumn() );
825 wxLogMessage("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, Column position: %d", pos
);
828 void MyFrame::OnHeaderRightClick( wxDataViewEvent
&event
)
833 int pos
= m_musicCtrl
->GetColumnPosition( event
.GetDataViewColumn() );
835 wxLogMessage("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, Column position: %d", pos
);
838 void MyFrame::OnSorted( wxDataViewEvent
&event
)
843 int pos
= m_musicCtrl
->GetColumnPosition( event
.GetDataViewColumn() );
845 wxLogMessage("wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, Column position: %d", pos
);
848 void MyFrame::OnRightClick( wxMouseEvent
&event
)
853 wxLogMessage("wxEVT_MOUSE_RIGHT_UP, Click Point is X: %d, Y: %d", event
.GetX(), event
.GetY());
856 void MyFrame::OnGoto( wxCommandEvent
&event
)
858 wxDataViewItem item
= m_list_model
->GetItem( 50 );
859 m_listCtrl
->EnsureVisible(item
,m_col
);
862 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
) )
864 wxAboutDialogInfo info
;
865 info
.SetName(_("DataView sample"));
866 info
.SetDescription(_("This sample demonstrates the dataview control handling"));
867 info
.SetCopyright(_T("(C) 2007 Robert Roebling"));