]> git.saurik.com Git - wxWidgets.git/blob - src/common/datavcmn.cpp
add XRC handler for wxSearchCtrl (extended patch 1751516)
[wxWidgets.git] / src / common / datavcmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/datavcmn.cpp
3 // Purpose: wxDataViewCtrl base classes and common parts
4 // Author: Robert Roebling
5 // Created: 2006/02/20
6 // RCS-ID: $Id$
7 // Copyright: (c) 2006, Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #if wxUSE_DATAVIEWCTRL
19
20 #include "wx/dataview.h"
21
22 #ifndef WX_PRECOMP
23 #include "wx/log.h"
24 #endif
25
26 const wxChar wxDataViewCtrlNameStr[] = wxT("dataviewCtrl");
27
28
29 bool operator == (const wxDataViewItem &left, const wxDataViewItem &right)
30 {
31 return (left.GetID() == right.GetID() );
32 }
33
34
35 // ---------------------------------------------------------
36 // wxDataViewModel
37 // ---------------------------------------------------------
38
39 #include <wx/listimpl.cpp>
40 WX_DEFINE_LIST(wxDataViewModelNotifiers);
41
42 wxDataViewModel::wxDataViewModel()
43 {
44 m_notifiers.DeleteContents( true );
45 m_sortingColumn = 0;
46 }
47
48 bool wxDataViewModel::ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item )
49 {
50 bool ret = true;
51
52 wxDataViewModelNotifiers::iterator iter;
53 for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
54 {
55 wxDataViewModelNotifier* notifier = *iter;
56 if (!notifier->ItemAdded( parent, item ))
57 ret = false;
58 }
59
60 return ret;
61 }
62
63 bool wxDataViewModel::ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item )
64 {
65 bool ret = true;
66
67 wxDataViewModelNotifiers::iterator iter;
68 for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
69 {
70 wxDataViewModelNotifier* notifier = *iter;
71 if (!notifier->ItemDeleted( parent, item ))
72 ret = false;
73 }
74
75 return ret;
76 }
77
78 bool wxDataViewModel::ItemChanged( const wxDataViewItem &item )
79 {
80 bool ret = true;
81
82 wxDataViewModelNotifiers::iterator iter;
83 for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
84 {
85 wxDataViewModelNotifier* notifier = *iter;
86 if (!notifier->ItemChanged( item ))
87 ret = false;
88 }
89
90 return ret;
91 }
92
93 bool wxDataViewModel::ValueChanged( const wxDataViewItem &item, unsigned int col )
94 {
95 bool ret = true;
96
97 wxDataViewModelNotifiers::iterator iter;
98 for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
99 {
100 wxDataViewModelNotifier* notifier = *iter;
101 if (!notifier->ValueChanged( item, col ))
102 ret = false;
103 }
104
105 return ret;
106 }
107
108 bool wxDataViewModel::Cleared()
109 {
110 bool ret = true;
111
112 wxDataViewModelNotifiers::iterator iter;
113 for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
114 {
115 wxDataViewModelNotifier* notifier = *iter;
116 if (!notifier->Cleared())
117 ret = false;
118 }
119
120 return ret;
121 }
122
123 void wxDataViewModel::Resort()
124 {
125 wxDataViewModelNotifiers::iterator iter;
126 for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
127 {
128 wxDataViewModelNotifier* notifier = *iter;
129 notifier->Resort();
130 }
131 }
132
133 void wxDataViewModel::AddNotifier( wxDataViewModelNotifier *notifier )
134 {
135 m_notifiers.push_back( notifier );
136 notifier->SetOwner( this );
137 }
138
139 void wxDataViewModel::RemoveNotifier( wxDataViewModelNotifier *notifier )
140 {
141 m_notifiers.DeleteObject( notifier );
142 }
143
144 int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem &item2 )
145 {
146 // sort branches before leaves
147 bool item1_is_container = IsContainer(item1);
148 bool item2_is_container = IsContainer(item2);
149
150 if (item1_is_container && !item2_is_container)
151 return 1;
152 if (item2_is_container && !item1_is_container)
153 return -1;
154
155 wxVariant value1,value2;
156 GetValue( value1, item1, m_sortingColumn );
157 GetValue( value2, item2, m_sortingColumn );
158
159 if (value1.GetType() == wxT("string"))
160 {
161 wxString str1 = value1.GetString();
162 wxString str2 = value2.GetString();
163 int res = str1.Cmp( str2 );
164 if (res) return res;
165 } else
166 if (value1.GetType() == wxT("long"))
167 {
168 long l1 = value1.GetLong();
169 long l2 = value2.GetLong();
170 long res = l1-l2;
171 if (res) return res;
172 } else
173 if (value1.GetType() == wxT("double"))
174 {
175 double d1 = value1.GetDouble();
176 double d2 = value2.GetDouble();
177 if (d1 < d2) return 1;
178 if (d1 > d2) return -1;
179 } else
180 if (value1.GetType() == wxT("datetime"))
181 {
182 wxDateTime dt1 = value1.GetDateTime();
183 wxDateTime dt2 = value2.GetDateTime();
184 if (dt1.IsEarlierThan(dt2)) return 1;
185 if (dt2.IsEarlierThan(dt1)) return -11;
186 }
187
188 // items must be different
189 unsigned long litem1 = (unsigned long) item1.GetID();
190 unsigned long litem2 = (unsigned long) item2.GetID();
191
192 return litem1-litem2;
193 }
194
195 // ---------------------------------------------------------
196 // wxDataViewIndexListModel
197 // ---------------------------------------------------------
198
199 wxDataViewIndexListModel::wxDataViewIndexListModel( unsigned int initial_size )
200 {
201 // build initial index
202 unsigned int i;
203 for (i = 1; i < initial_size+1; i++)
204 m_hash.Add( (void*) i );
205 m_lastIndex = initial_size + 1;
206 }
207
208 wxDataViewIndexListModel::~wxDataViewIndexListModel()
209 {
210 }
211
212 void wxDataViewIndexListModel::RowPrepended()
213 {
214 unsigned int id = m_lastIndex++;
215 m_hash.Insert( (void*) id, 0 );
216 wxDataViewItem item( (void*) id );
217 ItemAdded( wxDataViewItem(0), item );
218 }
219
220 void wxDataViewIndexListModel::RowInserted( unsigned int before )
221 {
222 unsigned int id = m_lastIndex++;
223 m_hash.Insert( (void*) id, before );
224 wxDataViewItem item( (void*) id );
225 ItemAdded( wxDataViewItem(0), item );
226 }
227
228 void wxDataViewIndexListModel::RowAppended()
229 {
230 unsigned int id = m_lastIndex++;
231 m_hash.Add( (void*) id );
232 wxDataViewItem item( (void*) id );
233 ItemAdded( wxDataViewItem(0), item );
234 }
235
236 void wxDataViewIndexListModel::RowDeleted( unsigned int row )
237 {
238 wxDataViewItem item( m_hash[row] );
239 wxDataViewModel::ItemDeleted( wxDataViewItem(0), item );
240 m_hash.RemoveAt( row );
241 }
242
243 void wxDataViewIndexListModel::RowChanged( unsigned int row )
244 {
245 wxDataViewModel::ItemChanged( GetItem(row) );
246 }
247
248 void wxDataViewIndexListModel::RowValueChanged( unsigned int row, unsigned int col )
249 {
250 wxDataViewModel::ValueChanged( GetItem(row), col );
251 }
252
253 unsigned int wxDataViewIndexListModel::GetRow( const wxDataViewItem &item ) const
254 {
255 // assert for not found
256 return (unsigned int) m_hash.Index( item.GetID() );
257 }
258
259 wxDataViewItem wxDataViewIndexListModel::GetItem( unsigned int row ) const
260 {
261 return wxDataViewItem( m_hash[row] );
262 }
263
264 int wxDataViewIndexListModel::Compare( const wxDataViewItem &item1, const wxDataViewItem &item2 )
265 {
266 return GetRow(item1) - GetRow(item2);
267 }
268
269 void wxDataViewIndexListModel::GetValue( wxVariant &variant,
270 const wxDataViewItem &item, unsigned int col ) const
271 {
272 GetValue( variant, GetRow(item), col );
273 }
274
275 bool wxDataViewIndexListModel::SetValue( const wxVariant &variant,
276 const wxDataViewItem &item, unsigned int col )
277 {
278 return SetValue( variant, GetRow(item), col );
279 }
280
281 wxDataViewItem wxDataViewIndexListModel::GetParent( const wxDataViewItem & WXUNUSED(item) ) const
282 {
283 return wxDataViewItem(0);
284 }
285
286 bool wxDataViewIndexListModel::IsContainer( const wxDataViewItem &item ) const
287 {
288 // only the invisible root item has children
289 if (!item.IsOk())
290 return true;
291
292 return false;
293 }
294
295 wxDataViewItem wxDataViewIndexListModel::GetFirstChild( const wxDataViewItem &parent ) const
296 {
297 if (!parent.IsOk())
298 {
299 if (m_hash.GetCount() == 0)
300 return wxDataViewItem(0);
301
302 return wxDataViewItem( m_hash[0]);
303 }
304
305 return wxDataViewItem(0);
306 }
307
308 wxDataViewItem wxDataViewIndexListModel::GetNextSibling( const wxDataViewItem &item ) const
309 {
310 if (!item.IsOk())
311 return wxDataViewItem(0);
312
313 int pos = m_hash.Index( item.GetID() );
314 if ((pos == wxNOT_FOUND) || (pos == (int) (m_hash.GetCount()-1)))
315 return wxDataViewItem(0);
316
317 return wxDataViewItem( m_hash[pos+1] );
318 }
319
320 // ---------------------------------------------------------
321 // wxDataViewRendererBase
322 // ---------------------------------------------------------
323
324 IMPLEMENT_ABSTRACT_CLASS(wxDataViewRendererBase, wxObject)
325
326 wxDataViewRendererBase::wxDataViewRendererBase( const wxString &varianttype,
327 wxDataViewCellMode WXUNUSED(mode),
328 int WXUNUSED(align) )
329 {
330 m_variantType = varianttype;
331 m_editorCtrl = NULL;
332 }
333
334 const wxDataViewCtrl* wxDataViewRendererBase::GetView() const
335 {
336 return wx_const_cast(wxDataViewRendererBase*, this)->GetOwner()->GetOwner();
337 }
338
339 bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect labelRect )
340 {
341 m_item = item; // remember for later
342
343 unsigned int col = GetOwner()->GetModelColumn();
344 wxVariant value;
345 GetOwner()->GetOwner()->GetModel()->GetValue( value, item, col );
346
347 m_editorCtrl = CreateEditorCtrl( GetOwner()->GetOwner()->GetMainWindow(), labelRect, value );
348
349 wxDataViewEditorCtrlEvtHandler *handler =
350 new wxDataViewEditorCtrlEvtHandler( m_editorCtrl, (wxDataViewRenderer*) this );
351
352 m_editorCtrl->PushEventHandler( handler );
353
354 #if defined(__WXGTK20__) && !defined(wxUSE_GENERICDATAVIEWCTRL)
355 handler->SetFocusOnIdle();
356 #else
357 m_editorCtrl->SetFocus();
358 #endif
359
360 return true;
361 }
362
363 void wxDataViewRendererBase::CancelEditing()
364 {
365 wxPendingDelete.Append( m_editorCtrl );
366
367 GetOwner()->GetOwner()->GetMainWindow()->SetFocus();
368
369 // m_editorCtrl->PopEventHandler( true );
370 }
371
372 bool wxDataViewRendererBase::FinishEditing()
373 {
374 wxVariant value;
375 GetValueFromEditorCtrl( m_editorCtrl, value );
376
377 wxPendingDelete.Append( m_editorCtrl );
378
379 GetOwner()->GetOwner()->GetMainWindow()->SetFocus();
380
381 if (!Validate(value))
382 return false;
383
384 unsigned int col = GetOwner()->GetModelColumn();
385 GetOwner()->GetOwner()->GetModel()->SetValue( value, m_item, col );
386 GetOwner()->GetOwner()->GetModel()->ValueChanged( m_item, col );
387
388 // m_editorCtrl->PopEventHandler( true );
389
390 return true;
391 }
392
393 //-----------------------------------------------------------------------------
394 // wxDataViewEditorCtrlEvtHandler
395 //-----------------------------------------------------------------------------
396
397 BEGIN_EVENT_TABLE(wxDataViewEditorCtrlEvtHandler, wxEvtHandler)
398 EVT_CHAR (wxDataViewEditorCtrlEvtHandler::OnChar)
399 EVT_KILL_FOCUS (wxDataViewEditorCtrlEvtHandler::OnKillFocus)
400 EVT_IDLE (wxDataViewEditorCtrlEvtHandler::OnIdle)
401 END_EVENT_TABLE()
402
403 wxDataViewEditorCtrlEvtHandler::wxDataViewEditorCtrlEvtHandler(
404 wxControl *editorCtrl,
405 wxDataViewRenderer *owner )
406 {
407 m_owner = owner;
408 m_editorCtrl = editorCtrl;
409
410 m_finished = false;
411 }
412
413 void wxDataViewEditorCtrlEvtHandler::OnIdle( wxIdleEvent &event )
414 {
415 if (m_focusOnIdle)
416 {
417 m_focusOnIdle = false;
418 if (wxWindow::FindFocus() != m_editorCtrl)
419 m_editorCtrl->SetFocus();
420 }
421
422 event.Skip();
423 }
424
425 void wxDataViewEditorCtrlEvtHandler::OnChar( wxKeyEvent &event )
426 {
427 switch ( event.m_keyCode )
428 {
429 case WXK_RETURN:
430 m_finished = true;
431 m_owner->FinishEditing();
432 break;
433
434 case WXK_ESCAPE:
435 m_finished = true;
436 m_owner->CancelEditing();
437 break;
438
439 default:
440 event.Skip();
441 }
442 }
443
444 void wxDataViewEditorCtrlEvtHandler::OnKillFocus( wxFocusEvent &event )
445 {
446 if (!m_finished)
447 {
448 m_finished = true;
449 m_owner->FinishEditing();
450 }
451
452 event.Skip();
453 }
454
455 // ---------------------------------------------------------
456 // wxDataViewColumnBase
457 // ---------------------------------------------------------
458
459 IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject)
460
461 wxDataViewColumnBase::wxDataViewColumnBase(const wxString& WXUNUSED(title),
462 wxDataViewRenderer *renderer,
463 unsigned int model_column,
464 int WXUNUSED(width),
465 wxAlignment WXUNUSED(align),
466 int WXUNUSED(flags))
467 {
468 m_renderer = renderer;
469 m_model_column = model_column;
470 m_owner = NULL;
471 m_renderer->SetOwner( (wxDataViewColumn*) this );
472
473 // NOTE: the wxDataViewColumn's ctor must store the width, align, flags
474 // parameters inside the native control!
475 }
476
477 wxDataViewColumnBase::wxDataViewColumnBase(const wxBitmap& bitmap,
478 wxDataViewRenderer *renderer,
479 unsigned int model_column,
480 int WXUNUSED(width),
481 wxAlignment WXUNUSED(align),
482 int WXUNUSED(flags) )
483 {
484 m_renderer = renderer;
485 m_model_column = model_column;
486 m_bitmap = bitmap;
487 m_owner = NULL;
488 m_renderer->SetOwner( (wxDataViewColumn*) this );
489 }
490
491 wxDataViewColumnBase::~wxDataViewColumnBase()
492 {
493 if (m_renderer)
494 delete m_renderer;
495 }
496
497 int wxDataViewColumnBase::GetFlags() const
498 {
499 int ret = 0;
500
501 if (IsSortable())
502 ret |= wxDATAVIEW_COL_SORTABLE;
503 if (IsResizeable())
504 ret |= wxDATAVIEW_COL_RESIZABLE;
505 if (IsHidden())
506 ret |= wxDATAVIEW_COL_HIDDEN;
507
508 return ret;
509 }
510
511 void wxDataViewColumnBase::SetFlags(int flags)
512 {
513 SetSortable((flags & wxDATAVIEW_COL_SORTABLE) != 0);
514 SetResizeable((flags & wxDATAVIEW_COL_RESIZABLE) != 0);
515 SetHidden((flags & wxDATAVIEW_COL_HIDDEN) != 0);
516 }
517
518 // ---------------------------------------------------------
519 // wxDataViewCtrlBase
520 // ---------------------------------------------------------
521
522 IMPLEMENT_ABSTRACT_CLASS(wxDataViewCtrlBase, wxControl)
523
524 wxDataViewCtrlBase::wxDataViewCtrlBase()
525 {
526 m_model = NULL;
527 m_cols.DeleteContents( true );
528 m_expander_column = 0;
529 m_indent = 8;
530 }
531
532 wxDataViewCtrlBase::~wxDataViewCtrlBase()
533 {
534 // IMPORTANT: before calling DecRef() on our model (since it may
535 // result in a free() call), erase all columns (since
536 // they hold a pointer to our model)
537 m_cols.Clear();
538
539 if (m_model)
540 {
541 m_model->DecRef();
542 m_model = NULL;
543 }
544 }
545
546 bool wxDataViewCtrlBase::AssociateModel( wxDataViewModel *model )
547 {
548 if (m_model)
549 {
550 m_model->DecRef(); // discard old model, if any
551 }
552
553 // add our own reference to the new model:
554 m_model = model;
555 if (m_model)
556 {
557 m_model->IncRef();
558 }
559
560 return true;
561 }
562
563 wxDataViewModel* wxDataViewCtrlBase::GetModel()
564 {
565 return m_model;
566 }
567
568 bool wxDataViewCtrlBase::AppendTextColumn( const wxString &label, unsigned int model_column,
569 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
570 {
571 return AppendColumn( new wxDataViewColumn( label,
572 new wxDataViewTextRenderer( wxT("string"), mode, (int)align ),
573 model_column, width, align, flags ) );
574 }
575
576 bool wxDataViewCtrlBase::AppendToggleColumn( const wxString &label, unsigned int model_column,
577 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
578 {
579 return AppendColumn( new wxDataViewColumn( label,
580 new wxDataViewToggleRenderer( wxT("bool"), mode, (int)align ),
581 model_column, width, align, flags ) );
582 }
583
584 bool wxDataViewCtrlBase::AppendProgressColumn( const wxString &label, unsigned int model_column,
585 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
586 {
587 return AppendColumn( new wxDataViewColumn( label,
588 new wxDataViewProgressRenderer( wxEmptyString, wxT("long"), mode, (int)align ),
589 model_column, width, align, flags ) );
590 }
591
592 bool wxDataViewCtrlBase::AppendDateColumn( const wxString &label, unsigned int model_column,
593 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
594 {
595 return AppendColumn( new wxDataViewColumn( label,
596 new wxDataViewDateRenderer( wxT("datetime"), mode, (int)align ),
597 model_column, width, align, flags ) );
598 }
599
600 bool wxDataViewCtrlBase::AppendBitmapColumn( const wxString &label, unsigned int model_column,
601 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
602 {
603 return AppendColumn( new wxDataViewColumn( label,
604 new wxDataViewBitmapRenderer( wxT("wxBitmap"), mode, (int)align ),
605 model_column, width, align, flags ) );
606 }
607
608 bool wxDataViewCtrlBase::AppendTextColumn( const wxBitmap &label, unsigned int model_column,
609 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
610 {
611 return AppendColumn( new wxDataViewColumn( label,
612 new wxDataViewTextRenderer( wxT("string"), mode, (int)align ),
613 model_column, width, align, flags ) );
614 }
615
616 bool wxDataViewCtrlBase::AppendToggleColumn( const wxBitmap &label, unsigned int model_column,
617 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
618 {
619 return AppendColumn( new wxDataViewColumn( label,
620 new wxDataViewToggleRenderer( wxT("bool"), mode, (int)align ),
621 model_column, width, align, flags ) );
622 }
623
624 bool wxDataViewCtrlBase::AppendProgressColumn( const wxBitmap &label, unsigned int model_column,
625 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
626 {
627 return AppendColumn( new wxDataViewColumn( label,
628 new wxDataViewProgressRenderer( wxEmptyString, wxT("long"), mode, (int)align ),
629 model_column, width, align, flags ) );
630 }
631
632 bool wxDataViewCtrlBase::AppendDateColumn( const wxBitmap &label, unsigned int model_column,
633 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
634 {
635 return AppendColumn( new wxDataViewColumn( label,
636 new wxDataViewDateRenderer( wxT("datetime"), mode, (int)align ),
637 model_column, width, align, flags ) );
638 }
639
640 bool wxDataViewCtrlBase::AppendBitmapColumn( const wxBitmap &label, unsigned int model_column,
641 wxDataViewCellMode mode, int width, wxAlignment align, int flags )
642 {
643 return AppendColumn( new wxDataViewColumn( label,
644 new wxDataViewBitmapRenderer( wxT("wxBitmap"), mode, (int)align ),
645 model_column, width, align, flags ) );
646 }
647
648 bool wxDataViewCtrlBase::AppendColumn( wxDataViewColumn *col )
649 {
650 m_cols.Append( (wxObject*) col );
651 col->SetOwner( (wxDataViewCtrl*) this );
652 return true;
653 }
654
655 unsigned int wxDataViewCtrlBase::GetColumnCount() const
656 {
657 return m_cols.GetCount();
658 }
659
660 bool wxDataViewCtrlBase::DeleteColumn( unsigned int WXUNUSED(pos) )
661 {
662 return false;
663 }
664
665 bool wxDataViewCtrlBase::ClearColumns()
666 {
667 return false;
668 }
669
670 wxDataViewColumn* wxDataViewCtrlBase::GetColumn( unsigned int pos )
671 {
672 return (wxDataViewColumn*) m_cols[ pos ];
673 }
674
675 // ---------------------------------------------------------
676 // wxDataViewEvent
677 // ---------------------------------------------------------
678
679 IMPLEMENT_DYNAMIC_CLASS(wxDataViewEvent,wxNotifyEvent)
680
681 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_SELECTED)
682 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED)
683 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK)
684 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK)
685 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED)
686
687 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_ADDED)
688 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED)
689 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_CHANGED)
690 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_VALUE_CHANGED)
691 DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_CLEARED)
692
693 #endif