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 (i.e. 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.
617 wxDataViewItem(void* id
= NULL
);
618 wxDataViewItem(const wxDataViewItem
& item
);
627 Returns @true if the ID is not @NULL.
635 @class wxDataViewCtrl
637 wxDataViewCtrl is a control to display data either in a tree like fashion or
638 in a tabular form or both.
640 If you only need to display a simple tree structure with an API more like the
641 older wxTreeCtrl class, then the specialized wxDataViewTreeCtrl can be used.
642 Likewise, if you only want to display simple table structure you can use
643 the specialized wxDataViewListCtrl class. Both wxDataViewTreeCtrl and
644 wxDataViewListCtrl can be used without defining your own wxDataViewModel.
646 A wxDataViewItem is used to represent a (visible) item in the control.
648 Unlike wxListCtrl, wxDataViewCtrl doesn't get its data from the user through
649 virtual functions or by setting it directly. Instead you need to write your own
650 wxDataViewModel and associate it with this control.
651 Then you need to add a number of wxDataViewColumn to this control to define
652 what each column shall display. Each wxDataViewColumn in turn owns 1 instance
653 of a wxDataViewRenderer to render its cells.
655 A number of standard renderers for rendering text, dates, images, toggle,
656 a progress bar etc. are provided. Additionally, the user can write custom
657 renderers deriving from wxDataViewCustomRenderer for displaying anything.
659 All data transfer from the control to the model and the user code is done
660 through wxVariant which can be extended to support more data formats as necessary.
661 Accordingly, all type information uses the strings returned from wxVariant::GetType.
665 Single selection mode. This is the default.
666 @style{wxDV_MULTIPLE}
667 Multiple selection mode.
668 @style{wxDV_ROW_LINES}
669 Use alternating colours for rows if supported by platform and theme.
670 Currently only supported by the native GTK and OS X implementations
671 but not by the generic one.
672 @style{wxDV_HORIZ_RULES}
673 Display fine rules between row if supported.
674 @style{wxDV_VERT_RULES}
675 Display fine rules between columns is supported.
676 @style{wxDV_VARIABLE_LINE_HEIGHT}
677 Allow variable line heights.
678 This can be inefficient when displaying large number of items.
679 @style{wxDV_NO_HEADER}
680 Do not show column headers (which are shown by default).
683 @beginEventEmissionTable{wxDataViewEvent}
684 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
685 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
686 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
687 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
688 @event{EVT_DATAVIEW_ITEM_START_EDITING(id, func)}
689 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event. This
690 event can be vetoed in order to prevent editing on an item by item
691 basis. Still experimental.
692 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
693 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
694 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
695 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
696 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
697 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
698 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
699 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
700 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
701 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
702 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
703 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
704 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
705 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
706 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
707 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
708 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
709 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
710 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
711 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
712 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
713 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
714 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
715 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
716 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
717 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
718 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
719 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
720 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
721 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
726 @appearance{dataviewctrl.png}
728 class wxDataViewCtrl
: public wxControl
737 Constructor. Calls Create().
739 wxDataViewCtrl(wxWindow
* parent
, wxWindowID id
,
740 const wxPoint
& pos
= wxDefaultPosition
,
741 const wxSize
& size
= wxDefaultSize
,
743 const wxValidator
& validator
= wxDefaultValidator
,
744 const wxString
& name
= wxDataViewCtrlNameStr
);
749 virtual ~wxDataViewCtrl();
752 Appends a wxDataViewColumn to the control. Returns @true on success.
754 Note that there is a number of short cut methods which implicitly create
755 a wxDataViewColumn and a wxDataViewRenderer for it (see below).
757 virtual bool AppendColumn(wxDataViewColumn
* col
);
760 Prepends a wxDataViewColumn to the control. Returns @true on success.
762 Note that there is a number of short cut methods which implicitly create
763 a wxDataViewColumn and a wxDataViewRenderer for it.
765 virtual bool PrependColumn(wxDataViewColumn
* col
);
768 Inserts a wxDataViewColumn to the control. Returns @true on success.
770 virtual bool InsertColumn(unsigned int pos
, wxDataViewColumn
* col
);
774 Appends a column for rendering a bitmap. Returns the wxDataViewColumn
775 created in the function or @NULL on failure.
777 wxDataViewColumn
* AppendBitmapColumn(const wxString
& label
,
778 unsigned int model_column
,
779 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
781 wxAlignment align
= wxALIGN_CENTER
,
782 int flags
= wxDATAVIEW_COL_RESIZABLE
);
783 wxDataViewColumn
* AppendBitmapColumn(const wxBitmap
& label
,
784 unsigned int model_column
,
785 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
787 wxAlignment align
= wxALIGN_CENTER
,
788 int flags
= wxDATAVIEW_COL_RESIZABLE
);
793 Appends a column for rendering a date. Returns the wxDataViewColumn
794 created in the function or @NULL on failure.
796 @note The @a align parameter is applied to both the column header and
799 wxDataViewColumn
* AppendDateColumn(const wxString
& label
,
800 unsigned int model_column
,
801 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
803 wxAlignment align
= wxALIGN_NOT
,
804 int flags
= wxDATAVIEW_COL_RESIZABLE
);
805 wxDataViewColumn
* AppendDateColumn(const wxBitmap
& label
,
806 unsigned int model_column
,
807 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
809 wxAlignment align
= wxALIGN_NOT
,
810 int flags
= wxDATAVIEW_COL_RESIZABLE
);
815 Appends a column for rendering text with an icon. Returns the wxDataViewColumn
816 created in the function or @NULL on failure.
817 This method uses the wxDataViewIconTextRenderer class.
819 @note The @a align parameter is applied to both the column header and
822 wxDataViewColumn
* AppendIconTextColumn(const wxString
& label
,
823 unsigned int model_column
,
824 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
826 wxAlignment align
= wxALIGN_NOT
,
827 int flags
= wxDATAVIEW_COL_RESIZABLE
);
828 wxDataViewColumn
* AppendIconTextColumn(const wxBitmap
& label
,
829 unsigned int model_column
,
830 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
832 wxAlignment align
= wxALIGN_NOT
,
833 int flags
= wxDATAVIEW_COL_RESIZABLE
);
838 Appends a column for rendering a progress indicator. Returns the
839 wxDataViewColumn created in the function or @NULL on failure.
841 @note The @a align parameter is applied to both the column header and
844 wxDataViewColumn
* AppendProgressColumn(const wxString
& label
,
845 unsigned int model_column
,
846 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
848 wxAlignment align
= wxALIGN_CENTER
,
849 int flags
= wxDATAVIEW_COL_RESIZABLE
);
850 wxDataViewColumn
* AppendProgressColumn(const wxBitmap
& label
,
851 unsigned int model_column
,
852 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
854 wxAlignment align
= wxALIGN_CENTER
,
855 int flags
= wxDATAVIEW_COL_RESIZABLE
);
860 Appends a column for rendering text. Returns the wxDataViewColumn
861 created in the function or @NULL on failure.
863 @note The @a align parameter is applied to both the column header and
866 wxDataViewColumn
* AppendTextColumn(const wxString
& label
,
867 unsigned int model_column
,
868 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
870 wxAlignment align
= wxALIGN_NOT
,
871 int flags
= wxDATAVIEW_COL_RESIZABLE
);
872 wxDataViewColumn
* AppendTextColumn(const wxBitmap
& label
,
873 unsigned int model_column
,
874 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
876 wxAlignment align
= wxALIGN_NOT
,
877 int flags
= wxDATAVIEW_COL_RESIZABLE
);
882 Appends a column for rendering a toggle. Returns the wxDataViewColumn
883 created in the function or @NULL on failure.
885 @note The @a align parameter is applied to both the column header and
888 wxDataViewColumn
* AppendToggleColumn(const wxString
& label
,
889 unsigned int model_column
,
890 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
892 wxAlignment align
= wxALIGN_CENTER
,
893 int flags
= wxDATAVIEW_COL_RESIZABLE
);
894 wxDataViewColumn
* AppendToggleColumn(const wxBitmap
& label
,
895 unsigned int model_column
,
896 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
898 wxAlignment align
= wxALIGN_CENTER
,
899 int flags
= wxDATAVIEW_COL_RESIZABLE
);
903 Associates a wxDataViewModel with the control.
904 This increases the reference count of the model by 1.
906 virtual bool AssociateModel(wxDataViewModel
* model
);
911 virtual bool ClearColumns();
916 virtual void Collapse(const wxDataViewItem
& item
);
919 Create the control. Useful for two step creation.
921 bool Create(wxWindow
* parent
, wxWindowID id
,
922 const wxPoint
& pos
= wxDefaultPosition
,
923 const wxSize
& size
= wxDefaultSize
,
925 const wxValidator
& validator
= wxDefaultValidator
,
926 const wxString
& name
= wxDataViewCtrlNameStr
);
929 Deletes given column.
931 virtual bool DeleteColumn(wxDataViewColumn
* column
);
934 Enable drag operations using the given @a format.
936 virtual bool EnableDragSource( const wxDataFormat
&format
);
939 Enable drop operations using the given @a format.
941 virtual bool EnableDropTarget( const wxDataFormat
&format
);
944 Call this to ensure that the given item is visible.
946 virtual void EnsureVisible(const wxDataViewItem
& item
,
947 const wxDataViewColumn
* column
= NULL
);
952 virtual void Expand(const wxDataViewItem
& item
);
955 Expands all ancestors of the @a item. This method also
956 ensures that the item itself as well as all ancestor
957 items have been read from the model by the control.
959 virtual void ExpandAncestors( const wxDataViewItem
& item
);
962 Returns pointer to the column. @a pos refers to the position in the
963 control which may change after reordering columns by the user.
965 virtual wxDataViewColumn
* GetColumn(unsigned int pos
) const;
968 Returns the number of columns.
970 virtual unsigned int GetColumnCount() const;
973 Returns the position of the column or -1 if not found in the control.
975 virtual int GetColumnPosition(const wxDataViewColumn
* column
) const;
978 Returns column containing the expanders.
980 wxDataViewColumn
* GetExpanderColumn() const;
983 Returns the currently focused item.
985 This is the item that the keyboard commands apply to. It may be invalid
986 if there is no focus currently.
988 This method is mostly useful for the controls with @c wxDV_MULTIPLE
989 style as in the case of single selection it returns the same thing as
992 Notice that under all platforms except Mac OS X the currently focused
993 item may be selected or not but under OS X the current item is always
996 @see SetCurrentItem()
1000 wxDataViewItem
GetCurrentItem() const;
1003 Returns indentation.
1005 int GetIndent() const;
1010 virtual wxRect
GetItemRect(const wxDataViewItem
& item
,
1011 const wxDataViewColumn
* col
= NULL
) const;
1014 Returns pointer to the data model associated with the control (if any).
1016 wxDataViewModel
* GetModel();
1019 Returns first selected item or an invalid item if none is selected.
1021 virtual wxDataViewItem
GetSelection() const;
1024 Fills @a sel with currently selected items and returns their number.
1026 virtual int GetSelections(wxDataViewItemArray
& sel
) const;
1029 Returns the wxDataViewColumn currently responsible for sorting
1030 or @NULL if none has been selected.
1032 virtual wxDataViewColumn
* GetSortingColumn() const;
1037 virtual void HitTest(const wxPoint
& point
, wxDataViewItem
& item
,
1038 wxDataViewColumn
*& col
) const;
1041 Return @true if the item is expanded.
1043 virtual bool IsExpanded(const wxDataViewItem
& item
) const;
1046 Return @true if the item is selected.
1048 virtual bool IsSelected(const wxDataViewItem
& item
) const;
1051 Select the given item.
1053 In single selection mode this changes the (unique) currently selected
1054 item. In multi selection mode, the @a item is selected and the
1055 previously selected items remain selected.
1057 virtual void Select(const wxDataViewItem
& item
);
1062 virtual void SelectAll();
1065 Set which column shall contain the tree-like expanders.
1067 void SetExpanderColumn(wxDataViewColumn
* col
);
1070 Changes the currently focused item.
1072 The @a item parameter must be valid, there is no way to remove the
1073 current item from the control.
1075 In single selection mode, calling this method is the same as calling
1076 Select() and is thus not very useful. In multiple selection mode this
1077 method only moves the current item however without changing the
1078 selection except under OS X where the current item is always selected,
1079 so calling SetCurrentItem() selects @a item if it hadn't been selected
1082 @see GetCurrentItem()
1086 void SetCurrentItem(const wxDataViewItem
& item
);
1089 Sets the indentation.
1091 void SetIndent(int indent
);
1094 Sets the selection to the array of wxDataViewItems.
1096 virtual void SetSelections(const wxDataViewItemArray
& sel
);
1099 Programmatically starts editing the given item on the given column.
1100 Currently not implemented on wxOSX Carbon.
1104 virtual void StartEditor(const wxDataViewItem
& item
, unsigned int column
);
1107 Unselect the given item.
1109 virtual void Unselect(const wxDataViewItem
& item
);
1113 This method only has effect if multiple selections are allowed.
1115 virtual void UnselectAll();
1121 @class wxDataViewModelNotifier
1123 A wxDataViewModelNotifier instance is owned by a wxDataViewModel and mirrors
1124 its notification interface.
1125 See the documentation of that class for further information.
1130 class wxDataViewModelNotifier
1136 wxDataViewModelNotifier();
1141 virtual ~wxDataViewModelNotifier();
1144 Called by owning model.
1146 virtual bool Cleared() = 0;
1149 Get owning wxDataViewModel.
1151 wxDataViewModel
* GetOwner() const;
1154 Called by owning model.
1156 virtual bool ItemAdded(const wxDataViewItem
& parent
,
1157 const wxDataViewItem
& item
) = 0;
1160 Called by owning model.
1162 virtual bool ItemChanged(const wxDataViewItem
& item
) = 0;
1165 Called by owning model.
1167 virtual bool ItemDeleted(const wxDataViewItem
& parent
,
1168 const wxDataViewItem
& item
) = 0;
1171 Called by owning model.
1173 virtual bool ItemsAdded(const wxDataViewItem
& parent
,
1174 const wxDataViewItemArray
& items
);
1177 Called by owning model.
1179 virtual bool ItemsChanged(const wxDataViewItemArray
& items
);
1182 Called by owning model.
1184 virtual bool ItemsDeleted(const wxDataViewItem
& parent
,
1185 const wxDataViewItemArray
& items
);
1188 Called by owning model.
1190 virtual void Resort() = 0;
1193 Set owner of this notifier. Used internally.
1195 void SetOwner(wxDataViewModel
* owner
);
1198 Called by owning model.
1200 virtual bool ValueChanged(const wxDataViewItem
& item
, unsigned int col
) = 0;
1205 The mode of a data-view cell; see wxDataViewRenderer for more info.
1207 enum wxDataViewCellMode
1209 wxDATAVIEW_CELL_INERT
,
1212 Indicates that the user can double click the cell and something will
1213 happen (e.g. a window for editing a date will pop up).
1215 wxDATAVIEW_CELL_ACTIVATABLE
,
1218 Indicates that the user can edit the data in-place, i.e. an control
1219 will show up after a slow click on the cell. This behaviour is best
1220 known from changing the filename in most file managers etc.
1222 wxDATAVIEW_CELL_EDITABLE
1226 The values of this enum controls how a wxDataViewRenderer should display
1227 its contents in a cell.
1229 enum wxDataViewCellRenderState
1231 wxDATAVIEW_CELL_SELECTED
= 1,
1232 wxDATAVIEW_CELL_PRELIT
= 2,
1233 wxDATAVIEW_CELL_INSENSITIVE
= 4,
1234 wxDATAVIEW_CELL_FOCUSED
= 8
1238 @class wxDataViewRenderer
1240 This class is used by wxDataViewCtrl to render the individual cells.
1241 One instance of a renderer class is owned by a wxDataViewColumn.
1242 There is a number of ready-to-use renderers provided:
1243 - wxDataViewTextRenderer,
1244 - wxDataViewIconTextRenderer,
1245 - wxDataViewToggleRenderer,
1246 - wxDataViewProgressRenderer,
1247 - wxDataViewBitmapRenderer,
1248 - wxDataViewDateRenderer,
1249 - wxDataViewSpinRenderer.
1250 - wxDataViewChoiceRenderer.
1252 Additionally, the user can write own renderers by deriving from
1253 wxDataViewCustomRenderer.
1255 The ::wxDataViewCellMode and ::wxDataViewCellRenderState flags accepted
1256 by the constructors respectively controls what actions the cell data allows
1257 and how the renderer should display its contents in a cell.
1262 class wxDataViewRenderer
: public wxObject
1268 wxDataViewRenderer(const wxString
& varianttype
,
1269 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1270 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1273 Enable or disable replacing parts of the item text with ellipsis to
1274 make it fit the column width.
1276 This method only makes sense for the renderers working with text, such
1277 as wxDataViewTextRenderer or wxDataViewIconTextRenderer.
1279 By default wxELLIPSIZE_MIDDLE is used.
1282 Ellipsization mode, use wxELLIPSIZE_NONE to disable.
1286 void EnableEllipsize(wxEllipsizeMode mode
= wxELLIPSIZE_MIDDLE
);
1289 Disable replacing parts of the item text with ellipsis.
1291 If ellipsizing is disabled, the string will be truncated if it doesn't
1294 This is the same as @code EnableEllipsize(wxELLIPSIZE_NONE) @endcode.
1298 void DisableEllipsize();
1301 Returns the alignment. See SetAlignment()
1303 virtual int GetAlignment() const;
1306 Returns the ellipsize mode used by the renderer.
1308 If the return value is wxELLIPSIZE_NONE, the text is simply truncated
1311 @see EnableEllipsize()
1313 wxEllipsizeMode
GetEllipsizeMode() const;
1316 Returns the cell mode.
1318 virtual wxDataViewCellMode
GetMode() const;
1321 Returns pointer to the owning wxDataViewColumn.
1323 wxDataViewColumn
* GetOwner() const;
1326 This methods retrieves the value from the renderer in order to
1327 transfer the value back to the data model.
1329 Returns @false on failure.
1331 virtual bool GetValue(wxVariant
& value
) const = 0;
1334 Returns a string with the type of the wxVariant supported by this renderer.
1336 wxString
GetVariantType() const;
1339 Sets the alignment of the renderer's content.
1340 The default value of @c wxDVR_DEFAULT_ALIGMENT indicates that the content
1341 should have the same alignment as the column header.
1343 The method is not implemented under OS X and the renderer always aligns
1344 its contents as the column header on that platform. The other platforms
1345 support both vertical and horizontal alignment.
1347 virtual void SetAlignment( int align
);
1349 Sets the owning wxDataViewColumn.
1350 This is usually called from within wxDataViewColumn.
1352 void SetOwner(wxDataViewColumn
* owner
);
1355 Set the value of the renderer (and thus its cell) to @a value.
1356 The internal code will then render this cell with this data.
1358 virtual bool SetValue(const wxVariant
& value
) = 0;
1361 Before data is committed to the data model, it is passed to this
1362 method where it can be checked for validity. This can also be
1363 used for checking a valid range or limiting the user input in
1364 a certain aspect (e.g. max number of characters or only alphanumeric
1365 input, ASCII only etc.). Return @false if the value is not valid.
1367 Please note that due to implementation limitations, this validation
1368 is done after the editing control already is destroyed and the
1369 editing process finished.
1371 virtual bool Validate(wxVariant
& value
);
1377 @class wxDataViewTextRenderer
1379 wxDataViewTextRenderer is used for rendering text.
1380 It supports in-place editing if desired.
1385 class wxDataViewTextRenderer
: public wxDataViewRenderer
1391 wxDataViewTextRenderer(const wxString
& varianttype
= "string",
1392 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1393 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1399 @class wxDataViewIconTextRenderer
1401 The wxDataViewIconTextRenderer class is used to display text with
1402 a small icon next to it as it is typically done in a file manager.
1404 This classes uses the wxDataViewIconText helper class to store its data.
1405 wxDataViewIconText can be converted to and from a wxVariant using the left
1411 class wxDataViewIconTextRenderer
: public wxDataViewRenderer
1417 wxDataViewIconTextRenderer(const wxString
& varianttype
= "wxDataViewIconText",
1418 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1419 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1425 @class wxDataViewProgressRenderer
1427 This class is used by wxDataViewCtrl to render progress bars.
1432 class wxDataViewProgressRenderer
: public wxDataViewRenderer
1438 wxDataViewProgressRenderer(const wxString
& label
= wxEmptyString
,
1439 const wxString
& varianttype
= "long",
1440 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1441 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1447 @class wxDataViewSpinRenderer
1449 This is a specialized renderer for rendering integer values.
1450 It supports modifying the values in-place by using a wxSpinCtrl.
1451 The renderer only support variants of type @e long.
1456 class wxDataViewSpinRenderer
: public wxDataViewCustomRenderer
1461 @a min and @a max indicate the minimum and maximum values for the wxSpinCtrl.
1463 wxDataViewSpinRenderer(int min
, int max
,
1464 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1465 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1471 @class wxDataViewToggleRenderer
1473 This class is used by wxDataViewCtrl to render toggle controls.
1478 class wxDataViewToggleRenderer
: public wxDataViewRenderer
1484 wxDataViewToggleRenderer(const wxString
& varianttype
= "bool",
1485 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1486 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1491 @class wxDataViewChoiceRenderer
1493 This class is used by wxDataViewCtrl to render choice controls.
1494 It stores a string so that SetValue() and GetValue() operate
1495 on a variant holding a string.
1501 class wxDataViewChoiceRenderer
: public wxDataViewRenderer
1507 wxDataViewChoiceRenderer( const wxArrayString
&choices
,
1508 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
1509 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
1512 Returns the choice referred to by index.
1514 wxString
GetChoice(size_t index
) const;
1517 Returns all choices.
1519 const wxArrayString
& GetChoices() const;
1524 @class wxDataViewDateRenderer
1526 This class is used by wxDataViewCtrl to render calendar controls.
1531 class wxDataViewDateRenderer
: public wxDataViewRenderer
1537 wxDataViewDateRenderer(const wxString
& varianttype
= "datetime",
1538 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1539 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1545 @class wxDataViewCustomRenderer
1547 You need to derive a new class from wxDataViewCustomRenderer in
1548 order to write a new renderer.
1550 You need to override at least wxDataViewRenderer::SetValue, wxDataViewRenderer::GetValue,
1551 wxDataViewCustomRenderer::GetSize and wxDataViewCustomRenderer::Render.
1553 If you want your renderer to support in-place editing then you also need to override
1554 wxDataViewCustomRenderer::HasEditorCtrl, wxDataViewCustomRenderer::CreateEditorCtrl
1555 and wxDataViewCustomRenderer::GetValueFromEditorCtrl.
1557 Note that a special event handler will be pushed onto that editor control
1558 which handles @e \<ENTER\> and focus out events in order to end the editing.
1563 class wxDataViewCustomRenderer
: public wxDataViewRenderer
1569 wxDataViewCustomRenderer(const wxString
& varianttype
= "string",
1570 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1571 int align
= -1, bool no_init
= false);
1576 virtual ~wxDataViewCustomRenderer();
1579 Override this to react to double clicks or ENTER.
1580 This method will only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
1582 virtual bool Activate( const wxRect
& cell
,
1583 wxDataViewModel
* model
,
1584 const wxDataViewItem
& item
,
1588 Override this to create the actual editor control once editing
1591 @a parent is the parent of the editor control, @a labelRect indicates the
1592 position and size of the editor control and @a value is its initial value:
1596 return new wxSpinCtrl( parent, wxID_ANY, wxEmptyString,
1597 labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l );
1601 virtual wxWindow
* CreateEditorCtrl(wxWindow
* parent
,
1603 const wxVariant
& value
);
1606 Return the attribute to be used for rendering.
1608 This function may be called from Render() implementation to use the
1609 attributes defined for the item if the renderer supports them.
1611 Notice that when Render() is called, the wxDC object passed to it is
1612 already set up to use the correct attributes (e.g. its font is set to
1613 bold or italic version if wxDataViewItemAttr::GetBold() or GetItalic()
1614 returns true) so it may not be necessary to call it explicitly if you
1615 only want to render text using the items attributes.
1619 const wxDataViewItemAttr
& GetAttr() const;
1622 Return size required to show content.
1624 virtual wxSize
GetSize() const = 0;
1627 Override this so that the renderer can get the value from the editor
1628 control (pointed to by @a editor):
1631 wxSpinCtrl *sc = (wxSpinCtrl*) editor;
1632 long l = sc->GetValue();
1638 virtual bool GetValueFromEditorCtrl(wxWindow
* editor
,
1642 Override this and make it return @true in order to
1643 indicate that this renderer supports in-place editing.
1645 virtual bool HasEditorCtrl() const;
1648 Override this to react to a left click.
1649 This method will only be called in @c wxDATAVIEW_CELL_ACTIVATABLE mode.
1651 virtual bool LeftClick( const wxPoint
& cursor
,
1653 wxDataViewModel
* model
,
1654 const wxDataViewItem
& item
,
1658 Override this to render the cell.
1659 Before this is called, wxDataViewRenderer::SetValue was called
1660 so that this instance knows what to render.
1662 virtual bool Render(wxRect cell
, wxDC
* dc
, int state
) = 0;
1665 This method should be called from within Render() whenever you need to
1667 This will ensure that the correct colour, font and vertical alignment will
1668 be chosen so the text will look the same as text drawn by native renderers.
1670 void RenderText(const wxString
& text
, int xoffset
, wxRect cell
,
1671 wxDC
* dc
, int state
);
1674 Override this to start a drag operation. Not yet supported.
1676 virtual bool StartDrag(const wxPoint
& cursor
,
1678 wxDataViewModel
* model
,
1679 const wxDataViewItem
& item
,
1686 @class wxDataViewBitmapRenderer
1688 This class is used by wxDataViewCtrl to render bitmap controls.
1693 class wxDataViewBitmapRenderer
: public wxDataViewRenderer
1699 wxDataViewBitmapRenderer(const wxString
& varianttype
= "wxBitmap",
1700 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1701 int align
= wxDVR_DEFAULT_ALIGNMENT
);
1706 The flags used by wxDataViewColumn.
1707 Can be combined together.
1709 enum wxDataViewColumnFlags
1711 wxDATAVIEW_COL_RESIZABLE
= 1,
1712 wxDATAVIEW_COL_SORTABLE
= 2,
1713 wxDATAVIEW_COL_REORDERABLE
= 4,
1714 wxDATAVIEW_COL_HIDDEN
= 8
1718 @class wxDataViewColumn
1720 This class represents a column in a wxDataViewCtrl.
1721 One wxDataViewColumn is bound to one column in the data model to which the
1722 wxDataViewCtrl has been associated.
1724 An instance of wxDataViewRenderer is used by this class to render its data.
1729 class wxDataViewColumn
: public wxSettableHeaderColumn
1733 Constructs a text column.
1736 The title of the column.
1738 The class which will render the contents of this column.
1740 The index of the model's column which is associated with this object.
1742 The width of the column.
1743 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1745 The alignment of the column title.
1747 One or more flags of the ::wxDataViewColumnFlags enumeration.
1749 wxDataViewColumn(const wxString
& title
,
1750 wxDataViewRenderer
* renderer
,
1751 unsigned int model_column
,
1752 int width
= wxDVC_DEFAULT_WIDTH
,
1753 wxAlignment align
= wxALIGN_CENTER
,
1754 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1757 Constructs a bitmap column.
1760 The bitmap of the column.
1762 The class which will render the contents of this column.
1764 The index of the model's column which is associated with this object.
1766 The width of the column.
1767 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1769 The alignment of the column title.
1771 One or more flags of the ::wxDataViewColumnFlags enumeration.
1773 wxDataViewColumn(const wxBitmap
& bitmap
,
1774 wxDataViewRenderer
* renderer
,
1775 unsigned int model_column
,
1776 int width
= wxDVC_DEFAULT_WIDTH
,
1777 wxAlignment align
= wxALIGN_CENTER
,
1778 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1781 Returns the index of the column of the model, which this
1782 wxDataViewColumn is displaying.
1784 unsigned int GetModelColumn() const;
1787 Returns the owning wxDataViewCtrl.
1789 wxDataViewCtrl
* GetOwner() const;
1792 Returns the renderer of this wxDataViewColumn.
1794 @see wxDataViewRenderer.
1796 wxDataViewRenderer
* GetRenderer() const;
1802 @class wxDataViewListCtrl
1804 This class is a wxDataViewCtrl which internally uses a wxDataViewListStore
1805 and forwards most of its API to that class.
1807 The purpose of this class is to offer a simple way to display and
1808 edit a small table of data without having to write your own wxDataViewModel.
1811 wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, wxID_ANY );
1813 listctrl->AppendToggleColumn( "Toggle" );
1814 listctrl->AppendTextColumn( "Text" );
1816 wxVector<wxVariant> data;
1817 data.push_back( wxVariant(true) );
1818 data.push_back( wxVariant("row 1") );
1819 listctrl->AppendItem( data );
1822 data.push_back( wxVariant(false) );
1823 data.push_back( wxVariant("row 3") );
1824 listctrl->AppendItem( data );
1828 See wxDataViewCtrl for the list of supported styles.
1831 @beginEventEmissionTable
1832 See wxDataViewCtrl for the list of events emitted by this class.
1838 class wxDataViewListCtrl
: public wxDataViewCtrl
1844 wxDataViewListCtrl();
1847 Constructor. Calls Create().
1849 wxDataViewListCtrl( wxWindow
*parent
, wxWindowID id
,
1850 const wxPoint
& pos
= wxDefaultPosition
,
1851 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_ROW_LINES
,
1852 const wxValidator
& validator
= wxDefaultValidator
);
1855 Destructor. Deletes the image list if any.
1857 ~wxDataViewListCtrl();
1860 Creates the control and a wxDataViewListStore as its internal model.
1862 bool Create( wxWindow
*parent
, wxWindowID id
,
1863 const wxPoint
& pos
= wxDefaultPosition
,
1864 const wxSize
& size
= wxDefaultSize
, long style
= wxDV_ROW_LINES
,
1865 const wxValidator
& validator
= wxDefaultValidator
);
1871 wxDataViewListStore
*GetStore();
1872 const wxDataViewListStore
*GetStore() const;
1876 Returns the position of given @e item or wxNOT_FOUND if it's
1881 int ItemToRow(const wxDataViewItem
&item
) const;
1884 Returns the wxDataViewItem at the given @e row.
1888 wxDataViewItem
RowToItem(int row
) const;
1892 @name Selection handling functions
1896 Returns index of the selected row or wxNOT_FOUND.
1898 @see wxDataViewCtrl::GetSelection()
1902 int GetSelectedRow() const;
1907 @see wxDataViewCtrl::Select()
1911 void SelectRow(unsigned row
);
1914 Unselects given row.
1916 @see wxDataViewCtrl::Unselect()
1920 void UnselectRow(unsigned row
);
1923 Returns true if @a row is selected.
1925 @see wxDataViewCtrl::IsSelected()
1929 bool IsRowSelected(unsigned row
) const;
1934 @name Column management functions
1939 Appends a column to the control and additionally appends a
1940 column to the store with the type string.
1942 virtual void AppendColumn( wxDataViewColumn
*column
);
1945 Appends a column to the control and additionally appends a
1946 column to the list store with the type @a varianttype.
1948 void AppendColumn( wxDataViewColumn
*column
, const wxString
&varianttype
);
1951 Appends a text column to the control and the store.
1953 See wxDataViewColumn::wxDataViewColumn for more info about
1956 wxDataViewColumn
*AppendTextColumn( const wxString
&label
,
1957 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1958 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1959 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1962 Appends a toggle column to the control and the store.
1964 See wxDataViewColumn::wxDataViewColumn for more info about
1967 wxDataViewColumn
*AppendToggleColumn( const wxString
&label
,
1968 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
1969 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1970 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1973 Appends a progress column to the control and the store.
1975 See wxDataViewColumn::wxDataViewColumn for more info about
1978 wxDataViewColumn
*AppendProgressColumn( const wxString
&label
,
1979 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1980 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1981 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1984 Appends an icon-and-text column to the control and the store.
1986 See wxDataViewColumn::wxDataViewColumn for more info about
1989 wxDataViewColumn
*AppendIconTextColumn( const wxString
&label
,
1990 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
1991 int width
= -1, wxAlignment align
= wxALIGN_LEFT
,
1992 int flags
= wxDATAVIEW_COL_RESIZABLE
);
1995 Inserts a column to the control and additionally inserts a
1996 column to the store with the type string.
1998 virtual void InsertColumn( unsigned int pos
, wxDataViewColumn
*column
);
2001 Inserts a column to the control and additionally inserts a
2002 column to the list store with the type @a varianttype.
2004 void InsertColumn( unsigned int pos
, wxDataViewColumn
*column
,
2005 const wxString
&varianttype
);
2008 Prepends a column to the control and additionally prepends a
2009 column to the store with the type string.
2011 virtual void PrependColumn( wxDataViewColumn
*column
);
2014 Prepends a column to the control and additionally prepends a
2015 column to the list store with the type @a varianttype.
2017 void PrependColumn( wxDataViewColumn
*column
, const wxString
&varianttype
);
2023 @name Item management functions
2028 Appends an item (=row) to the control and store.
2030 void AppendItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2033 Prepends an item (=row) to the control and store.
2035 void PrependItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2038 Inserts an item (=row) to the control and store.
2040 void InsertItem( unsigned int row
, const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2043 Delete the row at position @a row.
2045 void DeleteItem( unsigned row
);
2048 Delete all items (= all rows).
2050 void DeleteAllItems();
2053 Sets the value in the store and update the control.
2055 void SetValue( const wxVariant
&value
, unsigned int row
, unsigned int col
);
2058 Returns the value from the store.
2060 void GetValue( wxVariant
&value
, unsigned int row
, unsigned int col
);
2063 Sets the value in the store and update the control.
2065 This method assumes that the string is stored in respective
2068 void SetTextValue( const wxString
&value
, unsigned int row
, unsigned int col
);
2071 Returns the value from the store.
2073 This method assumes that the string is stored in respective
2076 wxString
GetTextValue( unsigned int row
, unsigned int col
) const;
2079 Sets the value in the store and update the control.
2081 This method assumes that the boolean value is stored in
2084 void SetToggleValue( bool value
, unsigned int row
, unsigned int col
);
2087 Returns the value from the store.
2089 This method assumes that the boolean value is stored in
2092 bool GetToggleValue( unsigned int row
, unsigned int col
) const;
2099 @class wxDataViewTreeCtrl
2101 This class is a wxDataViewCtrl which internally uses a wxDataViewTreeStore
2102 and forwards most of its API to that class.
2103 Additionally, it uses a wxImageList to store a list of icons.
2105 The main purpose of this class is to provide a simple upgrade path for code
2109 See wxDataViewCtrl for the list of supported styles.
2112 @beginEventEmissionTable
2113 See wxDataViewCtrl for the list of events emitted by this class.
2118 @appearance{dataviewtreectrl.png}
2120 class wxDataViewTreeCtrl
: public wxDataViewCtrl
2126 wxDataViewTreeCtrl();
2133 wxDataViewTreeCtrl(wxWindow
* parent
, wxWindowID id
,
2134 const wxPoint
& pos
= wxDefaultPosition
,
2135 const wxSize
& size
= wxDefaultSize
,
2136 long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
2137 const wxValidator
& validator
= wxDefaultValidator
);
2140 Destructor. Deletes the image list if any.
2142 virtual ~wxDataViewTreeCtrl();
2145 Appends a container to the given @a parent.
2147 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
2148 const wxString
& text
,
2151 wxClientData
* data
= NULL
);
2154 Appends an item to the given @a parent.
2156 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
2157 const wxString
& text
,
2159 wxClientData
* data
= NULL
);
2162 Creates the control and a wxDataViewTreeStore as its internal model.
2164 The default tree column created by this method is an editable column
2165 using wxDataViewIconTextRenderer as its renderer.
2167 bool Create(wxWindow
* parent
, wxWindowID id
,
2168 const wxPoint
& pos
= wxDefaultPosition
,
2169 const wxSize
& size
= wxDefaultSize
,
2170 long style
= wxDV_NO_HEADER
| wxDV_ROW_LINES
,
2171 const wxValidator
& validator
= wxDefaultValidator
);
2174 Calls the identical method from wxDataViewTreeStore.
2176 void DeleteAllItems();
2179 Calls the identical method from wxDataViewTreeStore.
2181 void DeleteChildren(const wxDataViewItem
& item
);
2184 Calls the identical method from wxDataViewTreeStore.
2186 void DeleteItem(const wxDataViewItem
& item
);
2189 Calls the identical method from wxDataViewTreeStore.
2191 int GetChildCount(const wxDataViewItem
& parent
) const;
2194 Returns the image list.
2196 wxImageList
* GetImageList();
2199 Calls the identical method from wxDataViewTreeStore.
2201 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
2204 Calls the identical method from wxDataViewTreeStore.
2206 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
2209 Calls the identical method from wxDataViewTreeStore.
2211 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
2214 Calls the identical method from wxDataViewTreeStore.
2216 wxString
GetItemText(const wxDataViewItem
& item
) const;
2219 Calls the identical method from wxDataViewTreeStore.
2221 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
2222 unsigned int pos
) const;
2228 wxDataViewTreeStore
* GetStore();
2229 const wxDataViewTreeStore
* GetStore() const;
2233 Calls the same method from wxDataViewTreeStore but uses
2234 an index position in the image list instead of a wxIcon.
2236 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
2237 const wxDataViewItem
& previous
,
2238 const wxString
& text
,
2241 wxClientData
* data
= NULL
);
2244 Calls the same method from wxDataViewTreeStore but uses
2245 an index position in the image list instead of a wxIcon.
2247 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
2248 const wxDataViewItem
& previous
,
2249 const wxString
& text
,
2251 wxClientData
* data
= NULL
);
2254 Returns true if item is a container.
2256 bool IsContainer( const wxDataViewItem
& item
);
2259 Calls the same method from wxDataViewTreeStore but uses
2260 an index position in the image list instead of a wxIcon.
2262 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
2263 const wxString
& text
,
2266 wxClientData
* data
= NULL
);
2269 Calls the same method from wxDataViewTreeStore but uses
2270 an index position in the image list instead of a wxIcon.
2272 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
2273 const wxString
& text
,
2275 wxClientData
* data
= NULL
);
2278 Sets the image list.
2280 void SetImageList(wxImageList
* imagelist
);
2283 Calls the identical method from wxDataViewTreeStore.
2285 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
2288 Calls the identical method from wxDataViewTreeStore.
2290 void SetItemExpandedIcon(const wxDataViewItem
& item
,
2291 const wxIcon
& icon
);
2294 Calls the identical method from wxDataViewTreeStore.
2296 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
2299 Calls the identical method from wxDataViewTreeStore.
2301 void SetItemText(const wxDataViewItem
& item
,
2302 const wxString
& text
);
2307 @class wxDataViewListStore
2309 wxDataViewListStore is a specialised wxDataViewModel for storing
2310 a simple table of data. Since it derives from wxDataViewIndexListModel
2311 its data is be accessed by row (i.e. by index) instead of only
2314 This class actually stores the values (therefore its name)
2315 and implements all virtual methods from the base classes so it can be
2316 used directly without having to derive any class from it, but it is
2317 mostly used from within wxDataViewListCtrl.
2323 class wxDataViewListStore
: public wxDataViewIndexListModel
2329 wxDataViewListStore();
2334 ~wxDataViewListStore();
2337 Prepends a data column.
2339 @a variantype indicates the type of values store in the column.
2341 This does not automatically fill in any (default) values in
2342 rows which exist in the store already.
2344 void PrependColumn( const wxString
&varianttype
);
2347 Inserts a data column before @a pos.
2349 @a variantype indicates the type of values store in the column.
2351 This does not automatically fill in any (default) values in
2352 rows which exist in the store already.
2354 void InsertColumn( unsigned int pos
, const wxString
&varianttype
);
2357 Appends a data column.
2359 @a variantype indicates the type of values store in the column.
2361 This does not automatically fill in any (default) values in
2362 rows which exist in the store already.
2364 void AppendColumn( const wxString
&varianttype
);
2367 Appends an item (=row) and fills it with @a values.
2369 The values must match the values specifies in the column
2370 in number and type. No (default) values are filled in
2373 void AppendItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2376 Prepends an item (=row) and fills it with @a values.
2378 The values must match the values specifies in the column
2379 in number and type. No (default) values are filled in
2382 void PrependItem( const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2385 Inserts an item (=row) and fills it with @a values.
2387 The values must match the values specifies in the column
2388 in number and type. No (default) values are filled in
2391 void InsertItem( unsigned int row
, const wxVector
<wxVariant
> &values
, wxClientData
*data
= NULL
);
2394 Delete the item (=row) at position @a pos.
2396 void DeleteItem( unsigned pos
);
2399 Delete all item (=all rows) in the store.
2401 void DeleteAllItems();
2404 Overridden from wxDataViewModel
2406 virtual unsigned int GetColumnCount() const;
2409 Overridden from wxDataViewModel
2411 virtual wxString
GetColumnType( unsigned int col
) const;
2414 Overridden from wxDataViewIndexListModel
2416 virtual void GetValueByRow( wxVariant
&value
,
2417 unsigned int row
, unsigned int col
) const;
2420 Overridden from wxDataViewIndexListModel
2422 virtual bool SetValueByRow( const wxVariant
&value
,
2423 unsigned int row
, unsigned int col
);
2428 @class wxDataViewTreeStore
2430 wxDataViewTreeStore is a specialised wxDataViewModel for storing simple
2431 trees very much like wxTreeCtrl does and it offers a similar API.
2433 This class actually stores the entire tree and the values (therefore its name)
2434 and implements all virtual methods from the base class so it can be used directly
2435 without having to derive any class from it, but it is mostly used from within
2441 class wxDataViewTreeStore
: public wxDataViewModel
2445 Constructor. Creates the invisible root node internally.
2447 wxDataViewTreeStore();
2452 virtual ~wxDataViewTreeStore();
2457 wxDataViewItem
AppendContainer(const wxDataViewItem
& parent
,
2458 const wxString
& text
,
2459 const wxIcon
& icon
= wxNullIcon
,
2460 const wxIcon
& expanded
= wxNullIcon
,
2461 wxClientData
* data
= NULL
);
2466 wxDataViewItem
AppendItem(const wxDataViewItem
& parent
,
2467 const wxString
& text
,
2468 const wxIcon
& icon
= wxNullIcon
,
2469 wxClientData
* data
= NULL
);
2472 Delete all item in the model.
2474 void DeleteAllItems();
2477 Delete all children of the item, but not the item itself.
2479 void DeleteChildren(const wxDataViewItem
& item
);
2484 void DeleteItem(const wxDataViewItem
& item
);
2487 Return the number of children of item.
2489 int GetChildCount(const wxDataViewItem
& parent
) const;
2492 Returns the client data associated with the item.
2494 wxClientData
* GetItemData(const wxDataViewItem
& item
) const;
2497 Returns the icon to display in expanded containers.
2499 const wxIcon
& GetItemExpandedIcon(const wxDataViewItem
& item
) const;
2502 Returns the icon of the item.
2504 const wxIcon
& GetItemIcon(const wxDataViewItem
& item
) const;
2507 Returns the text of the item.
2509 wxString
GetItemText(const wxDataViewItem
& item
) const;
2512 Returns the nth child item of item.
2514 wxDataViewItem
GetNthChild(const wxDataViewItem
& parent
,
2515 unsigned int pos
) const;
2518 Inserts a container after @a previous.
2520 wxDataViewItem
InsertContainer(const wxDataViewItem
& parent
,
2521 const wxDataViewItem
& previous
,
2522 const wxString
& text
,
2523 const wxIcon
& icon
= wxNullIcon
,
2524 const wxIcon
& expanded
= wxNullIcon
,
2525 wxClientData
* data
= NULL
);
2528 Inserts an item after @a previous.
2530 wxDataViewItem
InsertItem(const wxDataViewItem
& parent
,
2531 const wxDataViewItem
& previous
,
2532 const wxString
& text
,
2533 const wxIcon
& icon
= wxNullIcon
,
2534 wxClientData
* data
= NULL
);
2537 Inserts a container before the first child item or @a parent.
2539 wxDataViewItem
PrependContainer(const wxDataViewItem
& parent
,
2540 const wxString
& text
,
2541 const wxIcon
& icon
= wxNullIcon
,
2542 const wxIcon
& expanded
= wxNullIcon
,
2543 wxClientData
* data
= NULL
);
2546 Inserts an item before the first child item or @a parent.
2548 wxDataViewItem
PrependItem(const wxDataViewItem
& parent
,
2549 const wxString
& text
,
2550 const wxIcon
& icon
= wxNullIcon
,
2551 wxClientData
* data
= NULL
);
2554 Sets the client data associated with the item.
2556 void SetItemData(const wxDataViewItem
& item
, wxClientData
* data
);
2559 Sets the expanded icon for the item.
2561 void SetItemExpandedIcon(const wxDataViewItem
& item
,
2562 const wxIcon
& icon
);
2565 Sets the icon for the item.
2567 void SetItemIcon(const wxDataViewItem
& item
, const wxIcon
& icon
);
2572 @class wxDataViewIconText
2574 wxDataViewIconText is used by wxDataViewIconTextRenderer for data transfer.
2575 This class can be converted to and from a wxVariant.
2580 class wxDataViewIconText
: public wxObject
2587 wxDataViewIconText(const wxString
& text
= wxEmptyString
,
2588 const wxIcon
& icon
= wxNullIcon
);
2589 wxDataViewIconText(const wxDataViewIconText
& other
);
2595 const wxIcon
& GetIcon() const;
2600 wxString
GetText() const;
2605 void SetIcon(const wxIcon
& icon
);
2610 void SetText(const wxString
& text
);
2616 @class wxDataViewEvent
2618 This is the event class for the wxDataViewCtrl notifications.
2620 @beginEventTable{wxDataViewEvent}
2621 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
2622 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
2623 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
2624 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
2625 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
2626 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
2627 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
2628 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
2629 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
2630 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
2631 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
2632 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
2633 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
2634 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
2635 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
2636 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
2637 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
2638 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
2639 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
2640 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
2641 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
2642 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
2643 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
2644 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
2645 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
2646 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
2647 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
2648 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
2649 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
2650 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
2651 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
2652 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
2653 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
2654 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
2655 @event{EVT_DATAVIEW_CACHE_HINT(id, func)}
2656 Process a @c wxEVT_COMMAND_DATAVIEW_CACHE_HINT event.
2660 @category{events,dvc}
2662 class wxDataViewEvent
: public wxNotifyEvent
2666 Constructor. Typically used by wxWidgets internals only.
2668 wxDataViewEvent(wxEventType commandType
= wxEVT_NULL
,
2672 Returns the position of the column in the control or -1
2673 if no column field was set by the event emitter.
2675 int GetColumn() const;
2678 Returns a pointer to the wxDataViewColumn from which
2679 the event was emitted or @NULL.
2681 wxDataViewColumn
* GetDataViewColumn() const;
2684 Returns the wxDataViewModel associated with the event.
2686 wxDataViewModel
* GetModel() const;
2689 Returns the position of a context menu event in screen coordinates.
2691 wxPoint
GetPosition() const;
2694 Returns a reference to a value.
2696 const wxVariant
& GetValue() const;
2699 Sets the column index associated with this event.
2701 void SetColumn(int col
);
2704 For @c wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
2706 void SetDataViewColumn(wxDataViewColumn
* col
);
2709 Sets the dataview model associated with this event.
2711 void SetModel(wxDataViewModel
* model
);
2714 Sets the value associated with this event.
2716 void SetValue(const wxVariant
& value
);
2719 Set wxDataObject for data transfer within a drag operation.
2721 void SetDataObject( wxDataObject
*obj
);
2724 Used internally. Gets associated wxDataObject for data transfer
2725 within a drag operation.
2727 wxDataObject
*GetDataObject() const;
2730 Used internally. Sets the wxDataFormat during a drop operation.
2732 void SetDataFormat( const wxDataFormat
&format
);
2735 Gets the wxDataFormat during a drop operation.
2737 wxDataFormat
GetDataFormat() const;
2740 Used internally. Sets the data size for a drop data transfer.
2742 void SetDataSize( size_t size
);
2745 Gets the data size for a drop data transfer.
2747 size_t GetDataSize() const;
2750 Used internally. Sets the data buffer for a drop data transfer.
2752 void SetDataBuffer( void* buf
);
2755 Gets the data buffer for a drop data transfer.
2757 void *GetDataBuffer() const;
2760 Return the first row that will be displayed.
2762 int GetCacheFrom() const;
2765 Return the last row that will be displayed.
2767 int GetCacheTo() const;