]> git.saurik.com Git - wxWidgets.git/blob - include/wx/dataview.h
bb0077fefc01221a09247181843f538feed75c7b
[wxWidgets.git] / include / wx / dataview.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dataview.h
3 // Purpose: wxDataViewCtrl base classes
4 // Author: Robert Roebling
5 // Modified by:
6 // Created: 08.01.06
7 // RCS-ID: $Id$
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DATAVIEW_H_BASE_
13 #define _WX_DATAVIEW_H_BASE_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_DATAVIEWCTRL
18
19 #include "wx/control.h"
20 #include "wx/textctrl.h"
21 #include "wx/bitmap.h"
22 #include "wx/variant.h"
23 #include "wx/listctrl.h"
24
25 #if defined(__WXGTK20__)
26 // for testing
27 // #define wxUSE_GENERICDATAVIEWCTRL 1
28 #elif defined(__WXMAC__)
29 #else
30 #define wxUSE_GENERICDATAVIEWCTRL 1
31 #endif
32
33 // ----------------------------------------------------------------------------
34 // wxDataViewCtrl flags
35 // ----------------------------------------------------------------------------
36
37 // ----------------------------------------------------------------------------
38 // wxDataViewCtrl globals
39 // ----------------------------------------------------------------------------
40
41 class WXDLLIMPEXP_FWD_ADV wxDataViewItem;
42 class WXDLLIMPEXP_FWD_ADV wxDataViewModel;
43 class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl;
44 class WXDLLIMPEXP_FWD_ADV wxDataViewColumn;
45 class WXDLLIMPEXP_FWD_ADV wxDataViewRenderer;
46 class WXDLLIMPEXP_FWD_ADV wxDataViewModelNotifier;
47 class wxDataViewEventModelNotifier;
48
49 extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxDataViewCtrlNameStr[];
50
51 // the default width of new (text) columns:
52 #define wxDVC_DEFAULT_WIDTH 80
53
54 // the default width of new toggle columns:
55 #define wxDVC_TOGGLE_DEFAULT_WIDTH 30
56
57 // the default minimal width of the columns:
58 #define wxDVC_DEFAULT_MINWIDTH 30
59
60 // the default alignment of wxDataViewRenderers:
61 #define wxDVR_DEFAULT_ALIGNMENT (wxALIGN_LEFT|wxALIGN_TOP)
62
63
64 // ---------------------------------------------------------
65 // wxDataViewItem
66 // ---------------------------------------------------------
67
68 class WXDLLIMPEXP_ADV wxDataViewItem
69 {
70 public:
71 wxDataViewItem( void* id = NULL )
72 { m_id = id; }
73 wxDataViewItem( const wxDataViewItem &item )
74 { m_id = item.m_id; }
75 bool IsOk() const { return m_id != NULL; }
76 void* GetID() const { return m_id; }
77
78 private:
79 void* m_id;
80 };
81
82 bool operator == (const wxDataViewItem &left, const wxDataViewItem &right);
83
84 // ---------------------------------------------------------
85 // wxDataViewModel
86 // ---------------------------------------------------------
87
88 class WXDLLIMPEXP_ADV wxDataViewModel: public wxObjectRefData
89 {
90 public:
91 wxDataViewModel();
92
93 virtual unsigned int GetColumnCount() const = 0;
94
95 // return type as reported by wxVariant
96 virtual wxString GetColumnType( unsigned int col ) const = 0;
97
98 // get value into a wxVariant
99 virtual void GetValue( wxVariant &variant,
100 const wxDataViewItem &item, unsigned int col ) const = 0;
101
102 // set value, call ValueChanged() afterwards!
103 virtual bool SetValue( const wxVariant &variant,
104 const wxDataViewItem &item, unsigned int col ) = 0;
105
106 // define hierachy
107 virtual bool HasChildren( const wxDataViewItem &item ) const = 0;
108 virtual wxDataViewItem GetFirstChild( const wxDataViewItem &parent ) const = 0;
109 virtual wxDataViewItem GetNextSibling( const wxDataViewItem &item ) const = 0;
110
111 // delegated notifiers
112 virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item );
113 virtual bool ItemDeleted( const wxDataViewItem &item );
114 virtual bool ItemChanged( const wxDataViewItem &item );
115 virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col );
116 virtual bool Cleared();
117
118 // delegatd action
119 virtual void Resort();
120
121 void AddNotifier( wxDataViewModelNotifier *notifier );
122 void RemoveNotifier( wxDataViewModelNotifier *notifier );
123
124 // default compare function
125 virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2 );
126
127 void SetSortingColumn( unsigned int col ) { m_sortingColumn = col; }
128 unsigned int GetSortingColumn() { return m_sortingColumn; }
129 void SetSortOrderAscending( bool ascending ) { m_ascending = ascending; }
130 bool GetSortOrderAscending() { return m_ascending; }
131
132
133 protected:
134 // the user should not delete this class directly: he should use DecRef() instead!
135 virtual ~wxDataViewModel() { }
136
137 wxList m_notifiers;
138 unsigned int m_sortingColumn;
139 bool m_ascending;
140 };
141
142 // ---------------------------------------------------------
143 // wxDataViewVirtualListModel
144 // ---------------------------------------------------------
145
146 class wxDataViewIndexListModel: public wxDataViewModel
147 {
148 public:
149 wxDataViewIndexListModel();
150 ~wxDataViewIndexListModel();
151
152 virtual unsigned int GetRowCount() = 0;
153
154 virtual void GetValue( wxVariant &variant,
155 unsigned int row, unsigned int col ) const = 0;
156
157 virtual bool SetValue( const wxVariant &variant,
158 unsigned int row, unsigned int col ) = 0;
159
160 void ItemPrepended();
161 void ItemInserted( unsigned int before );
162 void ItemAppended();
163 void ItemChanged( unsigned int row );
164 void ValueChanged( unsigned int row, unsigned int col );
165
166 wxDataViewItem GetItem( unsigned int row );
167
168 virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2 );
169
170 };
171
172 // ---------------------------------------------------------
173 // wxDataViewModelNotifier
174 // ---------------------------------------------------------
175
176 class WXDLLIMPEXP_ADV wxDataViewModelNotifier: public wxObject
177 {
178 public:
179 wxDataViewModelNotifier() { }
180 virtual ~wxDataViewModelNotifier() { m_owner = NULL; }
181
182 virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
183 virtual bool ItemDeleted( const wxDataViewItem &item ) = 0;
184 virtual bool ItemChanged( const wxDataViewItem &item ) = 0;
185 virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0;
186 virtual bool Cleared() = 0;
187
188 virtual void Resort() { };
189
190 void SetOwner( wxDataViewModel *owner ) { m_owner = owner; }
191 wxDataViewModel *GetOwner() { return m_owner; }
192
193 private:
194 wxDataViewModel *m_owner;
195 };
196
197
198 //-----------------------------------------------------------------------------
199 // wxDataViewEditorCtrlEvtHandler
200 //-----------------------------------------------------------------------------
201
202 class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
203 {
204 public:
205 wxDataViewEditorCtrlEvtHandler( wxControl *editor, wxDataViewRenderer *owner );
206
207 void AcceptChangesAndFinish();
208 void SetFocusOnIdle( bool focus = true ) { m_focusOnIdle = focus; }
209
210 protected:
211 void OnChar( wxKeyEvent &event );
212 void OnKillFocus( wxFocusEvent &event );
213 void OnIdle( wxIdleEvent &event );
214
215 private:
216 wxDataViewRenderer *m_owner;
217 wxControl *m_editorCtrl;
218 bool m_finished;
219 bool m_focusOnIdle;
220
221 private:
222 DECLARE_EVENT_TABLE()
223 };
224
225 // ---------------------------------------------------------
226 // wxDataViewRendererBase
227 // ---------------------------------------------------------
228
229 enum wxDataViewCellMode
230 {
231 wxDATAVIEW_CELL_INERT,
232 wxDATAVIEW_CELL_ACTIVATABLE,
233 wxDATAVIEW_CELL_EDITABLE
234 };
235
236 enum wxDataViewCellRenderState
237 {
238 wxDATAVIEW_CELL_SELECTED = 1,
239 wxDATAVIEW_CELL_PRELIT = 2,
240 wxDATAVIEW_CELL_INSENSITIVE = 4,
241 wxDATAVIEW_CELL_FOCUSED = 8
242 };
243
244 class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject
245 {
246 public:
247 wxDataViewRendererBase( const wxString &varianttype,
248 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
249 int alignment = wxDVR_DEFAULT_ALIGNMENT );
250
251 virtual bool Validate( wxVariant& WXUNUSED(value) )
252 { return true; }
253
254 void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; }
255 wxDataViewColumn* GetOwner() { return m_owner; }
256
257 // renderer properties:
258
259 virtual bool SetValue( const wxVariant& WXUNUSED(value) ) = 0;
260 virtual bool GetValue( wxVariant& WXUNUSED(value) ) const = 0;
261
262 wxString GetVariantType() const { return m_variantType; }
263
264 virtual void SetMode( wxDataViewCellMode mode ) = 0;
265 virtual wxDataViewCellMode GetMode() const = 0;
266
267 // NOTE: Set/GetAlignment do not take/return a wxAlignment enum but
268 // rather an "int"; that's because for rendering cells it's allowed
269 // to combine alignment flags (e.g. wxALIGN_LEFT|wxALIGN_BOTTOM)
270 virtual void SetAlignment( int align ) = 0;
271 virtual int GetAlignment() const = 0;
272
273 // in-place editing
274 virtual bool HasEditorCtrl()
275 { return false; }
276 virtual wxControl* CreateEditorCtrl(wxWindow * WXUNUSED(parent),
277 wxRect WXUNUSED(labelRect),
278 const wxVariant& WXUNUSED(value))
279 { return NULL; }
280 virtual bool GetValueFromEditorCtrl(wxControl * WXUNUSED(editor),
281 wxVariant& WXUNUSED(value))
282 { return false; }
283
284 virtual bool StartEditing( const wxDataViewItem &item, wxRect labelRect );
285 virtual void CancelEditing();
286 virtual bool FinishEditing();
287
288 wxControl *GetEditorCtrl() { return m_editorCtrl; }
289
290 protected:
291 wxString m_variantType;
292 wxDataViewColumn *m_owner;
293 wxControl *m_editorCtrl;
294 wxDataViewItem m_item; // for m_editorCtrl
295
296 // internal utility:
297 const wxDataViewCtrl* GetView() const;
298
299 protected:
300 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
301 };
302
303 // ---------------------------------------------------------
304 // wxDataViewColumnBase
305 // ---------------------------------------------------------
306
307 enum wxDataViewColumnFlags
308 {
309 wxDATAVIEW_COL_RESIZABLE = 1,
310 wxDATAVIEW_COL_SORTABLE = 2,
311 wxDATAVIEW_COL_HIDDEN = 4
312 };
313
314 class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject
315 {
316 public:
317 wxDataViewColumnBase( const wxString &title, wxDataViewRenderer *renderer,
318 unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH,
319 wxAlignment align = wxALIGN_CENTER,
320 int flags = wxDATAVIEW_COL_RESIZABLE );
321 wxDataViewColumnBase( const wxBitmap &bitmap, wxDataViewRenderer *renderer,
322 unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH,
323 wxAlignment align = wxALIGN_CENTER,
324 int flags = wxDATAVIEW_COL_RESIZABLE );
325 virtual ~wxDataViewColumnBase();
326
327 // setters:
328
329 virtual void SetTitle( const wxString &title ) = 0;
330 virtual void SetAlignment( wxAlignment align ) = 0;
331 virtual void SetSortable( bool sortable ) = 0;
332 virtual void SetResizeable( bool resizeable ) = 0;
333 virtual void SetHidden( bool hidden ) = 0;
334 virtual void SetSortOrder( bool ascending ) = 0;
335 virtual void SetFlags( int flags );
336 virtual void SetOwner( wxDataViewCtrl *owner )
337 { m_owner = owner; }
338 virtual void SetBitmap( const wxBitmap &bitmap )
339 { m_bitmap=bitmap; }
340
341 virtual void SetMinWidth( int minWidth ) = 0;
342 virtual void SetWidth( int width ) = 0;
343
344
345 // getters:
346
347 virtual wxString GetTitle() const = 0;
348 virtual wxAlignment GetAlignment() const = 0;
349 virtual int GetWidth() const = 0;
350 virtual int GetMinWidth() const = 0;
351
352 virtual int GetFlags() const;
353
354 virtual bool IsSortable() const = 0;
355 virtual bool IsResizeable() const = 0;
356 virtual bool IsHidden() const = 0;
357 virtual bool IsSortOrderAscending() const = 0;
358
359 const wxBitmap &GetBitmap() const { return m_bitmap; }
360 unsigned int GetModelColumn() const { return m_model_column; }
361
362 wxDataViewCtrl *GetOwner() { return m_owner; }
363 wxDataViewRenderer* GetRenderer() { return m_renderer; }
364
365 protected:
366 wxDataViewRenderer *m_renderer;
367 int m_model_column;
368 wxBitmap m_bitmap;
369 wxDataViewCtrl *m_owner;
370
371 protected:
372 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase)
373 };
374
375 // ---------------------------------------------------------
376 // wxDataViewCtrlBase
377 // ---------------------------------------------------------
378
379 #define wxDV_SINGLE 0x0000 // for convenience
380 #define wxDV_MULTIPLE 0x0001 // can select multiple items
381
382 #define wxDV_NO_HEADER 0x0002 // column titles not visible
383 #define wxDV_HORIZ_RULES 0x0004 // light horizontal rules between rows
384 #define wxDV_VERT_RULES 0x0008 // light vertical rules between columns
385
386 class WXDLLIMPEXP_ADV wxDataViewCtrlBase: public wxControl
387 {
388 public:
389 wxDataViewCtrlBase();
390 virtual ~wxDataViewCtrlBase();
391
392 virtual bool AssociateModel( wxDataViewModel *model );
393 wxDataViewModel* GetModel();
394
395 // short cuts
396 bool AppendTextColumn( const wxString &label, unsigned int model_column,
397 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
398 wxAlignment align = wxALIGN_CENTER,
399 int flags = wxDATAVIEW_COL_RESIZABLE );
400 bool AppendToggleColumn( const wxString &label, unsigned int model_column,
401 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
402 wxAlignment align = wxALIGN_CENTER,
403 int flags = wxDATAVIEW_COL_RESIZABLE );
404 bool AppendProgressColumn( const wxString &label, unsigned int model_column,
405 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH,
406 wxAlignment align = wxALIGN_CENTER,
407 int flags = wxDATAVIEW_COL_RESIZABLE );
408 bool AppendDateColumn( const wxString &label, unsigned int model_column,
409 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
410 wxAlignment align = wxALIGN_CENTER,
411 int flags = wxDATAVIEW_COL_RESIZABLE );
412 bool AppendBitmapColumn( const wxString &label, unsigned int model_column,
413 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
414 wxAlignment align = wxALIGN_CENTER,
415 int flags = wxDATAVIEW_COL_RESIZABLE );
416 bool AppendTextColumn( const wxBitmap &label, unsigned int model_column,
417 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
418 wxAlignment align = wxALIGN_CENTER,
419 int flags = wxDATAVIEW_COL_RESIZABLE );
420 bool AppendToggleColumn( const wxBitmap &label, unsigned int model_column,
421 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
422 wxAlignment align = wxALIGN_CENTER,
423 int flags = wxDATAVIEW_COL_RESIZABLE );
424 bool AppendProgressColumn( const wxBitmap &label, unsigned int model_column,
425 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH,
426 wxAlignment align = wxALIGN_CENTER,
427 int flags = wxDATAVIEW_COL_RESIZABLE );
428 bool AppendDateColumn( const wxBitmap &label, unsigned int model_column,
429 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
430 wxAlignment align = wxALIGN_CENTER,
431 int flags = wxDATAVIEW_COL_RESIZABLE );
432 bool AppendBitmapColumn( const wxBitmap &label, unsigned int model_column,
433 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
434 wxAlignment align = wxALIGN_CENTER,
435 int flags = wxDATAVIEW_COL_RESIZABLE );
436
437 virtual bool AppendColumn( wxDataViewColumn *col );
438
439 virtual unsigned int GetColumnCount() const;
440
441 virtual bool DeleteColumn( unsigned int pos );
442 virtual bool ClearColumns();
443 virtual wxDataViewColumn* GetColumn( unsigned int pos );
444
445 void SetExpanderColumn( unsigned int col )
446 { m_expander_column = col ; DoSetExpanderColumn(); }
447 unsigned int GetExpanderColumn() const
448 { return m_expander_column; }
449
450 void SetIndent( int indent )
451 { m_indent = indent ; DoSetIndent(); }
452 int GetIndent() const
453 { return m_indent; }
454
455 // TODO selection code
456 virtual wxDataViewItem GetSelection() = 0;
457
458 protected:
459 virtual void DoSetExpanderColumn() = 0 ;
460 virtual void DoSetIndent() = 0;
461
462 private:
463 wxDataViewModel *m_model;
464 wxList m_cols;
465 wxDataViewEventModelNotifier *m_eventNotifier;
466 unsigned int m_expander_column;
467 int m_indent ;
468
469 protected:
470 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase)
471 };
472
473 // ----------------------------------------------------------------------------
474 // wxDataViewEvent - the event class for the wxDataViewCtrl notifications
475 // ----------------------------------------------------------------------------
476
477 class WXDLLIMPEXP_ADV wxDataViewEvent : public wxNotifyEvent
478 {
479 public:
480 wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
481 : wxNotifyEvent(commandType, winid),
482 m_item(0),
483 m_col(-1),
484 m_model(NULL),
485 m_value(wxNullVariant),
486 m_column(NULL)
487 { }
488
489 wxDataViewEvent(const wxDataViewEvent& event)
490 : wxNotifyEvent(event),
491 m_item(event.m_item),
492 m_col(event.m_col),
493 m_model(event.m_model),
494 m_value(event.m_value),
495 m_column(event.m_column)
496 { }
497
498 wxDataViewItem GetItem() const { return m_item; }
499 void SetItem( const wxDataViewItem &item ) { m_item = item; }
500
501 int GetColumn() const { return m_col; }
502 void SetColumn( int col ) { m_col = col; }
503
504 wxDataViewModel* GetModel() const { return m_model; }
505 void SetModel( wxDataViewModel *model ) { m_model = model; }
506
507 const wxVariant &GetValue() const { return m_value; }
508 void SetValue( const wxVariant &value ) { m_value = value; }
509
510 // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only
511 void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; }
512 wxDataViewColumn *GetDataViewColumn() const { return m_column; }
513
514 virtual wxEvent *Clone() const { return new wxDataViewEvent(*this); }
515
516 protected:
517 wxDataViewItem m_item;
518 int m_col;
519 wxDataViewModel *m_model;
520 wxVariant m_value;
521 wxDataViewColumn *m_column;
522
523 private:
524 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent)
525 };
526
527 BEGIN_DECLARE_EVENT_TYPES()
528 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_SELECTED, -1)
529 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, -1)
530 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, -1)
531 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, -1)
532 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, -1)
533 // notifications from the model to the control
534 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_ADDED, -1)
535 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, -1)
536 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_CHANGED, -1)
537 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_MODEL_VALUE_CHANGED, -1)
538 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_MODEL_CLEARED, -1)
539 END_DECLARE_EVENT_TYPES()
540
541 typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
542
543 #define wxDataViewEventHandler(func) \
544 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDataViewEventFunction, &func)
545
546 #define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \
547 wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn))
548
549 #define EVT_DATAVIEW_ITEM_SELECTED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_SELECTED, id, fn)
550 #define EVT_DATAVIEW_ITEM_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_ACTIVATED, id, fn)
551 #define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn)
552 #define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn)
553 #define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
554
555 #define EVT_DATAVIEW_MODEL_ITEM_ADDED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_APPENDED, id, fn)
556 #define EVT_DATAVIEW_MODEL_ITEM_DELETED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_DELETED, id, fn)
557 #define EVT_DATAVIEW_MODEL_ITEM_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_CHANGED, id, fn)
558 #define EVT_DATAVIEW_MODEL_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_VALUE_CHANGED, id, fn)
559 #define EVT_DATAVIEW_MODEL_CLEARED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_CLEARED, id, fn)
560
561
562 #if defined(wxUSE_GENERICDATAVIEWCTRL)
563 #include "wx/generic/dataview.h"
564 #elif defined(__WXGTK20__)
565 #include "wx/gtk/dataview.h"
566 #elif defined(__WXMAC__)
567 #include "wx/mac/dataview.h"
568 #else
569 #include "wx/generic/dataview.h"
570 #endif
571
572 #endif // wxUSE_DATAVIEWCTRL
573
574 #endif
575 // _WX_DATAVIEW_H_BASE_