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. This feature is
188 only partially supported in the generic version (wxMSW) and
189 currently not supported by the wxOSX/Carbon implementation.
193 virtual bool IsEnabled(const wxDataViewItem
&item
,
194 unsigned int col
) const;
197 Override this so the control can query the child items of an item.
198 Returns the number of items.
200 virtual unsigned int GetChildren(const wxDataViewItem
& item
,
201 wxDataViewItemArray
& children
) const = 0;
204 Override this to indicate the number of columns in the model.
206 virtual unsigned int GetColumnCount() const = 0;
209 Override this to indicate what type of data is stored in the
210 column specified by @a col.
212 This should return a string indicating the type of data as reported by wxVariant.
214 virtual wxString
GetColumnType(unsigned int col
) const = 0;
217 Override this to indicate which wxDataViewItem representing the parent
218 of @a item or an invalid wxDataViewItem if the the root item is
221 virtual wxDataViewItem
GetParent(const wxDataViewItem
& item
) const = 0;
224 Override this to indicate the value of @a item.
225 A wxVariant is used to store the data.
227 virtual void GetValue(wxVariant
& variant
, const wxDataViewItem
& item
,
228 unsigned int col
) const = 0;
231 Override this method to indicate if a container item merely acts as a
232 headline (or for categorisation) or if it also acts a normal item with
233 entries for futher columns. By default returns @false.
235 virtual bool HasContainerColumns(const wxDataViewItem
& item
) const;
238 Override this to indicate that the model provides a default compare
239 function that the control should use if no wxDataViewColumn has been
240 chosen for sorting. Usually, the user clicks on a column header for
241 sorting, the data will be sorted alphanumerically.
243 If any other order (e.g. by index or order of appearance) is required,
244 then this should be used.
245 See wxDataViewIndexListModel for a model which makes use of this.
247 virtual bool HasDefaultCompare() const;
250 Return true if there is a value in the given column of this item.
252 All normal items have values in all columns but the container items
253 only show their label in the first column (@a col == 0) by default (but
254 see HasContainerColumns()). So this function always returns true for
255 the first column while for the other ones it returns true only if the
256 item is not a container or HasContainerColumns() was overridden to
261 bool HasValue(const wxDataViewItem
& item
, unsigned col
) const;
264 Override this to indicate of @a item is a container, i.e. if
265 it can have child items.
267 virtual bool IsContainer(const wxDataViewItem
& item
) const = 0;
270 Call this to inform the model that an item has been added to the data.
272 bool ItemAdded(const wxDataViewItem
& parent
,
273 const wxDataViewItem
& item
);
276 Call this to inform the model that an item has changed.
278 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
279 event (in which the column fields will not be set) to the user.
281 bool ItemChanged(const wxDataViewItem
& item
);
284 Call this to inform the model that an item has been deleted from the data.
286 bool ItemDeleted(const wxDataViewItem
& parent
,
287 const wxDataViewItem
& item
);
290 Call this to inform the model that several items have been added to the data.
292 bool ItemsAdded(const wxDataViewItem
& parent
,
293 const wxDataViewItemArray
& items
);
296 Call this to inform the model that several items have changed.
298 This will eventually emit wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
299 events (in which the column fields will not be set) to the user.
301 bool ItemsChanged(const wxDataViewItemArray
& items
);
304 Call this to inform the model that several items have been deleted.
306 bool ItemsDeleted(const wxDataViewItem
& parent
,
307 const wxDataViewItemArray
& items
);
310 Remove the @a notifier from the list of notifiers.
312 void RemoveNotifier(wxDataViewModelNotifier
* notifier
);
315 Call this to initiate a resort after the sort function has been changed.
317 virtual void Resort();
320 This gets called in order to set a value in the data model.
322 The most common scenario is that the wxDataViewCtrl calls this method
323 after the user changed some data in the view.
325 This is the function you need to override in your derived class but if
326 you want to call it, ChangeValue() is usually more convenient as
327 otherwise you need to manually call ValueChanged() to update the
330 virtual bool SetValue(const wxVariant
& variant
,
331 const wxDataViewItem
& item
,
332 unsigned int col
) = 0;
335 Call this to inform this model that a value in the model has been changed.
336 This is also called from wxDataViewCtrl's internal editing code, e.g. when
337 editing a text field in the control.
339 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
342 virtual bool ValueChanged(const wxDataViewItem
& item
,
348 Destructor. This should not be called directly. Use DecRef() instead.
350 virtual ~wxDataViewModel();
356 @class wxDataViewListModel
358 Base class with abstract API for wxDataViewIndexListModel and
359 wxDataViewVirtualListModel.
364 class wxDataViewListModel
: public wxDataViewModel
371 virtual ~wxDataViewIndexListModel();
374 Compare method that sorts the items by their index.
376 int Compare(const wxDataViewItem
& item1
,
377 const wxDataViewItem
& item2
,
378 unsigned int column
, bool ascending
);
381 Override this to indicate that the row has special font attributes.
382 This only affects the wxDataViewTextRendererText() renderer.
384 The base class version always simply returns @false.
386 @see wxDataViewItemAttr.
389 The row for which the attribute is requested.
391 The column for which the attribute is requested.
393 The attribute to be filled in if the function returns @true.
395 @true if this item has an attribute or @false otherwise.
397 virtual bool GetAttrByRow(unsigned int row
, unsigned int col
,
398 wxDataViewItemAttr
& attr
) const;
401 Override this if you want to disable specific items.
403 The base class version always returns @true, thus making all items
407 The row of the item whose enabled status is requested.
409 The column of the item whose enabled status is requested.
411 @true if the item at this row and column should be enabled,
414 @note See wxDataViewModel::IsEnabled() for the current status of
415 support for disabling the items under different platforms.
419 virtual bool IsEnabledByRow(unsigned int row
,
420 unsigned int col
) const;
423 Returns the number of items (i.e. rows) in the list.
425 unsigned int GetCount() const;
428 Returns the wxDataViewItem at the given @e row.
430 wxDataViewItem
GetItem(unsigned int row
) const;
433 Returns the position of given @e item.
435 unsigned int GetRow(const wxDataViewItem
& item
) const;
438 Override this to allow getting values from the model.
440 virtual void GetValueByRow(wxVariant
& variant
, unsigned int row
,
441 unsigned int col
) const = 0;
444 Call this after if the data has to be read again from the model.
445 This is useful after major changes when calling the methods below
446 (possibly thousands of times) doesn't make sense.
448 void Reset(unsigned int new_size
);
451 Call this after a row has been appended to the model.
456 Call this after a row has been changed.
458 void RowChanged(unsigned int row
);
461 Call this after a row has been deleted.
463 void RowDeleted(unsigned int row
);
466 Call this after a row has been inserted at the given position.
468 void RowInserted(unsigned int before
);
471 Call this after a row has been prepended to the model.
476 Call this after a value has been changed.
478 void RowValueChanged(unsigned int row
, unsigned int col
);
481 Call this after rows have been deleted.
482 The array will internally get copied and sorted in descending order so
483 that the rows with the highest position will be deleted first.
485 void RowsDeleted(const wxArrayInt
& rows
);
488 Called in order to set a value in the model.
490 virtual bool SetValueByRow(const wxVariant
& variant
, unsigned int row
,
491 unsigned int col
) = 0;
496 @class wxDataViewIndexListModel
498 wxDataViewIndexListModel is a specialized data model which lets you address
499 an item by its position (row) rather than its wxDataViewItem (which you can
500 obtain from this class).
501 This model also provides its own wxDataViewIndexListModel::Compare
502 method which sorts the model's data by the index.
504 This model is not a virtual model since the control stores each wxDataViewItem.
505 Use wxDataViewVirtualListModel if you need to display millions of items or
506 have other reason to use a virtual control.
508 @see wxDataViewListModel for the API.
514 class wxDataViewIndexListModel
: public wxDataViewListModel
520 wxDataViewIndexListModel(unsigned int initial_size
= 0);
525 @class wxDataViewVirtualListModel
527 wxDataViewVirtualListModel is a specialized data model which lets you address
528 an item by its position (row) rather than its wxDataViewItem and as such offers
529 the exact same interface as wxDataViewIndexListModel.
530 The important difference is that under platforms other than OS X, using this
531 model will result in a truly virtual control able to handle millions of items
532 as the control doesn't store any item (a feature not supported by OS X).
534 @see wxDataViewListModel for the API.
540 class wxDataViewVirtualListModel
: public wxDataViewListModel
546 wxDataViewVirtualListModel(unsigned int initial_size
= 0);
553 @class wxDataViewItemAttr
555 This class is used to indicate to a wxDataViewCtrl that a certain item
556 (see wxDataViewItem) has extra font attributes for its renderer.
557 For this, it is required to override wxDataViewModel::GetAttr.
559 Attributes are currently only supported by wxDataViewTextRendererText.
564 class wxDataViewItemAttr
570 wxDataViewItemAttr();
573 Call this to indicate that the item shall be displayed in bold text.
575 void SetBold(bool set
);
578 Call this to indicate that the item shall be displayed with that colour.
580 void SetColour(const wxColour
& colour
);
583 Call this to indicate that the item shall be displayed in italic text.
585 void SetItalic(bool set
);
591 @class wxDataViewItem
593 wxDataViewItem is a small opaque class that represents an item in a wxDataViewCtrl
594 in a persistent way, i.e. independent of the position of the item in the control
595 or changes to its contents.
597 It must hold a unique ID of type @e void* in its only field and can be converted
600 If the ID is @NULL the wxDataViewItem is invalid and wxDataViewItem::IsOk will
601 return @false which used in many places in the API of wxDataViewCtrl to
602 indicate that e.g. no item was found. An ID of @NULL is also used to indicate
603 the invisible root. Examples for this are wxDataViewModel::GetParent and
604 wxDataViewModel::GetChildren.
616 wxDataViewItem(void* id
= NULL
);
617 wxDataViewItem(const wxDataViewItem
& item
);
626 Returns @true if the ID is not @NULL.
634 @class wxDataViewCtrl
636 wxDataViewCtrl is a control to display data either in a tree like fashion or
637 in a tabular form or both.
639 If you only need to display a simple tree structure with an API more like the
640 older wxTreeCtrl class, then the specialized wxDataViewTreeCtrl can be used.
641 Likewise, if you only want to display simple table structure you can use
642 the specialized wxDataViewListCtrl class. Both wxDataViewTreeCtrl and
643 wxDataViewListCtrl can be used without defining your own wxDataViewModel.
645 A wxDataViewItem is used to represent a (visible) item in the control.
647 Unlike wxListCtrl, wxDataViewCtrl doesn't get its data from the user through
648 virtual functions or by setting it directly. Instead you need to write your own
649 wxDataViewModel and associate it with this control.
650 Then you need to add a number of wxDataViewColumn to this control to define
651 what each column shall display. Each wxDataViewColumn in turn owns 1 instance
652 of a wxDataViewRenderer to render its cells.
654 A number of standard renderers for rendering text, dates, images, toggle,
655 a progress bar etc. are provided. Additionally, the user can write custom
656 renderers deriving from wxDataViewCustomRenderer for displaying anything.
658 All data transfer from the control to the model and the user code is done
659 through wxVariant which can be extended to support more data formats as necessary.
660 Accordingly, all type information uses the strings returned from wxVariant::GetType.
664 Single selection mode. This is the default.
665 @style{wxDV_MULTIPLE}
666 Multiple selection mode.
667 @style{wxDV_ROW_LINES}
668 Use alternating colours for rows if supported by platform and theme.
669 @style{wxDV_HORIZ_RULES}
670 Display fine rules between row if supported.
671 @style{wxDV_VERT_RULES}
672 Display fine rules between columns is supported.
673 @style{wxDV_VARIABLE_LINE_HEIGHT}
674 Allow variable line heights.
675 This can be inefficient when displaying large number of items.
676 @style{wxDV_NO_HEADER}
677 Do not show column headers (which are shown by default).
680 @beginEventEmissionTable{wxDataViewEvent}
681 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
682 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
683 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
684 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
685 @event{EVT_DATAVIEW_ITEM_START_EDITING(id, func)}
686 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event. This
687 event can be vetoed in order to prevent editing on an item by item
688 basis. Still experimental.
689 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
690 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
691 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
692 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
693 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
694 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
695 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
696 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
697 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
698 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
699 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
700 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
701 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
702 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
703 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
704 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
705 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
706 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
707 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
708 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
709 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
710 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
711 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
712 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
713 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
714 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
715 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
716 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
717 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
718 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
723 @appearance{dataviewctrl.png}
725 class wxDataViewCtrl
: public wxControl
734 Constructor. Calls Create().
736 wxDataViewCtrl(wxWindow
* parent
, wxWindowID id
,
737 const wxPoint
& pos
= wxDefaultPosition
,
738 const wxSize
& size
= wxDefaultSize
,
740 const wxValidator
& validator
= wxDefaultValidator
,
741 const wxString
& name
= wxDataViewCtrlNameStr
);
746 virtual ~wxDataViewCtrl();
749 Appends a wxDataViewColumn to the control. Returns @true on success.
751 Note that there is a number of short cut methods which implicitly create
752 a wxDataViewColumn and a wxDataViewRenderer for it (see below).
754 virtual bool AppendColumn(wxDataViewColumn
* col
);
757 Prepends a wxDataViewColumn to the control. Returns @true on success.
759 Note that there is a number of short cut methods which implicitly create
760 a wxDataViewColumn and a wxDataViewRenderer for it.
762 virtual bool PrependColumn(wxDataViewColumn
* col
);
765 Inserts a wxDataViewColumn to the control. Returns @true on success.
767 virtual bool InsertColumn(unsigned int pos
, wxDataViewColumn
* col
);
771 Appends a column for rendering a bitmap. Returns the wxDataViewColumn
772 created in the function or @NULL on failure.
774 wxDataViewColumn
* AppendBitmapColumn(const wxString
& label
,
775 unsigned int model_column
,
776 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
778 wxAlignment align
= wxALIGN_CENTER
,
779 int flags
= wxDATAVIEW_COL_RESIZABLE
);
780 wxDataViewColumn
* AppendBitmapColumn(const wxBitmap
& label
,
781 unsigned int model_column
,
782 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
784 wxAlignment align
= wxALIGN_CENTER
,
785 int flags
= wxDATAVIEW_COL_RESIZABLE
);
790 Appends a column for rendering a date. Returns the wxDataViewColumn
791 created in the function or @NULL on failure.
793 @note The @a align parameter is applied to both the column header and
796 wxDataViewColumn
* AppendDateColumn(const wxString
& label
,
797 unsigned int model_column
,
798 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
800 wxAlignment align
= wxALIGN_NOT
,
801 int flags
= wxDATAVIEW_COL_RESIZABLE
);
802 wxDataViewColumn
* AppendDateColumn(const wxBitmap
& label
,
803 unsigned int model_column
,
804 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
806 wxAlignment align
= wxALIGN_NOT
,
807 int flags
= wxDATAVIEW_COL_RESIZABLE
);
812 Appends a column for rendering text with an icon. Returns the wxDataViewColumn
813 created in the function or @NULL on failure.
814 This method uses the wxDataViewIconTextRenderer class.
816 @note The @a align parameter is applied to both the column header and
819 wxDataViewColumn
* AppendIconTextColumn(const wxString
& label
,
820 unsigned int model_column
,
821 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
823 wxAlignment align
= wxALIGN_NOT
,
824 int flags
= wxDATAVIEW_COL_RESIZABLE
);
825 wxDataViewColumn
* AppendIconTextColumn(const wxBitmap
& label
,
826 unsigned int model_column
,
827 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
829 wxAlignment align
= wxALIGN_NOT
,
830 int flags
= wxDATAVIEW_COL_RESIZABLE
);
835 Appends a column for rendering a progress indicator. Returns the
836 wxDataViewColumn created in the function or @NULL on failure.
838 @note The @a align parameter is applied to both the column header and
841 wxDataViewColumn
* AppendProgressColumn(const wxString
& label
,
842 unsigned int model_column
,
843 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
845 wxAlignment align
= wxALIGN_CENTER
,
846 int flags
= wxDATAVIEW_COL_RESIZABLE
);
847 wxDataViewColumn
* AppendProgressColumn(const wxBitmap
& label
,
848 unsigned int model_column
,
849 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
851 wxAlignment align
= wxALIGN_CENTER
,
852 int flags
= wxDATAVIEW_COL_RESIZABLE
);
857 Appends a column for rendering text. Returns the wxDataViewColumn
858 created in the function or @NULL on failure.
860 @note The @a align parameter is applied to both the column header and
863 wxDataViewColumn
* AppendTextColumn(const wxString
& label
,
864 unsigned int model_column
,
865 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
867 wxAlignment align
= wxALIGN_NOT
,
868 int flags
= wxDATAVIEW_COL_RESIZABLE
);
869 wxDataViewColumn
* AppendTextColumn(const wxBitmap
& label
,
870 unsigned int model_column
,
871 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
873 wxAlignment align
= wxALIGN_NOT
,
874 int flags
= wxDATAVIEW_COL_RESIZABLE
);
879 Appends a column for rendering a toggle. Returns the wxDataViewColumn
880 created in the function or @NULL on failure.
882 @note The @a align parameter is applied to both the column header and
885 wxDataViewColumn
* AppendToggleColumn(const wxString
& label
,
886 unsigned int model_column
,
887 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
889 wxAlignment align
= wxALIGN_CENTER
,
890 int flags
= wxDATAVIEW_COL_RESIZABLE
);
891 wxDataViewColumn
* AppendToggleColumn(const wxBitmap
& label
,
892 unsigned int model_column
,
893 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
895 wxAlignment align
= wxALIGN_CENTER
,
896 int flags
= wxDATAVIEW_COL_RESIZABLE
);
900 Associates a wxDataViewModel with the control.
901 This increases the reference count of the model by 1.
903 virtual bool AssociateModel(wxDataViewModel
* model
);
908 virtual bool ClearColumns();
913 virtual void Collapse(const wxDataViewItem
& item
);
916 Create the control. Useful for two step creation.
918 bool Create(wxWindow
* parent
, wxWindowID id
,
919 const wxPoint
& pos
= wxDefaultPosition
,
920 const wxSize
& size
= wxDefaultSize
,
922 const wxValidator
& validator
= wxDefaultValidator
,
923 const wxString
& name
= wxDataViewCtrlNameStr
);
926 Deletes given column.
928 virtual bool DeleteColumn(wxDataViewColumn
* column
);
931 Enable drag operations using the given @a format.
933 virtual bool EnableDragSource( const wxDataFormat
&format
);
936 Enable drop operations using the given @a format.
938 virtual bool EnableDropTarget( const wxDataFormat
&format
);
941 Call this to ensure that the given item is visible.
943 virtual void EnsureVisible(const wxDataViewItem
& item
,
944 const wxDataViewColumn
* column
= NULL
);
949 virtual void Expand(const wxDataViewItem
& item
);
952 Expands all ancestors of the @a item. This method also
953 ensures that the item itself as well as all ancestor
954 items have been read from the model by the control.
956 virtual void ExpandAncestors( const wxDataViewItem
& item
);
959 Returns pointer to the column. @a pos refers to the position in the
960 control which may change after reordering columns by the user.
962 virtual wxDataViewColumn
* GetColumn(unsigned int pos
) const;
965 Returns the number of columns.
967 virtual unsigned int GetColumnCount() const;
970 Returns the position of the column or -1 if not found in the control.
972 virtual int GetColumnPosition(const wxDataViewColumn
* column
) const;
975 Returns column containing the expanders.
977 wxDataViewColumn
* GetExpanderColumn() const;
980 Returns the currently focused item.
982 This is the item that the keyboard commands apply to. It may be invalid
983 if there is no focus currently.
985 This method is mostly useful for the controls with @c wxDV_MULTIPLE
986 style as in the case of single selection it returns the same thing as
989 Notice that under all platforms except Mac OS X the currently focused
990 item may be selected or not but under OS X the current item is always
993 @see SetCurrentItem()
997 wxDataViewItem
GetCurrentItem() const;
1000 Returns indentation.
1002 int GetIndent() const;
1007 virtual wxRect
GetItemRect(const wxDataViewItem
& item
,
1008 const wxDataViewColumn
* col
= NULL
) const;
1011 Returns pointer to the data model associated with the control (if any).
1013 wxDataViewModel
* GetModel();
1016 Returns first selected item or an invalid item if none is selected.
1018 virtual wxDataViewItem
GetSelection() const;
1021 Fills @a sel with currently selected items and returns their number.
1023 virtual int GetSelections(wxDataViewItemArray
& sel
) const;
1026 Returns the wxDataViewColumn currently responsible for sorting
1027 or @NULL if none has been selected.
1029 virtual wxDataViewColumn
* GetSortingColumn() const;
1034 virtual void HitTest(const wxPoint
& point
, wxDataViewItem
& item
,
1035 wxDataViewColumn
*& col
) const;
1038 Return @true if the item is expanded.
1040 virtual bool IsExpanded(const wxDataViewItem
& item
) const;
1043 Return @true if the item is selected.
1045 virtual bool IsSelected(const wxDataViewItem
& item
) const;
1048 Select the given item.
1050 In single selection mode this changes the (unique) currently selected
1051 item. In multi selection mode, the @a item is selected and the
1052 previously selected items remain selected.
1054 virtual void Select(const wxDataViewItem
& item
);
1059 virtual void SelectAll();
1062 Set which column shall contain the tree-like expanders.
1064 void SetExpanderColumn(wxDataViewColumn
* col
);
1067 Changes the currently focused item.
1069 The @a item parameter must be valid, there is no way to remove the
1070 current item from the control.
1072 In single selection mode, calling this method is the same as calling
1073 Select() and is thus not very useful. In multiple selection mode this
1074 method only moves the current item however without changing the
1075 selection except under OS X where the current item is always selected,
1076 so calling SetCurrentItem() selects @a item if it hadn't been selected
1079 @see GetCurrentItem()
1083 void SetCurrentItem(const wxDataViewItem
& item
);
1086 Sets the indendation.
1088 void SetIndent(int indent
);
1091 Sets the selection to the array of wxDataViewItems.
1093 virtual void SetSelections(const wxDataViewItemArray
& sel
);
1096 Unselect the given item.
1098 virtual void Unselect(const wxDataViewItem
& item
);
1102 This method only has effect if multiple selections are allowed.
1104 virtual void UnselectAll();
1110 @class wxDataViewModelNotifier
1112 A wxDataViewModelNotifier instance is owned by a wxDataViewModel and mirrors
1113 its notification interface.
1114 See the documentation of that class for further information.
1119 class wxDataViewModelNotifier
1125 wxDataViewModelNotifier();
1130 virtual ~wxDataViewModelNotifier();
1133 Called by owning model.
1135 virtual bool Cleared() = 0;
1138 Get owning wxDataViewModel.
1140 wxDataViewModel
* GetOwner() const;
1143 Called by owning model.
1145 virtual bool ItemAdded(const wxDataViewItem
& parent
,
1146 const wxDataViewItem
& item
) = 0;
1149 Called by owning model.
1151 virtual bool ItemChanged(const wxDataViewItem
& item
) = 0;
1154 Called by owning model.
1156 virtual bool ItemDeleted(const wxDataViewItem
& parent
,
1157 const wxDataViewItem
& item
) = 0;
1160 Called by owning model.
1162 virtual bool ItemsAdded(const wxDataViewItem
& parent
,
1163 const wxDataViewItemArray
& items
);
1166 Called by owning model.
1168 virtual bool ItemsChanged(const wxDataViewItemArray
& items
);
1171 Called by owning model.
1173 virtual bool ItemsDeleted(const wxDataViewItem
& parent
,
1174 const wxDataViewItemArray
& items
);
1177 Called by owning model.
1179 virtual void Resort() = 0;
1182 Set owner of this notifier. Used internally.
1184 void SetOwner(wxDataViewModel
* owner
);
1187 Called by owning model.
1189 virtual bool ValueChanged(const wxDataViewItem
& item
, unsigned int col
) = 0;
1194 The mode of a data-view cell; see wxDataViewRenderer for more info.
1196 enum wxDataViewCellMode
1198 wxDATAVIEW_CELL_INERT
,
1201 Indicates that the user can double click the cell and something will
1202 happen (e.g. a window for editing a date will pop up).
1204 wxDATAVIEW_CELL_ACTIVATABLE
,
1207 Indicates that the user can edit the data in-place, i.e. an control
1208 will show up after a slow click on the cell. This behaviour is best
1209 known from changing the filename in most file managers etc.
1211 wxDATAVIEW_CELL_EDITABLE
1215 The values of this enum controls how a wxDataViewRenderer should display
1216 its contents in a cell.
1218 enum wxDataViewCellRenderState
1220 wxDATAVIEW_CELL_SELECTED
= 1,
1221 wxDATAVIEW_CELL_PRELIT
= 2,
1222 wxDATAVIEW_CELL_INSENSITIVE
= 4,
1223 wxDATAVIEW_CELL_FOCUSED
= 8
1227 @class wxDataViewRenderer
1229 This class is used by wxDataViewCtrl to render the individual cells.
1230 One instance of a renderer class is owned by a wxDataViewColumn.
1231 There is a number of ready-to-use renderers provided:
1232 - wxDataViewTextRenderer,
1233 - wxDataViewIconTextRenderer,
1234 - wxDataViewToggleRenderer,
1235 - wxDataViewProgressRenderer,
1236 - wxDataViewBitmapRenderer,
1237 - wxDataViewDateRenderer,
1238 - wxDataViewSpinRenderer.
1239 - wxDataViewChoiceRenderer.
1241 Additionally, the user can write own renderers by deriving from
1242 wxDataViewCustomRenderer.
1244 The ::wxDataViewCellMode and ::wxDataViewCellRenderState flags accepted
1245 by the constructors respectively controls what actions the cell data allows
1246 and how the renderer should display its contents in a cell.
1251 class wxDataViewRenderer
: public wxObject
1257 wxDataViewRenderer(const wxString
& varianttype
,
1258 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1259 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1262 Enable or disable replacing parts of the item text with ellipsis to
1263 make it fit the column width.
1265 This method only makes sense for the renderers working with text, such
1266 as wxDataViewTextRenderer or wxDataViewIconTextRenderer.
1268 By default wxELLIPSIZE_MIDDLE is used.
1271 Ellipsization mode, use wxELLIPSIZE_NONE to disable.
1275 void EnableEllipsize(wxEllipsizeMode mode
= wxELLIPSIZE_MIDDLE
);
1278 Disable replacing parts of the item text with ellipsis.
1280 If ellipsizing is disabled, the string will be truncated if it doesn't
1283 This is the same as @code EnableEllipsize(wxELLIPSIZE_NONE) @endcode.
1287 void DisableEllipsize();
1290 Returns the alignment. See SetAlignment()
1292 virtual int GetAlignment() const;
1295 Returns the ellipsize mode used by the renderer.
1297 If the return value is wxELLIPSIZE_NONE, the text is simply truncated
1300 @see EnableEllipsize()
1302 wxEllipsizeMode
GetEllipsizeMode() const;
1305 Returns the cell mode.
1307 virtual wxDataViewCellMode
GetMode() const;
1310 Returns pointer to the owning wxDataViewColumn.
1312 wxDataViewColumn
* GetOwner() const;
1315 This methods retrieves the value from the renderer in order to
1316 transfer the value back to the data model.
1318 Returns @false on failure.
1320 virtual bool GetValue(wxVariant
& value
) const = 0;
1323 Returns a string with the type of the wxVariant supported by this renderer.
1325 wxString
GetVariantType() const;
1328 Sets the alignment of the renderer's content.
1329 The default value of @c wxDVR_DEFAULT_ALIGMENT indicates that the content
1330 should have the same alignment as the column header.
1332 The method is not implemented under OS X and the renderer always aligns
1333 its contents as the column header on that platform. The other platforms
1334 support both vertical and horizontal alignment.
1336 virtual void SetAlignment( int align
);
1338 Sets the owning wxDataViewColumn.
1339 This is usually called from within wxDataViewColumn.
1341 void SetOwner(wxDataViewColumn
* owner
);
1344 Set the value of the renderer (and thus its cell) to @a value.
1345 The internal code will then render this cell with this data.
1347 virtual bool SetValue(const wxVariant
& value
) = 0;
1350 Before data is committed to the data model, it is passed to this
1351 method where it can be checked for validity. This can also be
1352 used for checking a valid range or limiting the user input in
1353 a certain aspect (e.g. max number of characters or only alphanumeric
1354 input, ASCII only etc.). Return @false if the value is not valid.
1356 Please note that due to implementation limitations, this validation
1357 is done after the editing control already is destroyed and the
1358 editing process finished.
1360 virtual bool Validate(wxVariant
& value
);
1366 @class wxDataViewTextRenderer
1368 wxDataViewTextRenderer is used for rendering text.
1369 It supports in-place editing if desired.
1374 class wxDataViewTextRenderer
: public wxDataViewRenderer
1380 wxDataViewTextRenderer(const wxString
& varianttype
= "string",
1381 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1382 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1388 @class wxDataViewIconTextRenderer
1390 The wxDataViewIconTextRenderer class is used to display text with
1391 a small icon next to it as it is typically done in a file manager.
1393 This classes uses the wxDataViewIconText helper class to store its data.
1394 wxDataViewIconText can be converted to and from a wxVariant using the left
1400 class wxDataViewIconTextRenderer
: public wxDataViewRenderer
1406 wxDataViewIconTextRenderer(const wxString
& varianttype
= "wxDataViewIconText",
1407 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1408 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1414 @class wxDataViewProgressRenderer
1416 This class is used by wxDataViewCtrl to render progress bars.
1421 class wxDataViewProgressRenderer
: public wxDataViewRenderer
1427 wxDataViewProgressRenderer(const wxString
& label
= wxEmptyString
,
1428 const wxString
& varianttype
= "long",
1429 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1430 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1436 @class wxDataViewSpinRenderer
1438 This is a specialized renderer for rendering integer values.
1439 It supports modifying the values in-place by using a wxSpinCtrl.
1440 The renderer only support variants of type @e long.
1445 class wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
1450 @a min and @a max indicate the minimum and maximum values for the wxSpinCtrl.
1452 wxDataViewSpinRenderer(int min
, int max
,
1453 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1454 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1460 @class wxDataViewToggleRenderer
1462 This class is used by wxDataViewCtrl to render toggle controls.
1467 class wxDataViewToggleRenderer
: public wxDataViewRenderer
1473 wxDataViewToggleRenderer(const wxString
& varianttype
= "bool",
1474 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1475 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1480 @class wxDataViewChoiceRenderer
1482 This class is used by wxDataViewCtrl to render choice controls.
1483 It stores a string so that SetValue() and GetValue() operate
1484 on a variant holding a string.
1490 class wxDataViewChoiceRenderer
: public wxDataViewRenderer
1496 wxDataViewChoiceRenderer( const wxArrayString
&choices
,
1497 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1498 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
1501 Returns the choice referred to by index.
1503 wxString
GetChoice(size_t index
) const;
1506 Returns all choices.
1508 const wxArrayString
& GetChoices() const;
1513 @class wxDataViewDateRenderer
1515 This class is used by wxDataViewCtrl to render calendar controls.
1520 class wxDataViewDateRenderer
: public wxDataViewRenderer
1526 wxDataViewDateRenderer(const wxString
& varianttype
= "datetime",
1527 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1528 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1534 @class wxDataViewCustomRenderer
1536 You need to derive a new class from wxDataViewCustomRenderer in
1537 order to write a new renderer.
1539 You need to override at least wxDataViewRenderer::SetValue, wxDataViewRenderer::GetValue,
1540 wxDataViewCustomRenderer::GetSize and wxDataViewCustomRenderer::Render.
1542 If you want your renderer to support in-place editing then you also need to override
1543 wxDataViewCustomRenderer::HasEditorCtrl, wxDataViewCustomRenderer::CreateEditorCtrl
1544 and wxDataViewCustomRenderer::GetValueFromEditorCtrl.
1546 Note that a special event handler will be pushed onto that editor control
1547 which handles @e \<ENTER\> and focus out events in order to end the editing.
1552 class wxDataViewCustomRenderer
: public wxDataViewRenderer
1558 wxDataViewCustomRenderer(const wxString
& varianttype
= "string",
1559 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1560 int align
= -1, bool no_init
= false);
1565 virtual ~wxDataViewCustomRenderer();
1568 Override this to react to double clicks or ENTER.
1569 This method will only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
1571 virtual bool Activate( wxRect cell
,
1572 wxDataViewModel
* model
,
1573 const wxDataViewItem
& item
,
1577 Override this to create the actual editor control once editing
1580 @a parent is the parent of the editor control, @a labelRect indicates the
1581 position and size of the editor control and @a value is its initial value:
1585 return new wxSpinCtrl( parent, wxID_ANY, wxEmptyString,
1586 labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l );
1590 virtual wxControl
* CreateEditorCtrl(wxWindow
* parent
,
1592 const wxVariant
& value
);
1595 Return the attribute to be used for rendering.
1597 This function may be called from Render() implementation to use the
1598 attributes defined for the item if the renderer supports them.
1600 Notice that when Render() is called, the wxDC object passed to it is
1601 already set up to use the correct attributes (e.g. its font is set to
1602 bold or italic version if wxDataViewItemAttr::GetBold() or GetItalic()
1603 returns true) so it may not be necessary to call it explicitly if you
1604 only want to render text using the items attributes.
1608 const wxDataViewItemAttr
& GetAttr() const;
1611 Return size required to show content.
1613 virtual wxSize
GetSize() const = 0;
1616 Override this so that the renderer can get the value from the editor
1617 control (pointed to by @a editor):
1620 wxSpinCtrl *sc = (wxSpinCtrl*) editor;
1621 long l = sc->GetValue();
1627 virtual bool GetValueFromEditorCtrl(wxControl
* editor
,
1631 Override this and make it return @true in order to
1632 indicate that this renderer supports in-place editing.
1634 virtual bool HasEditorCtrl() const;
1637 Override this to react to a left click.
1638 This method will only be called in @c wxDATAVIEW_CELL_ACTIVATABLE mode.
1640 virtual bool LeftClick( wxPoint cursor
,
1642 wxDataViewModel
* model
,
1643 const wxDataViewItem
& item
,
1647 Override this to render the cell.
1648 Before this is called, wxDataViewRenderer::SetValue was called
1649 so that this instance knows what to render.
1651 virtual bool Render(wxRect cell
, wxDC
* dc
, int state
) = 0;
1654 This method should be called from within Render() whenever you need to
1656 This will ensure that the correct colour, font and vertical alignment will
1657 be chosen so the text will look the same as text drawn by native renderers.
1659 void RenderText(const wxString
& text
, int xoffset
, wxRect cell
,
1660 wxDC
* dc
, int state
);
1663 Override this to start a drag operation. Not yet supported.
1665 virtual bool StartDrag(wxPoint cursor
, wxRect cell
,
1666 wxDataViewModel
* model
,
1667 const wxDataViewItem
& item
,
1674 @class wxDataViewBitmapRenderer
1676 This class is used by wxDataViewCtrl to render bitmap controls.
1681 class wxDataViewBitmapRenderer
: public wxDataViewRenderer
1687 wxDataViewBitmapRenderer(const wxString
& varianttype
= "wxBitmap",
1688 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1689 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1694 The flags used by wxDataViewColumn.
1695 Can be combined together.
1697 enum wxDataViewColumnFlags
1699 wxDATAVIEW_COL_RESIZABLE
= 1,
1700 wxDATAVIEW_COL_SORTABLE
= 2,
1701 wxDATAVIEW_COL_REORDERABLE
= 4,
1702 wxDATAVIEW_COL_HIDDEN
= 8
1706 @class wxDataViewColumn
1708 This class represents a column in a wxDataViewCtrl.
1709 One wxDataViewColumn is bound to one column in the data model to which the
1710 wxDataViewCtrl has been associated.
1712 An instance of wxDataViewRenderer is used by this class to render its data.
1717 class wxDataViewColumn
: public wxSettableHeaderColumn
1721 Constructs a text column.
1724 The title of the column.
1726 The class which will render the contents of this column.
1728 The index of the model's column which is associated with this object.
1730 The width of the column.
1731 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1733 The alignment of the column title.
1735 One or more flags of the ::wxDataViewColumnFlags enumeration.
1737 wxDataViewColumn(const wxString
& title
,
1738 wxDataViewRenderer
* renderer
,
1739 unsigned int model_column
,
1740 int width
= wxDVC_DEFAULT_WIDTH
,
1741 wxAlignment align
= wxALIGN_CENTER
,
1742 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1745 Constructs a bitmap column.
1748 The bitmap of the column.
1750 The class which will render the contents of this column.
1752 The index of the model's column which is associated with this object.
1754 The width of the column.
1755 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1757 The alignment of the column title.
1759 One or more flags of the ::wxDataViewColumnFlags enumeration.
1761 wxDataViewColumn(const wxBitmap
& bitmap
,
1762 wxDataViewRenderer
* renderer
,
1763 unsigned int model_column
,
1764 int width
= wxDVC_DEFAULT_WIDTH
,
1765 wxAlignment align
= wxALIGN_CENTER
,
1766 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1769 Returns the index of the column of the model, which this
1770 wxDataViewColumn is displaying.
1772 unsigned int GetModelColumn() const;
1775 Returns the owning wxDataViewCtrl.
1777 wxDataViewCtrl
* GetOwner() const;
1780 Returns the renderer of this wxDataViewColumn.
1782 @see wxDataViewRenderer.
1784 wxDataViewRenderer
* GetRenderer() const;
1790 @class wxDataViewListCtrl
1792 This class is a wxDataViewCtrl which internally uses a wxDataViewListStore
1793 and forwards most of its API to that class.
1795 The purpose of this class is to offer a simple way to display and
1796 edit a small table of data without having to write your own wxDataViewModel.
1799 wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, wxID_ANY );
1801 listctrl->AppendToggleColumn( "Toggle" );
1802 listctrl->AppendTextColumn( "Text" );
1804 wxVector<wxVariant> data;
1805 data.push_back( wxVariant(true) );
1806 data.push_back( wxVariant("row 1") );
1807 listctrl->AppendItem( data );
1810 data.push_back( wxVariant(false) );
1811 data.push_back( wxVariant("row 3") );
1812 listctrl->AppendItem( data );
1816 See wxDataViewCtrl for the list of supported styles.
1819 @beginEventEmissionTable
1820 See wxDataViewCtrl for the list of events emitted by this class.
1826 class wxDataViewListCtrl
: public wxDataViewCtrl
1832 wxDataViewListCtrl();
1835 Constructor. Calls Create().
1837 wxDataViewListCtrl( wxWindow
*parent
, wxWindowID id
,
1838 const wxPoint
& pos
= wxDefaultPosition
,
1839 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_ROW_LINES
,
1840 const wxValidator
& validator
= wxDefaultValidator
);
1843 Destructor. Deletes the image list if any.
1845 ~wxDataViewListCtrl();
1848 Creates the control and a wxDataViewListStore as its internal model.
1850 bool Create( wxWindow
*parent
, wxWindowID id
,
1851 const wxPoint
& pos
= wxDefaultPosition
,
1852 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_ROW_LINES
,
1853 const wxValidator
& validator
= wxDefaultValidator
);
1859 wxDataViewListStore
*GetStore();
1860 const wxDataViewListStore
*GetStore() const;
1864 Returns the position of given @e item or wxNOT_FOUND if it's
1869 int ItemToRow(const wxDataViewItem
&item
) const;
1872 Returns the wxDataViewItem at the given @e row.
1876 wxDataViewItem
RowToItem(int row
) const;
1880 @name Selection handling functions
1884 Returns index of the selected row or wxNOT_FOUND.
1886 @see wxDataViewCtrl::GetSelection()
1890 int GetSelectedRow() const;
1895 @see wxDataViewCtrl::Select()
1899 void SelectRow(unsigned row
);
1902 Unselects given row.
1904 @see wxDataViewCtrl::Unselect()
1908 void UnselectRow(unsigned row
);
1911 Returns true if @a row is selected.
1913 @see wxDataViewCtrl::IsSelected()
1917 bool IsRowSelected(unsigned row
) const;
1922 @name Column management functions
1927 Appends a column to the control and additionally appends a
1928 column to the store with the type string.
1930 virtual void AppendColumn( wxDataViewColumn
*column
);
1933 Appends a column to the control and additionally appends a
1934 column to the list store with the type @a varianttype.
1936 void AppendColumn( wxDataViewColumn
*column
, const wxString
&varianttype
);
1939 Appends a text column to the control and the store.
1941 See wxDataViewColumn::wxDataViewColumn for more info about
1944 wxDataViewColumn
*AppendTextColumn( const wxString
&label
,
1945 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1946 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1947 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1950 Appends a toggle column to the control and the store.
1952 See wxDataViewColumn::wxDataViewColumn for more info about
1955 wxDataViewColumn
*AppendToggleColumn( const wxString
&label
,
1956 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1957 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1958 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1961 Appends a progress column to the control and the store.
1963 See wxDataViewColumn::wxDataViewColumn for more info about
1966 wxDataViewColumn
*AppendProgressColumn( const wxString
&label
,
1967 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1968 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1969 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1972 Appends an icon-and-text column to the control and the store.
1974 See wxDataViewColumn::wxDataViewColumn for more info about
1977 wxDataViewColumn
*AppendIconTextColumn( const wxString
&label
,
1978 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1979 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1980 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1983 Inserts a column to the control and additionally inserts a
1984 column to the store with the type string.
1986 virtual void InsertColumn( unsigned int pos
, wxDataViewColumn
*column
);
1989 Inserts a column to the control and additionally inserts a
1990 column to the list store with the type @a varianttype.
1992 void InsertColumn( unsigned int pos
, wxDataViewColumn
*column
,
1993 const wxString
&varianttype
);
1996 Prepends a column to the control and additionally prepends a
1997 column to the store with the type string.
1999 virtual void PrependColumn( wxDataViewColumn
*column
);
2002 Prepends a column to the control and additionally prepends a
2003 column to the list store with the type @a varianttype.
2005 void PrependColumn( wxDataViewColumn
*column
, const wxString
&varianttype
);
2011 @name Item management functions
2016 Appends an item (=row) to the control and store.
2018 void AppendItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2021 Prepends an item (=row) to the control and store.
2023 void PrependItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2026 Inserts an item (=row) to the control and store.
2028 void InsertItem( unsigned int row
, const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2031 Delete the row at position @a row.
2033 void DeleteItem( unsigned row
);
2036 Delete all items (= all rows).
2038 void DeleteAllItems();
2041 Sets the value in the store and update the control.
2043 void SetValue( const wxVariant
&value
, unsigned int row
, unsigned int col
);
2046 Returns the value from the store.
2048 void GetValue( wxVariant
&value
, unsigned int row
, unsigned int col
);
2051 Sets the value in the store and update the control.
2053 This method assumes that the a string is stored in respective
2056 void SetTextValue( const wxString
&value
, unsigned int row
, unsigned int col
);
2059 Returns the value from the store.
2061 This method assumes that the a string is stored in respective
2064 wxString
GetTextValue( unsigned int row
, unsigned int col
) const;
2067 Sets the value in the store and update the control.
2069 This method assumes that the a boolean value is stored in
2072 void SetToggleValue( bool value
, unsigned int row
, unsigned int col
);
2075 Returns the value from the store.
2077 This method assumes that the a boolean value is stored in
2080 bool GetToggleValue( unsigned int row
, unsigned int col
) const;
2087 @class wxDataViewTreeCtrl
2089 This class is a wxDataViewCtrl which internally uses a wxDataViewTreeStore
2090 and forwards most of its API to that class.
2091 Additionally, it uses a wxImageList to store a list of icons.
2093 The main purpose of this class is to provide a simple upgrade path for code
2097 See wxDataViewCtrl for the list of supported styles.
2100 @beginEventEmissionTable
2101 See wxDataViewCtrl for the list of events emitted by this class.
2106 @appearance{dataviewtreectrl.png}
2108 class wxDataViewTreeCtrl
: public wxDataViewCtrl
2114 wxDataViewTreeCtrl();
2121 wxDataViewTreeCtrl(wxWindow
* parent
, wxWindowID id
,
2122 const wxPoint
& pos
= wxDefaultPosition
,
2123 const wxSize
& size
= wxDefaultSize
,
2124 long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
2125 const wxValidator
& validator
= wxDefaultValidator
);
2128 Destructor. Deletes the image list if any.
2130 virtual ~wxDataViewTreeCtrl();
2133 Appends a container to the given @a parent.
2135 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
2136 const wxString
& text
,
2139 wxClientData
* data
= NULL
);
2142 Appends an item to the given @a parent.
2144 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
2145 const wxString
& text
,
2147 wxClientData
* data
= NULL
);
2150 Creates the control and a wxDataViewTreeStore as its internal model.
2152 The default tree column created by this method is an editable column
2153 using wxDataViewIconTextRenderer as its renderer.
2155 bool Create(wxWindow
* parent
, wxWindowID id
,
2156 const wxPoint
& pos
= wxDefaultPosition
,
2157 const wxSize
& size
= wxDefaultSize
,
2158 long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
2159 const wxValidator
& validator
= wxDefaultValidator
);
2162 Calls the identical method from wxDataViewTreeStore.
2164 void DeleteAllItems();
2167 Calls the identical method from wxDataViewTreeStore.
2169 void DeleteChildren(const wxDataViewItem
& item
);
2172 Calls the identical method from wxDataViewTreeStore.
2174 void DeleteItem(const wxDataViewItem
& item
);
2177 Calls the identical method from wxDataViewTreeStore.
2179 int GetChildCount(const wxDataViewItem
& parent
) const;
2182 Returns the image list.
2184 wxImageList
* GetImageList();
2187 Calls the identical method from wxDataViewTreeStore.
2189 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
2192 Calls the identical method from wxDataViewTreeStore.
2194 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
2197 Calls the identical method from wxDataViewTreeStore.
2199 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
2202 Calls the identical method from wxDataViewTreeStore.
2204 wxString
GetItemText(const wxDataViewItem
& item
) const;
2207 Calls the identical method from wxDataViewTreeStore.
2209 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
2210 unsigned int pos
) const;
2216 wxDataViewTreeStore
* GetStore();
2217 const wxDataViewTreeStore
* GetStore() const;
2221 Calls the same method from wxDataViewTreeStore but uses
2222 an index position in the image list instead of a wxIcon.
2224 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
2225 const wxDataViewItem
& previous
,
2226 const wxString
& text
,
2229 wxClientData
* data
= NULL
);
2232 Calls the same method from wxDataViewTreeStore but uses
2233 an index position in the image list instead of a wxIcon.
2235 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
2236 const wxDataViewItem
& previous
,
2237 const wxString
& text
,
2239 wxClientData
* data
= NULL
);
2242 Returns true if item is a container.
2244 bool IsContainer( const wxDataViewItem
& item
);
2247 Calls the same method from wxDataViewTreeStore but uses
2248 an index position in the image list instead of a wxIcon.
2250 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
2251 const wxString
& text
,
2254 wxClientData
* data
= NULL
);
2257 Calls the same method from wxDataViewTreeStore but uses
2258 an index position in the image list instead of a wxIcon.
2260 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
2261 const wxString
& text
,
2263 wxClientData
* data
= NULL
);
2266 Sets the image list.
2268 void SetImageList(wxImageList
* imagelist
);
2271 Calls the identical method from wxDataViewTreeStore.
2273 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
2276 Calls the identical method from wxDataViewTreeStore.
2278 void SetItemExpandedIcon(const wxDataViewItem
& item
,
2279 const wxIcon
& icon
);
2282 Calls the identical method from wxDataViewTreeStore.
2284 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
2287 Calls the identical method from wxDataViewTreeStore.
2289 void SetItemText(const wxDataViewItem
& item
,
2290 const wxString
& text
);
2295 @class wxDataViewListStore
2297 wxDataViewListStore is a specialised wxDataViewModel for storing
2298 a simple table of data. Since it derives from wxDataViewIndexListModel
2299 its data is be accessed by row (i.e. by index) instead of only
2302 This class actually stores the values (therefore its name)
2303 and implements all virtual methods from the base classes so it can be
2304 used directly without having to derive any class from it, but it is
2305 mostly used from within wxDataViewListCtrl.
2311 class wxDataViewListStore
: public wxDataViewIndexListModel
2317 wxDataViewListStore();
2322 ~wxDataViewListStore();
2325 Prepends a data column.
2327 @a variantype indicates the type of values store in the column.
2329 This does not automatically fill in any (default) values in
2330 rows which exist in the store already.
2332 void PrependColumn( const wxString
&varianttype
);
2335 Inserts a data column before @a pos.
2337 @a variantype indicates the type of values store in the column.
2339 This does not automatically fill in any (default) values in
2340 rows which exist in the store already.
2342 void InsertColumn( unsigned int pos
, const wxString
&varianttype
);
2345 Appends a data column.
2347 @a variantype indicates the type of values store in the column.
2349 This does not automatically fill in any (default) values in
2350 rows which exist in the store already.
2352 void AppendColumn( const wxString
&varianttype
);
2355 Appends an item (=row) and fills it with @a values.
2357 The values must match the values specifies in the column
2358 in number and type. No (default) values are filled in
2361 void AppendItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2364 Prepends an item (=row) and fills it with @a values.
2366 The values must match the values specifies in the column
2367 in number and type. No (default) values are filled in
2370 void PrependItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2373 Inserts an item (=row) and fills it with @a values.
2375 The values must match the values specifies in the column
2376 in number and type. No (default) values are filled in
2379 void InsertItem( unsigned int row
, const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2382 Delete the item (=row) at position @a pos.
2384 void DeleteItem( unsigned pos
);
2387 Delete all item (=all rows) in the store.
2389 void DeleteAllItems();
2392 Overriden from wxDataViewModel
2394 virtual unsigned int GetColumnCount() const;
2397 Overriden from wxDataViewModel
2399 virtual wxString
GetColumnType( unsigned int col
) const;
2402 Overriden from wxDataViewIndexListModel
2404 virtual void GetValueByRow( wxVariant
&value
,
2405 unsigned int row
, unsigned int col
) const;
2408 Overriden from wxDataViewIndexListModel
2410 virtual bool SetValueByRow( const wxVariant
&value
,
2411 unsigned int row
, unsigned int col
);
2416 @class wxDataViewTreeStore
2418 wxDataViewTreeStore is a specialised wxDataViewModel for stroing simple
2419 trees very much like wxTreeCtrl does and it offers a similar API.
2421 This class actually stores the entire tree and the values (therefore its name)
2422 and implements all virtual methods from the base class so it can be used directly
2423 without having to derive any class from it, but it is mostly used from within
2429 class wxDataViewTreeStore
: public wxDataViewModel
2433 Constructor. Creates the invisible root node internally.
2435 wxDataViewTreeStore();
2440 virtual ~wxDataViewTreeStore();
2445 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
2446 const wxString
& text
,
2447 const wxIcon
& icon
= wxNullIcon
,
2448 const wxIcon
& expanded
= wxNullIcon
,
2449 wxClientData
* data
= NULL
);
2454 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
2455 const wxString
& text
,
2456 const wxIcon
& icon
= wxNullIcon
,
2457 wxClientData
* data
= NULL
);
2460 Delete all item in the model.
2462 void DeleteAllItems();
2465 Delete all children of the item, but not the item itself.
2467 void DeleteChildren(const wxDataViewItem
& item
);
2472 void DeleteItem(const wxDataViewItem
& item
);
2475 Return the number of children of item.
2477 int GetChildCount(const wxDataViewItem
& parent
) const;
2480 Returns the client data asoociated with the item.
2482 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
2485 Returns the icon to display in expanded containers.
2487 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
2490 Returns the icon of the item.
2492 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
2495 Returns the text of the item.
2497 wxString
GetItemText(const wxDataViewItem
& item
) const;
2500 Returns the nth child item of item.
2502 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
2503 unsigned int pos
) const;
2506 Inserts a container after @a previous.
2508 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
2509 const wxDataViewItem
& previous
,
2510 const wxString
& text
,
2511 const wxIcon
& icon
= wxNullIcon
,
2512 const wxIcon
& expanded
= wxNullIcon
,
2513 wxClientData
* data
= NULL
);
2516 Inserts an item after @a previous.
2518 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
2519 const wxDataViewItem
& previous
,
2520 const wxString
& text
,
2521 const wxIcon
& icon
= wxNullIcon
,
2522 wxClientData
* data
= NULL
);
2525 Inserts a container before the first child item or @a parent.
2527 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
2528 const wxString
& text
,
2529 const wxIcon
& icon
= wxNullIcon
,
2530 const wxIcon
& expanded
= wxNullIcon
,
2531 wxClientData
* data
= NULL
);
2534 Inserts an item before the first child item or @a parent.
2536 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
2537 const wxString
& text
,
2538 const wxIcon
& icon
= wxNullIcon
,
2539 wxClientData
* data
= NULL
);
2542 Sets the client data associated with the item.
2544 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
2547 Sets the expanded icon for the item.
2549 void SetItemExpandedIcon(const wxDataViewItem
& item
,
2550 const wxIcon
& icon
);
2553 Sets the icon for the item.
2555 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
2560 @class wxDataViewIconText
2562 wxDataViewIconText is used by wxDataViewIconTextRenderer for data transfer.
2563 This class can be converted to and from a wxVariant.
2568 class wxDataViewIconText
: public wxObject
2575 wxDataViewIconText(const wxString
& text
= wxEmptyString
,
2576 const wxIcon
& icon
= wxNullIcon
);
2577 wxDataViewIconText(const wxDataViewIconText
& other
);
2583 const wxIcon
& GetIcon() const;
2588 wxString
GetText() const;
2593 void SetIcon(const wxIcon
& icon
);
2598 void SetText(const wxString
& text
);
2604 @class wxDataViewEvent
2606 This is the event class for the wxDataViewCtrl notifications.
2608 @beginEventTable{wxDataViewEvent}
2609 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
2610 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
2611 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
2612 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
2613 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
2614 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
2615 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
2616 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
2617 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
2618 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
2619 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
2620 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
2621 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
2622 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
2623 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
2624 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
2625 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
2626 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
2627 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
2628 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
2629 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
2630 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
2631 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
2632 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
2633 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
2634 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
2635 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
2636 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
2637 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
2638 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
2639 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
2640 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
2641 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
2642 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
2643 @event{EVT_DATAVIEW_CACHE_HINT(id, func)}
2644 Process a @c wxEVT_COMMAND_DATAVIEW_CACHE_HINT event.
2648 @category{events,dvc}
2650 class wxDataViewEvent
: public wxNotifyEvent
2654 Constructor. Typically used by wxWidgets internals only.
2656 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
,
2660 Returns the position of the column in the control or -1
2661 if no column field was set by the event emitter.
2663 int GetColumn() const;
2666 Returns a pointer to the wxDataViewColumn from which
2667 the event was emitted or @NULL.
2669 wxDataViewColumn
* GetDataViewColumn() const;
2672 Returns the wxDataViewModel associated with the event.
2674 wxDataViewModel
* GetModel() const;
2677 Returns a the position of a context menu event in screen coordinates.
2679 wxPoint
GetPosition() const;
2682 Returns a reference to a value.
2684 const wxVariant
& GetValue() const;
2687 Sets the column index associated with this event.
2689 void SetColumn(int col
);
2692 For wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
2694 void SetDataViewColumn(wxDataViewColumn
* col
);
2697 Sets the dataview model associated with this event.
2699 void SetModel(wxDataViewModel
* model
);
2702 Sets the value associated with this event.
2704 void SetValue(const wxVariant
& value
);
2707 Set wxDataObject for data transfer within a drag operation.
2709 void SetDataObject( wxDataObject
*obj
);
2712 Used internally. Gets associated wxDataObject for data transfer
2713 within a drag operation.
2715 wxDataObject
*GetDataObject() const;
2718 Used internally. Sets the wxDataFormat during a drop operation.
2720 void SetDataFormat( const wxDataFormat
&format
);
2723 Gets the wxDataFormat during a drop operation.
2725 wxDataFormat
GetDataFormat() const;
2728 Used internally. Sets the data size for a drop data transfer.
2730 void SetDataSize( size_t size
);
2733 Gets the data size for a drop data transfer.
2735 size_t GetDataSize() const;
2738 Used internally. Sets the data buffer for a drop data transfer.
2740 void SetDataBuffer( void* buf
);
2743 Gets the data buffer for a drop data transfer.
2745 void *GetDataBuffer() const;
2748 Return the first row that will be displayed.
2750 int GetCacheFrom() const;
2753 Return the last row that will be displayed.
2755 int GetCacheTo() const;