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
);
252 // convert to/from row/wxDataViewItem
254 unsigned int GetRow( const wxDataViewItem
&item
) const;
255 wxDataViewItem
GetItem( unsigned int row
) const;
257 // compare based on index
259 virtual int Compare( const wxDataViewItem
&item1
, const wxDataViewItem
&item2
,
260 unsigned int column
, bool ascending
);
261 virtual bool HasDefaultCompare() const;
263 // implement base methods
265 virtual void GetValue( wxVariant
&variant
,
266 const wxDataViewItem
&item
, unsigned int col
) const;
267 virtual bool SetValue( const wxVariant
&variant
,
268 const wxDataViewItem
&item
, unsigned int col
);
269 virtual bool GetAttr( const wxDataViewItem
&item
, unsigned int col
, wxDataViewItemAttr
&attr
);
270 virtual wxDataViewItem
GetParent( const wxDataViewItem
&item
) const;
271 virtual bool IsContainer( const wxDataViewItem
&item
) const;
272 virtual unsigned int GetChildren( const wxDataViewItem
&item
, wxDataViewItemArray
&children
) const;
275 virtual bool IsIndexListModel() const { return true; }
276 unsigned int GetLastIndex() const { return m_lastIndex
; }
279 wxDataViewItemArray m_hash
;
280 unsigned int m_lastIndex
;
286 //-----------------------------------------------------------------------------
287 // wxDataViewEditorCtrlEvtHandler
288 //-----------------------------------------------------------------------------
290 class wxDataViewEditorCtrlEvtHandler
: public wxEvtHandler
293 wxDataViewEditorCtrlEvtHandler( wxControl
*editor
, wxDataViewRenderer
*owner
);
295 void AcceptChangesAndFinish();
296 void SetFocusOnIdle( bool focus
= true ) { m_focusOnIdle
= focus
; }
299 void OnChar( wxKeyEvent
&event
);
300 void OnKillFocus( wxFocusEvent
&event
);
301 void OnIdle( wxIdleEvent
&event
);
304 wxDataViewRenderer
*m_owner
;
305 wxControl
*m_editorCtrl
;
310 DECLARE_EVENT_TABLE()
313 // ---------------------------------------------------------
314 // wxDataViewRendererBase
315 // ---------------------------------------------------------
317 enum wxDataViewCellMode
319 wxDATAVIEW_CELL_INERT
,
320 wxDATAVIEW_CELL_ACTIVATABLE
,
321 wxDATAVIEW_CELL_EDITABLE
324 enum wxDataViewCellRenderState
326 wxDATAVIEW_CELL_SELECTED
= 1,
327 wxDATAVIEW_CELL_PRELIT
= 2,
328 wxDATAVIEW_CELL_INSENSITIVE
= 4,
329 wxDATAVIEW_CELL_FOCUSED
= 8
332 class WXDLLIMPEXP_ADV wxDataViewRendererBase
: public wxObject
335 wxDataViewRendererBase( const wxString
&varianttype
,
336 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
337 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
339 virtual bool Validate( wxVariant
& WXUNUSED(value
) )
342 void SetOwner( wxDataViewColumn
*owner
) { m_owner
= owner
; }
343 wxDataViewColumn
* GetOwner() { return m_owner
; }
345 // renderer properties:
347 virtual bool SetValue( const wxVariant
& WXUNUSED(value
) ) = 0;
348 virtual bool GetValue( wxVariant
& WXUNUSED(value
) ) const = 0;
350 wxString
GetVariantType() const { return m_variantType
; }
352 virtual void SetMode( wxDataViewCellMode mode
) = 0;
353 virtual wxDataViewCellMode
GetMode() const = 0;
355 // NOTE: Set/GetAlignment do not take/return a wxAlignment enum but
356 // rather an "int"; that's because for rendering cells it's allowed
357 // to combine alignment flags (e.g. wxALIGN_LEFT|wxALIGN_BOTTOM)
358 virtual void SetAlignment( int align
) = 0;
359 virtual int GetAlignment() const = 0;
362 virtual bool HasEditorCtrl()
364 virtual wxControl
* CreateEditorCtrl(wxWindow
* WXUNUSED(parent
),
365 wxRect
WXUNUSED(labelRect
),
366 const wxVariant
& WXUNUSED(value
))
368 virtual bool GetValueFromEditorCtrl(wxControl
* WXUNUSED(editor
),
369 wxVariant
& WXUNUSED(value
))
372 virtual bool StartEditing( const wxDataViewItem
&item
, wxRect labelRect
);
373 virtual void CancelEditing();
374 virtual bool FinishEditing();
376 wxControl
*GetEditorCtrl() { return m_editorCtrl
; }
379 wxString m_variantType
;
380 wxDataViewColumn
*m_owner
;
381 wxControl
*m_editorCtrl
;
382 wxDataViewItem m_item
; // for m_editorCtrl
385 const wxDataViewCtrl
* GetView() const;
388 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase
)
391 //-----------------------------------------------------------------------------
392 // wxDataViewIconText
393 //-----------------------------------------------------------------------------
395 class WXDLLIMPEXP_ADV wxDataViewIconText
: public wxObject
398 wxDataViewIconText( const wxString
&text
= wxEmptyString
, const wxIcon
& icon
= wxNullIcon
)
399 { m_icon
= icon
; m_text
= text
; }
400 wxDataViewIconText( const wxDataViewIconText
&other
)
401 { m_icon
= other
.m_icon
; m_text
= other
.m_text
; }
403 void SetText( const wxString
&text
) { m_text
= text
; }
404 wxString
GetText() const { return m_text
; }
405 void SetIcon( const wxIcon
&icon
) { m_icon
= icon
; }
406 const wxIcon
&GetIcon() const { return m_icon
; }
413 DECLARE_DYNAMIC_CLASS(wxDataViewIconText
)
416 bool operator == (const wxDataViewIconText
&one
, const wxDataViewIconText
&two
);
418 DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText
, WXDLLIMPEXP_ADV
)
420 // ---------------------------------------------------------
421 // wxDataViewColumnBase
422 // ---------------------------------------------------------
424 enum wxDataViewColumnFlags
426 wxDATAVIEW_COL_RESIZABLE
= 1,
427 wxDATAVIEW_COL_SORTABLE
= 2,
428 wxDATAVIEW_COL_HIDDEN
= 4
431 class WXDLLIMPEXP_ADV wxDataViewColumnBase
: public wxObject
434 wxDataViewColumnBase( const wxString
&title
, wxDataViewRenderer
*renderer
,
435 unsigned int model_column
, int width
= wxDVC_DEFAULT_WIDTH
,
436 wxAlignment align
= wxALIGN_CENTER
,
437 int flags
= wxDATAVIEW_COL_RESIZABLE
);
438 wxDataViewColumnBase( const wxBitmap
&bitmap
, wxDataViewRenderer
*renderer
,
439 unsigned int model_column
, int width
= wxDVC_DEFAULT_WIDTH
,
440 wxAlignment align
= wxALIGN_CENTER
,
441 int flags
= wxDATAVIEW_COL_RESIZABLE
);
442 virtual ~wxDataViewColumnBase();
446 virtual void SetTitle( const wxString
&title
) = 0;
447 virtual void SetAlignment( wxAlignment align
) = 0;
448 virtual void SetSortable( bool sortable
) = 0;
449 virtual void SetResizeable( bool resizeable
) = 0;
450 virtual void SetHidden( bool hidden
) = 0;
451 virtual void SetSortOrder( bool ascending
) = 0;
452 virtual void SetFlags( int flags
);
453 virtual void SetOwner( wxDataViewCtrl
*owner
)
455 virtual void SetBitmap( const wxBitmap
&bitmap
)
458 virtual void SetMinWidth( int minWidth
) = 0;
459 virtual void SetWidth( int width
) = 0;
464 virtual wxString
GetTitle() const = 0;
465 virtual wxAlignment
GetAlignment() const = 0;
466 virtual int GetWidth() const = 0;
467 virtual int GetMinWidth() const = 0;
469 virtual int GetFlags() const;
471 virtual bool IsSortable() const = 0;
472 virtual bool IsResizeable() const = 0;
473 virtual bool IsHidden() const = 0;
474 virtual bool IsSortOrderAscending() const = 0;
476 const wxBitmap
&GetBitmap() const { return m_bitmap
; }
477 unsigned int GetModelColumn() const { return static_cast<unsigned int>(m_model_column
); }
479 wxDataViewCtrl
*GetOwner() const { return m_owner
; }
480 wxDataViewRenderer
* GetRenderer() const { return m_renderer
; }
483 wxDataViewRenderer
*m_renderer
;
486 wxDataViewCtrl
*m_owner
;
489 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase
)
492 // ---------------------------------------------------------
493 // wxDataViewCtrlBase
494 // ---------------------------------------------------------
496 #define wxDV_SINGLE 0x0000 // for convenience
497 #define wxDV_MULTIPLE 0x0001 // can select multiple items
499 #define wxDV_NO_HEADER 0x0002 // column titles not visible
500 #define wxDV_HORIZ_RULES 0x0004 // light horizontal rules between rows
501 #define wxDV_VERT_RULES 0x0008 // light vertical rules between columns
503 #define wxDV_ROW_LINES 0x0010 // alternating colour in rows
505 class WXDLLIMPEXP_ADV wxDataViewCtrlBase
: public wxControl
508 wxDataViewCtrlBase();
509 virtual ~wxDataViewCtrlBase();
511 virtual bool AssociateModel( wxDataViewModel
*model
);
512 wxDataViewModel
* GetModel();
513 const wxDataViewModel
* GetModel() const;
516 wxDataViewColumn
*PrependTextColumn( const wxString
&label
, unsigned int model_column
,
517 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
518 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
519 int flags
= wxDATAVIEW_COL_RESIZABLE
);
520 wxDataViewColumn
*PrependIconTextColumn( const wxString
&label
, unsigned int model_column
,
521 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
522 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
523 int flags
= wxDATAVIEW_COL_RESIZABLE
);
524 wxDataViewColumn
*PrependToggleColumn( const wxString
&label
, unsigned int model_column
,
525 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
526 wxAlignment align
= wxALIGN_CENTER
,
527 int flags
= wxDATAVIEW_COL_RESIZABLE
);
528 wxDataViewColumn
*PrependProgressColumn( const wxString
&label
, unsigned int model_column
,
529 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
530 wxAlignment align
= wxALIGN_CENTER
,
531 int flags
= wxDATAVIEW_COL_RESIZABLE
);
532 wxDataViewColumn
*PrependDateColumn( const wxString
&label
, unsigned int model_column
,
533 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
534 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
535 int flags
= wxDATAVIEW_COL_RESIZABLE
);
536 wxDataViewColumn
*PrependBitmapColumn( const wxString
&label
, unsigned int model_column
,
537 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
538 wxAlignment align
= wxALIGN_CENTER
,
539 int flags
= wxDATAVIEW_COL_RESIZABLE
);
540 wxDataViewColumn
*PrependTextColumn( const wxBitmap
&label
, unsigned int model_column
,
541 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
542 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
543 int flags
= wxDATAVIEW_COL_RESIZABLE
);
544 wxDataViewColumn
*PrependIconTextColumn( const wxBitmap
&label
, unsigned int model_column
,
545 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
546 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
547 int flags
= wxDATAVIEW_COL_RESIZABLE
);
548 wxDataViewColumn
*PrependToggleColumn( const wxBitmap
&label
, unsigned int model_column
,
549 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
550 wxAlignment align
= wxALIGN_CENTER
,
551 int flags
= wxDATAVIEW_COL_RESIZABLE
);
552 wxDataViewColumn
*PrependProgressColumn( const wxBitmap
&label
, unsigned int model_column
,
553 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
554 wxAlignment align
= wxALIGN_CENTER
,
555 int flags
= wxDATAVIEW_COL_RESIZABLE
);
556 wxDataViewColumn
*PrependDateColumn( const wxBitmap
&label
, unsigned int model_column
,
557 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
558 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
559 int flags
= wxDATAVIEW_COL_RESIZABLE
);
560 wxDataViewColumn
*PrependBitmapColumn( const wxBitmap
&label
, unsigned int model_column
,
561 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
562 wxAlignment align
= wxALIGN_CENTER
,
563 int flags
= wxDATAVIEW_COL_RESIZABLE
);
565 wxDataViewColumn
*AppendTextColumn( const wxString
&label
, unsigned int model_column
,
566 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
567 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
568 int flags
= wxDATAVIEW_COL_RESIZABLE
);
569 wxDataViewColumn
*AppendIconTextColumn( const wxString
&label
, unsigned int model_column
,
570 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
571 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
572 int flags
= wxDATAVIEW_COL_RESIZABLE
);
573 wxDataViewColumn
*AppendToggleColumn( const wxString
&label
, unsigned int model_column
,
574 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
575 wxAlignment align
= wxALIGN_CENTER
,
576 int flags
= wxDATAVIEW_COL_RESIZABLE
);
577 wxDataViewColumn
*AppendProgressColumn( const wxString
&label
, unsigned int model_column
,
578 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
579 wxAlignment align
= wxALIGN_CENTER
,
580 int flags
= wxDATAVIEW_COL_RESIZABLE
);
581 wxDataViewColumn
*AppendDateColumn( const wxString
&label
, unsigned int model_column
,
582 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
583 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
584 int flags
= wxDATAVIEW_COL_RESIZABLE
);
585 wxDataViewColumn
*AppendBitmapColumn( const wxString
&label
, unsigned int model_column
,
586 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
587 wxAlignment align
= wxALIGN_CENTER
,
588 int flags
= wxDATAVIEW_COL_RESIZABLE
);
589 wxDataViewColumn
*AppendTextColumn( const wxBitmap
&label
, unsigned int model_column
,
590 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
591 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
592 int flags
= wxDATAVIEW_COL_RESIZABLE
);
593 wxDataViewColumn
*AppendIconTextColumn( const wxBitmap
&label
, unsigned int model_column
,
594 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
595 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
596 int flags
= wxDATAVIEW_COL_RESIZABLE
);
597 wxDataViewColumn
*AppendToggleColumn( const wxBitmap
&label
, unsigned int model_column
,
598 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_TOGGLE_DEFAULT_WIDTH
,
599 wxAlignment align
= wxALIGN_CENTER
,
600 int flags
= wxDATAVIEW_COL_RESIZABLE
);
601 wxDataViewColumn
*AppendProgressColumn( const wxBitmap
&label
, unsigned int model_column
,
602 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= wxDVC_DEFAULT_WIDTH
,
603 wxAlignment align
= wxALIGN_CENTER
,
604 int flags
= wxDATAVIEW_COL_RESIZABLE
);
605 wxDataViewColumn
*AppendDateColumn( const wxBitmap
&label
, unsigned int model_column
,
606 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
, int width
= -1,
607 wxAlignment align
= (wxAlignment
)(wxALIGN_LEFT
|wxALIGN_CENTRE_VERTICAL
),
608 int flags
= wxDATAVIEW_COL_RESIZABLE
);
609 wxDataViewColumn
*AppendBitmapColumn( const wxBitmap
&label
, unsigned int model_column
,
610 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
, int width
= -1,
611 wxAlignment align
= wxALIGN_CENTER
,
612 int flags
= wxDATAVIEW_COL_RESIZABLE
);
615 virtual bool PrependColumn( wxDataViewColumn
*col
);
616 virtual bool AppendColumn( wxDataViewColumn
*col
);
618 virtual unsigned int GetColumnCount() const = 0;
619 virtual wxDataViewColumn
* GetColumn( unsigned int pos
) const = 0;
620 virtual int GetColumnPosition( const wxDataViewColumn
*column
) const = 0;
622 virtual bool DeleteColumn( wxDataViewColumn
*column
) = 0;
623 virtual bool ClearColumns() = 0;
625 void SetExpanderColumn( wxDataViewColumn
*col
)
626 { m_expander_column
= col
; DoSetExpanderColumn(); }
627 wxDataViewColumn
*GetExpanderColumn() const
628 { return m_expander_column
; }
630 virtual wxDataViewColumn
*GetSortingColumn() const = 0;
632 void SetIndent( int indent
)
633 { m_indent
= indent
; DoSetIndent(); }
634 int GetIndent() const
637 virtual wxDataViewItem
GetSelection() const = 0;
638 virtual int GetSelections( wxDataViewItemArray
& sel
) const = 0;
639 virtual void SetSelections( const wxDataViewItemArray
& sel
) = 0;
640 virtual void Select( const wxDataViewItem
& item
) = 0;
641 virtual void Unselect( const wxDataViewItem
& item
) = 0;
642 virtual bool IsSelected( const wxDataViewItem
& item
) const = 0;
644 virtual void SelectAll() = 0;
645 virtual void UnselectAll() = 0;
647 virtual void Expand( const wxDataViewItem
& item
) = 0;
648 virtual void Collapse( const wxDataViewItem
& item
) = 0;
650 virtual void EnsureVisible( const wxDataViewItem
& item
,
651 const wxDataViewColumn
*column
= NULL
) = 0;
652 virtual void HitTest( const wxPoint
& point
, wxDataViewItem
&item
, wxDataViewColumn
* &column
) const = 0;
653 virtual wxRect
GetItemRect( const wxDataViewItem
& item
, const wxDataViewColumn
*column
= NULL
) const = 0;
656 virtual void DoSetExpanderColumn() = 0 ;
657 virtual void DoSetIndent() = 0;
660 wxDataViewModel
*m_model
;
661 wxDataViewColumn
*m_expander_column
;
665 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase
)
668 // ----------------------------------------------------------------------------
669 // wxDataViewEvent - the event class for the wxDataViewCtrl notifications
670 // ----------------------------------------------------------------------------
672 class WXDLLIMPEXP_ADV wxDataViewEvent
: public wxNotifyEvent
675 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
, int winid
= 0)
676 : wxNotifyEvent(commandType
, winid
),
680 m_value(wxNullVariant
),
685 wxDataViewEvent(const wxDataViewEvent
& event
)
686 : wxNotifyEvent(event
),
687 m_item(event
.m_item
),
689 m_model(event
.m_model
),
690 m_value(event
.m_value
),
691 m_column(event
.m_column
),
695 wxDataViewItem
GetItem() const { return m_item
; }
696 void SetItem( const wxDataViewItem
&item
) { m_item
= item
; }
698 int GetColumn() const { return m_col
; }
699 void SetColumn( int col
) { m_col
= col
; }
701 wxDataViewModel
* GetModel() const { return m_model
; }
702 void SetModel( wxDataViewModel
*model
) { m_model
= model
; }
704 const wxVariant
&GetValue() const { return m_value
; }
705 void SetValue( const wxVariant
&value
) { m_value
= value
; }
707 // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only
708 void SetDataViewColumn( wxDataViewColumn
*col
) { m_column
= col
; }
709 wxDataViewColumn
*GetDataViewColumn() const { return m_column
; }
711 // for wxEVT_DATAVIEW_CONTEXT_MENU only
712 wxPoint
GetPosition() const;
713 void SetPosition( int x
, int y
) { m_pos
.x
= x
; m_pos
.y
= y
; }
715 virtual wxEvent
*Clone() const { return new wxDataViewEvent(*this); }
718 wxDataViewItem m_item
;
720 wxDataViewModel
*m_model
;
722 wxDataViewColumn
*m_column
;
726 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent
)
729 BEGIN_DECLARE_EVENT_TYPES()
730 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED
, -1)
732 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED
, -1)
733 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED
, -1)
734 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED
, -1)
735 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING
, -1)
736 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING
, -1)
737 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED
, -1)
738 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE
, -1)
739 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
, -1)
741 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU
, -1)
743 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK
, -1)
744 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK
, -1)
745 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED
, -1)
746 END_DECLARE_EVENT_TYPES()
748 typedef void (wxEvtHandler::*wxDataViewEventFunction
)(wxDataViewEvent
&);
750 #define wxDataViewEventHandler(func) \
751 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDataViewEventFunction, &func)
753 #define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \
754 wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn))
756 #define EVT_DATAVIEW_SELECTION_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(SELECTION_CHANGED, id, fn)
758 #define EVT_DATAVIEW_ITEM_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_ACTIVATED, id, fn)
759 #define EVT_DATAVIEW_ITEM_COLLAPSING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSING, id, fn)
760 #define EVT_DATAVIEW_ITEM_COLLAPSED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSED, id, fn)
761 #define EVT_DATAVIEW_ITEM_EXPANDING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDING, id, fn)
762 #define EVT_DATAVIEW_ITEM_EXPANDED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDED, id, fn)
763 #define EVT_DATAVIEW_ITEM_EDITING_STARTED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_STARTED, id, fn)
764 #define EVT_DATAVIEW_ITEM_EDITING_DONE(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_DONE, id, fn)
765 #define EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_VALUE_CHANGED, id, fn)
767 #define EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_CONTEXT_MENU, id, fn)
769 #define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn)
770 #define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn)
771 #define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
773 #if defined(wxUSE_GENERICDATAVIEWCTRL)
774 #include "wx/generic/dataview.h"
775 #elif defined(__WXGTK20__)
776 #include "wx/gtk/dataview.h"
777 #elif defined(__WXMAC__)
778 #include "wx/mac/dataview.h"
780 #include "wx/generic/dataview.h"
783 // -------------------------------------
784 // wxDataViewSpinRenderer
785 // -------------------------------------
787 class WXDLLIMPEXP_ADV wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
790 wxDataViewSpinRenderer( int min
, int max
,
791 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
792 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
793 virtual bool HasEditorCtrl() { return true; }
794 virtual wxControl
* CreateEditorCtrl( wxWindow
*parent
, wxRect labelRect
, const wxVariant
&value
);
795 virtual bool GetValueFromEditorCtrl( wxControl
* editor
, wxVariant
&value
);
796 virtual bool Render( wxRect rect
, wxDC
*dc
, int state
);
797 virtual wxSize
GetSize() const;
798 virtual bool SetValue( const wxVariant
&value
);
799 virtual bool GetValue( wxVariant
&value
) const;
806 //-----------------------------------------------------------------------------
807 // wxDataViewTreeStore
808 //-----------------------------------------------------------------------------
810 class WXDLLIMPEXP_ADV wxDataViewTreeStoreNode
813 wxDataViewTreeStoreNode( wxDataViewTreeStoreNode
*parent
,
814 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
815 virtual ~wxDataViewTreeStoreNode();
817 void SetText( const wxString
&text
)
819 wxString
GetText() const
821 void SetIcon( const wxIcon
&icon
)
823 const wxIcon
&GetIcon() const
825 void SetData( wxClientData
*data
)
826 { if (m_data
) delete m_data
; m_data
= data
; }
827 wxClientData
*GetData() const
830 wxDataViewItem
GetItem() const
831 { return wxDataViewItem( (void*) this ); }
833 virtual bool IsContainer()
836 wxDataViewTreeStoreNode
*GetParent()
840 wxDataViewTreeStoreNode
*m_parent
;
843 wxClientData
*m_data
;
846 WX_DECLARE_LIST_WITH_DECL(wxDataViewTreeStoreNode
, wxDataViewTreeStoreNodeList
,
847 class WXDLLIMPEXP_ADV
);
849 class WXDLLIMPEXP_ADV wxDataViewTreeStoreContainerNode
: public wxDataViewTreeStoreNode
852 wxDataViewTreeStoreContainerNode( wxDataViewTreeStoreNode
*parent
,
853 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
854 wxClientData
*data
= NULL
);
855 virtual ~wxDataViewTreeStoreContainerNode();
857 const wxDataViewTreeStoreNodeList
&GetChildren() const
858 { return m_children
; }
859 wxDataViewTreeStoreNodeList
&GetChildren()
860 { return m_children
; }
862 void SetExpandedIcon( const wxIcon
&icon
)
863 { m_iconExpanded
= icon
; }
864 const wxIcon
&GetExpandedIcon() const
865 { return m_iconExpanded
; }
867 void SetExpanded( bool expanded
= true )
868 { m_isExpanded
= expanded
; }
869 bool IsExpanded() const
870 { return m_isExpanded
; }
872 virtual bool IsContainer()
876 wxDataViewTreeStoreNodeList m_children
;
877 wxIcon m_iconExpanded
;
881 //-----------------------------------------------------------------------------
883 class WXDLLIMPEXP_ADV wxDataViewTreeStore
: public wxDataViewModel
886 wxDataViewTreeStore();
887 ~wxDataViewTreeStore();
889 wxDataViewItem
AppendItem( const wxDataViewItem
& parent
,
890 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
891 wxDataViewItem
PrependItem( const wxDataViewItem
& parent
,
892 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
893 wxDataViewItem
InsertItem( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
894 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, wxClientData
*data
= NULL
);
896 wxDataViewItem
PrependContainer( const wxDataViewItem
& parent
,
897 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
898 wxClientData
*data
= NULL
);
899 wxDataViewItem
AppendContainer( const wxDataViewItem
& parent
,
900 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
901 wxClientData
*data
= NULL
);
902 wxDataViewItem
InsertContainer( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
903 const wxString
&text
, const wxIcon
&icon
= wxNullIcon
, const wxIcon
&expanded
= wxNullIcon
,
904 wxClientData
*data
= NULL
);
906 wxDataViewItem
GetNthChild( const wxDataViewItem
& parent
, unsigned int pos
) const;
907 int GetChildCount( const wxDataViewItem
& parent
) const;
909 void SetItemText( const wxDataViewItem
& item
, const wxString
&text
);
910 wxString
GetItemText( const wxDataViewItem
& item
) const;
911 void SetItemIcon( const wxDataViewItem
& item
, const wxIcon
&icon
);
912 const wxIcon
&GetItemIcon( const wxDataViewItem
& item
) const;
913 void SetItemExpandedIcon( const wxDataViewItem
& item
, const wxIcon
&icon
);
914 const wxIcon
&GetItemExpandedIcon( const wxDataViewItem
& item
) const;
915 void SetItemData( const wxDataViewItem
& item
, wxClientData
*data
);
916 wxClientData
*GetItemData( const wxDataViewItem
& item
) const;
918 void DeleteItem( const wxDataViewItem
& item
);
919 void DeleteChildren( const wxDataViewItem
& item
);
920 void DeleteAllItems();
922 // implement base methods
924 virtual void GetValue( wxVariant
&variant
,
925 const wxDataViewItem
&item
, unsigned int col
) const;
926 virtual bool SetValue( const wxVariant
&variant
,
927 const wxDataViewItem
&item
, unsigned int col
);
928 virtual wxDataViewItem
GetParent( const wxDataViewItem
&item
) const;
929 virtual bool IsContainer( const wxDataViewItem
&item
) const;
930 virtual unsigned int GetChildren( const wxDataViewItem
&item
, wxDataViewItemArray
&children
) const;
932 virtual int Compare( const wxDataViewItem
&item1
, const wxDataViewItem
&item2
,
933 unsigned int column
, bool ascending
);
935 virtual bool HasDefaultCompare() const
937 virtual unsigned int GetColumnCount() const
939 virtual wxString
GetColumnType( unsigned int WXUNUSED(col
) ) const
940 { return wxT("wxDataViewIconText"); }
942 wxDataViewTreeStoreNode
*FindNode( const wxDataViewItem
&item
) const;
943 wxDataViewTreeStoreContainerNode
*FindContainerNode( const wxDataViewItem
&item
) const;
944 wxDataViewTreeStoreNode
*GetRoot() const { return m_root
; }
947 wxDataViewTreeStoreNode
*m_root
;
950 class WXDLLIMPEXP_ADV wxDataViewTreeCtrl
: public wxDataViewCtrl
953 wxDataViewTreeCtrl();
954 wxDataViewTreeCtrl( wxWindow
*parent
, wxWindowID id
,
955 const wxPoint
& pos
= wxDefaultPosition
,
956 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
957 const wxValidator
& validator
= wxDefaultValidator
);
958 ~wxDataViewTreeCtrl();
960 bool Create( wxWindow
*parent
, wxWindowID id
,
961 const wxPoint
& pos
= wxDefaultPosition
,
962 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
963 const wxValidator
& validator
= wxDefaultValidator
);
965 wxDataViewTreeStore
*GetStore()
966 { return (wxDataViewTreeStore
*) GetModel(); }
967 const wxDataViewTreeStore
*GetStore() const
968 { return (const wxDataViewTreeStore
*) GetModel(); }
970 void SetImageList( wxImageList
*imagelist
);
971 wxImageList
* GetImageList() { return m_imageList
; }
973 wxDataViewItem
AppendItem( const wxDataViewItem
& parent
,
974 const wxString
&text
, int icon
= -1, wxClientData
*data
= NULL
);
975 wxDataViewItem
PrependItem( const wxDataViewItem
& parent
,
976 const wxString
&text
, int icon
= -1, wxClientData
*data
= NULL
);
977 wxDataViewItem
InsertItem( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
978 const wxString
&text
, int icon
= -1, wxClientData
*data
= NULL
);
980 wxDataViewItem
PrependContainer( const wxDataViewItem
& parent
,
981 const wxString
&text
, int icon
= -1, int expanded
= -1,
982 wxClientData
*data
= NULL
);
983 wxDataViewItem
AppendContainer( const wxDataViewItem
& parent
,
984 const wxString
&text
, int icon
= -1, int expanded
= -1,
985 wxClientData
*data
= NULL
);
986 wxDataViewItem
InsertContainer( const wxDataViewItem
& parent
, const wxDataViewItem
& previous
,
987 const wxString
&text
, int icon
= -1, int expanded
= -1,
988 wxClientData
*data
= NULL
);
990 wxDataViewItem
GetNthChild( const wxDataViewItem
& parent
, unsigned int pos
) const
991 { return GetStore()->GetNthChild(parent
, pos
); }
992 int GetChildCount( const wxDataViewItem
& parent
) const
993 { return GetStore()->GetChildCount(parent
); }
995 void SetItemText( const wxDataViewItem
& item
, const wxString
&text
)
996 { GetStore()->SetItemText(item
,text
); }
997 wxString
GetItemText( const wxDataViewItem
& item
) const
998 { return GetStore()->GetItemText(item
); }
999 void SetItemIcon( const wxDataViewItem
& item
, const wxIcon
&icon
)
1000 { GetStore()->SetItemIcon(item
,icon
); }
1001 const wxIcon
&GetItemIcon( const wxDataViewItem
& item
) const
1002 { return GetStore()->GetItemIcon(item
); }
1003 void SetItemExpandedIcon( const wxDataViewItem
& item
, const wxIcon
&icon
)
1004 { GetStore()->SetItemExpandedIcon(item
,icon
); }
1005 const wxIcon
&GetItemExpandedIcon( const wxDataViewItem
& item
) const
1006 { return GetStore()->GetItemExpandedIcon(item
); }
1007 void SetItemData( const wxDataViewItem
& item
, wxClientData
*data
)
1008 { GetStore()->SetItemData(item
,data
); }
1009 wxClientData
*GetItemData( const wxDataViewItem
& item
) const
1010 { return GetStore()->GetItemData(item
); }
1012 void DeleteItem( const wxDataViewItem
& item
)
1013 { GetStore()->DeleteItem(item
); }
1014 void DeleteChildren( const wxDataViewItem
& item
)
1015 { GetStore()->DeleteChildren(item
); }
1016 void DeleteAllItems()
1017 { GetStore()->DeleteAllItems(); }
1019 void OnExpanded( wxDataViewEvent
&event
);
1020 void OnCollapsed( wxDataViewEvent
&event
);
1021 void OnSize( wxSizeEvent
&event
);
1024 wxImageList
*m_imageList
;
1027 DECLARE_EVENT_TABLE()
1028 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl
)
1031 #endif // wxUSE_DATAVIEWCTRL
1034 // _WX_DATAVIEW_H_BASE_