1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/datavcmn.cpp
3 // Purpose: wxDataViewCtrl base classes and common parts
4 // Author: Robert Roebling
7 // Copyright: (c) 2006, Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_DATAVIEWCTRL
20 #include "wx/dataview.h"
26 const wxChar wxDataViewCtrlNameStr
[] = wxT("dataviewCtrl");
29 // ---------------------------------------------------------
30 // wxDataViewListModel
31 // ---------------------------------------------------------
33 wxDataViewListModel::wxDataViewListModel()
35 m_viewingColumns
.DeleteContents( true );
36 m_notifiers
.DeleteContents( true );
39 wxDataViewListModel::~wxDataViewListModel()
41 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
44 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
46 node
= node
->GetNext();
50 bool wxDataViewListModel::RowAppended()
54 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
57 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
58 if (!notifier
->RowAppended())
60 node
= node
->GetNext();
66 bool wxDataViewListModel::RowPrepended()
70 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
73 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
74 if (!notifier
->RowPrepended())
76 node
= node
->GetNext();
82 bool wxDataViewListModel::RowInserted( unsigned int before
)
86 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
89 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
90 if (!notifier
->RowInserted(before
))
92 node
= node
->GetNext();
98 bool wxDataViewListModel::RowDeleted( unsigned int row
)
102 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
105 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
106 if (!notifier
->RowDeleted( row
))
108 node
= node
->GetNext();
114 bool wxDataViewListModel::RowChanged( unsigned int row
)
118 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
121 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
122 if (!notifier
->RowChanged( row
))
124 node
= node
->GetNext();
130 bool wxDataViewListModel::ValueChanged( unsigned int col
, unsigned int row
)
134 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
137 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
138 if (!notifier
->ValueChanged( col
, row
))
140 node
= node
->GetNext();
146 bool wxDataViewListModel::RowsReordered( unsigned int *new_order
)
150 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
153 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
154 if (!notifier
->RowsReordered( new_order
))
156 node
= node
->GetNext();
162 bool wxDataViewListModel::Cleared()
166 wxList::compatibility_iterator node
= m_notifiers
.GetFirst();
169 wxDataViewListModelNotifier
* notifier
= (wxDataViewListModelNotifier
*) node
->GetData();
170 if (!notifier
->Cleared())
172 node
= node
->GetNext();
178 void wxDataViewListModel::AddViewingColumn( wxDataViewColumn
*view_column
, unsigned int model_column
)
180 m_viewingColumns
.Append( new wxDataViewViewingColumn( view_column
, model_column
) );
183 void wxDataViewListModel::RemoveViewingColumn( wxDataViewColumn
*column
)
185 wxList::compatibility_iterator node
= m_viewingColumns
.GetFirst();
188 wxDataViewViewingColumn
* tmp
= (wxDataViewViewingColumn
*) node
->GetData();
190 if (tmp
->m_viewColumn
== column
)
192 m_viewingColumns
.DeleteObject( tmp
);
196 node
= node
->GetNext();
200 void wxDataViewListModel::AddNotifier( wxDataViewListModelNotifier
*notifier
)
202 m_notifiers
.Append( notifier
);
203 notifier
->SetOwner( this );
206 void wxDataViewListModel::RemoveNotifier( wxDataViewListModelNotifier
*notifier
)
208 m_notifiers
.DeleteObject( notifier
);
211 // ---------------------------------------------------------
212 // wxDataViewSortedListModelNotifier
213 // ---------------------------------------------------------
215 class wxDataViewSortedListModelNotifier
: public wxDataViewListModelNotifier
218 wxDataViewSortedListModelNotifier( wxDataViewSortedListModel
*model
)
221 virtual bool RowAppended()
222 { return m_model
->ChildRowAppended(); }
224 virtual bool RowPrepended()
225 { return m_model
->ChildRowPrepended(); }
227 virtual bool RowInserted( unsigned int before
)
228 { return m_model
->ChildRowInserted( before
); }
230 virtual bool RowDeleted( unsigned int row
)
231 { return m_model
->ChildRowDeleted( row
); }
233 virtual bool RowChanged( unsigned int row
)
234 { return m_model
->ChildRowChanged( row
); }
236 virtual bool ValueChanged( unsigned int col
, unsigned int row
)
237 { return m_model
->ChildValueChanged( col
, row
); }
239 virtual bool RowsReordered( unsigned int *new_order
)
240 { return m_model
->ChildRowsReordered( new_order
); }
242 virtual bool Cleared()
243 { return m_model
->ChildCleared(); }
246 { m_model
->m_child
= NULL
; return wxDataViewListModelNotifier::Freed(); }
248 wxDataViewSortedListModel
*m_model
;
251 // ---------------------------------------------------------
252 // wxDataViewSortedListModel compare function
253 // ---------------------------------------------------------
255 int wxCALLBACK wxDataViewListModelSortedDefaultCompare
256 (unsigned int row1
, unsigned int row2
, unsigned int col
, wxDataViewListModel
* model
)
258 wxVariant value1
,value2
;
259 model
->GetValue( value1
, col
, row1
);
260 model
->GetValue( value2
, col
, row2
);
261 if (value1
.GetType() == wxT("string"))
263 wxString str1
= value1
.GetString();
264 wxString str2
= value2
.GetString();
265 return str1
.Cmp( str2
);
267 if (value1
.GetType() == wxT("long"))
269 long l1
= value1
.GetLong();
270 long l2
= value2
.GetLong();
273 if (value1
.GetType() == wxT("double"))
275 double d1
= value1
.GetDouble();
276 double d2
= value2
.GetDouble();
277 if (d1
== d2
) return 0;
278 if (d1
< d2
) return 1;
281 if (value1
.GetType() == wxT("datetime"))
283 wxDateTime dt1
= value1
.GetDateTime();
284 wxDateTime dt2
= value2
.GetDateTime();
285 if (dt1
.IsEqualTo(dt2
)) return 0;
286 if (dt1
.IsEarlierThan(dt2
)) return 1;
293 int wxCALLBACK wxDataViewListModelSortedDefaultCompareDescending
294 (unsigned int row1
, unsigned int row2
, unsigned int col
, wxDataViewListModel
* model
)
296 return wxDataViewListModelSortedDefaultCompare( row2
, row1
, col
, model
);
299 static wxDataViewListModelCompare s_CmpFunc
;
300 static wxDataViewListModel
*s_CmpModel
;
301 static unsigned int s_CmpCol
;
303 int LINKAGEMODE
wxDataViewIntermediateCmp( unsigned int row1
, unsigned int row2
)
305 return s_CmpFunc( row1
, row2
, s_CmpCol
, s_CmpModel
);
308 // ---------------------------------------------------------
309 // wxDataViewSortedListModel
310 // ---------------------------------------------------------
312 wxDataViewSortedListModel::wxDataViewSortedListModel( wxDataViewListModel
*child
) :
313 m_array( wxDataViewIntermediateCmp
)
319 m_notifierOnChild
= new wxDataViewSortedListModelNotifier( this );
320 m_child
->AddNotifier( m_notifierOnChild
);
325 wxDataViewSortedListModel::~wxDataViewSortedListModel()
328 m_child
->RemoveNotifier( m_notifierOnChild
);
332 void wxDataViewSortedListModel::InitStatics()
335 s_CmpModel
= m_child
;
337 s_CmpFunc
= wxDataViewListModelSortedDefaultCompare
;
339 s_CmpFunc
= wxDataViewListModelSortedDefaultCompareDescending
;
342 void wxDataViewSortedListModel::Resort()
347 unsigned int n
= m_child
->GetRowCount();
349 for (i
= 0; i
< n
; i
++)
354 static void Dump( wxDataViewListModel
*model
, unsigned int col
)
356 unsigned int n
= model
->GetRowCount();
358 for (i
= 0; i
< n
; i
++)
361 model
->GetValue( variant
, col
, i
);
363 tmp
= variant
.GetString();
364 wxPrintf( wxT("%d: %s\n"), (int) i
, tmp
.c_str() );
369 bool wxDataViewSortedListModel::ChildRowAppended()
371 // no need to fix up array
373 unsigned int len
= m_array
.GetCount();
375 unsigned int pos
= m_array
.Add( len
);
378 return wxDataViewListModel::RowPrepended();
381 return wxDataViewListModel::RowAppended();
383 return wxDataViewListModel::RowInserted( pos
);
386 bool wxDataViewSortedListModel::ChildRowPrepended()
390 unsigned int len
= m_array
.GetCount();
391 for (i
= 0; i
< len
; i
++)
393 unsigned int value
= m_array
[i
];
394 m_array
[i
] = value
+1;
397 unsigned int pos
= m_array
.Add( 0 );
400 return wxDataViewListModel::RowPrepended();
403 return wxDataViewListModel::RowAppended();
405 return wxDataViewListModel::RowInserted( pos
);
408 bool wxDataViewSortedListModel::ChildRowInserted( unsigned int before
)
412 unsigned int len
= m_array
.GetCount();
413 for (i
= 0; i
< len
; i
++)
415 unsigned int value
= m_array
[i
];
417 m_array
[i
] = value
+1;
420 unsigned int pos
= m_array
.Add( before
);
423 return wxDataViewListModel::RowPrepended();
426 return wxDataViewListModel::RowAppended();
428 return wxDataViewListModel::RowInserted( pos
);
431 bool wxDataViewSortedListModel::ChildRowDeleted( unsigned int row
)
434 unsigned int len
= m_array
.GetCount();
436 for (i
= 0; i
< len
; i
++)
438 unsigned int value
= m_array
[i
];
448 m_array
[i
] = value
-1;
453 return false; // we should probably assert
456 m_array
.RemoveAt( (unsigned int) pos
);
458 return wxDataViewListModel::RowDeleted( (unsigned int) pos
);
461 bool wxDataViewSortedListModel::ChildRowChanged( unsigned int row
)
464 unsigned int len
= m_array
.GetCount();
466 // Remove and readd sorted. Find out at which
467 // position it was and where it ended.
468 unsigned int start_pos
= 0,end_pos
= 0;
469 for (i
= 0; i
< len
; i
++)
470 if (m_array
[i
] == row
)
475 m_array
.RemoveAt( start_pos
);
478 for (i
= 0; i
< len
; i
++)
479 if (m_array
[i
] == row
)
485 if (end_pos
== start_pos
)
486 return wxDataViewListModel::RowChanged( start_pos
);
488 // Create an array where order[old] -> new_pos, so that
489 // if nothing changed order[0] -> 0 etc.
490 unsigned int *order
= new unsigned int[ len
];
491 // Fill up initial values.
492 for (i
= 0; i
< len
; i
++)
495 if (start_pos
< end_pos
)
497 for (i
= start_pos
; i
< end_pos
; i
++)
498 order
[i
] = order
[i
+1];
499 order
[end_pos
] = start_pos
;
503 for (i
= end_pos
; i
> start_pos
; i
--)
504 order
[i
] = order
[i
-1];
505 order
[start_pos
] = end_pos
;
508 wxDataViewListModel::RowsReordered( order
);
515 bool wxDataViewSortedListModel::ChildValueChanged( unsigned int col
, unsigned int row
)
518 unsigned int len
= m_array
.GetCount();
520 // Remove and readd sorted. Find out at which
521 // position it was and where it ended.
522 unsigned int start_pos
= 0,end_pos
= 0;
523 for (i
= 0; i
< len
; i
++)
524 if (m_array
[i
] == row
)
529 m_array
.RemoveAt( start_pos
);
532 for (i
= 0; i
< len
; i
++)
533 if (m_array
[i
] == row
)
539 if (end_pos
== start_pos
)
540 return wxDataViewListModel::ValueChanged( col
, start_pos
);
542 // Create an array where order[old] -> new_pos, so that
543 // if nothing changed order[0] -> 0 etc.
544 unsigned int *order
= new unsigned int[ len
];
545 // Fill up initial values.
546 for (i
= 0; i
< len
; i
++)
549 if (start_pos
< end_pos
)
551 for (i
= start_pos
; i
< end_pos
; i
++)
552 order
[i
] = order
[i
+1];
553 order
[end_pos
] = start_pos
;
557 for (i
= end_pos
; i
> start_pos
; i
--)
558 order
[i
] = order
[i
-1];
559 order
[start_pos
] = end_pos
;
562 wxDataViewListModel::RowsReordered( order
);
569 bool wxDataViewSortedListModel::ChildRowsReordered( unsigned int *WXUNUSED(new_order
) )
571 // Nothing needs to be done. If the sort criteria
572 // of this list don't change, the order of the
573 // items of the child list isn't relevant.
577 bool wxDataViewSortedListModel::ChildCleared()
579 return wxDataViewListModel::Cleared();
582 unsigned int wxDataViewSortedListModel::GetRowCount() const
584 return m_array
.GetCount();
587 unsigned int wxDataViewSortedListModel::GetColumnCount() const
589 return m_child
->GetColumnCount();
592 wxString
wxDataViewSortedListModel::GetColumnType( unsigned int col
) const
594 return m_child
->GetColumnType( col
);
597 void wxDataViewSortedListModel::GetValue( wxVariant
&variant
, unsigned int col
, unsigned int row
) const
599 unsigned int child_row
= m_array
[row
];
600 m_child
->GetValue( variant
, col
, child_row
);
603 bool wxDataViewSortedListModel::SetValue( wxVariant
&variant
, unsigned int col
, unsigned int row
)
605 unsigned int child_row
= m_array
[row
];
606 bool ret
= m_child
->SetValue( variant
, col
, child_row
);
608 // Do nothing here as the change in the
609 // child model will be reported back.
614 bool wxDataViewSortedListModel::RowAppended()
616 // you can only append
617 bool ret
= m_child
->RowAppended();
619 // Do nothing here as the change in the
620 // child model will be reported back.
625 bool wxDataViewSortedListModel::RowPrepended()
627 // you can only append
628 bool ret
= m_child
->RowAppended();
630 // Do nothing here as the change in the
631 // child model will be reported back.
636 bool wxDataViewSortedListModel::RowInserted( unsigned int WXUNUSED(before
) )
638 // you can only append
639 bool ret
= m_child
->RowAppended();
641 // Do nothing here as the change in the
642 // child model will be reported back.
647 bool wxDataViewSortedListModel::RowDeleted( unsigned int row
)
649 unsigned int child_row
= m_array
[row
];
651 bool ret
= m_child
->RowDeleted( child_row
);
653 // Do nothing here as the change in the
654 // child model will be reported back.
659 bool wxDataViewSortedListModel::RowChanged( unsigned int row
)
661 unsigned int child_row
= m_array
[row
];
662 bool ret
= m_child
->RowChanged( child_row
);
664 // Do nothing here as the change in the
665 // child model will be reported back.
670 bool wxDataViewSortedListModel::ValueChanged( unsigned int col
, unsigned int row
)
672 unsigned int child_row
= m_array
[row
];
673 bool ret
= m_child
->ValueChanged( col
, child_row
);
675 // Do nothing here as the change in the
676 // child model will be reported back.
681 bool wxDataViewSortedListModel::RowsReordered( unsigned int *WXUNUSED(new_order
) )
683 // We sort them ourselves.
688 bool wxDataViewSortedListModel::Cleared()
690 bool ret
= m_child
->Cleared();
692 // Do nothing here as the change in the
693 // child model will be reported back.
698 // ---------------------------------------------------------
699 // wxDataViewRendererBase
700 // ---------------------------------------------------------
702 IMPLEMENT_ABSTRACT_CLASS(wxDataViewRendererBase
, wxObject
)
704 wxDataViewRendererBase::wxDataViewRendererBase( const wxString
&varianttype
,
705 wxDataViewCellMode
WXUNUSED(mode
),
706 int WXUNUSED(align
) )
708 m_variantType
= varianttype
;
711 const wxDataViewCtrl
* wxDataViewRendererBase::GetView() const
713 return wx_const_cast(wxDataViewRendererBase
*, this)->GetOwner()->GetOwner();
716 // ---------------------------------------------------------
717 // wxDataViewColumnBase
718 // ---------------------------------------------------------
720 IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase
, wxObject
)
722 wxDataViewColumnBase::wxDataViewColumnBase(const wxString
& WXUNUSED(title
),
723 wxDataViewRenderer
*renderer
,
724 unsigned int model_column
,
726 wxAlignment
WXUNUSED(align
),
729 m_renderer
= renderer
;
730 m_model_column
= model_column
;
732 m_renderer
->SetOwner( (wxDataViewColumn
*) this );
734 // NOTE: the wxDataViewColumn's ctor must store the width, align, flags
735 // parameters inside the native control!
738 wxDataViewColumnBase::wxDataViewColumnBase(const wxBitmap
& bitmap
,
739 wxDataViewRenderer
*renderer
,
740 unsigned int model_column
,
742 wxAlignment
WXUNUSED(align
),
743 int WXUNUSED(flags
) )
745 m_renderer
= renderer
;
746 m_model_column
= model_column
;
749 m_renderer
->SetOwner( (wxDataViewColumn
*) this );
752 wxDataViewColumnBase::~wxDataViewColumnBase()
759 GetOwner()->GetModel()->RemoveViewingColumn( (wxDataViewColumn
*) this );
763 int wxDataViewColumnBase::GetFlags() const
768 ret
|= wxDATAVIEW_COL_SORTABLE
;
770 ret
|= wxDATAVIEW_COL_RESIZABLE
;
772 ret
|= wxDATAVIEW_COL_HIDDEN
;
777 void wxDataViewColumnBase::SetFlags(int flags
)
779 SetSortable((flags
& wxDATAVIEW_COL_SORTABLE
) != 0);
780 SetResizeable((flags
& wxDATAVIEW_COL_RESIZABLE
) != 0);
781 SetHidden((flags
& wxDATAVIEW_COL_HIDDEN
) != 0);
785 // ---------------------------------------------------------
786 // wxDataViewCtrlBase
787 // ---------------------------------------------------------
789 IMPLEMENT_ABSTRACT_CLASS(wxDataViewCtrlBase
, wxControl
)
791 wxDataViewCtrlBase::wxDataViewCtrlBase()
794 m_cols
.DeleteContents( true );
797 wxDataViewCtrlBase::~wxDataViewCtrlBase()
799 // IMPORTANT: before calling DecRef() on our model (since it may
800 // result in a free() call), erase all columns (since
801 // they hold a pointer to our model)
811 bool wxDataViewCtrlBase::AssociateModel( wxDataViewListModel
*model
)
814 m_model
->DecRef(); // discard old model, if any
816 // add our own reference to the new model:
824 wxDataViewListModel
* wxDataViewCtrlBase::GetModel()
829 bool wxDataViewCtrlBase::AppendTextColumn( const wxString
&label
, unsigned int model_column
,
830 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
832 return AppendColumn( new wxDataViewColumn( label
,
833 new wxDataViewTextRenderer( wxT("string"), mode
, (int)align
),
834 model_column
, width
, align
, flags
) );
837 bool wxDataViewCtrlBase::AppendToggleColumn( const wxString
&label
, unsigned int model_column
,
838 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
840 return AppendColumn( new wxDataViewColumn( label
,
841 new wxDataViewToggleRenderer( wxT("bool"), mode
, (int)align
),
842 model_column
, width
, align
, flags
) );
845 bool wxDataViewCtrlBase::AppendProgressColumn( const wxString
&label
, unsigned int model_column
,
846 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
848 return AppendColumn( new wxDataViewColumn( label
,
849 new wxDataViewProgressRenderer( wxEmptyString
, wxT("long"), mode
, (int)align
),
850 model_column
, width
, align
, flags
) );
853 bool wxDataViewCtrlBase::AppendDateColumn( const wxString
&label
, unsigned int model_column
,
854 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
856 return AppendColumn( new wxDataViewColumn( label
,
857 new wxDataViewDateRenderer( wxT("datetime"), mode
, (int)align
),
858 model_column
, width
, align
, flags
) );
861 bool wxDataViewCtrlBase::AppendBitmapColumn( const wxString
&label
, unsigned int model_column
,
862 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
864 return AppendColumn( new wxDataViewColumn( label
,
865 new wxDataViewBitmapRenderer( wxT("wxBitmap"), mode
, (int)align
),
866 model_column
, width
, align
, flags
) );
869 bool wxDataViewCtrlBase::AppendTextColumn( const wxBitmap
&label
, unsigned int model_column
,
870 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
872 return AppendColumn( new wxDataViewColumn( label
,
873 new wxDataViewTextRenderer( wxT("string"), mode
, (int)align
),
874 model_column
, width
, align
, flags
) );
877 bool wxDataViewCtrlBase::AppendToggleColumn( const wxBitmap
&label
, unsigned int model_column
,
878 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
880 return AppendColumn( new wxDataViewColumn( label
,
881 new wxDataViewToggleRenderer( wxT("bool"), mode
, (int)align
),
882 model_column
, width
, align
, flags
) );
885 bool wxDataViewCtrlBase::AppendProgressColumn( const wxBitmap
&label
, unsigned int model_column
,
886 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
888 return AppendColumn( new wxDataViewColumn( label
,
889 new wxDataViewProgressRenderer( wxEmptyString
, wxT("long"), mode
, (int)align
),
890 model_column
, width
, align
, flags
) );
893 bool wxDataViewCtrlBase::AppendDateColumn( const wxBitmap
&label
, unsigned int model_column
,
894 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
896 return AppendColumn( new wxDataViewColumn( label
,
897 new wxDataViewDateRenderer( wxT("datetime"), mode
, (int)align
),
898 model_column
, width
, align
, flags
) );
901 bool wxDataViewCtrlBase::AppendBitmapColumn( const wxBitmap
&label
, unsigned int model_column
,
902 wxDataViewCellMode mode
, int width
, wxAlignment align
, int flags
)
904 return AppendColumn( new wxDataViewColumn( label
,
905 new wxDataViewBitmapRenderer( wxT("wxBitmap"), mode
, (int)align
),
906 model_column
, width
, align
, flags
) );
909 bool wxDataViewCtrlBase::AppendColumn( wxDataViewColumn
*col
)
911 m_cols
.Append( (wxObject
*) col
);
912 col
->SetOwner( (wxDataViewCtrl
*) this );
913 m_model
->AddViewingColumn( col
, col
->GetModelColumn() );
917 unsigned int wxDataViewCtrlBase::GetColumnCount() const
919 return m_cols
.GetCount();
922 bool wxDataViewCtrlBase::DeleteColumn( unsigned int WXUNUSED(pos
) )
927 bool wxDataViewCtrlBase::ClearColumns()
932 wxDataViewColumn
* wxDataViewCtrlBase::GetColumn( unsigned int pos
)
934 return (wxDataViewColumn
*) m_cols
[ pos
];
937 // ---------------------------------------------------------
939 // ---------------------------------------------------------
941 IMPLEMENT_DYNAMIC_CLASS(wxDataViewEvent
,wxNotifyEvent
)
943 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ROW_SELECTED
)
944 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ROW_ACTIVATED
)
945 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK
)
946 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK
)