1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDataViewIconText
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxDataViewIconText
12 wxDataViewIconText is used by
13 wxDataViewIconTextRenderer
14 for data transfer. This class can be converted to a from
20 class wxDataViewIconText
: public wxObject
27 wxDataViewIconText(const wxString
& text
= wxEmptyString
,
28 const wxIcon
& icon
= wxNullIcon
);
29 wxDataViewIconText(const wxDataViewIconText
& other
);
35 const wxIcon
GetIcon() const;
40 wxString
GetText() const;
45 void SetIcon(const wxIcon
& icon
);
50 void SetText(const wxString
& text
);
56 @class wxDataViewEvent
58 wxDataViewEvent - the event class for the wxDataViewCtrl notifications
63 class wxDataViewEvent
: public wxNotifyEvent
70 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
,
72 wxDataViewEvent(const wxDataViewEvent
& event
);
76 Used to clone the event.
78 wxEvent
* Clone() const;
81 Returns the position of the column in the control or -1
82 if no column field was set by the event emitter.
84 int GetColumn() const;
87 Returns a pointer to the wxDataViewColumn from which
88 the event was emitted or @NULL.
90 wxDataViewColumn
* GetDataViewColumn();
93 Returns the wxDataViewModel associated with the event.
95 wxDataViewModel
* GetModel() const;
98 Returns a the position of a context menu event in screen coordinates.
100 wxPoint
GetPosition() const;
103 Returns a reference to a value.
105 const wxVariant
GetValue() const;
110 void SetColumn(int col
);
113 For wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
115 void SetDataViewColumn(wxDataViewColumn
* col
);
120 void SetModel(wxDataViewModel
* model
);
125 void SetValue(const wxVariant
& value
);
131 @class wxDataViewModel
133 wxDataViewModel is the base class for all data model to be
134 displayed by a wxDataViewCtrl.
135 All other models derive from it and must implement its
136 pure virtual functions in order to define a complete
137 data model. In detail, you need to override
138 wxDataViewModel::IsContainer,
139 wxDataViewModel::GetParent,
140 wxDataViewModel::GetChildren,
141 wxDataViewModel::GetColumnCount,
142 wxDataViewModel::GetColumnType and
143 wxDataViewModel::GetValue in order to
144 define the data model which acts as an interface between
145 your actual data and the wxDataViewCtrl. Since you will
146 usually also allow the wxDataViewCtrl to change your data
147 through its graphical interface, you will also have to override
148 wxDataViewModel::SetValue which the
149 wxDataViewCtrl will call when a change to some data has been
152 wxDataViewModel (as indeed the entire wxDataViewCtrl
153 code) is using wxVariant to store data and
154 its type in a generic way. wxVariant can be extended to contain
155 almost any data without changes to the original class.
157 The data that is presented through this data model is expected
158 to change at run-time. You need to inform the data model when
159 a change happened. Depending on what happened you need to call
160 one of the following methods:
161 wxDataViewModel::ValueChanged,
162 wxDataViewModel::ItemAdded,
163 wxDataViewModel::ItemDeleted,
164 wxDataViewModel::ItemChanged,
165 wxDataViewModel::Cleared. There are
166 plural forms for notification of addition, change
167 or removal of several item at once. See
168 wxDataViewModel::ItemsAdded,
169 wxDataViewModel::ItemsDeleted,
170 wxDataViewModel::ItemsChanged.
172 Note that wxDataViewModel does not define the position or
173 index of any item in the control because different controls
174 might display the same data differently. wxDataViewModel does
175 provide a wxDataViewModel::Compare method
176 which the wxDataViewCtrl may use to sort the data either
177 in conjunction with a column header or without (see
178 wxDataViewModel::HasDefaultCompare).
180 This class maintains a list of
181 wxDataViewModelNotifier
182 which link this class to the specific implementations on the
183 supported platforms so that e.g. calling
184 wxDataViewModel::ValueChanged
185 on this model will just call
186 wxDataViewModelNotifier::ValueChanged
187 for each notifier that has been added. You can also add
188 your own notifier in order to get informed about any changes
189 to the data in the list model.
191 Currently wxWidgets provides the following models apart
193 wxDataViewIndexListModel,
194 wxDataViewVirtualListModel,
197 Note that wxDataViewModel is reference counted, derives from
198 wxObjectRefData and cannot be deleted
199 directly as it can be shared by several wxDataViewCtrls. This
200 implies that you need to decrease the reference count after
201 associating the model with a control like this:
204 wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, ID_MUSIC_CTRL );
205 wxDataViewModel *musicModel = new MyMusicModel;
206 m_musicCtrl-AssociateModel( musicModel );
207 musicModel-DecRef(); // avoid memory leak !!
215 class wxDataViewModel
: public wxObjectRefData
224 Destructor. This should not be called directly. Use DecRef() instead.
229 Adds a wxDataViewModelNotifier
232 void AddNotifier(wxDataViewModelNotifier
* notifier
);
235 Called to inform the model that all data has been cleared. The
236 control will reread the data from the model again.
238 virtual bool Cleared();
241 The compare function to be used by control. The default compare function
242 sorts by container and other items separately and in ascending order.
243 Override this for a different sorting behaviour.
244 See also HasDefaultCompare().
246 virtual int Compare(const wxDataViewItem
& item1
,
247 const wxDataViewItem
& item2
,
252 Oberride this to indicate that the item has special font attributes.
253 This only affects the
254 wxDataViewTextRendererText() renderer.
255 See also wxDataViewItemAttr.
257 bool GetAttr(const wxDataViewItem
& item
, unsigned int col
,
258 wxDataViewItemAttr
& attr
);
261 Override this so the control can query the child items of
262 an item. Returns the number of items.
264 virtual unsigned int GetChildren(const wxDataViewItem
& item
,
265 wxDataViewItemArray
& children
) const;
268 Override this to indicate the number of columns in the model.
270 virtual unsigned int GetColumnCount() const;
273 Override this to indicate what type of data is stored in the
274 column specified by @e col. This should return a string
275 indicating the type of data as reported by wxVariant.
277 virtual wxString
GetColumnType(unsigned int col
) const;
280 Override this to indicate which wxDataViewItem representing the parent
281 of @a item or an invalid wxDataViewItem if the the root item is
284 virtual wxDataViewItem
GetParent(const wxDataViewItem
& item
) const;
287 Override this to indicate the value of @e item
288 A wxVariant is used to store the data.
290 virtual void GetValue(wxVariant
& variant
,
291 const wxDataViewItem
& item
,
292 unsigned int col
) const;
295 Override this method to indicate if a container item merely
296 acts as a headline (or for categorisation) or if it also
297 acts a normal item with entries for futher columns. By
298 default returns @e @false.
300 virtual bool HasContainerColumns(const wxDataViewItem
& item
) const;
303 Override this to indicate that the model provides a default compare
304 function that the control should use if no wxDataViewColumn has been
305 chosen for sorting. Usually, the user clicks on a column header for
306 sorting, the data will be sorted alphanumerically. If any other
307 order (e.g. by index or order of appearance) is required, then this
308 should be used. See also wxDataViewIndexListModel
309 for a model which makes use of this.
311 virtual bool HasDefaultCompare() const;
314 Override this to indicate of @a item is a container, i.e. if
315 it can have child items.
317 virtual bool IsContainer(const wxDataViewItem
& item
) const;
320 Call this to inform the model that an item has been added
323 virtual bool ItemAdded(const wxDataViewItem
& parent
,
324 const wxDataViewItem
& item
);
327 Call this to inform the model that an item has changed.
328 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
329 event (in which the column fields will not be set) to the user.
331 virtual bool ItemChanged(const wxDataViewItem
& item
);
334 Call this to inform the model that an item has been deleted from the data.
336 virtual bool ItemDeleted(const wxDataViewItem
& parent
,
337 const wxDataViewItem
& item
);
340 Call this to inform the model that several items have been added
343 virtual bool ItemsAdded(const wxDataViewItem
& parent
,
344 const wxDataViewItemArray
& items
);
347 Call this to inform the model that several items have changed.
348 This will eventually emit wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
349 events (in which the column fields will not be set) to the user.
351 virtual bool ItemsChanged(const wxDataViewItemArray
& items
);
354 Call this to inform the model that several items have been deleted.
356 virtual bool ItemsDeleted(const wxDataViewItem
& parent
,
357 const wxDataViewItemArray
& items
);
360 Remove the @a notifier from the list of notifiers.
362 void RemoveNotifier(wxDataViewModelNotifier
* notifier
);
365 Call this to initiate a resort after the sort function has
368 virtual void Resort();
371 This gets called in order to set a value in the data model.
372 The most common scenario is that the wxDataViewCtrl calls
373 this method after the user changed some data in the view.
374 Afterwards ValueChanged()
377 virtual bool SetValue(const wxVariant
& variant
,
378 const wxDataViewItem
& item
,
382 Call this to inform this model that a value in the model has
383 been changed. This is also called from wxDataViewCtrl's
384 internal editing code, e.g. when editing a text field
386 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
389 virtual bool ValueChanged(const wxDataViewItem
& item
,
396 @class wxDataViewIndexListModel
398 wxDataViewIndexListModel is a specialized data model which lets
399 you address an item by its position (row) rather than its
400 wxDataViewItem (which you can obtain from this class).
401 This model also provides its own wxDataViewIndexListModel::Compare
402 method which sorts the model's data by the index.
404 This model is not a virtual model since the control stores
405 each wxDataViewItem. Use wxDataViewVirtualListModel if you
406 need to display millions of items or have other reason to
407 use a virtual control.
412 class wxDataViewIndexListModel
: public wxDataViewModel
418 wxDataViewIndexListModel(unsigned int initial_size
= 0);
423 ~wxDataViewIndexListModel();
426 Compare method that sorts the items by their index.
428 int Compare(const wxDataViewItem
& item1
,
429 const wxDataViewItem
& item2
,
430 unsigned int column
, bool ascending
);
433 Oberride this to indicate that the row has special font attributes.
434 This only affects the
435 wxDataViewTextRendererText() renderer.
436 See also wxDataViewItemAttr.
438 bool GetAttr(unsigned int row
, unsigned int col
,
439 wxDataViewItemAttr
& attr
);
442 Returns the wxDataViewItem at the given @e row.
444 wxDataViewItem
GetItem(unsigned int row
) const;
447 Returns the position of given @e item.
449 unsigned int GetRow(const wxDataViewItem
& item
) const;
452 Override this to allow getting values from the model.
454 void GetValue(wxVariant
& variant
, unsigned int row
,
455 unsigned int col
) const;
458 Call this after if the data has to be read again from
459 the model. This is useful after major changes when
460 calling the methods below (possibly thousands of times)
463 void Reset(unsigned int new_size
);
466 Call this after a row has been appended to the model.
471 Call this after a row has been changed.
473 void RowChanged(unsigned int row
);
476 Call this after a row has been deleted.
478 void RowDeleted(unsigned int row
);
481 Call this after a row has been inserted at the given position.
483 void RowInserted(unsigned int before
);
486 Call this after a row has been prepended to the model.
491 Call this after a value has been changed.
493 void RowValueChanged(unsigned int row
, unsigned int col
);
496 Call this after rows have been deleted. The array will internally
497 get copied and sorted in descending order so that the rows with
498 the highest position will be deleted first.
500 void RowsDeleted(const wxArrayInt
& rows
);
503 Called in order to set a value in the model.
505 bool SetValue(const wxVariant
& variant
, unsigned int row
,
512 @class wxDataViewVirtualListModel
514 wxDataViewVirtualListModel is a specialized data model which lets
515 you address an item by its position (row) rather than its
516 wxDataViewItem and as such offers the exact same interface as
517 wxDataViewIndexListModel. The important difference is that under
518 platforms other than OS X, using this model will result in a
519 truely virtual control able to handle millions of items as the
520 control doesn't store any item (a feature not supported by the
521 Carbon API under OS X).
523 @see wxDataViewIndexListModel for the API.
528 class wxDataViewVirtualListModel
: public wxDataViewModel
534 wxDataViewVirtualListModel(unsigned int initial_size
= 0);
540 @class wxDataViewItemAttr
542 This class is used to indicate to a wxDataViewCtrl
543 that a certain Item() has extra font attributes
544 for its renderer. For this, it is required to override
545 wxDataViewModel::GetAttr.
547 Attributes are currently only supported by
548 wxDataViewTextRendererText().
553 class wxDataViewItemAttr
559 wxDataViewItemAttr();
562 Call this to indicate that the item shall be displayed in bold text.
564 void SetBold(bool set
);
567 Call this to indicate that the item shall be displayed with
570 void SetColour(const wxColour
& colour
);
573 Call this to indicate that the item shall be displayed in italic text.
575 void SetItalic(bool set
);
581 @class wxDataViewItem
583 wxDataViewItem is a small opaque class that represents an
584 item in a wxDataViewCtrl in a
585 persistent way, i.e. indepent of the position of the
586 item in the control or changes to its contents. It must
587 hold a unique ID of type @e void* in its only field
588 and can be converted to a from it.
590 If the ID is @e @NULL the wxDataViewItem is invalid and
591 wxDataViewItem::IsOk will return @e @false
592 which used in many places in the API of wxDataViewCtrl
593 to indicate that e.g. no item was found. An ID of @NULL
594 is also used to indicate the invisible root. Examples
596 wxDataViewModel::GetParent and
597 wxDataViewModel::GetChildren.
609 wxDataViewItem(void* id
= NULL
);
610 wxDataViewItem(const wxDataViewItem
& item
);
619 Returns @true if the ID is not @e @NULL.
627 @class wxDataViewCtrl
629 wxDataViewCtrl is a control to display data either
630 in a tree like fashion or in a tabular form or both.
631 If you only need to display a simple tree structure
632 with an API more like the older wxTreeCtrl class,
633 then the specialized wxDataViewTreeCtrl
636 A wxDataViewItem is used
637 to represent a (visible) item in the control.
639 Unlike wxListCtrl wxDataViewCtrl doesn't
640 get its data from the user through virtual functions or by
641 setting it directly. Instead you need to write your own
642 wxDataViewModel and associate
643 it with this control. Then you need to add a number of
644 wxDataViewColumn to this control to
645 define what each column shall display. Each wxDataViewColumn
646 in turn owns 1 instance of a
647 wxDataViewRenderer to render its
648 cells. A number of standard renderers for rendering text, dates,
649 images, toggle, a progress bar etc. are provided. Additionally,
650 the user can write custom renderes deriving from
651 wxDataViewCustomRenderer
652 for displaying anything.
654 All data transfer from the control to the model and the user
655 code is done through wxVariant which can
656 be extended to support more data formats as necessary.
657 Accordingly, all type information uses the strings returned
658 from wxVariant::GetType.
662 Single selection mode. This is the default.
663 @style{wxDV_MULTIPLE}
664 Multiple selection mode.
665 @style{wxDV_ROW_LINES}
666 Use alternating colours for rows if supported by platform and theme.
667 @style{wxDV_HORIZ_RULES}
668 Display fine rules between row if supported.
669 @style{wxDV_VERT_RULES}
670 Display fine rules between columns is supported.
671 @style{wxDV_VARIABLE_LINE_HEIGHT}
672 Allow variable line heights. This can be inefficient when displaying large number of items.
675 @beginEventTable{wxDataViewEvent}
676 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
677 Process a wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
678 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
679 Process a wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
680 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
681 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
682 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
683 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
684 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
685 Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
686 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
687 Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
688 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
689 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
690 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
691 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
692 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
693 Process a wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
694 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
695 Process a wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
696 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
697 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
698 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
699 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
700 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
701 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
702 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
703 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
708 <!-- @appearance{dataviewctrl.png} -->
710 class wxDataViewCtrl
: public wxControl
719 Constructor. Calls Create().
721 wxDataViewCtrl(wxWindow
* parent
, wxWindowID id
,
722 const wxPoint
& pos
= wxDefaultPosition
,
723 const wxSize
& size
= wxDefaultSize
,
725 const wxValidator
& validator
= wxDefaultValidator
);
733 Appends a wxDataViewColumn to the control. Returns @true on success.
734 Note that there is a number of short cut methods which implicitly create
735 a wxDataViewColumn and a wxDataViewRenderer for it (see below).
737 virtual bool AppendColumn(wxDataViewColumn
* col
);
740 Prepends a wxDataViewColumn to the control. Returns @true on success.
741 Note that there is a number of short cut methods which implicitly create
742 a wxDataViewColumn and a wxDataViewRenderer for it.
744 virtual bool PrependColumn(wxDataViewColumn
* col
);
747 Inserts a wxDataViewColumn to the control. Returns @true on success.
749 virtual bool InsertColumn(unsigned int pos
, wxDataViewColumn
* col
);
753 Appends a column for rendering a bitmap. Returns the wxDataViewColumn
754 created in the function or @NULL on failure.
756 wxDataViewColumn
* AppendBitmapColumn(const wxString
& label
,
757 unsigned int model_column
,
758 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
760 wxAlignment align
= wxALIGN_CENTER
,
761 int flags
= wxDATAVIEW_COL_RESIZABLE
);
762 wxDataViewColumn
* AppendBitmapColumn(const wxBitmap
& label
,
763 unsigned int model_column
,
764 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
766 wxAlignment align
= wxALIGN_CENTER
,
767 int flags
= wxDATAVIEW_COL_RESIZABLE
);
772 Appends a column for rendering a date. Returns the wxDataViewColumn
773 created in the function or @NULL on failure.
775 NB: The @e align parameter is applied to both the column header and
778 wxDataViewColumn
* AppendDateColumn(const wxString
& label
,
779 unsigned int model_column
,
780 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
782 wxAlignment align
= wxALIGN_CENTER
,
783 int flags
= wxDATAVIEW_COL_RESIZABLE
);
784 wxDataViewColumn
* AppendDateColumn(const wxBitmap
& label
,
785 unsigned int model_column
,
786 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
788 wxAlignment align
= wxALIGN_CENTER
,
789 int flags
= wxDATAVIEW_COL_RESIZABLE
);
794 Appends a column for rendering text with an icon. Returns the wxDataViewColumn
795 created in the function or @NULL on failure. This method uses the
796 wxDataViewIconTextRenderer class.
798 NB: The @e align parameter is applied to both the column header and
801 wxDataViewColumn
* AppendIconTextColumn(const wxString
& label
,
802 unsigned int model_column
,
803 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
805 wxAlignment align
= wxALIGN_LEFT
,
806 int flags
= wxDATAVIEW_COL_RESIZABLE
);
807 wxDataViewColumn
* AppendIconTextColumn(const wxBitmap
& label
,
808 unsigned int model_column
,
809 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
811 wxAlignment align
= wxALIGN_LEFT
,
812 int flags
= wxDATAVIEW_COL_RESIZABLE
);
817 Appends a column for rendering a progress indicator. Returns the
818 wxDataViewColumn created in the function or @NULL on failure.
820 NB: The @e align parameter is applied to both the column header and
823 wxDataViewColumn
* AppendProgressColumn(const wxString
& label
,
824 unsigned int model_column
,
825 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
827 wxAlignment align
= wxALIGN_CENTER
,
828 int flags
= wxDATAVIEW_COL_RESIZABLE
);
829 wxDataViewColumn
* AppendProgressColumn(const wxBitmap
& label
,
830 unsigned int model_column
,
831 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
833 wxAlignment align
= wxALIGN_CENTER
,
834 int flags
= wxDATAVIEW_COL_RESIZABLE
);
839 Appends a column for rendering text. Returns the wxDataViewColumn
840 created in the function or @NULL on failure.
842 NB: The @e align parameter is applied to both the column header and
845 wxDataViewColumn
* AppendTextColumn(const wxString
& label
,
846 unsigned int model_column
,
847 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
849 wxAlignment align
= wxALIGN_LEFT
,
850 int flags
= wxDATAVIEW_COL_RESIZABLE
);
851 wxDataViewColumn
* AppendTextColumn(const wxBitmap
& label
,
852 unsigned int model_column
,
853 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
855 wxAlignment align
= wxALIGN_LEFT
,
856 int flags
= wxDATAVIEW_COL_RESIZABLE
);
861 Appends a column for rendering a toggle. Returns the wxDataViewColumn
862 created in the function or @NULL on failure.
864 NB: The @e align parameter is applied to both the column header and
867 wxDataViewColumn
* AppendToggleColumn(const wxString
& label
,
868 unsigned int model_column
,
869 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
871 wxAlignment align
= wxALIGN_CENTER
,
872 int flags
= wxDATAVIEW_COL_RESIZABLE
);
873 wxDataViewColumn
* AppendToggleColumn(const wxBitmap
& label
,
874 unsigned int model_column
,
875 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
877 wxAlignment align
= wxALIGN_CENTER
,
878 int flags
= wxDATAVIEW_COL_RESIZABLE
);
882 Associates a wxDataViewModel with the control. This increases the reference
883 count of the model by 1.
885 virtual bool AssociateModel(wxDataViewModel
* model
);
890 virtual bool ClearColumns();
895 void ClearSelection();
900 void Collapse(const wxDataViewItem
& item
);
903 Create the control. Useful for two step creation.
905 bool Create(wxWindow
* parent
, wxWindowID id
,
906 const wxPoint
& pos
= wxDefaultPosition
,
907 const wxSize
& size
= wxDefaultSize
,
909 const wxValidator
& validator
= wxDefaultValidator
);
912 Deletes given column.
914 virtual bool DeleteColumn(const wxDataViewColumn
* column
);
917 Call this to ensure that the given item is visible.
919 void EnsureVisible(const wxDataViewItem
& item
,
920 const wxDataViewColumn
* column
= NULL
);
925 void Expand(const wxDataViewItem
& item
);
928 Returns pointer to the column. @a pos refers to the
929 position in the control which may change after reordering
932 virtual wxDataViewColumn
* GetColumn(unsigned int pos
) const;
935 Returns the number of columns.
937 virtual unsigned int GetColumnCount() const;
940 Returns the position of the column or -1 if not found in the control.
942 virtual int GetColumnPosition(const wxDataViewColumn
* column
) const;
945 Returns column containing the expanders.
947 wxDataViewColumn
* GetExpanderColumn() const;
952 int GetIndent() const;
957 wxRect
GetItemRect(const wxDataViewItem
& item
,
958 const wxDataViewColumn
* col
= NULL
) const;
961 Returns pointer to the data model associated with the
964 virtual wxDataViewModel
* GetModel() const;
967 Returns first selected item or an invalid item if none is selected.
969 wxDataViewItem
GetSelection() const;
972 Fills @a sel with currently selected items and returns
975 int GetSelections(wxDataViewItemArray
& sel
) const;
978 Returns the wxDataViewColumn currently responsible for sorting
979 or @NULL if none has been selected.
981 virtual wxDataViewColumn
* GetSortingColumn() const;
986 void HitTest(const wxPoint
& point
, wxDataViewItem
& item
,
987 wxDataViewColumn
*& col
) const;
990 Return @true if the item is selected.
992 bool IsSelected(const wxDataViewItem
& item
) const;
995 Select the given item.
997 void Select(const wxDataViewItem
& item
);
1005 Set which column shall contain the tree-like expanders.
1007 void SetExpanderColumn(wxDataViewColumn
* col
);
1010 Sets the indendation.
1012 void SetIndent(int indent
);
1015 Sets the selection to the array of wxDataViewItems.
1017 void SetSelections(const wxDataViewItemArray
& sel
);
1020 Unselect the given item.
1022 void Unselect(const wxDataViewItem
& item
);
1025 Unselect all item. This method only has effect if multiple
1026 selections are allowed.
1034 @class wxDataViewModelNotifier
1036 A wxDataViewModelNotifier instance is owned by a
1038 and mirrors its notification interface. See
1039 the documentation of that class for further
1045 class wxDataViewModelNotifier
1051 wxDataViewModelNotifier();
1056 ~wxDataViewModelNotifier();
1059 Called by owning model.
1064 Get owning wxDataViewModel.
1066 wxDataViewModel
* GetOwner() const;
1069 Called by owning model.
1071 bool ItemAdded(const wxDataViewItem
& parent
,
1072 const wxDataViewItem
& item
);
1075 Called by owning model.
1077 bool ItemChanged(const wxDataViewItem
& item
);
1080 Called by owning model.
1082 bool ItemDeleted(const wxDataViewItem
& parent
,
1083 const wxDataViewItem
& item
);
1086 Called by owning model.
1088 bool ItemsAdded(const wxDataViewItem
& parent
,
1089 const wxDataViewItemArray
& items
);
1092 Called by owning model.
1094 bool ItemsChanged(const wxDataViewItemArray
& items
);
1097 Called by owning model.
1099 bool ItemsDeleted(const wxDataViewItem
& parent
,
1100 const wxDataViewItemArray
& items
);
1103 Called by owning model.
1108 Set owner of this notifier. Used internally.
1110 void SetOwner(wxDataViewModel
* owner
);
1113 Called by owning model.
1115 bool ValueChanged(const wxDataViewItem
& item
, unsigned int col
);
1121 @class wxDataViewRenderer
1123 This class is used by wxDataViewCtrl to render the individual cells.
1124 One instance of a renderer class is owned by a wxDataViewColumn. There
1125 is a number of ready-to-use renderers provided:
1126 wxDataViewTextRenderer,
1127 wxDataViewTextRendererAttr,
1128 wxDataViewIconTextRenderer,
1129 wxDataViewToggleRenderer,
1130 wxDataViewProgressRenderer,
1131 wxDataViewBitmapRenderer,
1132 wxDataViewDateRenderer.
1133 wxDataViewSpinRenderer.
1135 Additionally, the user can write own renderers by deriving from
1136 wxDataViewCustomRenderer.
1138 The @e wxDataViewCellMode flag controls, what actions
1139 the cell data allows. @e wxDATAVIEW_CELL_ACTIVATABLE
1140 indicates that the user can double click the cell and
1141 something will happen (e.g. a window for editing a date
1142 will pop up). @e wxDATAVIEW_CELL_EDITABLE indicates
1143 that the user can edit the data in-place, i.e. an control
1144 will show up after a slow click on the cell. This behaviour
1145 is best known from changing the filename in most file
1150 enum wxDataViewCellMode
1152 wxDATAVIEW_CELL_INERT,
1153 wxDATAVIEW_CELL_ACTIVATABLE,
1154 wxDATAVIEW_CELL_EDITABLE
1158 The @e wxDataViewCellRenderState flag controls how the
1159 the renderer should display its contents in a cell:
1162 enum wxDataViewCellRenderState
1164 wxDATAVIEW_CELL_SELECTED = 1,
1165 wxDATAVIEW_CELL_PRELIT = 2,
1166 wxDATAVIEW_CELL_INSENSITIVE = 4,
1167 wxDATAVIEW_CELL_FOCUSED = 8
1175 class wxDataViewRenderer
: public wxObject
1181 wxDataViewRenderer(const wxString
& varianttype
,
1182 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1183 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1186 Returns the alignment. See SetAlignment()
1188 virtual int GetAlignment() const;
1191 Returns the cell mode.
1193 virtual wxDataViewCellMode
GetMode();
1196 Returns pointer to the owning wxDataViewColumn.
1198 virtual wxDataViewColumn
* GetOwner() const;
1201 This methods retrieves the value from the renderer in order to
1202 transfer the value back to the data model. Returns @e @false
1205 virtual bool GetValue(wxVariant
& value
);
1208 Returns a string with the type of the wxVariant
1209 supported by this renderer.
1211 virtual wxString
GetVariantType();
1214 Sets the alignment of the renderer's content. The default value
1215 of wxDVR_DEFAULT_ALIGMENT indicates that the content should
1216 have the same alignment as the column header. The method is
1217 not implemented under OS X and the renderer always aligns its
1218 contents as the column header on that platform. The other platforms
1219 support both vertical and horizontal alignment.
1221 virtual void SetAlignment( int align
);
1223 Sets the owning wxDataViewColumn. This
1224 is usually called from within wxDataViewColumn.
1226 virtual void SetOwner(wxDataViewColumn
* owner
);
1229 Set the value of the renderer (and thus its cell) to @e value.
1230 The internal code will then render this cell with this data.
1232 virtual bool SetValue(const wxVariant
& value
);
1235 Before data is committed to the data model, it is passed to this
1236 method where it can be checked for validity. This can also be
1237 used for checking a valid range or limiting the user input in
1238 a certain aspect (e.g. max number of characters or only alphanumeric
1239 input, ASCII only etc.). Return @e @false if the value is
1241 Please note that due to implementation limitations, this validation
1242 is done after the editing control already is destroyed and the
1243 editing process finished.
1245 virtual bool Validate(wxVariant
& value
);
1251 @class wxDataViewTextRenderer
1253 wxDataViewTextRenderer is used for rendering text. It supports
1254 in-place editing if desired.
1259 class wxDataViewTextRenderer
: public wxDataViewRenderer
1265 wxDataViewTextRenderer(const wxString
& varianttype
= "string",
1266 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1267 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1273 @class wxDataViewIconTextRenderer
1275 The wxDataViewIconTextRenderer class is used to display text with
1276 a small icon next to it as it is typically done in a file manager.
1277 This classes uses the wxDataViewIconText
1278 helper class to store its data. wxDataViewIonText can be converted
1279 to a from a wxVariant using the left shift
1285 class wxDataViewIconTextRenderer
: public wxDataViewRenderer
1291 wxDataViewIconTextRenderer(const wxString
& varianttype
= "wxDataViewIconText",
1292 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1293 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1299 @class wxDataViewProgressRenderer
1301 wxDataViewProgressRenderer
1306 class wxDataViewProgressRenderer
: public wxDataViewRenderer
1312 wxDataViewProgressRenderer(const wxString
& label
= wxEmptyString
,
1313 const wxString
& varianttype
= "long",
1314 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1315 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1321 @class wxDataViewSpinRenderer
1323 This is a specialized renderer for rendering integer values. It
1324 supports modifying the values in-place by using a wxSpinCtrl.
1325 The renderer only support variants of type @e long.
1330 class wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
1334 Constructor. @a min and @a max indicate the minimum und
1335 maximum values of for the wxSpinCtrl.
1337 wxDataViewSpinRenderer(int min
, int max
,
1338 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1339 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1345 @class wxDataViewToggleRenderer
1347 wxDataViewToggleRenderer
1352 class wxDataViewToggleRenderer
: public wxDataViewRenderer
1358 wxDataViewToggleRenderer(const wxString
& varianttype
= "bool",
1359 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
);
1365 @class wxDataViewDateRenderer
1367 wxDataViewDateRenderer
1372 class wxDataViewDateRenderer
: public wxDataViewRenderer
1378 wxDataViewDateRenderer(const wxString
& varianttype
= "datetime",
1379 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
);
1385 @class wxDataViewTextRendererAttr
1387 The same as wxDataViewTextRenderer but with
1388 support for font attributes. Font attributes are currently only supported
1391 See also wxDataViewModel::GetAttr and
1397 class wxDataViewTextRendererAttr
: public wxDataViewTextRenderer
1403 wxDataViewTextRendererAttr(const wxString
& varianttype
= "string",
1404 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1405 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1411 @class wxDataViewCustomRenderer
1413 You need to derive a new class from wxDataViewCustomRenderer in
1414 order to write a new renderer. You need to override at least
1415 wxDataViewRenderer::SetValue,
1416 wxDataViewRenderer::GetValue,
1417 wxDataViewCustomRenderer::GetSize
1418 and wxDataViewCustomRenderer::Render.
1420 If you want your renderer to support in-place editing then you
1421 also need to override
1422 wxDataViewCustomRenderer::HasEditorCtrl,
1423 wxDataViewCustomRenderer::CreateEditorCtrl
1424 and wxDataViewCustomRenderer::GetValueFromEditorCtrl.
1425 Note that a special event handler will be pushed onto that
1426 editor control which handles ENTER and focus out events
1427 in order to end the editing.
1432 class wxDataViewCustomRenderer
: public wxDataViewRenderer
1438 wxDataViewCustomRenderer(const wxString
& varianttype
= "string",
1439 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1440 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1445 ~wxDataViewCustomRenderer();
1448 Override this to react to double clicks or ENTER. This method will
1449 only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
1451 virtual bool Activate( wxRect cell
,
1452 wxDataViewModel
* model
,
1453 const wxDataViewItem
& item
,
1457 Override this to create the actual editor control once editing
1458 is about to start. @a parent is the parent of the editor
1459 control, @a labelRect indicates the position and
1460 size of the editor control and @a value is its initial value:
1462 virtual wxControl
* CreateEditorCtrl(wxWindow
* parent
,
1464 const wxVariant
& value
);
1467 Create DC on request. Internal.
1469 virtual wxDC
* GetDC();
1472 Return size required to show content.
1474 virtual wxSize
GetSize();
1477 Overrride this so that the renderer can get the value
1478 from the editor control (pointed to by @e editor):
1480 virtual bool GetValueFromEditorCtrl(wxControl
* editor
,
1484 Override this and make it return @e @true in order to
1485 indicate that this renderer supports in-place editing.
1487 virtual bool HasEditorCtrl();
1490 Overrride this to react to a left click. This method will
1491 only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
1493 virtual bool LeftClick( wxPoint cursor
,
1495 wxDataViewModel
* model
,
1496 const wxDataViewItem
& item
,
1500 Override this to render the cell. Before this is called,
1501 wxDataViewRenderer::SetValue was called
1502 so that this instance knows what to render.
1504 virtual bool Render(wxRect cell
, wxDC
* dc
, int state
);
1507 This method should be called from within Render()
1508 whenever you need to render simple text. This will ensure that the
1509 correct colour, font and vertical alignment will be chosen so the
1510 text will look the same as text drawn by native renderers.
1512 bool RenderText(const wxString
& text
, int xoffset
, wxRect cell
,
1513 wxDC
* dc
, int state
);
1516 Overrride this to start a drag operation. Not yet
1519 virtual bool StartDrag(wxPoint cursor
, wxRect cell
,
1520 wxDataViewModel
* model
,
1521 const wxDataViewItem
& item
,
1528 @class wxDataViewBitmapRenderer
1530 wxDataViewBitmapRenderer
1535 class wxDataViewBitmapRenderer
: public wxDataViewRenderer
1541 wxDataViewBitmapRenderer(const wxString
& varianttype
= "wxBitmap",
1542 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1543 int align
= wxDVR_DEFAULT_ALIGNMENT
,
1549 @class wxDataViewColumn
1551 This class represents a column in a wxDataViewCtrl.
1552 One wxDataViewColumn is bound to one column in the data model,
1553 to which the wxDataViewCtrl has been associated.
1555 An instance of wxDataViewRenderer is used by
1556 this class to render its data.
1561 class wxDataViewColumn
: public wxObject
1568 wxDataViewColumn(const wxString
& title
,
1569 wxDataViewRenderer
* renderer
,
1570 unsigned int model_column
,
1571 int width
= wxDVC_DEFAULT_WIDTH
,
1572 wxAlignment align
= wxALIGN_CENTRE
,
1573 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1574 wxDataViewColumn(const wxBitmap
& bitmap
,
1575 wxDataViewRenderer
* renderer
,
1576 unsigned int model_column
,
1577 int width
= wxDVC_DEFAULT_WIDTH
,
1578 wxAlignment align
= wxALIGN_CENTRE
,
1579 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1585 ~wxDataViewColumn();
1588 Returns the bitmap in the header of the column, if any.
1590 const wxBitmap
GetBitmap();
1593 Returns the index of the column of the model, which this
1594 wxDataViewColumn is displaying.
1596 unsigned int GetModelColumn();
1599 Returns the owning wxDataViewCtrl.
1601 wxDataViewCtrl
* GetOwner() const;
1604 Returns the renderer of this wxDataViewColumn.
1605 See also wxDataViewRenderer.
1607 wxDataViewRenderer
* GetRenderer();
1610 Returns @true if the column is reorderable.
1612 bool GetReorderable();
1615 Returns @true if the column is sortable.
1621 Returns the width of the column.
1626 Returns @true, if the sort order is ascending.
1627 See also SetSortOrder()
1629 bool IsSortOrderAscending();
1632 Set the alignment of the column header.
1634 void SetAlignment(wxAlignment align
);
1637 Set the bitmap of the column header.
1639 void SetBitmap(const wxBitmap
& bitmap
);
1642 Indicate wether the column can be reordered by the
1643 user using the mouse. This is typically implemented
1644 visually by dragging the header button around.
1646 void SetReorderable(bool reorderable
);
1649 Indicate the sort order if the implementation of the
1650 wxDataViewCtrl supports it, most commonly by showing
1653 void SetSortOrder(bool ascending
);
1656 Indicate that the column is sortable. This does
1657 not show any sorting indicate yet, but it does
1658 make the column header clickable. Call
1660 afterwards to actually make the sort indicator appear.
1661 If @a sortable is @false, the column header is
1662 no longer clickable and the sort indicator (little
1663 arrow) will disappear.
1665 void SetSortable(bool sortable
);
1668 Set the title of the column header to @e title.
1670 void SetTitle(const wxString
& title
);
1676 @class wxDataViewTreeCtrl
1678 This class is a wxDataViewCtrl which internally
1679 uses a wxDataViewTreeStore and forwards
1680 most of its API to that class. Additionally, it uses a wxImageList
1681 to store a list of icons. The main purpose of this class is to look
1682 like a wxTreeCtrl to make a transition from it
1683 to the wxDataViewCtrl class simpler.
1687 <!-- @appearance{dataviewtreectrl.png} -->
1689 class wxDataViewTreeCtrl
: public wxDataViewCtrl
1694 Constructor. Calls Create().
1696 wxDataViewTreeCtrl();
1697 wxDataViewTreeCtrl(wxWindow
* parent
, wxWindowID id
,
1698 const wxPoint
& pos
= wxDefaultPosition
,
1699 const wxSize
& size
= wxDefaultSize
,
1700 long style
= wxDV_NO_HEADER
,
1701 const wxValidator
& validator
= wxDefaultValidator
);
1705 Destructor. Deletes the image list if any.
1707 ~wxDataViewTreeCtrl();
1712 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
1713 const wxString
& text
,
1716 wxClientData
* data
= NULL
);
1721 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
1722 const wxString
& text
,
1724 wxClientData
* data
= NULL
);
1727 Creates the control and a wxDataViewTreeStore as
1730 bool Create(wxWindow
* parent
, wxWindowID id
,
1731 const wxPoint
& pos
= wxDefaultPosition
,
1732 const wxSize
& size
= wxDefaultSize
,
1733 long style
= wxDV_NO_HEADER
,
1734 const wxValidator
& validator
= wxDefaultValidator
);
1737 Calls the identical method from wxDataViewTreeStore.
1739 void DeleteAllItems();
1742 Calls the identical method from wxDataViewTreeStore.
1744 void DeleteChildren(const wxDataViewItem
& item
);
1747 Calls the identical method from wxDataViewTreeStore.
1749 void DeleteItem(const wxDataViewItem
& item
);
1752 Calls the identical method from wxDataViewTreeStore.
1754 int GetChildCount(const wxDataViewItem
& parent
) const;
1757 Returns the image list.
1759 wxImageList
* GetImageList();
1762 Calls the identical method from wxDataViewTreeStore.
1764 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
1767 Calls the identical method from wxDataViewTreeStore.
1769 const wxIcon
GetItemExpandedIcon(const wxDataViewItem
& item
) const;
1772 Calls the identical method from wxDataViewTreeStore.
1774 const wxIcon
GetItemIcon(const wxDataViewItem
& item
) const;
1777 Calls the identical method from wxDataViewTreeStore.
1779 wxString
GetItemText(const wxDataViewItem
& item
) const;
1782 Calls the identical method from wxDataViewTreeStore.
1784 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
1785 unsigned int pos
) const;
1791 wxDataViewTreeStore
* GetStore() const;
1792 const wxDataViewTreeStore
* GetStore() const;
1796 Calls the same method from wxDataViewTreeStore but uess
1797 and index position in the image list instead of a wxIcon.
1799 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
1800 const wxDataViewItem
& previous
,
1801 const wxString
& text
,
1804 wxClientData
* data
= NULL
);
1807 Calls the same method from wxDataViewTreeStore but uess
1808 and index position in the image list instead of a wxIcon.
1810 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
1811 const wxDataViewItem
& previous
,
1812 const wxString
& text
,
1814 wxClientData
* data
= NULL
);
1817 Calls the same method from wxDataViewTreeStore but uess
1818 and index position in the image list instead of a wxIcon.
1820 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
1821 const wxString
& text
,
1824 wxClientData
* data
= NULL
);
1827 Calls the same method from wxDataViewTreeStore but uess
1828 and index position in the image list instead of a wxIcon.
1830 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
1831 const wxString
& text
,
1833 wxClientData
* data
= NULL
);
1836 Sets the image list.
1838 void SetImageList(wxImageList
* imagelist
);
1841 Calls the identical method from wxDataViewTreeStore.
1843 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
1846 Calls the identical method from wxDataViewTreeStore.
1848 void SetItemExpandedIcon(const wxDataViewItem
& item
,
1849 const wxIcon
& icon
);
1852 Calls the identical method from wxDataViewTreeStore.
1854 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
1857 Calls the identical method from wxDataViewTreeStore.
1859 void SetItemText(const wxDataViewItem
& item
,
1860 const wxString
& text
);
1866 @class wxDataViewTreeStore
1868 wxDataViewTreeStore is a specialised wxDataViewModel
1869 for displaying simple trees very much like wxTreeCtrl
1870 does and it offers a similar API. This class actually stores the entire
1871 tree (therefore its name) and implements all virtual methods from the base
1872 class so it can be used directly without having to derive any class from it.
1873 This comes at the price of much reduced flexibility.
1878 class wxDataViewTreeStore
: public wxDataViewModel
1882 Constructor. Creates the invisible root node internally.
1884 wxDataViewTreeStore();
1889 ~wxDataViewTreeStore();
1894 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
1895 const wxString
& text
,
1896 const wxIcon
& icon
= wxNullIcon
,
1897 const wxIcon
& expanded
= wxNullIcon
,
1898 wxClientData
* data
= NULL
);
1903 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
1904 const wxString
& text
,
1905 const wxIcon
& icon
= wxNullIcon
,
1906 wxClientData
* data
= NULL
);
1909 Delete all item in the model.
1911 void DeleteAllItems();
1914 Delete all children of the item, but not the item itself.
1916 void DeleteChildren(const wxDataViewItem
& item
);
1921 void DeleteItem(const wxDataViewItem
& item
);
1924 Return the number of children of item.
1926 int GetChildCount(const wxDataViewItem
& parent
) const;
1929 Returns the client data asoociated with the item.
1931 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
1934 Returns the icon to display in expanded containers.
1936 const wxIcon
GetItemExpandedIcon(const wxDataViewItem
& item
) const;
1939 Returns the icon of the item.
1941 const wxIcon
GetItemIcon(const wxDataViewItem
& item
) const;
1944 Returns the text of the item.
1946 wxString
GetItemText(const wxDataViewItem
& item
) const;
1949 Returns the nth child item of item.
1951 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
1952 unsigned int pos
) const;
1955 Inserts a container after @e previous.
1957 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
1958 const wxDataViewItem
& previous
,
1959 const wxString
& text
,
1960 const wxIcon
& icon
= wxNullIcon
,
1961 const wxIcon
& expanded
= wxNullIcon
,
1962 wxClientData
* data
= NULL
);
1965 Inserts an item after @e previous.
1967 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
1968 const wxDataViewItem
& previous
,
1969 const wxString
& text
,
1970 const wxIcon
& icon
= wxNullIcon
,
1971 wxClientData
* data
= NULL
);
1974 Inserts a container before the first child item or @e parent.
1976 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
1977 const wxString
& text
,
1978 const wxIcon
& icon
= wxNullIcon
,
1979 const wxIcon
& expanded
= wxNullIcon
,
1980 wxClientData
* data
= NULL
);
1983 Inserts an item before the first child item or @e parent.
1985 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
1986 const wxString
& text
,
1987 const wxIcon
& icon
= wxNullIcon
,
1988 wxClientData
* data
= NULL
);
1991 Sets the client data associated with the item.
1993 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
1996 Sets the expanded icon for the item.
1998 void SetItemExpandedIcon(const wxDataViewItem
& item
,
1999 const wxIcon
& icon
);
2002 Sets the icon for the item.
2004 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);