1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDataViewCtrl base classes
4 // Author: Robert Roebling
5 // Modified by: Bo Yang
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DATAVIEW_H_BASE_
13 #define _WX_DATAVIEW_H_BASE_
17 #if wxUSE_DATAVIEWCTRL
19 #include "wx/control.h"
20 #include "wx/textctrl.h"
21 #include "wx/bitmap.h"
22 #include "wx/variant.h"
23 #include "wx/dynarray.h"
25 #include "wx/imaglist.h"
27 #if defined(__WXGTK20__)
29 // #define wxUSE_GENERICDATAVIEWCTRL 1
30 #elif defined(__WXMAC__)
32 #define wxUSE_GENERICDATAVIEWCTRL 1
35 // ----------------------------------------------------------------------------
36 // wxDataViewCtrl flags
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
40 // wxDataViewCtrl globals
41 // ----------------------------------------------------------------------------
43 class WXDLLIMPEXP_FWD_ADV wxDataViewItem
;
44 class WXDLLIMPEXP_FWD_ADV wxDataViewModel
;
45 class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl
;
46 class WXDLLIMPEXP_FWD_ADV wxDataViewColumn
;
47 class WXDLLIMPEXP_FWD_ADV wxDataViewRenderer
;
48 class WXDLLIMPEXP_FWD_ADV wxDataViewModelNotifier
;
50 extern WXDLLIMPEXP_DATA_ADV(const wxChar
) wxDataViewCtrlNameStr
[];
52 // the default width of new (text) columns:
53 #define wxDVC_DEFAULT_WIDTH 80
55 // the default width of new toggle columns:
56 #define wxDVC_TOGGLE_DEFAULT_WIDTH 30
58 // the default minimal width of the columns:
59 #define wxDVC_DEFAULT_MINWIDTH 30
61 // the default alignment of wxDataViewRenderers:
62 #define wxDVR_DEFAULT_ALIGNMENT (wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL)
65 // ---------------------------------------------------------
67 // ---------------------------------------------------------
69 class WXDLLIMPEXP_ADV wxDataViewItem
72 wxDataViewItem( void* id
= NULL
)
74 wxDataViewItem( const wxDataViewItem
&item
)
76 bool IsOk() const { return m_id
!= NULL
; }
77 void* GetID() const { return m_id
; }
78 operator const void* () const { return m_id
; }
81 void Print( const wxString
&text
) const;
88 bool operator == (const wxDataViewItem
&left
, const wxDataViewItem
&right
);
90 WX_DEFINE_ARRAY(wxDataViewItem
, wxDataViewItemArray
);
92 // ---------------------------------------------------------
93 // wxDataViewModelNotifier
94 // ---------------------------------------------------------
96 class WXDLLIMPEXP_ADV wxDataViewModelNotifier
99 wxDataViewModelNotifier() { }
100 virtual ~wxDataViewModelNotifier() { m_owner
= NULL
; }
102 virtual bool ItemAdded( const wxDataViewItem
&parent
, const wxDataViewItem
&item
) = 0;
103 virtual bool ItemDeleted( const wxDataViewItem
&parent
, const wxDataViewItem
&item
) = 0;
104 virtual bool ItemChanged( const wxDataViewItem
&item
) = 0;
105 virtual bool ItemsAdded( const wxDataViewItem
&parent
, const wxDataViewItemArray
&items
);
106 virtual bool ItemsDeleted( const wxDataViewItem
&parent
, const wxDataViewItemArray
&items
);
107 virtual bool ItemsChanged( const wxDataViewItemArray
&items
);
108 virtual bool ValueChanged( const wxDataViewItem
&item
, unsigned int col
) = 0;
109 virtual bool Cleared() = 0;
111 virtual void Resort() = 0;
113 void SetOwner( wxDataViewModel
*owner
) { m_owner
= owner
; }
114 wxDataViewModel
*GetOwner() { return m_owner
; }
117 wxDataViewModel
*m_owner
;
122 // ----------------------------------------------------------------------------
123 // wxDataViewItemAttr: a structure containing the visual attributes of an item
124 // ----------------------------------------------------------------------------
126 // TODO: this should be renamed to wxItemAttr or something general like this
128 class WXDLLIMPEXP_ADV wxDataViewItemAttr
139 void SetColour(const wxColour
& colour
) { m_colour
= colour
; }
140 void SetBold( bool set
) { m_bold
= set
; }
141 void SetItalic( bool set
) { m_italic
= set
; }
144 bool HasColour() const { return m_colour
.Ok(); }
145 const wxColour
& GetColour() const { return m_colour
; }
147 bool GetBold() const { return m_bold
; }
148 bool GetItalic() const { return m_italic
; }
157 // ---------------------------------------------------------
159 // ---------------------------------------------------------
161 WX_DECLARE_LIST_WITH_DECL(wxDataViewModelNotifier
, wxDataViewModelNotifiers
,
162 class WXDLLIMPEXP_ADV
);
164 class WXDLLIMPEXP_ADV wxDataViewModel
: public wxObjectRefData
169 virtual unsigned int GetColumnCount() const = 0;
171 // return type as reported by wxVariant
172 virtual wxString
GetColumnType( unsigned int col
) const = 0;
174 // get value into a wxVariant
175 virtual void GetValue( wxVariant
&variant
,
176 const wxDataViewItem
&item
, unsigned int col
) const = 0;
178 // set value, call ValueChanged() afterwards!
179 virtual bool SetValue( const wxVariant
&variant
,
180 const wxDataViewItem
&item
, unsigned int col
) = 0;
182 // Get text attribute, return false of default attributes should be used
183 virtual bool GetAttr( const wxDataViewItem
&WXUNUSED(item
), unsigned int WXUNUSED(col
), wxDataViewItemAttr
&WXUNUSED(attr
) )
187 virtual wxDataViewItem
GetParent( const wxDataViewItem
&item
) const = 0;
188 virtual bool IsContainer( const wxDataViewItem
&item
) const = 0;
189 // Is the container just a header or an item with all columns
190 virtual bool HasContainerColumns(const wxDataViewItem
& WXUNUSED(item
)) const
192 virtual unsigned int GetChildren( const wxDataViewItem
&item
, wxDataViewItemArray
&children
) const = 0;
194 // delegated notifiers
195 virtual bool ItemAdded( const wxDataViewItem
&parent
, const wxDataViewItem
&item
);
196 virtual bool ItemsAdded( const wxDataViewItem
&parent
, const wxDataViewItemArray
&items
);
197 virtual bool ItemDeleted( const wxDataViewItem
&parent
, const wxDataViewItem
&item
);
198 virtual bool ItemsDeleted( const wxDataViewItem
&parent
, const wxDataViewItemArray
&items
);
199 virtual bool ItemChanged( const wxDataViewItem
&item
);
200 virtual bool ItemsChanged( const wxDataViewItemArray
&items
);
201 virtual bool ValueChanged( const wxDataViewItem
&item
, unsigned int col
);
202 virtual bool Cleared();
205 virtual void Resort();
207 void AddNotifier( wxDataViewModelNotifier
*notifier
);
208 void RemoveNotifier( wxDataViewModelNotifier
*notifier
);
210 // default compare function
211 virtual int Compare( const wxDataViewItem
&item1
, const wxDataViewItem
&item2
,
212 unsigned int column
, bool ascending
);
213 virtual bool HasDefaultCompare() const { return false; }
216 virtual bool IsIndexListModel() const { return false; }
219 // the user should not delete this class directly: he should use DecRef() instead!
220 virtual ~wxDataViewModel() { }
222 wxDataViewModelNotifiers m_notifiers
;
225 // ---------------------------------------------------------
226 // wxDataViewIndexListModel
227 // ---------------------------------------------------------
229 class WXDLLIMPEXP_ADV wxDataViewIndexListModel
: public wxDataViewModel
232 wxDataViewIndexListModel( unsigned int initial_size
= 0 );
233 ~wxDataViewIndexListModel();
235 virtual void GetValue( wxVariant
&variant
,
236 unsigned int row
, unsigned int col
) const = 0;
238 virtual bool SetValue( const wxVariant
&variant
,
239 unsigned int row
, unsigned int col
) = 0;
241 virtual bool GetAttr( unsigned int WXUNUSED(row
), unsigned int WXUNUSED(col
), wxDataViewItemAttr
&WXUNUSED(attr
) )
245 void RowInserted( unsigned int before
);
247 void RowDeleted( unsigned int row
);
248 void RowsDeleted( const wxArrayInt
&rows
);
249 void RowChanged( unsigned int row
);
250 void RowValueChanged( unsigned int row
, unsigned int col
);
251 void Reset( unsigned int new_size
);
253 // convert to/from row/wxDataViewItem
255 unsigned int GetRow( const wxDataViewItem
&item
) const;
256 wxDataViewItem
GetItem( unsigned int row
) const;
258 // compare based on index
260 virtual int Compare( const wxDataViewItem
&item1
, const wxDataViewItem
&item2
,
261 unsigned int column
, bool ascending
);
262 virtual bool HasDefaultCompare() const;
264 // implement base methods
266 virtual void GetValue( wxVariant
&variant
,
267 const wxDataViewItem
&item
, unsigned int col
) const;
268 virtual bool SetValue( const wxVariant
&variant
,
269 const wxDataViewItem
&item
, unsigned int col
);
270 virtual bool GetAttr( const wxDataViewItem
&item
, unsigned int col
, wxDataViewItemAttr
&attr
);
271 virtual wxDataViewItem
GetParent( const wxDataViewItem
&item
) const;
272 virtual bool IsContainer( const wxDataViewItem
&item
) const;
273 virtual unsigned int GetChildren( const wxDataViewItem
&item
, wxDataViewItemArray
&children
) const;
276 virtual bool IsIndexListModel() const { return true; }
277 unsigned int GetLastIndex() const { return m_lastIndex
; }
280 wxDataViewItemArray m_hash
;
281 unsigned int m_lastIndex
;
287 //-----------------------------------------------------------------------------
288 // wxDataViewEditorCtrlEvtHandler
289 //-----------------------------------------------------------------------------
291 class wxDataViewEditorCtrlEvtHandler
: public wxEvtHandler
294 wxDataViewEditorCtrlEvtHandler( wxControl
*editor
, wxDataViewRenderer
*owner
);
296 void AcceptChangesAndFinish();
297 void SetFocusOnIdle( bool focus
= true ) { m_focusOnIdle
= focus
; }
300 void OnChar( wxKeyEvent
&event
);
301 void OnKillFocus( wxFocusEvent
&event
);
302 void OnIdle( wxIdleEvent
&event
);
305 wxDataViewRenderer
*m_owner
;
306 wxControl
*m_editorCtrl
;
311 DECLARE_EVENT_TABLE()
314 // ---------------------------------------------------------
315 // wxDataViewRendererBase
316 // ---------------------------------------------------------
318 enum wxDataViewCellMode
320 wxDATAVIEW_CELL_INERT
,
321 wxDATAVIEW_CELL_ACTIVATABLE
,
322 wxDATAVIEW_CELL_EDITABLE
325 enum wxDataViewCellRenderState
327 wxDATAVIEW_CELL_SELECTED
= 1,
328 wxDATAVIEW_CELL_PRELIT
= 2,
329 wxDATAVIEW_CELL_INSENSITIVE
= 4,
330 wxDATAVIEW_CELL_FOCUSED
= 8
333 class WXDLLIMPEXP_ADV wxDataViewRendererBase
: public wxObject
336 wxDataViewRendererBase( const wxString
&varianttype
,
337 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
338 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
340 virtual bool Validate( wxVariant
& WXUNUSED(value
) )
343 void SetOwner( wxDataViewColumn
*owner
) { m_owner
= owner
; }
344 wxDataViewColumn
* GetOwner() { return m_owner
; }
346 // renderer properties:
348 virtual bool SetValue( const wxVariant
& WXUNUSED(value
) ) = 0;
349 virtual bool GetValue( wxVariant
& WXUNUSED(value
) ) const = 0;
351 wxString
GetVariantType() const { return m_variantType
; }
353 virtual void SetMode( wxDataViewCellMode mode
) = 0;
354 virtual wxDataViewCellMode
GetMode() const = 0;
356 // NOTE: Set/GetAlignment do not take/return a wxAlignment enum but
357 // rather an "int"; that's because for rendering cells it's allowed
358 // to combine alignment flags (e.g. wxALIGN_LEFT|wxALIGN_BOTTOM)
359 virtual void SetAlignment( int align
) = 0;
360 virtual int GetAlignment() const = 0;
363 virtual bool HasEditorCtrl()
365 virtual wxControl
* CreateEditorCtrl(wxWindow
* WXUNUSED(parent
),
366 wxRect
WXUNUSED(labelRect
),
367 const wxVariant
& WXUNUSED(value
))
369 virtual bool GetValueFromEditorCtrl(wxControl
* WXUNUSED(editor
),
370 wxVariant
& WXUNUSED(value
))
373 virtual bool StartEditing( const wxDataViewItem
&item
, wxRect labelRect
);
374 virtual void CancelEditing();
375 virtual bool FinishEditing();
377 wxControl
*GetEditorCtrl() { return m_editorCtrl
; }
380 wxString m_variantType
;
381 wxDataViewColumn
*m_owner
;
382 wxControl
*m_editorCtrl
;
383 wxDataViewItem m_item
; // for m_editorCtrl
386 const wxDataViewCtrl
* GetView() const;
389 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase
)
392 //-----------------------------------------------------------------------------
393 // wxDataViewIconText
394 //-----------------------------------------------------------------------------
396 class WXDLLIMPEXP_ADV wxDataViewIconText
: public wxObject
399 wxDataViewIconText( const wxString
&text
= wxEmptyString
, const wxIcon
& icon
= wxNullIcon
)
400 { m_icon
= icon
; m_text
= text
; }
401 wxDataViewIconText( const wxDataViewIconText
&other
)
402 { m_icon
= other
.m_icon
; m_text
= other
.m_text
; }
404 void SetText( const wxString
&text
) { m_text
= text
; }
405 wxString
GetText() const { return m_text
; }
406 void SetIcon( const wxIcon
&icon
) { m_icon
= icon
; }
407 const wxIcon
&GetIcon() const { return m_icon
; }
414 DECLARE_DYNAMIC_CLASS(wxDataViewIconText
)
417 bool operator == (const wxDataViewIconText
&one
, const wxDataViewIconText
&two
);
419 DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText
, WXDLLIMPEXP_ADV
)
421 // ---------------------------------------------------------
422 // wxDataViewColumnBase
423 // ---------------------------------------------------------
425 enum wxDataViewColumnFlags
427 wxDATAVIEW_COL_RESIZABLE
= 1,
428 wxDATAVIEW_COL_SORTABLE
= 2,
429 wxDATAVIEW_COL_HIDDEN
= 4
432 class WXDLLIMPEXP_ADV wxDataViewColumnBase
: public wxObject
435 wxDataViewColumnBase( const wxString
&title
, wxDataViewRenderer
*renderer
,
436 unsigned int model_column
, int width
= wxDVC_DEFAULT_WIDTH
,
437 wxAlignment align
= wxALIGN_CENTER
,
438 int flags
= wxDATAVIEW_COL_RESIZABLE
);
439 wxDataViewColumnBase( const wxBitmap
&bitmap
, wxDataViewRenderer
*renderer
,
440 unsigned int model_column
, int width
= wxDVC_DEFAULT_WIDTH
,
441 wxAlignment align
= wxALIGN_CENTER
,
442 int flags
= wxDATAVIEW_COL_RESIZABLE
);
443 virtual ~wxDataViewColumnBase();
447 virtual void SetTitle( const wxString
&title
) = 0;
448 virtual void SetAlignment( wxAlignment align
) = 0;
449 virtual void SetSortable( bool sortable
) = 0;
450 virtual void SetResizeable( bool resizeable
) = 0;
451 virtual void SetHidden( bool hidden
) = 0;
452 virtual void SetSortOrder( bool ascending
) = 0;
453 virtual void SetFlags( int flags
);
454 virtual void SetOwner( wxDataViewCtrl
*owner
)
456 virtual void SetBitmap( const wxBitmap
&bitmap
)
459 virtual void SetMinWidth( int minWidth
) = 0;
460 virtual void SetWidth( int width
) = 0;
465 virtual wxString
GetTitle() const = 0;
466 virtual wxAlignment
GetAlignment() const = 0;
467 virtual int GetWidth() const = 0;
468 virtual int GetMinWidth() const = 0;
470 virtual int GetFlags() const;
472 virtual bool IsSortable() const = 0;
473 virtual bool IsResizeable() const = 0;
474 virtual bool IsHidden() const = 0;
475 virtual bool IsSortOrderAscending() const = 0;
477 const wxBitmap
&GetBitmap() const { return m_bitmap
; }
478 unsigned int GetModelColumn() const { return static_cast<unsigned int>(m_model_column
); }
480 wxDataViewCtrl
*GetOwner() const { return m_owner
; }
481 wxDataViewRenderer
* GetRenderer() const { return m_renderer
; }
484 wxDataViewRenderer
*m_renderer
;
487 wxDataViewCtrl
*m_owner
;
490 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase
)
493 // ---------------------------------------------------------
494 // wxDataViewCtrlBase
495 // ---------------------------------------------------------
497 #define wxDV_SINGLE 0x0000 // for convenience
498 #define wxDV_MULTIPLE 0x0001 // can select multiple items
500 #define wxDV_NO_HEADER 0x0002 // column titles not visible
501 #define wxDV_HORIZ_RULES 0x0004 // light horizontal rules between rows
502 #define wxDV_VERT_RULES 0x0008 // light vertical rules between columns
504 #define wxDV_ROW_LINES 0x0010 // alternating colour in rows
506 class WXDLLIMPEXP_ADV wxDataViewCtrlBase
: public wxControl
509 wxDataViewCtrlBase();
510 virtual ~wxDataViewCtrlBase();
512 virtual bool AssociateModel( wxDataViewModel
*model
);
513 wxDataViewModel
* GetModel();
514 const wxDataViewModel
* GetModel() const;
517 wxDataViewColumn
*PrependTextColumn( const wxString
&label
, unsigned int model_column
,
518 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
519 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
520 int flags
= wxDATAVIEW_COL_RESIZABLE
);
521 wxDataViewColumn
*PrependIconTextColumn( const wxString
&label
, unsigned int model_column
,
522 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
523 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
524 int flags
= wxDATAVIEW_COL_RESIZABLE
);
525 wxDataViewColumn
*PrependToggleColumn( const wxString
&label
, unsigned int model_column
,
526 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
527 wxAlignment align
= wxALIGN_CENTER
,
528 int flags
= wxDATAVIEW_COL_RESIZABLE
);
529 wxDataViewColumn
*PrependProgressColumn( const wxString
&label
, unsigned int model_column
,
530 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
531 wxAlignment align
= wxALIGN_CENTER
,
532 int flags
= wxDATAVIEW_COL_RESIZABLE
);
533 wxDataViewColumn
*PrependDateColumn( const wxString
&label
, unsigned int model_column
,
534 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
535 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
536 int flags
= wxDATAVIEW_COL_RESIZABLE
);
537 wxDataViewColumn
*PrependBitmapColumn( const wxString
&label
, unsigned int model_column
,
538 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
539 wxAlignment align
= wxALIGN_CENTER
,
540 int flags
= wxDATAVIEW_COL_RESIZABLE
);
541 wxDataViewColumn
*PrependTextColumn( const wxBitmap
&label
, unsigned int model_column
,
542 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
543 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
544 int flags
= wxDATAVIEW_COL_RESIZABLE
);
545 wxDataViewColumn
*PrependIconTextColumn( const wxBitmap
&label
, unsigned int model_column
,
546 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
547 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
548 int flags
= wxDATAVIEW_COL_RESIZABLE
);
549 wxDataViewColumn
*PrependToggleColumn( const wxBitmap
&label
, unsigned int model_column
,
550 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
551 wxAlignment align
= wxALIGN_CENTER
,
552 int flags
= wxDATAVIEW_COL_RESIZABLE
);
553 wxDataViewColumn
*PrependProgressColumn( const wxBitmap
&label
, unsigned int model_column
,
554 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
555 wxAlignment align
= wxALIGN_CENTER
,
556 int flags
= wxDATAVIEW_COL_RESIZABLE
);
557 wxDataViewColumn
*PrependDateColumn( const wxBitmap
&label
, unsigned int model_column
,
558 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
559 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
560 int flags
= wxDATAVIEW_COL_RESIZABLE
);
561 wxDataViewColumn
*PrependBitmapColumn( const wxBitmap
&label
, unsigned int model_column
,
562 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
563 wxAlignment align
= wxALIGN_CENTER
,
564 int flags
= wxDATAVIEW_COL_RESIZABLE
);
566 wxDataViewColumn
*AppendTextColumn( const wxString
&label
, unsigned int model_column
,
567 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
568 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
569 int flags
= wxDATAVIEW_COL_RESIZABLE
);
570 wxDataViewColumn
*AppendIconTextColumn( const wxString
&label
, unsigned int model_column
,
571 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
572 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
573 int flags
= wxDATAVIEW_COL_RESIZABLE
);
574 wxDataViewColumn
*AppendToggleColumn( const wxString
&label
, unsigned int model_column
,
575 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
576 wxAlignment align
= wxALIGN_CENTER
,
577 int flags
= wxDATAVIEW_COL_RESIZABLE
);
578 wxDataViewColumn
*AppendProgressColumn( const wxString
&label
, unsigned int model_column
,
579 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
580 wxAlignment align
= wxALIGN_CENTER
,
581 int flags
= wxDATAVIEW_COL_RESIZABLE
);
582 wxDataViewColumn
*AppendDateColumn( const wxString
&label
, unsigned int model_column
,
583 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
584 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
585 int flags
= wxDATAVIEW_COL_RESIZABLE
);
586 wxDataViewColumn
*AppendBitmapColumn( const wxString
&label
, unsigned int model_column
,
587 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
588 wxAlignment align
= wxALIGN_CENTER
,
589 int flags
= wxDATAVIEW_COL_RESIZABLE
);
590 wxDataViewColumn
*AppendTextColumn( const wxBitmap
&label
, unsigned int model_column
,
591 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
592 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
593 int flags
= wxDATAVIEW_COL_RESIZABLE
);
594 wxDataViewColumn
*AppendIconTextColumn( const wxBitmap
&label
, unsigned int model_column
,
595 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
596 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
597 int flags
= wxDATAVIEW_COL_RESIZABLE
);
598 wxDataViewColumn
*AppendToggleColumn( const wxBitmap
&label
, unsigned int model_column
,
599 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
600 wxAlignment align
= wxALIGN_CENTER
,
601 int flags
= wxDATAVIEW_COL_RESIZABLE
);
602 wxDataViewColumn
*AppendProgressColumn( const wxBitmap
&label
, unsigned int model_column
,
603 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
604 wxAlignment align
= wxALIGN_CENTER
,
605 int flags
= wxDATAVIEW_COL_RESIZABLE
);
606 wxDataViewColumn
*AppendDateColumn( const wxBitmap
&label
, unsigned int model_column
,
607 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
608 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
609 int flags
= wxDATAVIEW_COL_RESIZABLE
);
610 wxDataViewColumn
*AppendBitmapColumn( const wxBitmap
&label
, unsigned int model_column
,
611 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
612 wxAlignment align
= wxALIGN_CENTER
,
613 int flags
= wxDATAVIEW_COL_RESIZABLE
);
616 virtual bool PrependColumn( wxDataViewColumn
*col
);
617 virtual bool AppendColumn( wxDataViewColumn
*col
);
619 virtual unsigned int GetColumnCount() const = 0;
620 virtual wxDataViewColumn
* GetColumn( unsigned int pos
) const = 0;
621 virtual int GetColumnPosition( const wxDataViewColumn
*column
) const = 0;
623 virtual bool DeleteColumn( wxDataViewColumn
*column
) = 0;
624 virtual bool ClearColumns() = 0;
626 void SetExpanderColumn( wxDataViewColumn
*col
)
627 { m_expander_column
= col
; DoSetExpanderColumn(); }
628 wxDataViewColumn
*GetExpanderColumn() const
629 { return m_expander_column
; }
631 virtual wxDataViewColumn
*GetSortingColumn() const = 0;
633 void SetIndent( int indent
)
634 { m_indent
= indent
; DoSetIndent(); }
635 int GetIndent() const
638 virtual wxDataViewItem
GetSelection() const = 0;
639 virtual int GetSelections( wxDataViewItemArray
& sel
) const = 0;
640 virtual void SetSelections( const wxDataViewItemArray
& sel
) = 0;
641 virtual void Select( const wxDataViewItem
& item
) = 0;
642 virtual void Unselect( const wxDataViewItem
& item
) = 0;
643 virtual bool IsSelected( const wxDataViewItem
& item
) const = 0;
645 virtual void SelectAll() = 0;
646 virtual void UnselectAll() = 0;
648 virtual void Expand( const wxDataViewItem
& item
) = 0;
649 virtual void Collapse( const wxDataViewItem
& item
) = 0;
651 virtual void EnsureVisible( const wxDataViewItem
& item
,
652 const wxDataViewColumn
*column
= NULL
) = 0;
653 virtual void HitTest( const wxPoint
& point
, wxDataViewItem
&item
, wxDataViewColumn
* &column
) const = 0;
654 virtual wxRect
GetItemRect( const wxDataViewItem
& item
, const wxDataViewColumn
*column
= NULL
) const = 0;
657 virtual void DoSetExpanderColumn() = 0 ;
658 virtual void DoSetIndent() = 0;
661 wxDataViewModel
*m_model
;
662 wxDataViewColumn
*m_expander_column
;
666 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase
)
669 // ----------------------------------------------------------------------------
670 // wxDataViewEvent - the event class for the wxDataViewCtrl notifications
671 // ----------------------------------------------------------------------------
673 class WXDLLIMPEXP_ADV wxDataViewEvent
: public wxNotifyEvent
676 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
, int winid
= 0)
677 : wxNotifyEvent(commandType
, winid
),
681 m_value(wxNullVariant
),
686 wxDataViewEvent(const wxDataViewEvent
& event
)
687 : wxNotifyEvent(event
),
688 m_item(event
.m_item
),
690 m_model(event
.m_model
),
691 m_value(event
.m_value
),
692 m_column(event
.m_column
),
696 wxDataViewItem
GetItem() const { return m_item
; }
697 void SetItem( const wxDataViewItem
&item
) { m_item
= item
; }
699 int GetColumn() const { return m_col
; }
700 void SetColumn( int col
) { m_col
= col
; }
702 wxDataViewModel
* GetModel() const { return m_model
; }
703 void SetModel( wxDataViewModel
*model
) { m_model
= model
; }
705 const wxVariant
&GetValue() const { return m_value
; }
706 void SetValue( const wxVariant
&value
) { m_value
= value
; }
708 // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only
709 void SetDataViewColumn( wxDataViewColumn
*col
) { m_column
= col
; }
710 wxDataViewColumn
*GetDataViewColumn() const { return m_column
; }
712 // for wxEVT_DATAVIEW_CONTEXT_MENU only
713 wxPoint
GetPosition() const;
714 void SetPosition( int x
, int y
) { m_pos
.x
= x
; m_pos
.y
= y
; }
716 virtual wxEvent
*Clone() const { return new wxDataViewEvent(*this); }
719 wxDataViewItem m_item
;
721 wxDataViewModel
*m_model
;
723 wxDataViewColumn
*m_column
;
727 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent
)
730 BEGIN_DECLARE_EVENT_TYPES()
731 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED
, -1)
733 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED
, -1)
734 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED
, -1)
735 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED
, -1)
736 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING
, -1)
737 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING
, -1)
738 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED
, -1)
739 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE
, -1)
740 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
, -1)
742 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU
, -1)
744 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK
, -1)
745 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK
, -1)
746 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED
, -1)
747 END_DECLARE_EVENT_TYPES()
749 typedef void (wxEvtHandler::*wxDataViewEventFunction
)(wxDataViewEvent
&);
751 #define wxDataViewEventHandler(func) \
752 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDataViewEventFunction, &func)
754 #define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \
755 wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn))
757 #define EVT_DATAVIEW_SELECTION_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(SELECTION_CHANGED, id, fn)
759 #define EVT_DATAVIEW_ITEM_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_ACTIVATED, id, fn)
760 #define EVT_DATAVIEW_ITEM_COLLAPSING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSING, id, fn)
761 #define EVT_DATAVIEW_ITEM_COLLAPSED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSED, id, fn)
762 #define EVT_DATAVIEW_ITEM_EXPANDING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDING, id, fn)
763 #define EVT_DATAVIEW_ITEM_EXPANDED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDED, id, fn)
764 #define EVT_DATAVIEW_ITEM_EDITING_STARTED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_STARTED, id, fn)
765 #define EVT_DATAVIEW_ITEM_EDITING_DONE(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_DONE, id, fn)
766 #define EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_VALUE_CHANGED, id, fn)
768 #define EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_CONTEXT_MENU, id, fn)
770 #define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn)
771 #define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn)
772 #define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
774 #if defined(wxUSE_GENERICDATAVIEWCTRL)
775 #include "wx/generic/dataview.h"
776 #elif defined(__WXGTK20__)
777 #include "wx/gtk/dataview.h"
778 #elif defined(__WXMAC__)
779 #include "wx/mac/dataview.h"
781 #include "wx/generic/dataview.h"
784 // -------------------------------------
785 // wxDataViewSpinRenderer
786 // -------------------------------------
788 class WXDLLIMPEXP_ADV wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
791 wxDataViewSpinRenderer( int min
, int max
,
792 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
793 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
794 virtual bool HasEditorCtrl() { return true; }
795 virtual wxControl
* CreateEditorCtrl( wxWindow
*parent
, wxRect labelRect
, const wxVariant
&value
);
796 virtual bool GetValueFromEditorCtrl( wxControl
* editor
, wxVariant
&value
);
797 virtual bool Render( wxRect rect
, wxDC
*dc
, int state
);
798 virtual wxSize
GetSize() const;
799 virtual bool SetValue( const wxVariant
&value
);
800 virtual bool GetValue( wxVariant
&value
) const;
807 //-----------------------------------------------------------------------------
808 // wxDataViewTreeStore
809 //-----------------------------------------------------------------------------
811 class WXDLLIMPEXP_ADV wxDataViewTreeStoreNode
814 wxDataViewTreeStoreNode( wxDataViewTreeStoreNode
*parent
,
815 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
816 virtual ~wxDataViewTreeStoreNode();
818 void SetText( const wxString
&text
)
820 wxString
GetText() const
822 void SetIcon( const wxIcon
&icon
)
824 const wxIcon
&GetIcon() const
826 void SetData( wxClientData
*data
)
827 { if (m_data
) delete m_data
; m_data
= data
; }
828 wxClientData
*GetData() const
831 wxDataViewItem
GetItem() const
832 { return wxDataViewItem( (void*) this ); }
834 virtual bool IsContainer()
837 wxDataViewTreeStoreNode
*GetParent()
841 wxDataViewTreeStoreNode
*m_parent
;
844 wxClientData
*m_data
;
847 WX_DECLARE_LIST_WITH_DECL(wxDataViewTreeStoreNode
, wxDataViewTreeStoreNodeList
,
848 class WXDLLIMPEXP_ADV
);
850 class WXDLLIMPEXP_ADV wxDataViewTreeStoreContainerNode
: public wxDataViewTreeStoreNode
853 wxDataViewTreeStoreContainerNode( wxDataViewTreeStoreNode
*parent
,
854 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
855 wxClientData
*data
= NULL
);
856 virtual ~wxDataViewTreeStoreContainerNode();
858 const wxDataViewTreeStoreNodeList
&GetChildren() const
859 { return m_children
; }
860 wxDataViewTreeStoreNodeList
&GetChildren()
861 { return m_children
; }
863 void SetExpandedIcon( const wxIcon
&icon
)
864 { m_iconExpanded
= icon
; }
865 const wxIcon
&GetExpandedIcon() const
866 { return m_iconExpanded
; }
868 void SetExpanded( bool expanded
= true )
869 { m_isExpanded
= expanded
; }
870 bool IsExpanded() const
871 { return m_isExpanded
; }
873 virtual bool IsContainer()
877 wxDataViewTreeStoreNodeList m_children
;
878 wxIcon m_iconExpanded
;
882 //-----------------------------------------------------------------------------
884 class WXDLLIMPEXP_ADV wxDataViewTreeStore
: public wxDataViewModel
887 wxDataViewTreeStore();
888 ~wxDataViewTreeStore();
890 wxDataViewItem
AppendItem( const wxDataViewItem
& parent
,
891 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
892 wxDataViewItem
PrependItem( const wxDataViewItem
& parent
,
893 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
894 wxDataViewItem
InsertItem( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
895 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
897 wxDataViewItem
PrependContainer( const wxDataViewItem
& parent
,
898 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
899 wxClientData
*data
= NULL
);
900 wxDataViewItem
AppendContainer( const wxDataViewItem
& parent
,
901 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
902 wxClientData
*data
= NULL
);
903 wxDataViewItem
InsertContainer( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
904 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
905 wxClientData
*data
= NULL
);
907 wxDataViewItem
GetNthChild( const wxDataViewItem
& parent
, unsigned int pos
) const;
908 int GetChildCount( const wxDataViewItem
& parent
) const;
910 void SetItemText( const wxDataViewItem
& item
, const wxString
&text
);
911 wxString
GetItemText( const wxDataViewItem
& item
) const;
912 void SetItemIcon( const wxDataViewItem
& item
, const wxIcon
&icon
);
913 const wxIcon
&GetItemIcon( const wxDataViewItem
& item
) const;
914 void SetItemExpandedIcon( const wxDataViewItem
& item
, const wxIcon
&icon
);
915 const wxIcon
&GetItemExpandedIcon( const wxDataViewItem
& item
) const;
916 void SetItemData( const wxDataViewItem
& item
, wxClientData
*data
);
917 wxClientData
*GetItemData( const wxDataViewItem
& item
) const;
919 void DeleteItem( const wxDataViewItem
& item
);
920 void DeleteChildren( const wxDataViewItem
& item
);
921 void DeleteAllItems();
923 // implement base methods
925 virtual void GetValue( wxVariant
&variant
,
926 const wxDataViewItem
&item
, unsigned int col
) const;
927 virtual bool SetValue( const wxVariant
&variant
,
928 const wxDataViewItem
&item
, unsigned int col
);
929 virtual wxDataViewItem
GetParent( const wxDataViewItem
&item
) const;
930 virtual bool IsContainer( const wxDataViewItem
&item
) const;
931 virtual unsigned int GetChildren( const wxDataViewItem
&item
, wxDataViewItemArray
&children
) const;
933 virtual int Compare( const wxDataViewItem
&item1
, const wxDataViewItem
&item2
,
934 unsigned int column
, bool ascending
);
936 virtual bool HasDefaultCompare() const
938 virtual unsigned int GetColumnCount() const
940 virtual wxString
GetColumnType( unsigned int WXUNUSED(col
) ) const
941 { return wxT("wxDataViewIconText"); }
943 wxDataViewTreeStoreNode
*FindNode( const wxDataViewItem
&item
) const;
944 wxDataViewTreeStoreContainerNode
*FindContainerNode( const wxDataViewItem
&item
) const;
945 wxDataViewTreeStoreNode
*GetRoot() const { return m_root
; }
948 wxDataViewTreeStoreNode
*m_root
;
951 class WXDLLIMPEXP_ADV wxDataViewTreeCtrl
: public wxDataViewCtrl
954 wxDataViewTreeCtrl();
955 wxDataViewTreeCtrl( wxWindow
*parent
, wxWindowID id
,
956 const wxPoint
& pos
= wxDefaultPosition
,
957 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
958 const wxValidator
& validator
= wxDefaultValidator
);
959 ~wxDataViewTreeCtrl();
961 bool Create( wxWindow
*parent
, wxWindowID id
,
962 const wxPoint
& pos
= wxDefaultPosition
,
963 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
964 const wxValidator
& validator
= wxDefaultValidator
);
966 wxDataViewTreeStore
*GetStore()
967 { return (wxDataViewTreeStore
*) GetModel(); }
968 const wxDataViewTreeStore
*GetStore() const
969 { return (const wxDataViewTreeStore
*) GetModel(); }
971 void SetImageList( wxImageList
*imagelist
);
972 wxImageList
* GetImageList() { return m_imageList
; }
974 wxDataViewItem
AppendItem( const wxDataViewItem
& parent
,
975 const wxString
&text
, int icon
= -1, wxClientData
*data
= NULL
);
976 wxDataViewItem
PrependItem( const wxDataViewItem
& parent
,
977 const wxString
&text
, int icon
= -1, wxClientData
*data
= NULL
);
978 wxDataViewItem
InsertItem( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
979 const wxString
&text
, int icon
= -1, wxClientData
*data
= NULL
);
981 wxDataViewItem
PrependContainer( const wxDataViewItem
& parent
,
982 const wxString
&text
, int icon
= -1, int expanded
= -1,
983 wxClientData
*data
= NULL
);
984 wxDataViewItem
AppendContainer( const wxDataViewItem
& parent
,
985 const wxString
&text
, int icon
= -1, int expanded
= -1,
986 wxClientData
*data
= NULL
);
987 wxDataViewItem
InsertContainer( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
988 const wxString
&text
, int icon
= -1, int expanded
= -1,
989 wxClientData
*data
= NULL
);
991 wxDataViewItem
GetNthChild( const wxDataViewItem
& parent
, unsigned int pos
) const
992 { return GetStore()->GetNthChild(parent
, pos
); }
993 int GetChildCount( const wxDataViewItem
& parent
) const
994 { return GetStore()->GetChildCount(parent
); }
996 void SetItemText( const wxDataViewItem
& item
, const wxString
&text
)
997 { GetStore()->SetItemText(item
,text
); }
998 wxString
GetItemText( const wxDataViewItem
& item
) const
999 { return GetStore()->GetItemText(item
); }
1000 void SetItemIcon( const wxDataViewItem
& item
, const wxIcon
&icon
)
1001 { GetStore()->SetItemIcon(item
,icon
); }
1002 const wxIcon
&GetItemIcon( const wxDataViewItem
& item
) const
1003 { return GetStore()->GetItemIcon(item
); }
1004 void SetItemExpandedIcon( const wxDataViewItem
& item
, const wxIcon
&icon
)
1005 { GetStore()->SetItemExpandedIcon(item
,icon
); }
1006 const wxIcon
&GetItemExpandedIcon( const wxDataViewItem
& item
) const
1007 { return GetStore()->GetItemExpandedIcon(item
); }
1008 void SetItemData( const wxDataViewItem
& item
, wxClientData
*data
)
1009 { GetStore()->SetItemData(item
,data
); }
1010 wxClientData
*GetItemData( const wxDataViewItem
& item
) const
1011 { return GetStore()->GetItemData(item
); }
1013 void DeleteItem( const wxDataViewItem
& item
)
1014 { GetStore()->DeleteItem(item
); }
1015 void DeleteChildren( const wxDataViewItem
& item
)
1016 { GetStore()->DeleteChildren(item
); }
1017 void DeleteAllItems()
1018 { GetStore()->DeleteAllItems(); }
1020 void OnExpanded( wxDataViewEvent
&event
);
1021 void OnCollapsed( wxDataViewEvent
&event
);
1022 void OnSize( wxSizeEvent
&event
);
1025 wxImageList
*m_imageList
;
1028 DECLARE_EVENT_TABLE()
1029 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl
)
1032 #endif // wxUSE_DATAVIEWCTRL
1035 // _WX_DATAVIEW_H_BASE_