1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDataView* classes
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
11 @class wxDataViewModel
13 wxDataViewModel is the base class for all data model to be displayed by a
16 All other models derive from it and must implement its pure virtual functions
17 in order to define a complete data model. In detail, you need to override
18 wxDataViewModel::IsContainer, wxDataViewModel::GetParent, wxDataViewModel::GetChildren,
19 wxDataViewModel::GetColumnCount, wxDataViewModel::GetColumnType and
20 wxDataViewModel::GetValue in order to define the data model which acts as an
21 interface between your actual data and the wxDataViewCtrl.
23 Note that wxDataViewModel does not define the position or index of any item
24 in the control because different controls might display the same data differently.
25 wxDataViewModel does provide a wxDataViewModel::Compare method which the
26 wxDataViewCtrl may use to sort the data either in conjunction with a column
27 header or without (see wxDataViewModel::HasDefaultCompare).
29 wxDataViewModel (as indeed the entire wxDataViewCtrl code) is using wxVariant
30 to store data and its type in a generic way. wxVariant can be extended to contain
31 almost any data without changes to the original class. To a certain extent,
32 you can use (the somewhat more elegant) wxAny instead of wxVariant as there
33 is code to convert between the two, but it is unclear what impact this will
36 Since you will usually allow the wxDataViewCtrl to change your data
37 through its graphical interface, you will also have to override
38 wxDataViewModel::SetValue which the wxDataViewCtrl will call when a change
39 to some data has been committed.
41 If the data represented by the model is changed by something else than its
42 associated wxDataViewCtrl, the control has to be notified about the change.
43 Depending on what happened you need to call one of the following methods:
44 - wxDataViewModel::ValueChanged,
45 - wxDataViewModel::ItemAdded,
46 - wxDataViewModel::ItemDeleted,
47 - wxDataViewModel::ItemChanged,
48 - wxDataViewModel::Cleared.
50 There are plural forms for notification of addition, change or removal of
51 several item at once. See:
52 - wxDataViewModel::ItemsAdded,
53 - wxDataViewModel::ItemsDeleted,
54 - wxDataViewModel::ItemsChanged.
56 This class maintains a list of wxDataViewModelNotifier which link this class
57 to the specific implementations on the supported platforms so that e.g. calling
58 wxDataViewModel::ValueChanged on this model will just call
59 wxDataViewModelNotifier::ValueChanged for each notifier that has been added.
60 You can also add your own notifier in order to get informed about any changes
61 to the data in the list model.
63 Currently wxWidgets provides the following models apart from the base model:
64 wxDataViewIndexListModel, wxDataViewVirtualListModel, wxDataViewTreeStore,
67 Note that wxDataViewModel is reference counted, derives from wxRefCounter
68 and cannot be deleted directly as it can be shared by several wxDataViewCtrls.
69 This implies that you need to decrease the reference count after
70 associating the model with a control like this:
73 wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, wxID_ANY );
74 wxDataViewModel *musicModel = new MyMusicModel;
75 m_musicCtrl->AssociateModel( musicModel );
76 musicModel->DecRef(); // avoid memory leak !!
81 A potentially better way to avoid memory leaks is to use wxObjectDataPtr
84 wxObjectDataPtr<MyMusicModel> musicModel;
86 wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, wxID_ANY );
87 musicModel = new MyMusicModel;
88 m_musicCtrl->AssociateModel( musicModel.get() );
97 class wxDataViewModel
: public wxRefCounter
106 Adds a wxDataViewModelNotifier to the model.
108 void AddNotifier(wxDataViewModelNotifier
* notifier
);
111 Change the value of the given item and update the control to reflect
114 This function simply calls SetValue() and, if it succeeded,
122 The item (row) to update.
124 The column to update.
126 @true if both SetValue() and ValueChanged() returned @true.
128 bool ChangeValue(const wxVariant
& variant
,
129 const wxDataViewItem
& item
,
133 Called to inform the model that all data has been cleared.
134 The control will reread the data from the model again.
136 virtual bool Cleared();
139 The compare function to be used by control. The default compare function
140 sorts by container and other items separately and in ascending order.
141 Override this for a different sorting behaviour.
143 @see HasDefaultCompare().
145 virtual int Compare(const wxDataViewItem
& item1
,
146 const wxDataViewItem
& item2
,
148 bool ascending
) const;
151 Override this to indicate that the item has special font attributes.
152 This only affects the wxDataViewTextRendererText renderer.
154 The base class version always simply returns @false.
156 @see wxDataViewItemAttr.
159 The item for which the attribute is requested.
161 The column of the item for which the attribute is requested.
163 The attribute to be filled in if the function returns @true.
165 @true if this item has an attribute or @false otherwise.
167 virtual bool GetAttr(const wxDataViewItem
& item
, unsigned int col
,
168 wxDataViewItemAttr
& attr
) const;
171 Override this to indicate that the item should be disabled.
173 Disabled items are displayed differently (e.g. grayed out) and cannot
176 The base class version always returns @true, thus making all items
180 The item whose enabled status is requested.
182 The column of the item whose enabled status is requested.
184 @true if this item should be enabled, @false otherwise.
186 @note Currently disabling items is fully implemented only for the
187 native control implementation in wxOSX/Cocoa and wxGTK.
188 This feature is only partially supported in the generic
189 version (used by wxMSW) and not supported by the wxOSX/Carbon
194 virtual bool IsEnabled(const wxDataViewItem
&item
,
195 unsigned int col
) const;
198 Override this so the control can query the child items of an item.
199 Returns the number of items.
201 virtual unsigned int GetChildren(const wxDataViewItem
& item
,
202 wxDataViewItemArray
& children
) const = 0;
205 Override this to indicate the number of columns in the model.
207 virtual unsigned int GetColumnCount() const = 0;
210 Override this to indicate what type of data is stored in the
211 column specified by @a col.
213 This should return a string indicating the type of data as reported by wxVariant.
215 virtual wxString
GetColumnType(unsigned int col
) const = 0;
218 Override this to indicate which wxDataViewItem representing the parent
219 of @a item or an invalid wxDataViewItem if the root item is
222 virtual wxDataViewItem
GetParent(const wxDataViewItem
& item
) const = 0;
225 Override this to indicate the value of @a item.
226 A wxVariant is used to store the data.
228 virtual void GetValue(wxVariant
& variant
, const wxDataViewItem
& item
,
229 unsigned int col
) const = 0;
232 Override this method to indicate if a container item merely acts as a
233 headline (or for categorisation) or if it also acts a normal item with
234 entries for further columns. By default returns @false.
236 virtual bool HasContainerColumns(const wxDataViewItem
& item
) const;
239 Override this to indicate that the model provides a default compare
240 function that the control should use if no wxDataViewColumn has been
241 chosen for sorting. Usually, the user clicks on a column header for
242 sorting, the data will be sorted alphanumerically.
244 If any other order (e.g. by index or order of appearance) is required,
245 then this should be used.
246 See wxDataViewIndexListModel for a model which makes use of this.
248 virtual bool HasDefaultCompare() const;
251 Return true if there is a value in the given column of this item.
253 All normal items have values in all columns but the container items
254 only show their label in the first column (@a col == 0) by default (but
255 see HasContainerColumns()). So this function always returns true for
256 the first column while for the other ones it returns true only if the
257 item is not a container or HasContainerColumns() was overridden to
262 bool HasValue(const wxDataViewItem
& item
, unsigned col
) const;
265 Override this to indicate of @a item is a container, i.e. if
266 it can have child items.
268 virtual bool IsContainer(const wxDataViewItem
& item
) const = 0;
271 Call this to inform the model that an item has been added to the data.
273 bool ItemAdded(const wxDataViewItem
& parent
,
274 const wxDataViewItem
& item
);
277 Call this to inform the model that an item has changed.
279 This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
280 event (in which the column fields will not be set) to the user.
282 bool ItemChanged(const wxDataViewItem
& item
);
285 Call this to inform the model that an item has been deleted from the data.
287 bool ItemDeleted(const wxDataViewItem
& parent
,
288 const wxDataViewItem
& item
);
291 Call this to inform the model that several items have been added to the data.
293 bool ItemsAdded(const wxDataViewItem
& parent
,
294 const wxDataViewItemArray
& items
);
297 Call this to inform the model that several items have changed.
299 This will eventually emit @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
300 events (in which the column fields will not be set) to the user.
302 bool ItemsChanged(const wxDataViewItemArray
& items
);
305 Call this to inform the model that several items have been deleted.
307 bool ItemsDeleted(const wxDataViewItem
& parent
,
308 const wxDataViewItemArray
& items
);
311 Remove the @a notifier from the list of notifiers.
313 void RemoveNotifier(wxDataViewModelNotifier
* notifier
);
316 Call this to initiate a resort after the sort function has been changed.
318 virtual void Resort();
321 This gets called in order to set a value in the data model.
323 The most common scenario is that the wxDataViewCtrl calls this method
324 after the user changed some data in the view.
326 This is the function you need to override in your derived class but if
327 you want to call it, ChangeValue() is usually more convenient as
328 otherwise you need to manually call ValueChanged() to update the
331 virtual bool SetValue(const wxVariant
& variant
,
332 const wxDataViewItem
& item
,
333 unsigned int col
) = 0;
336 Call this to inform this model that a value in the model has been changed.
337 This is also called from wxDataViewCtrl's internal editing code, e.g. when
338 editing a text field in the control.
340 This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
343 virtual bool ValueChanged(const wxDataViewItem
& item
,
349 Destructor. This should not be called directly. Use DecRef() instead.
351 virtual ~wxDataViewModel();
357 @class wxDataViewListModel
359 Base class with abstract API for wxDataViewIndexListModel and
360 wxDataViewVirtualListModel.
365 class wxDataViewListModel
: public wxDataViewModel
372 virtual ~wxDataViewIndexListModel();
375 Compare method that sorts the items by their index.
377 int Compare(const wxDataViewItem
& item1
,
378 const wxDataViewItem
& item2
,
379 unsigned int column
, bool ascending
);
382 Override this to indicate that the row has special font attributes.
383 This only affects the wxDataViewTextRendererText() renderer.
385 The base class version always simply returns @false.
387 @see wxDataViewItemAttr.
390 The row for which the attribute is requested.
392 The column for which the attribute is requested.
394 The attribute to be filled in if the function returns @true.
396 @true if this item has an attribute or @false otherwise.
398 virtual bool GetAttrByRow(unsigned int row
, unsigned int col
,
399 wxDataViewItemAttr
& attr
) const;
402 Override this if you want to disable specific items.
404 The base class version always returns @true, thus making all items
408 The row of the item whose enabled status is requested.
410 The column of the item whose enabled status is requested.
412 @true if the item at this row and column should be enabled,
415 @note See wxDataViewModel::IsEnabled() for the current status of
416 support for disabling the items under different platforms.
420 virtual bool IsEnabledByRow(unsigned int row
,
421 unsigned int col
) const;
424 Returns the number of items (or rows) in the list.
426 unsigned int GetCount() const;
429 Returns the wxDataViewItem at the given @e row.
431 wxDataViewItem
GetItem(unsigned int row
) const;
434 Returns the position of given @e item.
436 unsigned int GetRow(const wxDataViewItem
& item
) const;
439 Override this to allow getting values from the model.
441 virtual void GetValueByRow(wxVariant
& variant
, unsigned int row
,
442 unsigned int col
) const = 0;
445 Call this after if the data has to be read again from the model.
446 This is useful after major changes when calling the methods below
447 (possibly thousands of times) doesn't make sense.
449 void Reset(unsigned int new_size
);
452 Call this after a row has been appended to the model.
457 Call this after a row has been changed.
459 void RowChanged(unsigned int row
);
462 Call this after a row has been deleted.
464 void RowDeleted(unsigned int row
);
467 Call this after a row has been inserted at the given position.
469 void RowInserted(unsigned int before
);
472 Call this after a row has been prepended to the model.
477 Call this after a value has been changed.
479 void RowValueChanged(unsigned int row
, unsigned int col
);
482 Call this after rows have been deleted.
483 The array will internally get copied and sorted in descending order so
484 that the rows with the highest position will be deleted first.
486 void RowsDeleted(const wxArrayInt
& rows
);
489 Called in order to set a value in the model.
491 virtual bool SetValueByRow(const wxVariant
& variant
, unsigned int row
,
492 unsigned int col
) = 0;
497 @class wxDataViewIndexListModel
499 wxDataViewIndexListModel is a specialized data model which lets you address
500 an item by its position (row) rather than its wxDataViewItem (which you can
501 obtain from this class).
502 This model also provides its own wxDataViewIndexListModel::Compare
503 method which sorts the model's data by the index.
505 This model is not a virtual model since the control stores each wxDataViewItem.
506 Use wxDataViewVirtualListModel if you need to display millions of items or
507 have other reason to use a virtual control.
509 @see wxDataViewListModel for the API.
515 class wxDataViewIndexListModel
: public wxDataViewListModel
521 wxDataViewIndexListModel(unsigned int initial_size
= 0);
526 @class wxDataViewVirtualListModel
528 wxDataViewVirtualListModel is a specialized data model which lets you address
529 an item by its position (row) rather than its wxDataViewItem and as such offers
530 the exact same interface as wxDataViewIndexListModel.
531 The important difference is that under platforms other than OS X, using this
532 model will result in a truly virtual control able to handle millions of items
533 as the control doesn't store any item (a feature not supported by OS X).
535 @see wxDataViewListModel for the API.
541 class wxDataViewVirtualListModel
: public wxDataViewListModel
547 wxDataViewVirtualListModel(unsigned int initial_size
= 0);
554 @class wxDataViewItemAttr
556 This class is used to indicate to a wxDataViewCtrl that a certain item
557 (see wxDataViewItem) has extra font attributes for its renderer.
558 For this, it is required to override wxDataViewModel::GetAttr.
560 Attributes are currently only supported by wxDataViewTextRendererText.
565 class wxDataViewItemAttr
571 wxDataViewItemAttr();
574 Call this to indicate that the item shall be displayed in bold text.
576 void SetBold(bool set
);
579 Call this to indicate that the item shall be displayed with that colour.
581 void SetColour(const wxColour
& colour
);
584 Call this to indicate that the item shall be displayed in italic text.
586 void SetItalic(bool set
);
592 @class wxDataViewItem
594 wxDataViewItem is a small opaque class that represents an item in a wxDataViewCtrl
595 in a persistent way, i.e. independent of the position of the item in the control
596 or changes to its contents.
598 It must hold a unique ID of type @e void* in its only field and can be converted
601 If the ID is @NULL the wxDataViewItem is invalid and wxDataViewItem::IsOk will
602 return @false which used in many places in the API of wxDataViewCtrl to
603 indicate that e.g. no item was found. An ID of @NULL is also used to indicate
604 the invisible root. Examples for this are wxDataViewModel::GetParent and
605 wxDataViewModel::GetChildren.
618 wxDataViewItem(const wxDataViewItem
& item
);
619 explicit wxDataViewItem(void* id
);
628 Returns @true if the ID is not @NULL.
636 @class wxDataViewCtrl
638 wxDataViewCtrl is a control to display data either in a tree like fashion or
639 in a tabular form or both.
641 If you only need to display a simple tree structure with an API more like the
642 older wxTreeCtrl class, then the specialized wxDataViewTreeCtrl can be used.
643 Likewise, if you only want to display simple table structure you can use
644 the specialized wxDataViewListCtrl class. Both wxDataViewTreeCtrl and
645 wxDataViewListCtrl can be used without defining your own wxDataViewModel.
647 A wxDataViewItem is used to represent a (visible) item in the control.
649 Unlike wxListCtrl, wxDataViewCtrl doesn't get its data from the user through
650 virtual functions or by setting it directly. Instead you need to write your own
651 wxDataViewModel and associate it with this control.
652 Then you need to add a number of wxDataViewColumn to this control to define
653 what each column shall display. Each wxDataViewColumn in turn owns 1 instance
654 of a wxDataViewRenderer to render its cells.
656 A number of standard renderers for rendering text, dates, images, toggle,
657 a progress bar etc. are provided. Additionally, the user can write custom
658 renderers deriving from wxDataViewCustomRenderer for displaying anything.
660 All data transfer from the control to the model and the user code is done
661 through wxVariant which can be extended to support more data formats as necessary.
662 Accordingly, all type information uses the strings returned from wxVariant::GetType.
666 Single selection mode. This is the default.
667 @style{wxDV_MULTIPLE}
668 Multiple selection mode.
669 @style{wxDV_ROW_LINES}
670 Use alternating colours for rows if supported by platform and theme.
671 Currently only supported by the native GTK and OS X implementations
672 but not by the generic one.
673 @style{wxDV_HORIZ_RULES}
674 Display fine rules between row if supported.
675 @style{wxDV_VERT_RULES}
676 Display fine rules between columns is supported.
677 @style{wxDV_VARIABLE_LINE_HEIGHT}
678 Allow variable line heights.
679 This can be inefficient when displaying large number of items.
680 @style{wxDV_NO_HEADER}
681 Do not show column headers (which are shown by default).
684 @beginEventEmissionTable{wxDataViewEvent}
685 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
686 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
687 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
688 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
689 @event{EVT_DATAVIEW_ITEM_START_EDITING(id, func)}
690 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event. This
691 event can be vetoed in order to prevent editing on an item by item
692 basis. Still experimental.
693 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
694 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
695 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
696 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
697 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
698 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
699 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
700 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
701 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
702 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
703 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
704 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
705 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
706 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
707 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
708 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
709 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
710 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
711 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
712 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
713 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
714 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
715 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
716 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
717 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
718 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
719 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
720 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
721 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
722 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
727 @appearance{dataviewctrl.png}
729 class wxDataViewCtrl
: public wxControl
738 Constructor. Calls Create().
740 wxDataViewCtrl(wxWindow
* parent
, wxWindowID id
,
741 const wxPoint
& pos
= wxDefaultPosition
,
742 const wxSize
& size
= wxDefaultSize
,
744 const wxValidator
& validator
= wxDefaultValidator
,
745 const wxString
& name
= wxDataViewCtrlNameStr
);
750 virtual ~wxDataViewCtrl();
753 Appends a wxDataViewColumn to the control. Returns @true on success.
755 Note that there is a number of short cut methods which implicitly create
756 a wxDataViewColumn and a wxDataViewRenderer for it (see below).
758 virtual bool AppendColumn(wxDataViewColumn
* col
);
761 Prepends a wxDataViewColumn to the control. Returns @true on success.
763 Note that there is a number of short cut methods which implicitly create
764 a wxDataViewColumn and a wxDataViewRenderer for it.
766 virtual bool PrependColumn(wxDataViewColumn
* col
);
769 Inserts a wxDataViewColumn to the control. Returns @true on success.
771 virtual bool InsertColumn(unsigned int pos
, wxDataViewColumn
* col
);
775 Appends a column for rendering a bitmap. Returns the wxDataViewColumn
776 created in the function or @NULL on failure.
778 wxDataViewColumn
* AppendBitmapColumn(const wxString
& label
,
779 unsigned int model_column
,
780 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
782 wxAlignment align
= wxALIGN_CENTER
,
783 int flags
= wxDATAVIEW_COL_RESIZABLE
);
784 wxDataViewColumn
* AppendBitmapColumn(const wxBitmap
& label
,
785 unsigned int model_column
,
786 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
788 wxAlignment align
= wxALIGN_CENTER
,
789 int flags
= wxDATAVIEW_COL_RESIZABLE
);
794 Appends a column for rendering a date. Returns the wxDataViewColumn
795 created in the function or @NULL on failure.
797 @note The @a align parameter is applied to both the column header and
800 wxDataViewColumn
* AppendDateColumn(const wxString
& label
,
801 unsigned int model_column
,
802 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
804 wxAlignment align
= wxALIGN_NOT
,
805 int flags
= wxDATAVIEW_COL_RESIZABLE
);
806 wxDataViewColumn
* AppendDateColumn(const wxBitmap
& label
,
807 unsigned int model_column
,
808 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
810 wxAlignment align
= wxALIGN_NOT
,
811 int flags
= wxDATAVIEW_COL_RESIZABLE
);
816 Appends a column for rendering text with an icon. Returns the wxDataViewColumn
817 created in the function or @NULL on failure.
818 This method uses the wxDataViewIconTextRenderer class.
820 @note The @a align parameter is applied to both the column header and
823 wxDataViewColumn
* AppendIconTextColumn(const wxString
& label
,
824 unsigned int model_column
,
825 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
827 wxAlignment align
= wxALIGN_NOT
,
828 int flags
= wxDATAVIEW_COL_RESIZABLE
);
829 wxDataViewColumn
* AppendIconTextColumn(const wxBitmap
& label
,
830 unsigned int model_column
,
831 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
833 wxAlignment align
= wxALIGN_NOT
,
834 int flags
= wxDATAVIEW_COL_RESIZABLE
);
839 Appends a column for rendering a progress indicator. Returns the
840 wxDataViewColumn created in the function or @NULL on failure.
842 @note The @a align parameter is applied to both the column header and
845 wxDataViewColumn
* AppendProgressColumn(const wxString
& label
,
846 unsigned int model_column
,
847 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
849 wxAlignment align
= wxALIGN_CENTER
,
850 int flags
= wxDATAVIEW_COL_RESIZABLE
);
851 wxDataViewColumn
* AppendProgressColumn(const wxBitmap
& label
,
852 unsigned int model_column
,
853 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
855 wxAlignment align
= wxALIGN_CENTER
,
856 int flags
= wxDATAVIEW_COL_RESIZABLE
);
861 Appends a column for rendering text. Returns the wxDataViewColumn
862 created in the function or @NULL on failure.
864 @note The @a align parameter is applied to both the column header and
867 wxDataViewColumn
* AppendTextColumn(const wxString
& label
,
868 unsigned int model_column
,
869 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
871 wxAlignment align
= wxALIGN_NOT
,
872 int flags
= wxDATAVIEW_COL_RESIZABLE
);
873 wxDataViewColumn
* AppendTextColumn(const wxBitmap
& label
,
874 unsigned int model_column
,
875 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
877 wxAlignment align
= wxALIGN_NOT
,
878 int flags
= wxDATAVIEW_COL_RESIZABLE
);
883 Appends a column for rendering a toggle. Returns the wxDataViewColumn
884 created in the function or @NULL on failure.
886 @note The @a align parameter is applied to both the column header and
889 wxDataViewColumn
* AppendToggleColumn(const wxString
& label
,
890 unsigned int model_column
,
891 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
893 wxAlignment align
= wxALIGN_CENTER
,
894 int flags
= wxDATAVIEW_COL_RESIZABLE
);
895 wxDataViewColumn
* AppendToggleColumn(const wxBitmap
& label
,
896 unsigned int model_column
,
897 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
899 wxAlignment align
= wxALIGN_CENTER
,
900 int flags
= wxDATAVIEW_COL_RESIZABLE
);
904 Associates a wxDataViewModel with the control.
905 This increases the reference count of the model by 1.
907 virtual bool AssociateModel(wxDataViewModel
* model
);
912 virtual bool ClearColumns();
917 virtual void Collapse(const wxDataViewItem
& item
);
920 Create the control. Useful for two step creation.
922 bool Create(wxWindow
* parent
, wxWindowID id
,
923 const wxPoint
& pos
= wxDefaultPosition
,
924 const wxSize
& size
= wxDefaultSize
,
926 const wxValidator
& validator
= wxDefaultValidator
,
927 const wxString
& name
= wxDataViewCtrlNameStr
);
930 Deletes given column.
932 virtual bool DeleteColumn(wxDataViewColumn
* column
);
935 Enable drag operations using the given @a format.
937 virtual bool EnableDragSource( const wxDataFormat
&format
);
940 Enable drop operations using the given @a format.
942 virtual bool EnableDropTarget( const wxDataFormat
&format
);
945 Call this to ensure that the given item is visible.
947 virtual void EnsureVisible(const wxDataViewItem
& item
,
948 const wxDataViewColumn
* column
= NULL
);
953 virtual void Expand(const wxDataViewItem
& item
);
956 Expands all ancestors of the @a item. This method also
957 ensures that the item itself as well as all ancestor
958 items have been read from the model by the control.
960 virtual void ExpandAncestors( const wxDataViewItem
& item
);
963 Returns pointer to the column. @a pos refers to the position in the
964 control which may change after reordering columns by the user.
966 virtual wxDataViewColumn
* GetColumn(unsigned int pos
) const;
969 Returns the number of columns.
971 virtual unsigned int GetColumnCount() const;
974 Returns the position of the column or -1 if not found in the control.
976 virtual int GetColumnPosition(const wxDataViewColumn
* column
) const;
979 Returns column containing the expanders.
981 wxDataViewColumn
* GetExpanderColumn() const;
984 Returns the currently focused item.
986 This is the item that the keyboard commands apply to. It may be invalid
987 if there is no focus currently.
989 This method is mostly useful for the controls with @c wxDV_MULTIPLE
990 style as in the case of single selection it returns the same thing as
993 Notice that under all platforms except Mac OS X the currently focused
994 item may be selected or not but under OS X the current item is always
997 @see SetCurrentItem()
1001 wxDataViewItem
GetCurrentItem() const;
1004 Returns indentation.
1006 int GetIndent() const;
1011 virtual wxRect
GetItemRect(const wxDataViewItem
& item
,
1012 const wxDataViewColumn
* col
= NULL
) const;
1015 Returns pointer to the data model associated with the control (if any).
1017 wxDataViewModel
* GetModel();
1020 Returns first selected item or an invalid item if none is selected.
1022 virtual wxDataViewItem
GetSelection() const;
1025 Fills @a sel with currently selected items and returns their number.
1027 virtual int GetSelections(wxDataViewItemArray
& sel
) const;
1030 Returns the wxDataViewColumn currently responsible for sorting
1031 or @NULL if none has been selected.
1033 virtual wxDataViewColumn
* GetSortingColumn() const;
1038 virtual void HitTest(const wxPoint
& point
, wxDataViewItem
& item
,
1039 wxDataViewColumn
*& col
) const;
1042 Return @true if the item is expanded.
1044 virtual bool IsExpanded(const wxDataViewItem
& item
) const;
1047 Return @true if the item is selected.
1049 virtual bool IsSelected(const wxDataViewItem
& item
) const;
1052 Select the given item.
1054 In single selection mode this changes the (unique) currently selected
1055 item. In multi selection mode, the @a item is selected and the
1056 previously selected items remain selected.
1058 virtual void Select(const wxDataViewItem
& item
);
1063 virtual void SelectAll();
1066 Set which column shall contain the tree-like expanders.
1068 void SetExpanderColumn(wxDataViewColumn
* col
);
1071 Changes the currently focused item.
1073 The @a item parameter must be valid, there is no way to remove the
1074 current item from the control.
1076 In single selection mode, calling this method is the same as calling
1077 Select() and is thus not very useful. In multiple selection mode this
1078 method only moves the current item however without changing the
1079 selection except under OS X where the current item is always selected,
1080 so calling SetCurrentItem() selects @a item if it hadn't been selected
1083 @see GetCurrentItem()
1087 void SetCurrentItem(const wxDataViewItem
& item
);
1090 Sets the indentation.
1092 void SetIndent(int indent
);
1095 Sets the selection to the array of wxDataViewItems.
1097 virtual void SetSelections(const wxDataViewItemArray
& sel
);
1100 Programmatically starts editing the given item on the given column.
1101 Currently not implemented on wxOSX Carbon.
1105 virtual void StartEditor(const wxDataViewItem
& item
, unsigned int column
);
1108 Unselect the given item.
1110 virtual void Unselect(const wxDataViewItem
& item
);
1114 This method only has effect if multiple selections are allowed.
1116 virtual void UnselectAll();
1119 Sets the row height.
1121 This function can only be used when all rows have the same height, i.e.
1122 when wxDV_VARIABLE_LINE_HEIGHT flag is not used.
1124 Currently this is implemented in the generic and native GTK versions
1125 only and nothing is done (and @false returned) when using OS X port.
1127 Also notice that this method can only be used to increase the row
1128 height compared with the default one (as determined by the return value
1129 of wxDataViewRenderer::GetSize()), if it is set to a too small value
1130 then the minimum required by the renderers will be used.
1132 @return @true if the line height was changed or @false otherwise.
1136 virtual bool SetRowHeight(int rowHeight
);
1142 @class wxDataViewModelNotifier
1144 A wxDataViewModelNotifier instance is owned by a wxDataViewModel and mirrors
1145 its notification interface.
1146 See the documentation of that class for further information.
1151 class wxDataViewModelNotifier
1157 wxDataViewModelNotifier();
1162 virtual ~wxDataViewModelNotifier();
1165 Called by owning model.
1167 virtual bool Cleared() = 0;
1170 Get owning wxDataViewModel.
1172 wxDataViewModel
* GetOwner() const;
1175 Called by owning model.
1177 virtual bool ItemAdded(const wxDataViewItem
& parent
,
1178 const wxDataViewItem
& item
) = 0;
1181 Called by owning model.
1183 virtual bool ItemChanged(const wxDataViewItem
& item
) = 0;
1186 Called by owning model.
1188 virtual bool ItemDeleted(const wxDataViewItem
& parent
,
1189 const wxDataViewItem
& item
) = 0;
1192 Called by owning model.
1194 virtual bool ItemsAdded(const wxDataViewItem
& parent
,
1195 const wxDataViewItemArray
& items
);
1198 Called by owning model.
1200 virtual bool ItemsChanged(const wxDataViewItemArray
& items
);
1203 Called by owning model.
1205 virtual bool ItemsDeleted(const wxDataViewItem
& parent
,
1206 const wxDataViewItemArray
& items
);
1209 Called by owning model.
1211 virtual void Resort() = 0;
1214 Set owner of this notifier. Used internally.
1216 void SetOwner(wxDataViewModel
* owner
);
1219 Called by owning model.
1221 virtual bool ValueChanged(const wxDataViewItem
& item
, unsigned int col
) = 0;
1226 The mode of a data-view cell; see wxDataViewRenderer for more info.
1228 enum wxDataViewCellMode
1230 wxDATAVIEW_CELL_INERT
,
1233 Indicates that the user can double click the cell and something will
1234 happen (e.g. a window for editing a date will pop up).
1236 wxDATAVIEW_CELL_ACTIVATABLE
,
1239 Indicates that the user can edit the data in-place, i.e. an control
1240 will show up after a slow click on the cell. This behaviour is best
1241 known from changing the filename in most file managers etc.
1243 wxDATAVIEW_CELL_EDITABLE
1247 The values of this enum controls how a wxDataViewRenderer should display
1248 its contents in a cell.
1250 enum wxDataViewCellRenderState
1252 wxDATAVIEW_CELL_SELECTED
= 1,
1253 wxDATAVIEW_CELL_PRELIT
= 2,
1254 wxDATAVIEW_CELL_INSENSITIVE
= 4,
1255 wxDATAVIEW_CELL_FOCUSED
= 8
1259 @class wxDataViewRenderer
1261 This class is used by wxDataViewCtrl to render the individual cells.
1262 One instance of a renderer class is owned by a wxDataViewColumn.
1263 There is a number of ready-to-use renderers provided:
1264 - wxDataViewTextRenderer,
1265 - wxDataViewIconTextRenderer,
1266 - wxDataViewToggleRenderer,
1267 - wxDataViewProgressRenderer,
1268 - wxDataViewBitmapRenderer,
1269 - wxDataViewDateRenderer,
1270 - wxDataViewSpinRenderer.
1271 - wxDataViewChoiceRenderer.
1273 Additionally, the user can write own renderers by deriving from
1274 wxDataViewCustomRenderer.
1276 The ::wxDataViewCellMode and ::wxDataViewCellRenderState flags accepted
1277 by the constructors respectively controls what actions the cell data allows
1278 and how the renderer should display its contents in a cell.
1283 class wxDataViewRenderer
: public wxObject
1289 wxDataViewRenderer(const wxString
& varianttype
,
1290 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1291 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1294 Enable or disable replacing parts of the item text with ellipsis to
1295 make it fit the column width.
1297 This method only makes sense for the renderers working with text, such
1298 as wxDataViewTextRenderer or wxDataViewIconTextRenderer.
1300 By default wxELLIPSIZE_MIDDLE is used.
1303 Ellipsization mode, use wxELLIPSIZE_NONE to disable.
1307 void EnableEllipsize(wxEllipsizeMode mode
= wxELLIPSIZE_MIDDLE
);
1310 Disable replacing parts of the item text with ellipsis.
1312 If ellipsizing is disabled, the string will be truncated if it doesn't
1315 This is the same as @code EnableEllipsize(wxELLIPSIZE_NONE) @endcode.
1319 void DisableEllipsize();
1322 Returns the alignment. See SetAlignment()
1324 virtual int GetAlignment() const;
1327 Returns the ellipsize mode used by the renderer.
1329 If the return value is wxELLIPSIZE_NONE, the text is simply truncated
1332 @see EnableEllipsize()
1334 wxEllipsizeMode
GetEllipsizeMode() const;
1337 Returns the cell mode.
1339 virtual wxDataViewCellMode
GetMode() const;
1342 Returns pointer to the owning wxDataViewColumn.
1344 wxDataViewColumn
* GetOwner() const;
1347 This methods retrieves the value from the renderer in order to
1348 transfer the value back to the data model.
1350 Returns @false on failure.
1352 virtual bool GetValue(wxVariant
& value
) const = 0;
1355 Returns a string with the type of the wxVariant supported by this renderer.
1357 wxString
GetVariantType() const;
1360 Sets the alignment of the renderer's content.
1361 The default value of @c wxDVR_DEFAULT_ALIGMENT indicates that the content
1362 should have the same alignment as the column header.
1364 The method is not implemented under OS X and the renderer always aligns
1365 its contents as the column header on that platform. The other platforms
1366 support both vertical and horizontal alignment.
1368 virtual void SetAlignment( int align
);
1370 Sets the owning wxDataViewColumn.
1371 This is usually called from within wxDataViewColumn.
1373 void SetOwner(wxDataViewColumn
* owner
);
1376 Set the value of the renderer (and thus its cell) to @a value.
1377 The internal code will then render this cell with this data.
1379 virtual bool SetValue(const wxVariant
& value
) = 0;
1382 Before data is committed to the data model, it is passed to this
1383 method where it can be checked for validity. This can also be
1384 used for checking a valid range or limiting the user input in
1385 a certain aspect (e.g. max number of characters or only alphanumeric
1386 input, ASCII only etc.). Return @false if the value is not valid.
1388 Please note that due to implementation limitations, this validation
1389 is done after the editing control already is destroyed and the
1390 editing process finished.
1392 virtual bool Validate(wxVariant
& value
);
1398 @class wxDataViewTextRenderer
1400 wxDataViewTextRenderer is used for rendering text.
1401 It supports in-place editing if desired.
1406 class wxDataViewTextRenderer
: public wxDataViewRenderer
1412 wxDataViewTextRenderer(const wxString
& varianttype
= "string",
1413 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1414 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1420 @class wxDataViewIconTextRenderer
1422 The wxDataViewIconTextRenderer class is used to display text with
1423 a small icon next to it as it is typically done in a file manager.
1425 This classes uses the wxDataViewIconText helper class to store its data.
1426 wxDataViewIconText can be converted to and from a wxVariant using the left
1432 class wxDataViewIconTextRenderer
: public wxDataViewRenderer
1438 wxDataViewIconTextRenderer(const wxString
& varianttype
= "wxDataViewIconText",
1439 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1440 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1446 @class wxDataViewProgressRenderer
1448 This class is used by wxDataViewCtrl to render progress bars.
1453 class wxDataViewProgressRenderer
: public wxDataViewRenderer
1459 wxDataViewProgressRenderer(const wxString
& label
= wxEmptyString
,
1460 const wxString
& varianttype
= "long",
1461 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1462 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1468 @class wxDataViewSpinRenderer
1470 This is a specialized renderer for rendering integer values.
1471 It supports modifying the values in-place by using a wxSpinCtrl.
1472 The renderer only support variants of type @e long.
1477 class wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
1482 @a min and @a max indicate the minimum and maximum values for the wxSpinCtrl.
1484 wxDataViewSpinRenderer(int min
, int max
,
1485 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1486 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1492 @class wxDataViewToggleRenderer
1494 This class is used by wxDataViewCtrl to render toggle controls.
1499 class wxDataViewToggleRenderer
: public wxDataViewRenderer
1505 wxDataViewToggleRenderer(const wxString
& varianttype
= "bool",
1506 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1507 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1512 @class wxDataViewChoiceRenderer
1514 This class is used by wxDataViewCtrl to render choice controls.
1515 It stores a string so that SetValue() and GetValue() operate
1516 on a variant holding a string.
1522 class wxDataViewChoiceRenderer
: public wxDataViewRenderer
1528 wxDataViewChoiceRenderer( const wxArrayString
&choices
,
1529 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1530 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
1533 Returns the choice referred to by index.
1535 wxString
GetChoice(size_t index
) const;
1538 Returns all choices.
1540 const wxArrayString
& GetChoices() const;
1545 @class wxDataViewDateRenderer
1547 This class is used by wxDataViewCtrl to render calendar controls.
1552 class wxDataViewDateRenderer
: public wxDataViewRenderer
1558 wxDataViewDateRenderer(const wxString
& varianttype
= "datetime",
1559 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1560 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1566 @class wxDataViewCustomRenderer
1568 You need to derive a new class from wxDataViewCustomRenderer in
1569 order to write a new renderer.
1571 You need to override at least wxDataViewRenderer::SetValue, wxDataViewRenderer::GetValue,
1572 wxDataViewCustomRenderer::GetSize and wxDataViewCustomRenderer::Render.
1574 If you want your renderer to support in-place editing then you also need to override
1575 wxDataViewCustomRenderer::HasEditorCtrl, wxDataViewCustomRenderer::CreateEditorCtrl
1576 and wxDataViewCustomRenderer::GetValueFromEditorCtrl.
1578 Note that a special event handler will be pushed onto that editor control
1579 which handles @e \<ENTER\> and focus out events in order to end the editing.
1584 class wxDataViewCustomRenderer
: public wxDataViewRenderer
1590 wxDataViewCustomRenderer(const wxString
& varianttype
= "string",
1591 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1592 int align
= -1, bool no_init
= false);
1597 virtual ~wxDataViewCustomRenderer();
1600 Override this to react to double clicks or ENTER.
1601 This method will only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
1603 virtual bool Activate( const wxRect
& cell
,
1604 wxDataViewModel
* model
,
1605 const wxDataViewItem
& item
,
1609 Override this to create the actual editor control once editing
1612 @a parent is the parent of the editor control, @a labelRect indicates the
1613 position and size of the editor control and @a value is its initial value:
1617 return new wxSpinCtrl( parent, wxID_ANY, wxEmptyString,
1618 labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l );
1622 virtual wxWindow
* CreateEditorCtrl(wxWindow
* parent
,
1624 const wxVariant
& value
);
1627 Return the attribute to be used for rendering.
1629 This function may be called from Render() implementation to use the
1630 attributes defined for the item if the renderer supports them.
1632 Notice that when Render() is called, the wxDC object passed to it is
1633 already set up to use the correct attributes (e.g. its font is set to
1634 bold or italic version if wxDataViewItemAttr::GetBold() or GetItalic()
1635 returns true) so it may not be necessary to call it explicitly if you
1636 only want to render text using the items attributes.
1640 const wxDataViewItemAttr
& GetAttr() const;
1643 Return size required to show content.
1645 virtual wxSize
GetSize() const = 0;
1648 Override this so that the renderer can get the value from the editor
1649 control (pointed to by @a editor):
1652 wxSpinCtrl *sc = (wxSpinCtrl*) editor;
1653 long l = sc->GetValue();
1659 virtual bool GetValueFromEditorCtrl(wxWindow
* editor
,
1663 Override this and make it return @true in order to
1664 indicate that this renderer supports in-place editing.
1666 virtual bool HasEditorCtrl() const;
1669 Override this to react to a left click.
1670 This method will only be called in @c wxDATAVIEW_CELL_ACTIVATABLE mode.
1672 virtual bool LeftClick( const wxPoint
& cursor
,
1674 wxDataViewModel
* model
,
1675 const wxDataViewItem
& item
,
1679 Override this to render the cell.
1680 Before this is called, wxDataViewRenderer::SetValue was called
1681 so that this instance knows what to render.
1683 virtual bool Render(wxRect cell
, wxDC
* dc
, int state
) = 0;
1686 This method should be called from within Render() whenever you need to
1688 This will ensure that the correct colour, font and vertical alignment will
1689 be chosen so the text will look the same as text drawn by native renderers.
1691 void RenderText(const wxString
& text
, int xoffset
, wxRect cell
,
1692 wxDC
* dc
, int state
);
1695 Override this to start a drag operation. Not yet supported.
1697 virtual bool StartDrag(const wxPoint
& cursor
,
1699 wxDataViewModel
* model
,
1700 const wxDataViewItem
& item
,
1707 @class wxDataViewBitmapRenderer
1709 This class is used by wxDataViewCtrl to render bitmap controls.
1714 class wxDataViewBitmapRenderer
: public wxDataViewRenderer
1720 wxDataViewBitmapRenderer(const wxString
& varianttype
= "wxBitmap",
1721 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1722 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1727 The flags used by wxDataViewColumn.
1728 Can be combined together.
1730 enum wxDataViewColumnFlags
1732 wxDATAVIEW_COL_RESIZABLE
= 1,
1733 wxDATAVIEW_COL_SORTABLE
= 2,
1734 wxDATAVIEW_COL_REORDERABLE
= 4,
1735 wxDATAVIEW_COL_HIDDEN
= 8
1739 @class wxDataViewColumn
1741 This class represents a column in a wxDataViewCtrl.
1742 One wxDataViewColumn is bound to one column in the data model to which the
1743 wxDataViewCtrl has been associated.
1745 An instance of wxDataViewRenderer is used by this class to render its data.
1750 class wxDataViewColumn
: public wxSettableHeaderColumn
1754 Constructs a text column.
1757 The title of the column.
1759 The class which will render the contents of this column.
1761 The index of the model's column which is associated with this object.
1763 The width of the column.
1764 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1766 The alignment of the column title.
1768 One or more flags of the ::wxDataViewColumnFlags enumeration.
1770 wxDataViewColumn(const wxString
& title
,
1771 wxDataViewRenderer
* renderer
,
1772 unsigned int model_column
,
1773 int width
= wxDVC_DEFAULT_WIDTH
,
1774 wxAlignment align
= wxALIGN_CENTER
,
1775 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1778 Constructs a bitmap column.
1781 The bitmap of the column.
1783 The class which will render the contents of this column.
1785 The index of the model's column which is associated with this object.
1787 The width of the column.
1788 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1790 The alignment of the column title.
1792 One or more flags of the ::wxDataViewColumnFlags enumeration.
1794 wxDataViewColumn(const wxBitmap
& bitmap
,
1795 wxDataViewRenderer
* renderer
,
1796 unsigned int model_column
,
1797 int width
= wxDVC_DEFAULT_WIDTH
,
1798 wxAlignment align
= wxALIGN_CENTER
,
1799 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1802 Returns the index of the column of the model, which this
1803 wxDataViewColumn is displaying.
1805 unsigned int GetModelColumn() const;
1808 Returns the owning wxDataViewCtrl.
1810 wxDataViewCtrl
* GetOwner() const;
1813 Returns the renderer of this wxDataViewColumn.
1815 @see wxDataViewRenderer.
1817 wxDataViewRenderer
* GetRenderer() const;
1823 @class wxDataViewListCtrl
1825 This class is a wxDataViewCtrl which internally uses a wxDataViewListStore
1826 and forwards most of its API to that class.
1828 The purpose of this class is to offer a simple way to display and
1829 edit a small table of data without having to write your own wxDataViewModel.
1832 wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, wxID_ANY );
1834 listctrl->AppendToggleColumn( "Toggle" );
1835 listctrl->AppendTextColumn( "Text" );
1837 wxVector<wxVariant> data;
1838 data.push_back( wxVariant(true) );
1839 data.push_back( wxVariant("row 1") );
1840 listctrl->AppendItem( data );
1843 data.push_back( wxVariant(false) );
1844 data.push_back( wxVariant("row 3") );
1845 listctrl->AppendItem( data );
1849 See wxDataViewCtrl for the list of supported styles.
1852 @beginEventEmissionTable
1853 See wxDataViewCtrl for the list of events emitted by this class.
1859 class wxDataViewListCtrl
: public wxDataViewCtrl
1865 wxDataViewListCtrl();
1868 Constructor. Calls Create().
1870 wxDataViewListCtrl( wxWindow
*parent
, wxWindowID id
,
1871 const wxPoint
& pos
= wxDefaultPosition
,
1872 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_ROW_LINES
,
1873 const wxValidator
& validator
= wxDefaultValidator
);
1876 Destructor. Deletes the image list if any.
1878 ~wxDataViewListCtrl();
1881 Creates the control and a wxDataViewListStore as its internal model.
1883 bool Create( wxWindow
*parent
, wxWindowID id
,
1884 const wxPoint
& pos
= wxDefaultPosition
,
1885 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_ROW_LINES
,
1886 const wxValidator
& validator
= wxDefaultValidator
);
1892 wxDataViewListStore
*GetStore();
1893 const wxDataViewListStore
*GetStore() const;
1897 Returns the position of given @e item or wxNOT_FOUND if it's
1902 int ItemToRow(const wxDataViewItem
&item
) const;
1905 Returns the wxDataViewItem at the given @e row.
1909 wxDataViewItem
RowToItem(int row
) const;
1913 @name Selection handling functions
1917 Returns index of the selected row or wxNOT_FOUND.
1919 @see wxDataViewCtrl::GetSelection()
1923 int GetSelectedRow() const;
1928 @see wxDataViewCtrl::Select()
1932 void SelectRow(unsigned row
);
1935 Unselects given row.
1937 @see wxDataViewCtrl::Unselect()
1941 void UnselectRow(unsigned row
);
1944 Returns true if @a row is selected.
1946 @see wxDataViewCtrl::IsSelected()
1950 bool IsRowSelected(unsigned row
) const;
1955 @name Column management functions
1960 Appends a column to the control and additionally appends a
1961 column to the store with the type string.
1963 virtual void AppendColumn( wxDataViewColumn
*column
);
1966 Appends a column to the control and additionally appends a
1967 column to the list store with the type @a varianttype.
1969 void AppendColumn( wxDataViewColumn
*column
, const wxString
&varianttype
);
1972 Appends a text column to the control and the store.
1974 See wxDataViewColumn::wxDataViewColumn for more info about
1977 wxDataViewColumn
*AppendTextColumn( const wxString
&label
,
1978 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1979 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1980 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1983 Appends a toggle column to the control and the store.
1985 See wxDataViewColumn::wxDataViewColumn for more info about
1988 wxDataViewColumn
*AppendToggleColumn( const wxString
&label
,
1989 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1990 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1991 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1994 Appends a progress column to the control and the store.
1996 See wxDataViewColumn::wxDataViewColumn for more info about
1999 wxDataViewColumn
*AppendProgressColumn( const wxString
&label
,
2000 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
2001 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
2002 int flags
= wxDATAVIEW_COL_RESIZABLE
);
2005 Appends an icon-and-text column to the control and the store.
2007 See wxDataViewColumn::wxDataViewColumn for more info about
2010 wxDataViewColumn
*AppendIconTextColumn( const wxString
&label
,
2011 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
2012 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
2013 int flags
= wxDATAVIEW_COL_RESIZABLE
);
2016 Inserts a column to the control and additionally inserts a
2017 column to the store with the type string.
2019 virtual void InsertColumn( unsigned int pos
, wxDataViewColumn
*column
);
2022 Inserts a column to the control and additionally inserts a
2023 column to the list store with the type @a varianttype.
2025 void InsertColumn( unsigned int pos
, wxDataViewColumn
*column
,
2026 const wxString
&varianttype
);
2029 Prepends a column to the control and additionally prepends a
2030 column to the store with the type string.
2032 virtual void PrependColumn( wxDataViewColumn
*column
);
2035 Prepends a column to the control and additionally prepends a
2036 column to the list store with the type @a varianttype.
2038 void PrependColumn( wxDataViewColumn
*column
, const wxString
&varianttype
);
2044 @name Item management functions
2049 Appends an item (=row) to the control and store.
2051 void AppendItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2054 Prepends an item (=row) to the control and store.
2056 void PrependItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2059 Inserts an item (=row) to the control and store.
2061 void InsertItem( unsigned int row
, const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2064 Delete the row at position @a row.
2066 void DeleteItem( unsigned row
);
2069 Delete all items (= all rows).
2071 void DeleteAllItems();
2074 Sets the value in the store and update the control.
2076 void SetValue( const wxVariant
&value
, unsigned int row
, unsigned int col
);
2079 Returns the value from the store.
2081 void GetValue( wxVariant
&value
, unsigned int row
, unsigned int col
);
2084 Sets the value in the store and update the control.
2086 This method assumes that the string is stored in respective
2089 void SetTextValue( const wxString
&value
, unsigned int row
, unsigned int col
);
2092 Returns the value from the store.
2094 This method assumes that the string is stored in respective
2097 wxString
GetTextValue( unsigned int row
, unsigned int col
) const;
2100 Sets the value in the store and update the control.
2102 This method assumes that the boolean value is stored in
2105 void SetToggleValue( bool value
, unsigned int row
, unsigned int col
);
2108 Returns the value from the store.
2110 This method assumes that the boolean value is stored in
2113 bool GetToggleValue( unsigned int row
, unsigned int col
) const;
2120 @class wxDataViewTreeCtrl
2122 This class is a wxDataViewCtrl which internally uses a wxDataViewTreeStore
2123 and forwards most of its API to that class.
2124 Additionally, it uses a wxImageList to store a list of icons.
2126 The main purpose of this class is to provide a simple upgrade path for code
2130 See wxDataViewCtrl for the list of supported styles.
2133 @beginEventEmissionTable
2134 See wxDataViewCtrl for the list of events emitted by this class.
2139 @appearance{dataviewtreectrl.png}
2141 class wxDataViewTreeCtrl
: public wxDataViewCtrl
2147 wxDataViewTreeCtrl();
2154 wxDataViewTreeCtrl(wxWindow
* parent
, wxWindowID id
,
2155 const wxPoint
& pos
= wxDefaultPosition
,
2156 const wxSize
& size
= wxDefaultSize
,
2157 long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
2158 const wxValidator
& validator
= wxDefaultValidator
);
2161 Destructor. Deletes the image list if any.
2163 virtual ~wxDataViewTreeCtrl();
2166 Appends a container to the given @a parent.
2168 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
2169 const wxString
& text
,
2172 wxClientData
* data
= NULL
);
2175 Appends an item to the given @a parent.
2177 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
2178 const wxString
& text
,
2180 wxClientData
* data
= NULL
);
2183 Creates the control and a wxDataViewTreeStore as its internal model.
2185 The default tree column created by this method is an editable column
2186 using wxDataViewIconTextRenderer as its renderer.
2188 bool Create(wxWindow
* parent
, wxWindowID id
,
2189 const wxPoint
& pos
= wxDefaultPosition
,
2190 const wxSize
& size
= wxDefaultSize
,
2191 long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
2192 const wxValidator
& validator
= wxDefaultValidator
);
2195 Calls the identical method from wxDataViewTreeStore.
2197 void DeleteAllItems();
2200 Calls the identical method from wxDataViewTreeStore.
2202 void DeleteChildren(const wxDataViewItem
& item
);
2205 Calls the identical method from wxDataViewTreeStore.
2207 void DeleteItem(const wxDataViewItem
& item
);
2210 Calls the identical method from wxDataViewTreeStore.
2212 int GetChildCount(const wxDataViewItem
& parent
) const;
2215 Returns the image list.
2217 wxImageList
* GetImageList();
2220 Calls the identical method from wxDataViewTreeStore.
2222 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
2225 Calls the identical method from wxDataViewTreeStore.
2227 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
2230 Calls the identical method from wxDataViewTreeStore.
2232 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
2235 Calls the identical method from wxDataViewTreeStore.
2237 wxString
GetItemText(const wxDataViewItem
& item
) const;
2240 Calls the identical method from wxDataViewTreeStore.
2242 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
2243 unsigned int pos
) const;
2249 wxDataViewTreeStore
* GetStore();
2250 const wxDataViewTreeStore
* GetStore() const;
2254 Calls the same method from wxDataViewTreeStore but uses
2255 an index position in the image list instead of a wxIcon.
2257 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
2258 const wxDataViewItem
& previous
,
2259 const wxString
& text
,
2262 wxClientData
* data
= NULL
);
2265 Calls the same method from wxDataViewTreeStore but uses
2266 an index position in the image list instead of a wxIcon.
2268 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
2269 const wxDataViewItem
& previous
,
2270 const wxString
& text
,
2272 wxClientData
* data
= NULL
);
2275 Returns true if item is a container.
2277 bool IsContainer( const wxDataViewItem
& item
);
2280 Calls the same method from wxDataViewTreeStore but uses
2281 an index position in the image list instead of a wxIcon.
2283 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
2284 const wxString
& text
,
2287 wxClientData
* data
= NULL
);
2290 Calls the same method from wxDataViewTreeStore but uses
2291 an index position in the image list instead of a wxIcon.
2293 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
2294 const wxString
& text
,
2296 wxClientData
* data
= NULL
);
2299 Sets the image list.
2301 void SetImageList(wxImageList
* imagelist
);
2304 Calls the identical method from wxDataViewTreeStore.
2306 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
2309 Calls the identical method from wxDataViewTreeStore.
2311 void SetItemExpandedIcon(const wxDataViewItem
& item
,
2312 const wxIcon
& icon
);
2315 Calls the identical method from wxDataViewTreeStore.
2317 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
2320 Calls the identical method from wxDataViewTreeStore.
2322 void SetItemText(const wxDataViewItem
& item
,
2323 const wxString
& text
);
2328 @class wxDataViewListStore
2330 wxDataViewListStore is a specialised wxDataViewModel for storing
2331 a simple table of data. Since it derives from wxDataViewIndexListModel
2332 its data is be accessed by row (i.e. by index) instead of only
2335 This class actually stores the values (therefore its name)
2336 and implements all virtual methods from the base classes so it can be
2337 used directly without having to derive any class from it, but it is
2338 mostly used from within wxDataViewListCtrl.
2344 class wxDataViewListStore
: public wxDataViewIndexListModel
2350 wxDataViewListStore();
2355 ~wxDataViewListStore();
2358 Prepends a data column.
2360 @a variantype indicates the type of values store in the column.
2362 This does not automatically fill in any (default) values in
2363 rows which exist in the store already.
2365 void PrependColumn( const wxString
&varianttype
);
2368 Inserts a data column before @a pos.
2370 @a variantype indicates the type of values store in the column.
2372 This does not automatically fill in any (default) values in
2373 rows which exist in the store already.
2375 void InsertColumn( unsigned int pos
, const wxString
&varianttype
);
2378 Appends a data column.
2380 @a variantype indicates the type of values store in the column.
2382 This does not automatically fill in any (default) values in
2383 rows which exist in the store already.
2385 void AppendColumn( const wxString
&varianttype
);
2388 Appends an item (=row) and fills it with @a values.
2390 The values must match the values specifies in the column
2391 in number and type. No (default) values are filled in
2394 void AppendItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2397 Prepends an item (=row) and fills it with @a values.
2399 The values must match the values specifies in the column
2400 in number and type. No (default) values are filled in
2403 void PrependItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2406 Inserts an item (=row) and fills it with @a values.
2408 The values must match the values specifies in the column
2409 in number and type. No (default) values are filled in
2412 void InsertItem( unsigned int row
, const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2415 Delete the item (=row) at position @a pos.
2417 void DeleteItem( unsigned pos
);
2420 Delete all item (=all rows) in the store.
2422 void DeleteAllItems();
2425 Overridden from wxDataViewModel
2427 virtual unsigned int GetColumnCount() const;
2430 Overridden from wxDataViewModel
2432 virtual wxString
GetColumnType( unsigned int col
) const;
2435 Overridden from wxDataViewIndexListModel
2437 virtual void GetValueByRow( wxVariant
&value
,
2438 unsigned int row
, unsigned int col
) const;
2441 Overridden from wxDataViewIndexListModel
2443 virtual bool SetValueByRow( const wxVariant
&value
,
2444 unsigned int row
, unsigned int col
);
2449 @class wxDataViewTreeStore
2451 wxDataViewTreeStore is a specialised wxDataViewModel for storing simple
2452 trees very much like wxTreeCtrl does and it offers a similar API.
2454 This class actually stores the entire tree and the values (therefore its name)
2455 and implements all virtual methods from the base class so it can be used directly
2456 without having to derive any class from it, but it is mostly used from within
2462 class wxDataViewTreeStore
: public wxDataViewModel
2466 Constructor. Creates the invisible root node internally.
2468 wxDataViewTreeStore();
2473 virtual ~wxDataViewTreeStore();
2478 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
2479 const wxString
& text
,
2480 const wxIcon
& icon
= wxNullIcon
,
2481 const wxIcon
& expanded
= wxNullIcon
,
2482 wxClientData
* data
= NULL
);
2487 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
2488 const wxString
& text
,
2489 const wxIcon
& icon
= wxNullIcon
,
2490 wxClientData
* data
= NULL
);
2493 Delete all item in the model.
2495 void DeleteAllItems();
2498 Delete all children of the item, but not the item itself.
2500 void DeleteChildren(const wxDataViewItem
& item
);
2505 void DeleteItem(const wxDataViewItem
& item
);
2508 Return the number of children of item.
2510 int GetChildCount(const wxDataViewItem
& parent
) const;
2513 Returns the client data associated with the item.
2515 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
2518 Returns the icon to display in expanded containers.
2520 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
2523 Returns the icon of the item.
2525 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
2528 Returns the text of the item.
2530 wxString
GetItemText(const wxDataViewItem
& item
) const;
2533 Returns the nth child item of item.
2535 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
2536 unsigned int pos
) const;
2539 Inserts a container after @a previous.
2541 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
2542 const wxDataViewItem
& previous
,
2543 const wxString
& text
,
2544 const wxIcon
& icon
= wxNullIcon
,
2545 const wxIcon
& expanded
= wxNullIcon
,
2546 wxClientData
* data
= NULL
);
2549 Inserts an item after @a previous.
2551 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
2552 const wxDataViewItem
& previous
,
2553 const wxString
& text
,
2554 const wxIcon
& icon
= wxNullIcon
,
2555 wxClientData
* data
= NULL
);
2558 Inserts a container before the first child item or @a parent.
2560 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
2561 const wxString
& text
,
2562 const wxIcon
& icon
= wxNullIcon
,
2563 const wxIcon
& expanded
= wxNullIcon
,
2564 wxClientData
* data
= NULL
);
2567 Inserts an item before the first child item or @a parent.
2569 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
2570 const wxString
& text
,
2571 const wxIcon
& icon
= wxNullIcon
,
2572 wxClientData
* data
= NULL
);
2575 Sets the client data associated with the item.
2577 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
2580 Sets the expanded icon for the item.
2582 void SetItemExpandedIcon(const wxDataViewItem
& item
,
2583 const wxIcon
& icon
);
2586 Sets the icon for the item.
2588 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
2593 @class wxDataViewIconText
2595 wxDataViewIconText is used by wxDataViewIconTextRenderer for data transfer.
2596 This class can be converted to and from a wxVariant.
2601 class wxDataViewIconText
: public wxObject
2608 wxDataViewIconText(const wxString
& text
= wxEmptyString
,
2609 const wxIcon
& icon
= wxNullIcon
);
2610 wxDataViewIconText(const wxDataViewIconText
& other
);
2616 const wxIcon
& GetIcon() const;
2621 wxString
GetText() const;
2626 void SetIcon(const wxIcon
& icon
);
2631 void SetText(const wxString
& text
);
2637 @class wxDataViewEvent
2639 This is the event class for the wxDataViewCtrl notifications.
2641 @beginEventTable{wxDataViewEvent}
2642 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
2643 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
2644 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
2645 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
2646 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
2647 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
2648 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
2649 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
2650 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
2651 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
2652 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
2653 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
2654 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
2655 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
2656 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
2657 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
2658 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
2659 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
2660 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
2661 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
2662 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
2663 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
2664 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
2665 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
2666 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
2667 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
2668 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
2669 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
2670 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
2671 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
2672 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
2673 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
2674 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
2675 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
2676 @event{EVT_DATAVIEW_CACHE_HINT(id, func)}
2677 Process a @c wxEVT_COMMAND_DATAVIEW_CACHE_HINT event.
2681 @category{events,dvc}
2683 class wxDataViewEvent
: public wxNotifyEvent
2687 Constructor. Typically used by wxWidgets internals only.
2689 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
,
2693 Returns the position of the column in the control or -1
2694 if no column field was set by the event emitter.
2696 int GetColumn() const;
2699 Returns a pointer to the wxDataViewColumn from which
2700 the event was emitted or @NULL.
2702 wxDataViewColumn
* GetDataViewColumn() const;
2705 Returns the wxDataViewModel associated with the event.
2707 wxDataViewModel
* GetModel() const;
2710 Returns the position of a context menu event in screen coordinates.
2712 wxPoint
GetPosition() const;
2715 Returns a reference to a value.
2717 const wxVariant
& GetValue() const;
2720 Can be used to determine whether the new value is going to be accepted
2721 in wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE handler.
2723 Returns @true if editing the item was cancelled or if the user tried to
2724 enter an invalid value (refused by wxDataViewRenderer::Validate()). If
2725 this method returns @false, it means that the value in the model is
2726 about to be changed to the new one.
2728 Notice that wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event handler can
2729 call wxNotifyEvent::Veto() to prevent this from happening.
2731 Currently support for setting this field and for vetoing the change is
2732 only available in the generic version of wxDataViewCtrl, i.e. under MSW
2733 but not GTK nor OS X.
2737 bool IsEditCancelled() const;
2740 Sets the column index associated with this event.
2742 void SetColumn(int col
);
2745 For @c wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
2747 void SetDataViewColumn(wxDataViewColumn
* col
);
2750 Sets the dataview model associated with this event.
2752 void SetModel(wxDataViewModel
* model
);
2755 Sets the value associated with this event.
2757 void SetValue(const wxVariant
& value
);
2760 Set wxDataObject for data transfer within a drag operation.
2762 void SetDataObject( wxDataObject
*obj
);
2765 Used internally. Gets associated wxDataObject for data transfer
2766 within a drag operation.
2768 wxDataObject
*GetDataObject() const;
2771 Used internally. Sets the wxDataFormat during a drop operation.
2773 void SetDataFormat( const wxDataFormat
&format
);
2776 Gets the wxDataFormat during a drop operation.
2778 wxDataFormat
GetDataFormat() const;
2781 Used internally. Sets the data size for a drop data transfer.
2783 void SetDataSize( size_t size
);
2786 Gets the data size for a drop data transfer.
2788 size_t GetDataSize() const;
2791 Used internally. Sets the data buffer for a drop data transfer.
2793 void SetDataBuffer( void* buf
);
2796 Gets the data buffer for a drop data transfer.
2798 void *GetDataBuffer() const;
2801 Return the first row that will be displayed.
2803 int GetCacheFrom() const;
2806 Return the last row that will be displayed.
2808 int GetCacheTo() const;