1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDataViewIconText
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxDataViewIconText
12 wxDataViewIconText is used by wxDataViewIconTextRenderer for data transfer.
13 This class can be converted to and from a wxVariant.
18 class wxDataViewIconText
: public wxObject
25 wxDataViewIconText(const wxString
& text
= wxEmptyString
,
26 const wxIcon
& icon
= wxNullIcon
);
27 wxDataViewIconText(const wxDataViewIconText
& other
);
33 const wxIcon
& GetIcon() const;
38 wxString
GetText() const;
43 void SetIcon(const wxIcon
& icon
);
48 void SetText(const wxString
& text
);
54 @class wxDataViewEvent
56 This is the event class for the wxDataViewCtrl notifications.
61 class wxDataViewEvent
: public wxNotifyEvent
66 Constructor. Typically used by wxWidgets internals only.
68 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
,
70 wxDataViewEvent(const wxDataViewEvent
& event
);
74 Used to clone the event.
76 wxEvent
* Clone() const;
79 Returns the position of the column in the control or -1
80 if no column field was set by the event emitter.
82 int GetColumn() const;
85 Returns a pointer to the wxDataViewColumn from which
86 the event was emitted or @NULL.
88 wxDataViewColumn
* GetDataViewColumn() const;
91 Returns the wxDataViewModel associated with the event.
93 wxDataViewModel
* GetModel() const;
96 Returns a the position of a context menu event in screen coordinates.
98 wxPoint
GetPosition() const;
101 Returns a reference to a value.
103 const wxVariant
& GetValue() const;
106 Sets the column index associated with this event.
108 void SetColumn(int col
);
111 For wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
113 void SetDataViewColumn(wxDataViewColumn
* col
);
116 Sets the dataview model associated with this event.
118 void SetModel(wxDataViewModel
* model
);
121 Sets the value associated with this event.
123 void SetValue(const wxVariant
& value
);
129 @class wxDataViewModel
131 wxDataViewModel is the base class for all data model to be displayed by a
134 All other models derive from it and must implement its pure virtual functions
135 in order to define a complete data model. In detail, you need to override
136 wxDataViewModel::IsContainer, wxDataViewModel::GetParent, wxDataViewModel::GetChildren,
137 wxDataViewModel::GetColumnCount, wxDataViewModel::GetColumnType and
138 wxDataViewModel::GetValue in order to define the data model which acts as an
139 interface between your actual data and the wxDataViewCtrl.
141 Since you will usually also allow the wxDataViewCtrl to change your data
142 through its graphical interface, you will also have to override
143 wxDataViewModel::SetValue which the wxDataViewCtrl will call when a change
144 to some data has been commited.
146 wxDataViewModel (as indeed the entire wxDataViewCtrl code) is using wxVariant
147 to store data and its type in a generic way. wxVariant can be extended to contain
148 almost any data without changes to the original class.
150 The data that is presented through this data model is expected to change at
151 run-time. You need to inform the data model when a change happened.
152 Depending on what happened you need to call one of the following methods:
153 - wxDataViewModel::ValueChanged,
154 - wxDataViewModel::ItemAdded,
155 - wxDataViewModel::ItemDeleted,
156 - wxDataViewModel::ItemChanged,
157 - wxDataViewModel::Cleared.
159 There are plural forms for notification of addition, change or removal of
160 several item at once. See:
161 - wxDataViewModel::ItemsAdded,
162 - wxDataViewModel::ItemsDeleted,
163 - wxDataViewModel::ItemsChanged.
165 Note that wxDataViewModel does not define the position or index of any item
166 in the control because different controls might display the same data differently.
167 wxDataViewModel does provide a wxDataViewModel::Compare method which the
168 wxDataViewCtrl may use to sort the data either in conjunction with a column
169 header or without (see wxDataViewModel::HasDefaultCompare).
171 This class maintains a list of wxDataViewModelNotifier which link this class
172 to the specific implementations on the supported platforms so that e.g. calling
173 wxDataViewModel::ValueChanged on this model will just call
174 wxDataViewModelNotifier::ValueChanged for each notifier that has been added.
175 You can also add your own notifier in order to get informed about any changes
176 to the data in the list model.
178 Currently wxWidgets provides the following models apart from the base model:
179 wxDataViewIndexListModel, wxDataViewVirtualListModel, wxDataViewTreeStore.
181 Note that wxDataViewModel is reference counted, derives from wxObjectRefData
182 and cannot be deleted directly as it can be shared by several wxDataViewCtrls.
183 This implies that you need to decrease the reference count after
184 associating the model with a control like this:
187 wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, ID_MUSIC_CTRL );
188 wxDataViewModel *musicModel = new MyMusicModel;
189 m_musicCtrl-AssociateModel( musicModel );
190 musicModel-DecRef(); // avoid memory leak !!
198 class wxDataViewModel
: public wxObjectRefData
207 Destructor. This should not be called directly. Use DecRef() instead.
209 virtual ~wxDataViewModel();
212 Adds a wxDataViewModelNotifier to the model.
214 void AddNotifier(wxDataViewModelNotifier
* notifier
);
217 Called to inform the model that all data has been cleared.
218 The control will reread the data from the model again.
220 virtual bool Cleared();
223 The compare function to be used by control. The default compare function
224 sorts by container and other items separately and in ascending order.
225 Override this for a different sorting behaviour.
227 @see HasDefaultCompare().
229 virtual int Compare(const wxDataViewItem
& item1
,
230 const wxDataViewItem
& item2
,
235 Oberride this to indicate that the item has special font attributes.
236 This only affects the wxDataViewTextRendererText renderer.
238 @see wxDataViewItemAttr.
240 virtual bool GetAttr(const wxDataViewItem
& item
, unsigned int col
,
241 wxDataViewItemAttr
& attr
);
244 Override this so the control can query the child items of an item.
245 Returns the number of items.
247 virtual unsigned int GetChildren(const wxDataViewItem
& item
,
248 wxDataViewItemArray
& children
) const = 0;
251 Override this to indicate the number of columns in the model.
253 virtual unsigned int GetColumnCount() const = 0;
256 Override this to indicate what type of data is stored in the
257 column specified by @a col.
259 This should return a string indicating the type of data as reported by wxVariant.
261 virtual wxString
GetColumnType(unsigned int col
) const = 0;
264 Override this to indicate which wxDataViewItem representing the parent
265 of @a item or an invalid wxDataViewItem if the the root item is
268 virtual wxDataViewItem
GetParent(const wxDataViewItem
& item
) const = 0;
271 Override this to indicate the value of @a item.
272 A wxVariant is used to store the data.
274 virtual void GetValue(wxVariant
& variant
, const wxDataViewItem
& item
,
275 unsigned int col
) const = 0;
278 Override this method to indicate if a container item merely acts as a
279 headline (or for categorisation) or if it also acts a normal item with
280 entries for futher columns. By default returns @false.
282 virtual bool HasContainerColumns(const wxDataViewItem
& item
) const;
285 Override this to indicate that the model provides a default compare
286 function that the control should use if no wxDataViewColumn has been
287 chosen for sorting. Usually, the user clicks on a column header for
288 sorting, the data will be sorted alphanumerically.
290 If any other order (e.g. by index or order of appearance) is required,
291 then this should be used.
292 See wxDataViewIndexListModel for a model which makes use of this.
294 virtual bool HasDefaultCompare() const;
297 Override this to indicate of @a item is a container, i.e. if
298 it can have child items.
300 virtual bool IsContainer(const wxDataViewItem
& item
) const = 0;
303 Call this to inform the model that an item has been added to the data.
305 virtual bool ItemAdded(const wxDataViewItem
& parent
,
306 const wxDataViewItem
& item
);
309 Call this to inform the model that an item has changed.
311 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
312 event (in which the column fields will not be set) to the user.
314 virtual bool ItemChanged(const wxDataViewItem
& item
);
317 Call this to inform the model that an item has been deleted from the data.
319 virtual bool ItemDeleted(const wxDataViewItem
& parent
,
320 const wxDataViewItem
& item
);
323 Call this to inform the model that several items have been added to the data.
325 virtual bool ItemsAdded(const wxDataViewItem
& parent
,
326 const wxDataViewItemArray
& items
);
329 Call this to inform the model that several items have changed.
331 This will eventually emit wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
332 events (in which the column fields will not be set) to the user.
334 virtual bool ItemsChanged(const wxDataViewItemArray
& items
);
337 Call this to inform the model that several items have been deleted.
339 virtual bool ItemsDeleted(const wxDataViewItem
& parent
,
340 const wxDataViewItemArray
& items
);
343 Remove the @a notifier from the list of notifiers.
345 void RemoveNotifier(wxDataViewModelNotifier
* notifier
);
348 Call this to initiate a resort after the sort function has been changed.
350 virtual void Resort();
353 This gets called in order to set a value in the data model.
354 The most common scenario is that the wxDataViewCtrl calls this method
355 after the user changed some data in the view.
357 Afterwards ValueChanged() has to be called!
359 virtual bool SetValue(const wxVariant
& variant
, const wxDataViewItem
& item
,
360 unsigned int col
) = 0;
363 Call this to inform this model that a value in the model has been changed.
364 This is also called from wxDataViewCtrl's internal editing code, e.g. when
365 editing a text field in the control.
367 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
370 virtual bool ValueChanged(const wxDataViewItem
& item
,
377 @class wxDataViewIndexListModel
379 wxDataViewIndexListModel is a specialized data model which lets you address
380 an item by its position (row) rather than its wxDataViewItem (which you can
381 obtain from this class).
382 This model also provides its own wxDataViewIndexListModel::Compare
383 method which sorts the model's data by the index.
385 This model is not a virtual model since the control stores each wxDataViewItem.
386 Use wxDataViewVirtualListModel if you need to display millions of items or
387 have other reason to use a virtual control.
392 class wxDataViewIndexListModel
: public wxDataViewModel
398 wxDataViewIndexListModel(unsigned int initial_size
= 0);
403 virtual ~wxDataViewIndexListModel();
406 Compare method that sorts the items by their index.
408 int Compare(const wxDataViewItem
& item1
,
409 const wxDataViewItem
& item2
,
410 unsigned int column
, bool ascending
);
413 Oberride this to indicate that the row has special font attributes.
414 This only affects the wxDataViewTextRendererText() renderer.
416 @see wxDataViewItemAttr.
418 virtual bool GetAttr(unsigned int row
, unsigned int col
,
419 wxDataViewItemAttr
& attr
);
422 Returns the wxDataViewItem at the given @e row.
424 wxDataViewItem
GetItem(unsigned int row
) const;
427 Returns the position of given @e item.
429 unsigned int GetRow(const wxDataViewItem
& item
) const;
432 Override this to allow getting values from the model.
434 virtual void GetValue(wxVariant
& variant
, unsigned int row
,
435 unsigned int col
) const = 0;
438 Call this after if the data has to be read again from the model.
439 This is useful after major changes when calling the methods below
440 (possibly thousands of times) doesn't make sense.
442 void Reset(unsigned int new_size
);
445 Call this after a row has been appended to the model.
450 Call this after a row has been changed.
452 void RowChanged(unsigned int row
);
455 Call this after a row has been deleted.
457 void RowDeleted(unsigned int row
);
460 Call this after a row has been inserted at the given position.
462 void RowInserted(unsigned int before
);
465 Call this after a row has been prepended to the model.
470 Call this after a value has been changed.
472 void RowValueChanged(unsigned int row
, unsigned int col
);
475 Call this after rows have been deleted.
476 The array will internally get copied and sorted in descending order so
477 that the rows with the highest position will be deleted first.
479 void RowsDeleted(const wxArrayInt
& rows
);
482 Called in order to set a value in the model.
484 virtual bool SetValue(const wxVariant
& variant
, unsigned int row
,
485 unsigned int col
) = 0;
491 @class wxDataViewVirtualListModel
493 wxDataViewVirtualListModel is a specialized data model which lets you address
494 an item by its position (row) rather than its wxDataViewItem and as such offers
495 the exact same interface as wxDataViewIndexListModel.
496 The important difference is that under platforms other than OS X, using this
497 model will result in a truly virtual control able to handle millions of items
498 as the control doesn't store any item (a feature not supported by the
499 Carbon API under OS X).
501 @see wxDataViewIndexListModel for the API.
506 class wxDataViewVirtualListModel
: public wxDataViewModel
512 wxDataViewVirtualListModel(unsigned int initial_size
= 0);
518 @class wxDataViewItemAttr
520 This class is used to indicate to a wxDataViewCtrl that a certain item
521 (see wxDataViewItem) has extra font attributes for its renderer.
522 For this, it is required to override wxDataViewModel::GetAttr.
524 Attributes are currently only supported by wxDataViewTextRendererText.
529 class wxDataViewItemAttr
535 wxDataViewItemAttr();
538 Call this to indicate that the item shall be displayed in bold text.
540 void SetBold(bool set
);
543 Call this to indicate that the item shall be displayed with that colour.
545 void SetColour(const wxColour
& colour
);
548 Call this to indicate that the item shall be displayed in italic text.
550 void SetItalic(bool set
);
556 @class wxDataViewItem
558 wxDataViewItem is a small opaque class that represents an item in a wxDataViewCtrl
559 in a persistent way, i.e. indepent of the position of the item in the control
560 or changes to its contents.
562 It must hold a unique ID of type @e void* in its only field and can be converted
565 If the ID is @NULL the wxDataViewItem is invalid and wxDataViewItem::IsOk will
566 return @false which used in many places in the API of wxDataViewCtrl to
567 indicate that e.g. no item was found. An ID of @NULL is also used to indicate
568 the invisible root. Examples for this are wxDataViewModel::GetParent and
569 wxDataViewModel::GetChildren.
581 wxDataViewItem(void* id
= NULL
);
582 wxDataViewItem(const wxDataViewItem
& item
);
591 Returns @true if the ID is not @NULL.
599 @class wxDataViewCtrl
601 wxDataViewCtrl is a control to display data either in a tree like fashion or
602 in a tabular form or both.
603 If you only need to display a simple tree structure with an API more like the
604 older wxTreeCtrl class, then the specialized wxDataViewTreeCtrl can be used.
606 A wxDataViewItem is used to represent a (visible) item in the control.
608 Unlike wxListCtrl wxDataViewCtrl doesn't get its data from the user through
609 virtual functions or by setting it directly. Instead you need to write your own
610 wxDataViewModel and associate it with this control.
611 Then you need to add a number of wxDataViewColumn to this control to define
612 what each column shall display. Each wxDataViewColumn in turn owns 1 instance
613 of a wxDataViewRenderer to render its cells.
615 A number of standard renderers for rendering text, dates, images, toggle,
616 a progress bar etc. are provided. Additionally, the user can write custom
617 renderes deriving from wxDataViewCustomRenderer for displaying anything.
619 All data transfer from the control to the model and the user code is done
620 through wxVariant which can be extended to support more data formats as necessary.
621 Accordingly, all type information uses the strings returned from wxVariant::GetType.
625 Single selection mode. This is the default.
626 @style{wxDV_MULTIPLE}
627 Multiple selection mode.
628 @style{wxDV_ROW_LINES}
629 Use alternating colours for rows if supported by platform and theme.
630 @style{wxDV_HORIZ_RULES}
631 Display fine rules between row if supported.
632 @style{wxDV_VERT_RULES}
633 Display fine rules between columns is supported.
634 @style{wxDV_VARIABLE_LINE_HEIGHT}
635 Allow variable line heights.
636 This can be inefficient when displaying large number of items.
639 @beginEventTable{wxDataViewEvent}
640 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
641 Process a wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
642 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
643 Process a wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
644 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
645 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
646 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
647 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
648 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
649 Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
650 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
651 Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
652 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
653 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
654 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
655 Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
656 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
657 Process a wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
658 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
659 Process a wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
660 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
661 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
662 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
663 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
664 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
665 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
666 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
667 Process a wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
672 @appearance{dataviewctrl.png}
674 class wxDataViewCtrl
: public wxControl
683 Constructor. Calls Create().
685 wxDataViewCtrl(wxWindow
* parent
, wxWindowID id
,
686 const wxPoint
& pos
= wxDefaultPosition
,
687 const wxSize
& size
= wxDefaultSize
,
689 const wxValidator
& validator
= wxDefaultValidator
);
694 virtual ~wxDataViewCtrl();
697 Appends a wxDataViewColumn to the control. Returns @true on success.
699 Note that there is a number of short cut methods which implicitly create
700 a wxDataViewColumn and a wxDataViewRenderer for it (see below).
702 virtual bool AppendColumn(wxDataViewColumn
* col
);
705 Prepends a wxDataViewColumn to the control. Returns @true on success.
707 Note that there is a number of short cut methods which implicitly create
708 a wxDataViewColumn and a wxDataViewRenderer for it.
710 virtual bool PrependColumn(wxDataViewColumn
* col
);
713 Inserts a wxDataViewColumn to the control. Returns @true on success.
715 virtual bool InsertColumn(unsigned int pos
, wxDataViewColumn
* col
);
719 Appends a column for rendering a bitmap. Returns the wxDataViewColumn
720 created in the function or @NULL on failure.
722 wxDataViewColumn
* AppendBitmapColumn(const wxString
& label
,
723 unsigned int model_column
,
724 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
726 wxAlignment align
= wxALIGN_CENTER
,
727 int flags
= wxDATAVIEW_COL_RESIZABLE
);
728 wxDataViewColumn
* AppendBitmapColumn(const wxBitmap
& label
,
729 unsigned int model_column
,
730 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
732 wxAlignment align
= wxALIGN_CENTER
,
733 int flags
= wxDATAVIEW_COL_RESIZABLE
);
738 Appends a column for rendering a date. Returns the wxDataViewColumn
739 created in the function or @NULL on failure.
741 @note The @a align parameter is applied to both the column header and
744 wxDataViewColumn
* AppendDateColumn(const wxString
& label
,
745 unsigned int model_column
,
746 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
748 wxAlignment align
= wxALIGN_CENTER
,
749 int flags
= wxDATAVIEW_COL_RESIZABLE
);
750 wxDataViewColumn
* AppendDateColumn(const wxBitmap
& label
,
751 unsigned int model_column
,
752 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
754 wxAlignment align
= wxALIGN_CENTER
,
755 int flags
= wxDATAVIEW_COL_RESIZABLE
);
760 Appends a column for rendering text with an icon. Returns the wxDataViewColumn
761 created in the function or @NULL on failure.
762 This method uses the wxDataViewIconTextRenderer class.
764 @note The @a align parameter is applied to both the column header and
767 wxDataViewColumn
* AppendIconTextColumn(const wxString
& label
,
768 unsigned int model_column
,
769 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
771 wxAlignment align
= wxALIGN_LEFT
,
772 int flags
= wxDATAVIEW_COL_RESIZABLE
);
773 wxDataViewColumn
* AppendIconTextColumn(const wxBitmap
& label
,
774 unsigned int model_column
,
775 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
777 wxAlignment align
= wxALIGN_LEFT
,
778 int flags
= wxDATAVIEW_COL_RESIZABLE
);
783 Appends a column for rendering a progress indicator. Returns the
784 wxDataViewColumn created in the function or @NULL on failure.
786 @note The @a align parameter is applied to both the column header and
789 wxDataViewColumn
* AppendProgressColumn(const wxString
& label
,
790 unsigned int model_column
,
791 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
793 wxAlignment align
= wxALIGN_CENTER
,
794 int flags
= wxDATAVIEW_COL_RESIZABLE
);
795 wxDataViewColumn
* AppendProgressColumn(const wxBitmap
& label
,
796 unsigned int model_column
,
797 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
799 wxAlignment align
= wxALIGN_CENTER
,
800 int flags
= wxDATAVIEW_COL_RESIZABLE
);
805 Appends a column for rendering text. Returns the wxDataViewColumn
806 created in the function or @NULL on failure.
808 @note The @a align parameter is applied to both the column header and
811 wxDataViewColumn
* AppendTextColumn(const wxString
& label
,
812 unsigned int model_column
,
813 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
815 wxAlignment align
= wxALIGN_LEFT
,
816 int flags
= wxDATAVIEW_COL_RESIZABLE
);
817 wxDataViewColumn
* AppendTextColumn(const wxBitmap
& label
,
818 unsigned int model_column
,
819 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
821 wxAlignment align
= wxALIGN_LEFT
,
822 int flags
= wxDATAVIEW_COL_RESIZABLE
);
827 Appends a column for rendering a toggle. Returns the wxDataViewColumn
828 created in the function or @NULL on failure.
830 @note The @a align parameter is applied to both the column header and
833 wxDataViewColumn
* AppendToggleColumn(const wxString
& label
,
834 unsigned int model_column
,
835 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
837 wxAlignment align
= wxALIGN_CENTER
,
838 int flags
= wxDATAVIEW_COL_RESIZABLE
);
839 wxDataViewColumn
* AppendToggleColumn(const wxBitmap
& label
,
840 unsigned int model_column
,
841 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
843 wxAlignment align
= wxALIGN_CENTER
,
844 int flags
= wxDATAVIEW_COL_RESIZABLE
);
848 Associates a wxDataViewModel with the control.
849 This increases the reference count of the model by 1.
851 virtual bool AssociateModel(wxDataViewModel
* model
);
856 virtual bool ClearColumns();
861 void ClearSelection();
866 virtual void Collapse(const wxDataViewItem
& item
);
869 Create the control. Useful for two step creation.
871 bool Create(wxWindow
* parent
, wxWindowID id
,
872 const wxPoint
& pos
= wxDefaultPosition
,
873 const wxSize
& size
= wxDefaultSize
,
875 const wxValidator
& validator
= wxDefaultValidator
);
878 Deletes given column.
880 virtual bool DeleteColumn(wxDataViewColumn
* column
);
883 Call this to ensure that the given item is visible.
885 virtual void EnsureVisible(const wxDataViewItem
& item
,
886 const wxDataViewColumn
* column
= NULL
);
891 virtual void Expand(const wxDataViewItem
& item
);
894 Returns pointer to the column. @a pos refers to the position in the
895 control which may change after reordering columns by the user.
897 virtual wxDataViewColumn
* GetColumn(unsigned int pos
) const;
900 Returns the number of columns.
902 virtual unsigned int GetColumnCount() const;
905 Returns the position of the column or -1 if not found in the control.
907 virtual int GetColumnPosition(const wxDataViewColumn
* column
) const;
910 Returns column containing the expanders.
912 wxDataViewColumn
* GetExpanderColumn() const;
917 int GetIndent() const;
922 virtual wxRect
GetItemRect(const wxDataViewItem
& item
,
923 const wxDataViewColumn
* col
= NULL
) const;
926 Returns pointer to the data model associated with the control (if any).
928 wxDataViewModel
* GetModel();
931 Returns first selected item or an invalid item if none is selected.
933 virtual wxDataViewItem
GetSelection() const;
936 Fills @a sel with currently selected items and returns their number.
938 virtual int GetSelections(wxDataViewItemArray
& sel
) const;
941 Returns the wxDataViewColumn currently responsible for sorting
942 or @NULL if none has been selected.
944 virtual wxDataViewColumn
* GetSortingColumn() const;
949 virtual void HitTest(const wxPoint
& point
, wxDataViewItem
& item
,
950 wxDataViewColumn
*& col
) const;
953 Return @true if the item is selected.
955 virtual bool IsSelected(const wxDataViewItem
& item
) const;
958 Select the given item.
960 virtual void Select(const wxDataViewItem
& item
);
965 virtual void SelectAll();
968 Set which column shall contain the tree-like expanders.
970 void SetExpanderColumn(wxDataViewColumn
* col
);
973 Sets the indendation.
975 void SetIndent(int indent
);
978 Sets the selection to the array of wxDataViewItems.
980 virtual void SetSelections(const wxDataViewItemArray
& sel
);
983 Unselect the given item.
985 virtual void Unselect(const wxDataViewItem
& item
);
989 This method only has effect if multiple selections are allowed.
991 virtual void UnselectAll();
997 @class wxDataViewModelNotifier
999 A wxDataViewModelNotifier instance is owned by a wxDataViewModel and mirrors
1000 its notification interface.
1001 See the documentation of that class for further information.
1006 class wxDataViewModelNotifier
1012 wxDataViewModelNotifier();
1017 virtual ~wxDataViewModelNotifier();
1020 Called by owning model.
1022 virtual bool Cleared() = 0;
1025 Get owning wxDataViewModel.
1027 wxDataViewModel
* GetOwner() const;
1030 Called by owning model.
1032 virtual bool ItemAdded(const wxDataViewItem
& parent
,
1033 const wxDataViewItem
& item
) = 0;
1036 Called by owning model.
1038 virtual bool ItemChanged(const wxDataViewItem
& item
) = 0;
1041 Called by owning model.
1043 virtual bool ItemDeleted(const wxDataViewItem
& parent
,
1044 const wxDataViewItem
& item
) = 0;
1047 Called by owning model.
1049 virtual bool ItemsAdded(const wxDataViewItem
& parent
,
1050 const wxDataViewItemArray
& items
);
1053 Called by owning model.
1055 virtual bool ItemsChanged(const wxDataViewItemArray
& items
);
1058 Called by owning model.
1060 virtual bool ItemsDeleted(const wxDataViewItem
& parent
,
1061 const wxDataViewItemArray
& items
);
1064 Called by owning model.
1066 virtual void Resort() = 0;
1069 Set owner of this notifier. Used internally.
1071 void SetOwner(wxDataViewModel
* owner
);
1074 Called by owning model.
1076 virtual bool ValueChanged(const wxDataViewItem
& item
, unsigned int col
) = 0;
1081 The mode of a data-view cell; see wxDataViewRenderer for more info.
1083 enum wxDataViewCellMode
1085 wxDATAVIEW_CELL_INERT
,
1088 Indicates that the user can double click the cell and something will
1089 happen (e.g. a window for editing a date will pop up).
1091 wxDATAVIEW_CELL_ACTIVATABLE
,
1094 Indicates that the user can edit the data in-place, i.e. an control
1095 will show up after a slow click on the cell. This behaviour is best
1096 known from changing the filename in most file managers etc.
1098 wxDATAVIEW_CELL_EDITABLE
1102 The values of this enum controls how a wxDataViewRenderer should display
1103 its contents in a cell.
1105 enum wxDataViewCellRenderState
1107 wxDATAVIEW_CELL_SELECTED
= 1,
1108 wxDATAVIEW_CELL_PRELIT
= 2,
1109 wxDATAVIEW_CELL_INSENSITIVE
= 4,
1110 wxDATAVIEW_CELL_FOCUSED
= 8
1114 @class wxDataViewRenderer
1116 This class is used by wxDataViewCtrl to render the individual cells.
1117 One instance of a renderer class is owned by a wxDataViewColumn.
1118 There is a number of ready-to-use renderers provided:
1119 - wxDataViewTextRenderer,
1120 - wxDataViewTextRendererAttr,
1121 - wxDataViewIconTextRenderer,
1122 - wxDataViewToggleRenderer,
1123 - wxDataViewProgressRenderer,
1124 - wxDataViewBitmapRenderer,
1125 - wxDataViewDateRenderer,
1126 - wxDataViewSpinRenderer.
1128 Additionally, the user can write own renderers by deriving from
1129 wxDataViewCustomRenderer.
1131 The ::wxDataViewCellMode and ::wxDataViewCellRenderState flags accepted
1132 by the constructors respectively controls what actions the cell data allows
1133 and how the renderer should display its contents in a cell.
1138 class wxDataViewRenderer
: public wxObject
1144 wxDataViewRenderer(const wxString
& varianttype
,
1145 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1146 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1149 Returns the alignment. See SetAlignment()
1151 virtual int GetAlignment() const;
1154 Returns the cell mode.
1156 virtual wxDataViewCellMode
GetMode() const;
1159 Returns pointer to the owning wxDataViewColumn.
1161 wxDataViewColumn
* GetOwner() const;
1164 This methods retrieves the value from the renderer in order to
1165 transfer the value back to the data model.
1167 Returns @false on failure.
1169 virtual bool GetValue(wxVariant
& value
) const = 0;
1172 Returns a string with the type of the wxVariant supported by this renderer.
1174 wxString
GetVariantType() const;
1177 Sets the alignment of the renderer's content.
1178 The default value of @c wxDVR_DEFAULT_ALIGMENT indicates that the content
1179 should have the same alignment as the column header.
1181 The method is not implemented under OS X and the renderer always aligns
1182 its contents as the column header on that platform. The other platforms
1183 support both vertical and horizontal alignment.
1185 virtual void SetAlignment( int align
);
1187 Sets the owning wxDataViewColumn.
1188 This is usually called from within wxDataViewColumn.
1190 void SetOwner(wxDataViewColumn
* owner
);
1193 Set the value of the renderer (and thus its cell) to @a value.
1194 The internal code will then render this cell with this data.
1196 virtual bool SetValue(const wxVariant
& value
) = 0;
1199 Before data is committed to the data model, it is passed to this
1200 method where it can be checked for validity. This can also be
1201 used for checking a valid range or limiting the user input in
1202 a certain aspect (e.g. max number of characters or only alphanumeric
1203 input, ASCII only etc.). Return @false if the value is not valid.
1205 Please note that due to implementation limitations, this validation
1206 is done after the editing control already is destroyed and the
1207 editing process finished.
1209 virtual bool Validate(wxVariant
& value
);
1215 @class wxDataViewTextRenderer
1217 wxDataViewTextRenderer is used for rendering text.
1218 It supports in-place editing if desired.
1223 class wxDataViewTextRenderer
: public wxDataViewRenderer
1229 wxDataViewTextRenderer(const wxString
& varianttype
= "string",
1230 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1231 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1237 @class wxDataViewIconTextRenderer
1239 The wxDataViewIconTextRenderer class is used to display text with
1240 a small icon next to it as it is typically done in a file manager.
1242 This classes uses the wxDataViewIconText helper class to store its data.
1243 wxDataViewIonText can be converted to and from a wxVariant using the left shift
1249 class wxDataViewIconTextRenderer
: public wxDataViewRenderer
1255 wxDataViewIconTextRenderer(const wxString
& varianttype
= "wxDataViewIconText",
1256 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1257 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1263 @class wxDataViewProgressRenderer
1265 This class is used by wxDataViewCtrl to render progress bars.
1270 class wxDataViewProgressRenderer
: public wxDataViewRenderer
1276 wxDataViewProgressRenderer(const wxString
& label
= wxEmptyString
,
1277 const wxString
& varianttype
= "long",
1278 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1279 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1285 @class wxDataViewSpinRenderer
1287 This is a specialized renderer for rendering integer values.
1288 It supports modifying the values in-place by using a wxSpinCtrl.
1289 The renderer only support variants of type @e long.
1294 class wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
1299 @a min and @a max indicate the minimum and maximum values for the wxSpinCtrl.
1301 wxDataViewSpinRenderer(int min
, int max
,
1302 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1303 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1309 @class wxDataViewToggleRenderer
1311 This class is used by wxDataViewCtrl to render toggle controls.
1316 class wxDataViewToggleRenderer
: public wxDataViewRenderer
1322 wxDataViewToggleRenderer(const wxString
& varianttype
= "bool",
1323 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1324 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1330 @class wxDataViewDateRenderer
1332 This class is used by wxDataViewCtrl to render calendar controls.
1337 class wxDataViewDateRenderer
: public wxDataViewRenderer
1343 wxDataViewDateRenderer(const wxString
& varianttype
= "datetime",
1344 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1345 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1351 @class wxDataViewTextRendererAttr
1353 The same as wxDataViewTextRenderer but with support for font attributes.
1354 Font attributes are currently only supported under GTK+ and MSW.
1356 @see wxDataViewModel::GetAttr and wxDataViewItemAttr.
1361 class wxDataViewTextRendererAttr
: public wxDataViewTextRenderer
1367 wxDataViewTextRendererAttr(const wxString
& varianttype
= "string",
1368 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1369 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1375 @class wxDataViewCustomRenderer
1377 You need to derive a new class from wxDataViewCustomRenderer in
1378 order to write a new renderer.
1380 You need to override at least wxDataViewRenderer::SetValue, wxDataViewRenderer::GetValue,
1381 wxDataViewCustomRenderer::GetSize and wxDataViewCustomRenderer::Render.
1383 If you want your renderer to support in-place editing then you also need to override
1384 wxDataViewCustomRenderer::HasEditorCtrl, wxDataViewCustomRenderer::CreateEditorCtrl
1385 and wxDataViewCustomRenderer::GetValueFromEditorCtrl.
1387 Note that a special event handler will be pushed onto that editor control
1388 which handles @e \<ENTER\> and focus out events in order to end the editing.
1393 class wxDataViewCustomRenderer
: public wxDataViewRenderer
1399 wxDataViewCustomRenderer(const wxString
& varianttype
= "string",
1400 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1401 int align
= -1, bool no_init
= false);
1406 virtual ~wxDataViewCustomRenderer();
1409 Override this to react to double clicks or ENTER.
1410 This method will only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
1412 virtual bool Activate( wxRect cell
,
1413 wxDataViewModel
* model
,
1414 const wxDataViewItem
& item
,
1418 Override this to create the actual editor control once editing
1421 @a parent is the parent of the editor control, @a labelRect indicates the
1422 position and size of the editor control and @a value is its initial value:
1426 return new wxSpinCtrl( parent, wxID_ANY, wxEmptyString,
1427 labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l );
1431 virtual wxControl
* CreateEditorCtrl(wxWindow
* parent
,
1433 const wxVariant
& value
);
1436 Create DC on request. Internal.
1438 virtual wxDC
* GetDC();
1441 Return size required to show content.
1443 virtual wxSize
GetSize() const = 0;
1446 Overrride this so that the renderer can get the value from the editor
1447 control (pointed to by @a editor):
1450 wxSpinCtrl *sc = (wxSpinCtrl*) editor;
1451 long l = sc->GetValue();
1457 virtual bool GetValueFromEditorCtrl(wxControl
* editor
,
1461 Override this and make it return @true in order to
1462 indicate that this renderer supports in-place editing.
1464 virtual bool HasEditorCtrl();
1467 Overrride this to react to a left click.
1468 This method will only be called in @c wxDATAVIEW_CELL_ACTIVATABLE mode.
1470 virtual bool LeftClick( wxPoint cursor
,
1472 wxDataViewModel
* model
,
1473 const wxDataViewItem
& item
,
1477 Override this to render the cell.
1478 Before this is called, wxDataViewRenderer::SetValue was called
1479 so that this instance knows what to render.
1481 virtual bool Render(wxRect cell
, wxDC
* dc
, int state
) = 0;
1484 This method should be called from within Render() whenever you need to
1486 This will ensure that the correct colour, font and vertical alignment will
1487 be chosen so the text will look the same as text drawn by native renderers.
1489 void RenderText(const wxString
& text
, int xoffset
, wxRect cell
,
1490 wxDC
* dc
, int state
);
1493 Overrride this to start a drag operation. Not yet supported.
1495 virtual bool StartDrag(wxPoint cursor
, wxRect cell
,
1496 wxDataViewModel
* model
,
1497 const wxDataViewItem
& item
,
1504 @class wxDataViewBitmapRenderer
1506 This class is used by wxDataViewCtrl to render bitmap controls.
1511 class wxDataViewBitmapRenderer
: public wxDataViewRenderer
1517 wxDataViewBitmapRenderer(const wxString
& varianttype
= "wxBitmap",
1518 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1519 int align
= wxDVR_DEFAULT_ALIGNMENT
,
1524 The flags used by wxDataViewColumn.
1526 enum wxDataViewColumnFlags
1528 wxDATAVIEW_COL_RESIZABLE
= 1,
1529 wxDATAVIEW_COL_SORTABLE
= 2,
1530 wxDATAVIEW_COL_REORDERABLE
= 4,
1531 wxDATAVIEW_COL_HIDDEN
= 8
1535 @class wxDataViewColumn
1537 This class represents a column in a wxDataViewCtrl.
1538 One wxDataViewColumn is bound to one column in the data model, to which the
1539 wxDataViewCtrl has been associated.
1541 An instance of wxDataViewRenderer is used by this class to render its data.
1546 class wxDataViewColumn
: public wxObject
1553 wxDataViewColumn(const wxString
& title
,
1554 wxDataViewRenderer
* renderer
,
1555 unsigned int model_column
,
1556 int width
= wxDVC_DEFAULT_WIDTH
,
1557 wxAlignment align
= wxALIGN_CENTRE
,
1558 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1559 wxDataViewColumn(const wxBitmap
& bitmap
,
1560 wxDataViewRenderer
* renderer
,
1561 unsigned int model_column
,
1562 int width
= wxDVC_DEFAULT_WIDTH
,
1563 wxAlignment align
= wxALIGN_CENTRE
,
1564 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1570 virtual ~wxDataViewColumn();
1573 Returns the bitmap in the header of the column, if any.
1575 const wxBitmap
& GetBitmap() const;
1578 Returns the index of the column of the model, which this
1579 wxDataViewColumn is displaying.
1581 unsigned int GetModelColumn() const;
1584 Returns the owning wxDataViewCtrl.
1586 wxDataViewCtrl
* GetOwner() const;
1589 Returns the renderer of this wxDataViewColumn.
1591 @see wxDataViewRenderer.
1593 wxDataViewRenderer
* GetRenderer() const;
1596 Returns @true if the column is reorderable.
1598 bool GetReorderable();
1601 Returns @true if the column is sortable.
1608 Returns the width of the column.
1610 virtual int GetWidth() const;
1613 Returns @true, if the sort order is ascending.
1617 virtual bool IsSortOrderAscending() const;
1620 Set the alignment of the column header.
1622 virtual void SetAlignment(wxAlignment align
);
1625 Set the bitmap of the column header.
1627 virtual void SetBitmap(const wxBitmap
& bitmap
);
1630 Indicate wether the column can be reordered by the user using the mouse.
1631 This is typically implemented visually by dragging the header button around.
1633 virtual void SetReorderable(bool reorderable
);
1636 Indicate the sort order if the implementation of the wxDataViewCtrl supports
1637 it, most commonly by showing a little arrow.
1639 virtual void SetSortOrder(bool ascending
);
1642 Indicate that the column is sortable.
1643 This does not show any sorting indicate yet, but it does make the column
1644 header clickable. Call SetSortOrder() afterwards to actually make the sort
1647 If @a sortable is @false, the column header is no longer clickable and
1648 the sort indicator (little arrow) will disappear.
1650 virtual void SetSortable(bool sortable
);
1653 Set the title of the column header to @a title.
1655 virtual void SetTitle(const wxString
& title
);
1661 @class wxDataViewTreeCtrl
1663 This class is a wxDataViewCtrl which internally uses a wxDataViewTreeStore
1664 and forwards most of its API to that class.
1665 Additionally, it uses a wxImageList to store a list of icons.
1667 The main purpose of this class is to look like a wxTreeCtrl to make a transition
1668 from it to the wxDataViewCtrl class simpler.
1672 @appearance{dataviewtreectrl.png}
1674 class wxDataViewTreeCtrl
: public wxDataViewCtrl
1680 wxDataViewTreeCtrl();
1683 Constructor. Calls Create().
1685 wxDataViewTreeCtrl(wxWindow
* parent
, wxWindowID id
,
1686 const wxPoint
& pos
= wxDefaultPosition
,
1687 const wxSize
& size
= wxDefaultSize
,
1688 long style
= wxDV_NO_HEADER
,
1689 const wxValidator
& validator
= wxDefaultValidator
);
1692 Destructor. Deletes the image list if any.
1694 virtual ~wxDataViewTreeCtrl();
1699 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
1700 const wxString
& text
,
1703 wxClientData
* data
= NULL
);
1708 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
1709 const wxString
& text
,
1711 wxClientData
* data
= NULL
);
1714 Creates the control and a wxDataViewTreeStore as its internal model.
1716 bool Create(wxWindow
* parent
, wxWindowID id
,
1717 const wxPoint
& pos
= wxDefaultPosition
,
1718 const wxSize
& size
= wxDefaultSize
,
1719 long style
= wxDV_NO_HEADER
,
1720 const wxValidator
& validator
= wxDefaultValidator
);
1723 Calls the identical method from wxDataViewTreeStore.
1725 void DeleteAllItems();
1728 Calls the identical method from wxDataViewTreeStore.
1730 void DeleteChildren(const wxDataViewItem
& item
);
1733 Calls the identical method from wxDataViewTreeStore.
1735 void DeleteItem(const wxDataViewItem
& item
);
1738 Calls the identical method from wxDataViewTreeStore.
1740 int GetChildCount(const wxDataViewItem
& parent
) const;
1743 Returns the image list.
1745 wxImageList
* GetImageList();
1748 Calls the identical method from wxDataViewTreeStore.
1750 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
1753 Calls the identical method from wxDataViewTreeStore.
1755 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
1758 Calls the identical method from wxDataViewTreeStore.
1760 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
1763 Calls the identical method from wxDataViewTreeStore.
1765 wxString
GetItemText(const wxDataViewItem
& item
) const;
1768 Calls the identical method from wxDataViewTreeStore.
1770 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
1771 unsigned int pos
) const;
1777 wxDataViewTreeStore
* GetStore() const;
1778 const wxDataViewTreeStore
* GetStore() const;
1782 Calls the same method from wxDataViewTreeStore but uses
1783 an index position in the image list instead of a wxIcon.
1785 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
1786 const wxDataViewItem
& previous
,
1787 const wxString
& text
,
1790 wxClientData
* data
= NULL
);
1793 Calls the same method from wxDataViewTreeStore but uses
1794 an index position in the image list instead of a wxIcon.
1796 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
1797 const wxDataViewItem
& previous
,
1798 const wxString
& text
,
1800 wxClientData
* data
= NULL
);
1803 Calls the same method from wxDataViewTreeStore but uses
1804 an index position in the image list instead of a wxIcon.
1806 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
1807 const wxString
& text
,
1810 wxClientData
* data
= NULL
);
1813 Calls the same method from wxDataViewTreeStore but uses
1814 an index position in the image list instead of a wxIcon.
1816 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
1817 const wxString
& text
,
1819 wxClientData
* data
= NULL
);
1822 Sets the image list.
1824 void SetImageList(wxImageList
* imagelist
);
1827 Calls the identical method from wxDataViewTreeStore.
1829 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
1832 Calls the identical method from wxDataViewTreeStore.
1834 void SetItemExpandedIcon(const wxDataViewItem
& item
,
1835 const wxIcon
& icon
);
1838 Calls the identical method from wxDataViewTreeStore.
1840 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
1843 Calls the identical method from wxDataViewTreeStore.
1845 void SetItemText(const wxDataViewItem
& item
,
1846 const wxString
& text
);
1852 @class wxDataViewTreeStore
1854 wxDataViewTreeStore is a specialised wxDataViewModel for displaying simple
1855 trees very much like wxTreeCtrl does and it offers a similar API.
1857 This class actually stores the entire tree (therefore its name) and implements
1858 all virtual methods from the base class so it can be used directly without
1859 having to derive any class from it.
1860 This comes at the price of much reduced flexibility.
1865 class wxDataViewTreeStore
: public wxDataViewModel
1869 Constructor. Creates the invisible root node internally.
1871 wxDataViewTreeStore();
1876 virtual ~wxDataViewTreeStore();
1881 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
1882 const wxString
& text
,
1883 const wxIcon
& icon
= wxNullIcon
,
1884 const wxIcon
& expanded
= wxNullIcon
,
1885 wxClientData
* data
= NULL
);
1890 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
1891 const wxString
& text
,
1892 const wxIcon
& icon
= wxNullIcon
,
1893 wxClientData
* data
= NULL
);
1896 Delete all item in the model.
1898 void DeleteAllItems();
1901 Delete all children of the item, but not the item itself.
1903 void DeleteChildren(const wxDataViewItem
& item
);
1908 void DeleteItem(const wxDataViewItem
& item
);
1911 Return the number of children of item.
1913 int GetChildCount(const wxDataViewItem
& parent
) const;
1916 Returns the client data asoociated with the item.
1918 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
1921 Returns the icon to display in expanded containers.
1923 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
1926 Returns the icon of the item.
1928 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
1931 Returns the text of the item.
1933 wxString
GetItemText(const wxDataViewItem
& item
) const;
1936 Returns the nth child item of item.
1938 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
1939 unsigned int pos
) const;
1942 Inserts a container after @a previous.
1944 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
1945 const wxDataViewItem
& previous
,
1946 const wxString
& text
,
1947 const wxIcon
& icon
= wxNullIcon
,
1948 const wxIcon
& expanded
= wxNullIcon
,
1949 wxClientData
* data
= NULL
);
1952 Inserts an item after @a previous.
1954 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
1955 const wxDataViewItem
& previous
,
1956 const wxString
& text
,
1957 const wxIcon
& icon
= wxNullIcon
,
1958 wxClientData
* data
= NULL
);
1961 Inserts a container before the first child item or @a parent.
1963 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
1964 const wxString
& text
,
1965 const wxIcon
& icon
= wxNullIcon
,
1966 const wxIcon
& expanded
= wxNullIcon
,
1967 wxClientData
* data
= NULL
);
1970 Inserts an item before the first child item or @a parent.
1972 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
1973 const wxString
& text
,
1974 const wxIcon
& icon
= wxNullIcon
,
1975 wxClientData
* data
= NULL
);
1978 Sets the client data associated with the item.
1980 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
1983 Sets the expanded icon for the item.
1985 void SetItemExpandedIcon(const wxDataViewItem
& item
,
1986 const wxIcon
& icon
);
1989 Sets the icon for the item.
1991 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);