]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/dataview.h
Use virtual items in wxDVC sample under Mac too.
[wxWidgets.git] / interface / wx / dataview.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: dataview.h
80932a3e 3// Purpose: interface of wxDataView* classes
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
b321b61c 9
23324ae1
FM
10/**
11 @class wxDataViewModel
7c913512 12
c4e57202
FM
13 wxDataViewModel is the base class for all data model to be displayed by a
14 wxDataViewCtrl.
15
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.
22
23 Since you will usually also allow the wxDataViewCtrl to change your data
23324ae1 24 through its graphical interface, you will also have to override
c4e57202 25 wxDataViewModel::SetValue which the wxDataViewCtrl will call when a change
795dac4c 26 to some data has been committed.
7c913512 27
c4e57202
FM
28 wxDataViewModel (as indeed the entire wxDataViewCtrl code) is using wxVariant
29 to store data and its type in a generic way. wxVariant can be extended to contain
23324ae1 30 almost any data without changes to the original class.
7c913512 31
c4e57202
FM
32 The data that is presented through this data model is expected to change at
33 run-time. You need to inform the data model when a change happened.
34 Depending on what happened you need to call one of the following methods:
35 - wxDataViewModel::ValueChanged,
36 - wxDataViewModel::ItemAdded,
37 - wxDataViewModel::ItemDeleted,
38 - wxDataViewModel::ItemChanged,
39 - wxDataViewModel::Cleared.
40
41 There are plural forms for notification of addition, change or removal of
42 several item at once. See:
43 - wxDataViewModel::ItemsAdded,
44 - wxDataViewModel::ItemsDeleted,
45 - wxDataViewModel::ItemsChanged.
46
47 Note that wxDataViewModel does not define the position or index of any item
48 in the control because different controls might display the same data differently.
49 wxDataViewModel does provide a wxDataViewModel::Compare method which the
50 wxDataViewCtrl may use to sort the data either in conjunction with a column
51 header or without (see wxDataViewModel::HasDefaultCompare).
52
53 This class maintains a list of wxDataViewModelNotifier which link this class
54 to the specific implementations on the supported platforms so that e.g. calling
55 wxDataViewModel::ValueChanged on this model will just call
56 wxDataViewModelNotifier::ValueChanged for each notifier that has been added.
57 You can also add your own notifier in order to get informed about any changes
23324ae1 58 to the data in the list model.
7c913512 59
c4e57202 60 Currently wxWidgets provides the following models apart from the base model:
bda698ed
RR
61 wxDataViewIndexListModel, wxDataViewVirtualListModel, wxDataViewTreeStore,
62 wxDataViewListStore.
7c913512 63
e4e83d3a 64 Note that wxDataViewModel is reference counted, derives from wxRefCounter
c4e57202
FM
65 and cannot be deleted directly as it can be shared by several wxDataViewCtrls.
66 This implies that you need to decrease the reference count after
23324ae1 67 associating the model with a control like this:
7c913512 68
23324ae1 69 @code
14f73cf1 70 wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, wxID_ANY );
23324ae1 71 wxDataViewModel *musicModel = new MyMusicModel;
14f73cf1
FM
72 m_musicCtrl->AssociateModel( musicModel );
73 musicModel->DecRef(); // avoid memory leak !!
74
23324ae1
FM
75 // add columns now
76 @endcode
7c913512 77
23324ae1 78 @library{wxadv}
b321b61c 79 @category{dvc}
23324ae1 80*/
e4e83d3a 81class wxDataViewModel : public wxRefCounter
23324ae1
FM
82{
83public:
84 /**
85 Constructor.
86 */
87 wxDataViewModel();
88
23324ae1 89 /**
c4e57202 90 Adds a wxDataViewModelNotifier to the model.
23324ae1
FM
91 */
92 void AddNotifier(wxDataViewModelNotifier* notifier);
93
795dac4c
VZ
94 /**
95 Change the value of the given item and update the control to reflect
96 it.
97
98 This function simply calls SetValue() and, if it succeeded,
99 ValueChanged().
100
101 @since 2.9.1
102
103 @param variable
104 The new value.
105 @param item
106 The item (row) to update.
107 @param col
108 The column to update.
109 @return
110 @true if both SetValue() and ValueChanged() returned @true.
111 */
112 bool ChangeValue(const wxVariant& variant,
113 const wxDataViewItem& item,
114 unsigned int col);
115
23324ae1 116 /**
c4e57202
FM
117 Called to inform the model that all data has been cleared.
118 The control will reread the data from the model again.
23324ae1
FM
119 */
120 virtual bool Cleared();
121
122 /**
123 The compare function to be used by control. The default compare function
124 sorts by container and other items separately and in ascending order.
125 Override this for a different sorting behaviour.
c4e57202
FM
126
127 @see HasDefaultCompare().
23324ae1
FM
128 */
129 virtual int Compare(const wxDataViewItem& item1,
130 const wxDataViewItem& item2,
131 unsigned int column,
862de7b3 132 bool ascending) const;
23324ae1
FM
133
134 /**
13f184c0 135 Override this to indicate that the item has special font attributes.
c4e57202
FM
136 This only affects the wxDataViewTextRendererText renderer.
137
138 @see wxDataViewItemAttr.
23324ae1 139 */
fadc2df6
FM
140 virtual bool GetAttr(const wxDataViewItem& item, unsigned int col,
141 wxDataViewItemAttr& attr);
23324ae1
FM
142
143 /**
c4e57202
FM
144 Override this so the control can query the child items of an item.
145 Returns the number of items.
23324ae1
FM
146 */
147 virtual unsigned int GetChildren(const wxDataViewItem& item,
fadc2df6 148 wxDataViewItemArray& children) const = 0;
23324ae1
FM
149
150 /**
151 Override this to indicate the number of columns in the model.
152 */
b91c4601 153 virtual unsigned int GetColumnCount() const = 0;
23324ae1
FM
154
155 /**
156 Override this to indicate what type of data is stored in the
c4e57202
FM
157 column specified by @a col.
158
159 This should return a string indicating the type of data as reported by wxVariant.
23324ae1 160 */
b91c4601 161 virtual wxString GetColumnType(unsigned int col) const = 0;
23324ae1
FM
162
163 /**
164 Override this to indicate which wxDataViewItem representing the parent
4cc4bfaf 165 of @a item or an invalid wxDataViewItem if the the root item is
23324ae1
FM
166 the parent item.
167 */
b91c4601 168 virtual wxDataViewItem GetParent(const wxDataViewItem& item) const = 0;
23324ae1
FM
169
170 /**
c4e57202 171 Override this to indicate the value of @a item.
23324ae1
FM
172 A wxVariant is used to store the data.
173 */
b91c4601
FM
174 virtual void GetValue(wxVariant& variant, const wxDataViewItem& item,
175 unsigned int col) const = 0;
23324ae1
FM
176
177 /**
c4e57202
FM
178 Override this method to indicate if a container item merely acts as a
179 headline (or for categorisation) or if it also acts a normal item with
180 entries for futher columns. By default returns @false.
23324ae1 181 */
328f5751 182 virtual bool HasContainerColumns(const wxDataViewItem& item) const;
23324ae1
FM
183
184 /**
185 Override this to indicate that the model provides a default compare
186 function that the control should use if no wxDataViewColumn has been
187 chosen for sorting. Usually, the user clicks on a column header for
c4e57202
FM
188 sorting, the data will be sorted alphanumerically.
189
190 If any other order (e.g. by index or order of appearance) is required,
191 then this should be used.
192 See wxDataViewIndexListModel for a model which makes use of this.
23324ae1 193 */
328f5751 194 virtual bool HasDefaultCompare() const;
23324ae1
FM
195
196 /**
4cc4bfaf 197 Override this to indicate of @a item is a container, i.e. if
23324ae1
FM
198 it can have child items.
199 */
b91c4601 200 virtual bool IsContainer(const wxDataViewItem& item) const = 0;
23324ae1
FM
201
202 /**
c4e57202 203 Call this to inform the model that an item has been added to the data.
23324ae1
FM
204 */
205 virtual bool ItemAdded(const wxDataViewItem& parent,
206 const wxDataViewItem& item);
207
208 /**
209 Call this to inform the model that an item has changed.
c4e57202 210
23324ae1
FM
211 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
212 event (in which the column fields will not be set) to the user.
213 */
214 virtual bool ItemChanged(const wxDataViewItem& item);
215
216 /**
217 Call this to inform the model that an item has been deleted from the data.
218 */
219 virtual bool ItemDeleted(const wxDataViewItem& parent,
220 const wxDataViewItem& item);
221
222 /**
c4e57202 223 Call this to inform the model that several items have been added to the data.
23324ae1
FM
224 */
225 virtual bool ItemsAdded(const wxDataViewItem& parent,
226 const wxDataViewItemArray& items);
227
228 /**
229 Call this to inform the model that several items have changed.
c4e57202 230
23324ae1
FM
231 This will eventually emit wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
232 events (in which the column fields will not be set) to the user.
233 */
234 virtual bool ItemsChanged(const wxDataViewItemArray& items);
235
236 /**
237 Call this to inform the model that several items have been deleted.
238 */
239 virtual bool ItemsDeleted(const wxDataViewItem& parent,
240 const wxDataViewItemArray& items);
241
242 /**
4cc4bfaf 243 Remove the @a notifier from the list of notifiers.
23324ae1
FM
244 */
245 void RemoveNotifier(wxDataViewModelNotifier* notifier);
246
247 /**
c4e57202 248 Call this to initiate a resort after the sort function has been changed.
23324ae1
FM
249 */
250 virtual void Resort();
251
252 /**
253 This gets called in order to set a value in the data model.
795dac4c 254
c4e57202
FM
255 The most common scenario is that the wxDataViewCtrl calls this method
256 after the user changed some data in the view.
257
795dac4c
VZ
258 This is the function you need to override in your derived class but if
259 you want to call it, ChangeValue() is usually more convenient as
260 otherwise you need to manually call ValueChanged() to update the
261 control itself.
23324ae1 262 */
795dac4c
VZ
263 virtual bool SetValue(const wxVariant& variant,
264 const wxDataViewItem& item,
b91c4601 265 unsigned int col) = 0;
23324ae1
FM
266
267 /**
c4e57202
FM
268 Call this to inform this model that a value in the model has been changed.
269 This is also called from wxDataViewCtrl's internal editing code, e.g. when
270 editing a text field in the control.
271
23324ae1
FM
272 This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
273 event to the user.
274 */
275 virtual bool ValueChanged(const wxDataViewItem& item,
276 unsigned int col);
5e6e278d
FM
277
278protected:
279
280 /**
281 Destructor. This should not be called directly. Use DecRef() instead.
282 */
283 virtual ~wxDataViewModel();
23324ae1
FM
284};
285
286
e54c96f1 287
e39de702
RR
288/**
289 @class wxDataViewIndexListModel
e39de702 290
c4e57202
FM
291 wxDataViewIndexListModel is a specialized data model which lets you address
292 an item by its position (row) rather than its wxDataViewItem (which you can
293 obtain from this class).
e39de702
RR
294 This model also provides its own wxDataViewIndexListModel::Compare
295 method which sorts the model's data by the index.
b91c4601 296
c4e57202
FM
297 This model is not a virtual model since the control stores each wxDataViewItem.
298 Use wxDataViewVirtualListModel if you need to display millions of items or
299 have other reason to use a virtual control.
e39de702 300
8ed522d9 301 @library{wxadv}
b321b61c 302 @category{dvc}
e39de702
RR
303*/
304class wxDataViewIndexListModel : public wxDataViewModel
305{
306public:
307 /**
308 Constructor.
309 */
310 wxDataViewIndexListModel(unsigned int initial_size = 0);
311
312 /**
313 Destructor.
314 */
adaaa686 315 virtual ~wxDataViewIndexListModel();
e39de702
RR
316
317 /**
318 Compare method that sorts the items by their index.
319 */
320 int Compare(const wxDataViewItem& item1,
321 const wxDataViewItem& item2,
322 unsigned int column, bool ascending);
323
324 /**
13f184c0 325 Override this to indicate that the row has special font attributes.
c4e57202
FM
326 This only affects the wxDataViewTextRendererText() renderer.
327
328 @see wxDataViewItemAttr.
e39de702 329 */
8eff6c56 330 virtual bool GetAttrByRow(unsigned int row, unsigned int col,
fadc2df6 331 wxDataViewItemAttr& attr);
e39de702
RR
332
333 /**
334 Returns the wxDataViewItem at the given @e row.
335 */
336 wxDataViewItem GetItem(unsigned int row) const;
337
338 /**
339 Returns the position of given @e item.
340 */
341 unsigned int GetRow(const wxDataViewItem& item) const;
342
343 /**
344 Override this to allow getting values from the model.
345 */
8eff6c56 346 virtual void GetValueByRow(wxVariant& variant, unsigned int row,
fadc2df6 347 unsigned int col) const = 0;
e39de702
RR
348
349 /**
c4e57202
FM
350 Call this after if the data has to be read again from the model.
351 This is useful after major changes when calling the methods below
352 (possibly thousands of times) doesn't make sense.
e39de702
RR
353 */
354 void Reset(unsigned int new_size);
355
356 /**
357 Call this after a row has been appended to the model.
358 */
359 void RowAppended();
360
361 /**
362 Call this after a row has been changed.
363 */
364 void RowChanged(unsigned int row);
365
366 /**
367 Call this after a row has been deleted.
368 */
369 void RowDeleted(unsigned int row);
370
371 /**
372 Call this after a row has been inserted at the given position.
373 */
374 void RowInserted(unsigned int before);
375
376 /**
377 Call this after a row has been prepended to the model.
378 */
379 void RowPrepended();
380
381 /**
382 Call this after a value has been changed.
383 */
384 void RowValueChanged(unsigned int row, unsigned int col);
385
386 /**
c4e57202
FM
387 Call this after rows have been deleted.
388 The array will internally get copied and sorted in descending order so
389 that the rows with the highest position will be deleted first.
e39de702
RR
390 */
391 void RowsDeleted(const wxArrayInt& rows);
392
393 /**
394 Called in order to set a value in the model.
395 */
8eff6c56 396 virtual bool SetValueByRow(const wxVariant& variant, unsigned int row,
fadc2df6 397 unsigned int col) = 0;
e39de702
RR
398};
399
400
401
402/**
403 @class wxDataViewVirtualListModel
e39de702 404
c4e57202
FM
405 wxDataViewVirtualListModel is a specialized data model which lets you address
406 an item by its position (row) rather than its wxDataViewItem and as such offers
407 the exact same interface as wxDataViewIndexListModel.
408 The important difference is that under platforms other than OS X, using this
409 model will result in a truly virtual control able to handle millions of items
410 as the control doesn't store any item (a feature not supported by the
e39de702
RR
411 Carbon API under OS X).
412
413 @see wxDataViewIndexListModel for the API.
414
8ed522d9 415 @library{wxadv}
b321b61c 416 @category{dvc}
e39de702
RR
417*/
418class wxDataViewVirtualListModel : public wxDataViewModel
419{
420public:
421 /**
422 Constructor.
423 */
424 wxDataViewVirtualListModel(unsigned int initial_size = 0);
6da3d196 425};
e39de702
RR
426
427
428
23324ae1
FM
429/**
430 @class wxDataViewItemAttr
7c913512 431
c4e57202
FM
432 This class is used to indicate to a wxDataViewCtrl that a certain item
433 (see wxDataViewItem) has extra font attributes for its renderer.
434 For this, it is required to override wxDataViewModel::GetAttr.
7c913512 435
c4e57202 436 Attributes are currently only supported by wxDataViewTextRendererText.
7c913512 437
23324ae1 438 @library{wxadv}
b321b61c 439 @category{dvc}
23324ae1 440*/
7c913512 441class wxDataViewItemAttr
23324ae1
FM
442{
443public:
444 /**
445 Constructor.
446 */
447 wxDataViewItemAttr();
448
449 /**
450 Call this to indicate that the item shall be displayed in bold text.
451 */
452 void SetBold(bool set);
453
454 /**
c4e57202 455 Call this to indicate that the item shall be displayed with that colour.
23324ae1
FM
456 */
457 void SetColour(const wxColour& colour);
458
459 /**
460 Call this to indicate that the item shall be displayed in italic text.
461 */
462 void SetItalic(bool set);
463};
464
465
e54c96f1 466
23324ae1
FM
467/**
468 @class wxDataViewItem
7c913512 469
c4e57202
FM
470 wxDataViewItem is a small opaque class that represents an item in a wxDataViewCtrl
471 in a persistent way, i.e. indepent of the position of the item in the control
472 or changes to its contents.
473
474 It must hold a unique ID of type @e void* in its only field and can be converted
475 to and from it.
476
477 If the ID is @NULL the wxDataViewItem is invalid and wxDataViewItem::IsOk will
478 return @false which used in many places in the API of wxDataViewCtrl to
479 indicate that e.g. no item was found. An ID of @NULL is also used to indicate
480 the invisible root. Examples for this are wxDataViewModel::GetParent and
23324ae1 481 wxDataViewModel::GetChildren.
7c913512 482
23324ae1 483 @library{wxadv}
b321b61c 484 @category{dvc}
23324ae1 485*/
7c913512 486class wxDataViewItem
23324ae1
FM
487{
488public:
489 //@{
490 /**
c4e57202 491 Constructor.
23324ae1 492 */
4cc4bfaf 493 wxDataViewItem(void* id = NULL);
7c913512 494 wxDataViewItem(const wxDataViewItem& item);
23324ae1
FM
495 //@}
496
497 /**
498 Returns the ID.
499 */
328f5751 500 void* GetID() const;
23324ae1
FM
501
502 /**
c4e57202 503 Returns @true if the ID is not @NULL.
23324ae1 504 */
328f5751 505 bool IsOk() const;
23324ae1
FM
506};
507
508
e54c96f1 509
23324ae1
FM
510/**
511 @class wxDataViewCtrl
7c913512 512
c4e57202
FM
513 wxDataViewCtrl is a control to display data either in a tree like fashion or
514 in a tabular form or both.
02b51ae5 515
c4e57202
FM
516 If you only need to display a simple tree structure with an API more like the
517 older wxTreeCtrl class, then the specialized wxDataViewTreeCtrl can be used.
02b51ae5 518 Likewise, if you only want to display simple table structure you can use
832df171
RR
519 the specialized wxDataViewListCtrl class. Both wxDataViewTreeCtrl and
520 wxDataViewListCtrl can be used without defining your own wxDataViewModel.
c4e57202
FM
521
522 A wxDataViewItem is used to represent a (visible) item in the control.
523
80932a3e 524 Unlike wxListCtrl, wxDataViewCtrl doesn't get its data from the user through
c4e57202
FM
525 virtual functions or by setting it directly. Instead you need to write your own
526 wxDataViewModel and associate it with this control.
527 Then you need to add a number of wxDataViewColumn to this control to define
528 what each column shall display. Each wxDataViewColumn in turn owns 1 instance
529 of a wxDataViewRenderer to render its cells.
530
531 A number of standard renderers for rendering text, dates, images, toggle,
532 a progress bar etc. are provided. Additionally, the user can write custom
80932a3e 533 renderers deriving from wxDataViewCustomRenderer for displaying anything.
c4e57202
FM
534
535 All data transfer from the control to the model and the user code is done
536 through wxVariant which can be extended to support more data formats as necessary.
537 Accordingly, all type information uses the strings returned from wxVariant::GetType.
7c913512 538
23324ae1 539 @beginStyleTable
8c6791e4 540 @style{wxDV_SINGLE}
23324ae1 541 Single selection mode. This is the default.
8c6791e4 542 @style{wxDV_MULTIPLE}
23324ae1 543 Multiple selection mode.
8c6791e4 544 @style{wxDV_ROW_LINES}
23324ae1 545 Use alternating colours for rows if supported by platform and theme.
8c6791e4 546 @style{wxDV_HORIZ_RULES}
23324ae1 547 Display fine rules between row if supported.
8c6791e4 548 @style{wxDV_VERT_RULES}
23324ae1 549 Display fine rules between columns is supported.
d7c6d397 550 @style{wxDV_VARIABLE_LINE_HEIGHT}
c4e57202 551 Allow variable line heights.
14f73cf1 552 This can be inefficient when displaying large number of items.
23324ae1 553 @endStyleTable
7c913512 554
3051a44a 555 @beginEventEmissionTable{wxDataViewEvent}
7d01d660 556 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
14f73cf1 557 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
7d01d660 558 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
14f73cf1 559 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
3e978cf7
RR
560 @event{EVT_DATAVIEW_ITEM_START_EDITING(id, func)}
561 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event. This
562 event can be vetoed in order to prevent editing on an item by item
563 basis. Still experimental.
7d01d660 564 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
14f73cf1 565 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
7d01d660 566 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
14f73cf1 567 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
7d01d660 568 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
14f73cf1 569 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
7d01d660 570 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
14f73cf1 571 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
7d01d660 572 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
14f73cf1 573 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
7d01d660 574 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
14f73cf1 575 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
7d01d660 576 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
14f73cf1 577 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
7d01d660 578 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
14f73cf1 579 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
7d01d660 580 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
14f73cf1 581 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
7d01d660 582 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
14f73cf1 583 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
7d01d660 584 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
14f73cf1 585 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
7d01d660 586 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
14f73cf1 587 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
591cc82d 588 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
14f73cf1 589 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
e4de825e 590 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
14f73cf1 591 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
e4de825e 592 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
14f73cf1 593 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
7d01d660 594 @endEventTable
b91c4601 595
23324ae1 596 @library{wxadv}
b321b61c 597 @category{ctrl,dvc}
7e59b885 598 @appearance{dataviewctrl.png}
23324ae1
FM
599*/
600class wxDataViewCtrl : public wxControl
601{
602public:
23324ae1 603 /**
19723525 604 Default Constructor.
23324ae1
FM
605 */
606 wxDataViewCtrl();
b91c4601 607
19723525
RR
608 /**
609 Constructor. Calls Create().
610 */
7c913512
FM
611 wxDataViewCtrl(wxWindow* parent, wxWindowID id,
612 const wxPoint& pos = wxDefaultPosition,
613 const wxSize& size = wxDefaultSize,
614 long style = 0,
615 const wxValidator& validator = wxDefaultValidator);
23324ae1
FM
616
617 /**
618 Destructor.
619 */
adaaa686 620 virtual ~wxDataViewCtrl();
23324ae1 621
e39de702 622 /**
19723525 623 Appends a wxDataViewColumn to the control. Returns @true on success.
c4e57202 624
e39de702
RR
625 Note that there is a number of short cut methods which implicitly create
626 a wxDataViewColumn and a wxDataViewRenderer for it (see below).
627 */
628 virtual bool AppendColumn(wxDataViewColumn* col);
629
19723525
RR
630 /**
631 Prepends a wxDataViewColumn to the control. Returns @true on success.
c4e57202 632
19723525
RR
633 Note that there is a number of short cut methods which implicitly create
634 a wxDataViewColumn and a wxDataViewRenderer for it.
635 */
636 virtual bool PrependColumn(wxDataViewColumn* col);
637
638 /**
639 Inserts a wxDataViewColumn to the control. Returns @true on success.
640 */
641 virtual bool InsertColumn(unsigned int pos, wxDataViewColumn* col);
b91c4601 642
23324ae1
FM
643 //@{
644 /**
645 Appends a column for rendering a bitmap. Returns the wxDataViewColumn
646 created in the function or @NULL on failure.
647 */
648 wxDataViewColumn* AppendBitmapColumn(const wxString& label,
649 unsigned int model_column,
650 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
651 int width = -1,
652 wxAlignment align = wxALIGN_CENTER,
653 int flags = wxDATAVIEW_COL_RESIZABLE);
7c913512
FM
654 wxDataViewColumn* AppendBitmapColumn(const wxBitmap& label,
655 unsigned int model_column,
656 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
657 int width = -1,
658 wxAlignment align = wxALIGN_CENTER,
659 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1
FM
660 //@}
661
23324ae1
FM
662 //@{
663 /**
664 Appends a column for rendering a date. Returns the wxDataViewColumn
665 created in the function or @NULL on failure.
b91c4601 666
c4e57202
FM
667 @note The @a align parameter is applied to both the column header and
668 the column renderer.
23324ae1
FM
669 */
670 wxDataViewColumn* AppendDateColumn(const wxString& label,
671 unsigned int model_column,
672 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
673 int width = -1,
882678eb 674 wxAlignment align = wxALIGN_NOT,
23324ae1 675 int flags = wxDATAVIEW_COL_RESIZABLE);
7c913512
FM
676 wxDataViewColumn* AppendDateColumn(const wxBitmap& label,
677 unsigned int model_column,
678 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
679 int width = -1,
882678eb 680 wxAlignment align = wxALIGN_NOT,
7c913512 681 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1
FM
682 //@}
683
684 //@{
685 /**
686 Appends a column for rendering text with an icon. Returns the wxDataViewColumn
c4e57202
FM
687 created in the function or @NULL on failure.
688 This method uses the wxDataViewIconTextRenderer class.
b91c4601 689
c4e57202
FM
690 @note The @a align parameter is applied to both the column header and
691 the column renderer.
23324ae1
FM
692 */
693 wxDataViewColumn* AppendIconTextColumn(const wxString& label,
694 unsigned int model_column,
695 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
696 int width = -1,
882678eb 697 wxAlignment align = wxALIGN_NOT,
23324ae1 698 int flags = wxDATAVIEW_COL_RESIZABLE);
7c913512
FM
699 wxDataViewColumn* AppendIconTextColumn(const wxBitmap& label,
700 unsigned int model_column,
701 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
702 int width = -1,
882678eb 703 wxAlignment align = wxALIGN_NOT,
7c913512 704 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1
FM
705 //@}
706
707 //@{
708 /**
709 Appends a column for rendering a progress indicator. Returns the
e39de702 710 wxDataViewColumn created in the function or @NULL on failure.
b91c4601 711
c4e57202
FM
712 @note The @a align parameter is applied to both the column header and
713 the column renderer.
23324ae1
FM
714 */
715 wxDataViewColumn* AppendProgressColumn(const wxString& label,
716 unsigned int model_column,
717 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
718 int width = 80,
719 wxAlignment align = wxALIGN_CENTER,
720 int flags = wxDATAVIEW_COL_RESIZABLE);
7c913512
FM
721 wxDataViewColumn* AppendProgressColumn(const wxBitmap& label,
722 unsigned int model_column,
723 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
724 int width = 80,
725 wxAlignment align = wxALIGN_CENTER,
726 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1
FM
727 //@}
728
729 //@{
730 /**
731 Appends a column for rendering text. Returns the wxDataViewColumn
732 created in the function or @NULL on failure.
b91c4601 733
c4e57202
FM
734 @note The @a align parameter is applied to both the column header and
735 the column renderer.
23324ae1
FM
736 */
737 wxDataViewColumn* AppendTextColumn(const wxString& label,
738 unsigned int model_column,
739 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
740 int width = -1,
882678eb 741 wxAlignment align = wxALIGN_NOT,
23324ae1 742 int flags = wxDATAVIEW_COL_RESIZABLE);
7c913512
FM
743 wxDataViewColumn* AppendTextColumn(const wxBitmap& label,
744 unsigned int model_column,
745 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
746 int width = -1,
882678eb 747 wxAlignment align = wxALIGN_NOT,
7c913512 748 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1
FM
749 //@}
750
751 //@{
752 /**
753 Appends a column for rendering a toggle. Returns the wxDataViewColumn
754 created in the function or @NULL on failure.
b91c4601 755
c4e57202
FM
756 @note The @a align parameter is applied to both the column header and
757 the column renderer.
23324ae1
FM
758 */
759 wxDataViewColumn* AppendToggleColumn(const wxString& label,
760 unsigned int model_column,
761 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
762 int width = 30,
763 wxAlignment align = wxALIGN_CENTER,
764 int flags = wxDATAVIEW_COL_RESIZABLE);
7c913512
FM
765 wxDataViewColumn* AppendToggleColumn(const wxBitmap& label,
766 unsigned int model_column,
767 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
768 int width = 30,
769 wxAlignment align = wxALIGN_CENTER,
770 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1
FM
771 //@}
772
773 /**
c4e57202
FM
774 Associates a wxDataViewModel with the control.
775 This increases the reference count of the model by 1.
23324ae1
FM
776 */
777 virtual bool AssociateModel(wxDataViewModel* model);
778
779 /**
780 Removes all columns.
781 */
782 virtual bool ClearColumns();
783
23324ae1
FM
784 /**
785 Collapses the item.
786 */
adaaa686 787 virtual void Collapse(const wxDataViewItem& item);
23324ae1
FM
788
789 /**
790 Create the control. Useful for two step creation.
791 */
792 bool Create(wxWindow* parent, wxWindowID id,
793 const wxPoint& pos = wxDefaultPosition,
794 const wxSize& size = wxDefaultSize,
795 long style = 0,
796 const wxValidator& validator = wxDefaultValidator);
797
798 /**
799 Deletes given column.
800 */
50ec54b6 801 virtual bool DeleteColumn(wxDataViewColumn* column);
23324ae1 802
e4de825e
RR
803 /**
804 Enable drag operations using the given @a format.
805 */
806 virtual bool EnableDragSource( const wxDataFormat &format );
02b51ae5 807
e4de825e
RR
808 /**
809 Enable drop operations using the given @a format.
810 */
811 virtual bool EnableDropTarget( const wxDataFormat &format );
02b51ae5 812
23324ae1
FM
813 /**
814 Call this to ensure that the given item is visible.
815 */
fadc2df6
FM
816 virtual void EnsureVisible(const wxDataViewItem& item,
817 const wxDataViewColumn* column = NULL);
23324ae1
FM
818
819 /**
820 Expands the item.
821 */
adaaa686 822 virtual void Expand(const wxDataViewItem& item);
23324ae1 823
4219d8b0
RR
824 /**
825 Expands all ancestors of the @a item. This method also
826 ensures that the item itself as well as all ancestor
827 items have been read from the model by the control.
828 */
829 virtual void ExpandAncestors( const wxDataViewItem & item );
798c0d87 830
23324ae1 831 /**
c4e57202
FM
832 Returns pointer to the column. @a pos refers to the position in the
833 control which may change after reordering columns by the user.
23324ae1 834 */
328f5751 835 virtual wxDataViewColumn* GetColumn(unsigned int pos) const;
23324ae1
FM
836
837 /**
838 Returns the number of columns.
839 */
328f5751 840 virtual unsigned int GetColumnCount() const;
23324ae1
FM
841
842 /**
843 Returns the position of the column or -1 if not found in the control.
844 */
328f5751 845 virtual int GetColumnPosition(const wxDataViewColumn* column) const;
23324ae1
FM
846
847 /**
848 Returns column containing the expanders.
849 */
328f5751 850 wxDataViewColumn* GetExpanderColumn() const;
23324ae1
FM
851
852 /**
853 Returns indentation.
854 */
328f5751 855 int GetIndent() const;
23324ae1
FM
856
857 /**
858 Returns item rect.
859 */
fadc2df6
FM
860 virtual wxRect GetItemRect(const wxDataViewItem& item,
861 const wxDataViewColumn* col = NULL) const;
23324ae1
FM
862
863 /**
c4e57202 864 Returns pointer to the data model associated with the control (if any).
23324ae1 865 */
adaaa686 866 wxDataViewModel* GetModel();
23324ae1
FM
867
868 /**
869 Returns first selected item or an invalid item if none is selected.
870 */
adaaa686 871 virtual wxDataViewItem GetSelection() const;
23324ae1
FM
872
873 /**
c4e57202 874 Fills @a sel with currently selected items and returns their number.
23324ae1 875 */
adaaa686 876 virtual int GetSelections(wxDataViewItemArray& sel) const;
23324ae1
FM
877
878 /**
879 Returns the wxDataViewColumn currently responsible for sorting
880 or @NULL if none has been selected.
881 */
328f5751 882 virtual wxDataViewColumn* GetSortingColumn() const;
23324ae1
FM
883
884 /**
885 Hittest.
886 */
fadc2df6
FM
887 virtual void HitTest(const wxPoint& point, wxDataViewItem& item,
888 wxDataViewColumn*& col) const;
23324ae1 889
739a8399
RR
890 /**
891 Return @true if the item is expanded.
739a8399
RR
892 */
893 virtual bool IsExpanded(const wxDataViewItem& item) const;
894
23324ae1
FM
895 /**
896 Return @true if the item is selected.
897 */
adaaa686 898 virtual bool IsSelected(const wxDataViewItem& item) const;
23324ae1
FM
899
900 /**
901 Select the given item.
902 */
adaaa686 903 virtual void Select(const wxDataViewItem& item);
23324ae1
FM
904
905 /**
906 Select all items.
907 */
adaaa686 908 virtual void SelectAll();
23324ae1
FM
909
910 /**
911 Set which column shall contain the tree-like expanders.
912 */
4cc4bfaf 913 void SetExpanderColumn(wxDataViewColumn* col);
23324ae1
FM
914
915 /**
916 Sets the indendation.
917 */
918 void SetIndent(int indent);
919
920 /**
921 Sets the selection to the array of wxDataViewItems.
922 */
adaaa686 923 virtual void SetSelections(const wxDataViewItemArray& sel);
23324ae1
FM
924
925 /**
926 Unselect the given item.
927 */
adaaa686 928 virtual void Unselect(const wxDataViewItem& item);
23324ae1
FM
929
930 /**
c4e57202
FM
931 Unselect all item.
932 This method only has effect if multiple selections are allowed.
23324ae1 933 */
adaaa686 934 virtual void UnselectAll();
23324ae1
FM
935};
936
937
e54c96f1 938
23324ae1
FM
939/**
940 @class wxDataViewModelNotifier
7c913512 941
c4e57202
FM
942 A wxDataViewModelNotifier instance is owned by a wxDataViewModel and mirrors
943 its notification interface.
944 See the documentation of that class for further information.
7c913512 945
8ed522d9 946 @library{wxadv}
b321b61c 947 @category{dvc}
23324ae1 948*/
7c913512 949class wxDataViewModelNotifier
23324ae1
FM
950{
951public:
952 /**
953 Constructor.
954 */
955 wxDataViewModelNotifier();
956
957 /**
958 Destructor.
959 */
adaaa686 960 virtual ~wxDataViewModelNotifier();
23324ae1
FM
961
962 /**
963 Called by owning model.
964 */
b91c4601 965 virtual bool Cleared() = 0;
23324ae1
FM
966
967 /**
968 Get owning wxDataViewModel.
969 */
e51bf699 970 wxDataViewModel* GetOwner() const;
23324ae1
FM
971
972 /**
973 Called by owning model.
974 */
fadc2df6
FM
975 virtual bool ItemAdded(const wxDataViewItem& parent,
976 const wxDataViewItem& item) = 0;
23324ae1
FM
977
978 /**
979 Called by owning model.
980 */
b91c4601 981 virtual bool ItemChanged(const wxDataViewItem& item) = 0;
23324ae1
FM
982
983 /**
984 Called by owning model.
985 */
fadc2df6
FM
986 virtual bool ItemDeleted(const wxDataViewItem& parent,
987 const wxDataViewItem& item) = 0;
23324ae1
FM
988
989 /**
990 Called by owning model.
991 */
fadc2df6
FM
992 virtual bool ItemsAdded(const wxDataViewItem& parent,
993 const wxDataViewItemArray& items);
23324ae1
FM
994
995 /**
996 Called by owning model.
997 */
adaaa686 998 virtual bool ItemsChanged(const wxDataViewItemArray& items);
23324ae1
FM
999
1000 /**
1001 Called by owning model.
1002 */
fadc2df6
FM
1003 virtual bool ItemsDeleted(const wxDataViewItem& parent,
1004 const wxDataViewItemArray& items);
23324ae1
FM
1005
1006 /**
1007 Called by owning model.
1008 */
b91c4601 1009 virtual void Resort() = 0;
23324ae1
FM
1010
1011 /**
1012 Set owner of this notifier. Used internally.
1013 */
1014 void SetOwner(wxDataViewModel* owner);
1015
1016 /**
1017 Called by owning model.
1018 */
b91c4601 1019 virtual bool ValueChanged(const wxDataViewItem& item, unsigned int col) = 0;
23324ae1
FM
1020};
1021
1022
c4e57202
FM
1023/**
1024 The mode of a data-view cell; see wxDataViewRenderer for more info.
1025*/
1026enum wxDataViewCellMode
1027{
1028 wxDATAVIEW_CELL_INERT,
1029
1030 /**
1031 Indicates that the user can double click the cell and something will
1032 happen (e.g. a window for editing a date will pop up).
1033 */
1034 wxDATAVIEW_CELL_ACTIVATABLE,
1035
1036 /**
1037 Indicates that the user can edit the data in-place, i.e. an control
1038 will show up after a slow click on the cell. This behaviour is best
1039 known from changing the filename in most file managers etc.
1040 */
1041 wxDATAVIEW_CELL_EDITABLE
1042};
1043
1044/**
1045 The values of this enum controls how a wxDataViewRenderer should display
1046 its contents in a cell.
1047*/
1048enum wxDataViewCellRenderState
1049{
1050 wxDATAVIEW_CELL_SELECTED = 1,
1051 wxDATAVIEW_CELL_PRELIT = 2,
1052 wxDATAVIEW_CELL_INSENSITIVE = 4,
1053 wxDATAVIEW_CELL_FOCUSED = 8
1054};
e54c96f1 1055
23324ae1
FM
1056/**
1057 @class wxDataViewRenderer
7c913512 1058
5b99d5d8 1059 This class is used by wxDataViewCtrl to render the individual cells.
c4e57202
FM
1060 One instance of a renderer class is owned by a wxDataViewColumn.
1061 There is a number of ready-to-use renderers provided:
1062 - wxDataViewTextRenderer,
c4e57202
FM
1063 - wxDataViewIconTextRenderer,
1064 - wxDataViewToggleRenderer,
1065 - wxDataViewProgressRenderer,
1066 - wxDataViewBitmapRenderer,
1067 - wxDataViewDateRenderer,
1068 - wxDataViewSpinRenderer.
7c913512 1069
23324ae1
FM
1070 Additionally, the user can write own renderers by deriving from
1071 wxDataViewCustomRenderer.
7c913512 1072
c4e57202
FM
1073 The ::wxDataViewCellMode and ::wxDataViewCellRenderState flags accepted
1074 by the constructors respectively controls what actions the cell data allows
1075 and how the renderer should display its contents in a cell.
7c913512 1076
23324ae1 1077 @library{wxadv}
b321b61c 1078 @category{dvc}
23324ae1
FM
1079*/
1080class wxDataViewRenderer : public wxObject
1081{
1082public:
1083 /**
b91c4601 1084 Constructor.
23324ae1
FM
1085 */
1086 wxDataViewRenderer(const wxString& varianttype,
1087 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
f2b7492a 1088 int align = wxDVR_DEFAULT_ALIGNMENT );
23324ae1 1089
c937bcac
VZ
1090 /**
1091 Enable or disable replacing parts of the item text with ellipsis to
1092 make it fit the column width.
1093
1094 This method only makes sense for the renderers working with text, such
1095 as wxDataViewTextRenderer or wxDataViewIconTextRenderer.
1096
1097 By default wxELLIPSIZE_MIDDLE is used.
1098
1099 @param mode
1100 Ellipsization mode, use wxELLIPSIZE_NONE to disable.
1101
1102 @since 2.9.1
1103 */
1104 void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE);
1105
1106 /**
1107 Disable replacing parts of the item text with ellipsis.
1108
1109 If ellipsizing is disabled, the string will be truncated if it doesn't
1110 fit.
1111
1112 This is the same as @code EnableEllipsize(wxELLIPSIZE_NONE) @endcode.
1113
1114 @since 2.9.1
1115 */
1116 void DisableEllipsize();
1117
20c36737 1118 /**
f2b7492a 1119 Returns the alignment. See SetAlignment()
20c36737
RR
1120 */
1121 virtual int GetAlignment() const;
1122
c937bcac
VZ
1123 /**
1124 Returns the ellipsize mode used by the renderer.
1125
1126 If the return value is wxELLIPSIZE_NONE, the text is simply truncated
1127 if it doesn't fit.
1128
1129 @see EnableEllipsize()
1130 */
1131 wxEllipsizeMode GetEllipsizeMode() const;
1132
23324ae1
FM
1133 /**
1134 Returns the cell mode.
1135 */
adaaa686 1136 virtual wxDataViewCellMode GetMode() const;
23324ae1
FM
1137
1138 /**
1139 Returns pointer to the owning wxDataViewColumn.
1140 */
adaaa686 1141 wxDataViewColumn* GetOwner() const;
23324ae1
FM
1142
1143 /**
1144 This methods retrieves the value from the renderer in order to
c4e57202
FM
1145 transfer the value back to the data model.
1146
1147 Returns @false on failure.
23324ae1 1148 */
b91c4601 1149 virtual bool GetValue(wxVariant& value) const = 0;
23324ae1
FM
1150
1151 /**
c4e57202 1152 Returns a string with the type of the wxVariant supported by this renderer.
23324ae1 1153 */
adaaa686 1154 wxString GetVariantType() const;
23324ae1 1155
20c36737 1156 /**
c4e57202
FM
1157 Sets the alignment of the renderer's content.
1158 The default value of @c wxDVR_DEFAULT_ALIGMENT indicates that the content
1159 should have the same alignment as the column header.
1160
1161 The method is not implemented under OS X and the renderer always aligns
1162 its contents as the column header on that platform. The other platforms
f2b7492a 1163 support both vertical and horizontal alignment.
20c36737
RR
1164 */
1165 virtual void SetAlignment( int align );
23324ae1 1166 /**
c4e57202
FM
1167 Sets the owning wxDataViewColumn.
1168 This is usually called from within wxDataViewColumn.
23324ae1 1169 */
adaaa686 1170 void SetOwner(wxDataViewColumn* owner);
23324ae1
FM
1171
1172 /**
c4e57202 1173 Set the value of the renderer (and thus its cell) to @a value.
23324ae1
FM
1174 The internal code will then render this cell with this data.
1175 */
b91c4601 1176 virtual bool SetValue(const wxVariant& value) = 0;
23324ae1
FM
1177
1178 /**
1179 Before data is committed to the data model, it is passed to this
1180 method where it can be checked for validity. This can also be
1181 used for checking a valid range or limiting the user input in
1182 a certain aspect (e.g. max number of characters or only alphanumeric
c4e57202
FM
1183 input, ASCII only etc.). Return @false if the value is not valid.
1184
23324ae1
FM
1185 Please note that due to implementation limitations, this validation
1186 is done after the editing control already is destroyed and the
1187 editing process finished.
1188 */
1189 virtual bool Validate(wxVariant& value);
1190};
1191
1192
e54c96f1 1193
23324ae1
FM
1194/**
1195 @class wxDataViewTextRenderer
7c913512 1196
c4e57202
FM
1197 wxDataViewTextRenderer is used for rendering text.
1198 It supports in-place editing if desired.
7c913512 1199
23324ae1 1200 @library{wxadv}
b321b61c 1201 @category{dvc}
23324ae1
FM
1202*/
1203class wxDataViewTextRenderer : public wxDataViewRenderer
1204{
1205public:
1206 /**
c4e57202 1207 The ctor.
23324ae1
FM
1208 */
1209 wxDataViewTextRenderer(const wxString& varianttype = "string",
05303ccd
RR
1210 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1211 int align = wxDVR_DEFAULT_ALIGNMENT );
23324ae1
FM
1212};
1213
1214
e54c96f1 1215
f2b7492a
RR
1216/**
1217 @class wxDataViewIconTextRenderer
f2b7492a
RR
1218
1219 The wxDataViewIconTextRenderer class is used to display text with
1220 a small icon next to it as it is typically done in a file manager.
c4e57202
FM
1221
1222 This classes uses the wxDataViewIconText helper class to store its data.
1223 wxDataViewIonText can be converted to and from a wxVariant using the left shift
f2b7492a
RR
1224 operator.
1225
1226 @library{wxadv}
b321b61c 1227 @category{dvc}
f2b7492a
RR
1228*/
1229class wxDataViewIconTextRenderer : public wxDataViewRenderer
1230{
1231public:
1232 /**
c4e57202 1233 The ctor.
f2b7492a
RR
1234 */
1235 wxDataViewIconTextRenderer(const wxString& varianttype = "wxDataViewIconText",
1236 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1237 int align = wxDVR_DEFAULT_ALIGNMENT );
1238};
1239
1240
1241
23324ae1
FM
1242/**
1243 @class wxDataViewProgressRenderer
7c913512 1244
c4e57202 1245 This class is used by wxDataViewCtrl to render progress bars.
7c913512 1246
23324ae1 1247 @library{wxadv}
b321b61c 1248 @category{dvc}
23324ae1
FM
1249*/
1250class wxDataViewProgressRenderer : public wxDataViewRenderer
1251{
1252public:
1253 /**
c4e57202 1254 The ctor.
23324ae1
FM
1255 */
1256 wxDataViewProgressRenderer(const wxString& label = wxEmptyString,
1257 const wxString& varianttype = "long",
05303ccd
RR
1258 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1259 int align = wxDVR_DEFAULT_ALIGNMENT );
23324ae1
FM
1260};
1261
1262
e54c96f1 1263
23324ae1
FM
1264/**
1265 @class wxDataViewSpinRenderer
7c913512 1266
c4e57202
FM
1267 This is a specialized renderer for rendering integer values.
1268 It supports modifying the values in-place by using a wxSpinCtrl.
23324ae1 1269 The renderer only support variants of type @e long.
7c913512 1270
8ed522d9 1271 @library{wxadv}
b321b61c 1272 @category{dvc}
23324ae1
FM
1273*/
1274class wxDataViewSpinRenderer : public wxDataViewCustomRenderer
1275{
1276public:
1277 /**
c4e57202
FM
1278 Constructor.
1279 @a min and @a max indicate the minimum and maximum values for the wxSpinCtrl.
23324ae1
FM
1280 */
1281 wxDataViewSpinRenderer(int min, int max,
1282 wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
05303ccd 1283 int align = wxDVR_DEFAULT_ALIGNMENT);
23324ae1
FM
1284};
1285
1286
e54c96f1 1287
23324ae1
FM
1288/**
1289 @class wxDataViewToggleRenderer
7c913512 1290
c4e57202 1291 This class is used by wxDataViewCtrl to render toggle controls.
7c913512 1292
23324ae1 1293 @library{wxadv}
b321b61c 1294 @category{dvc}
23324ae1
FM
1295*/
1296class wxDataViewToggleRenderer : public wxDataViewRenderer
1297{
1298public:
1299 /**
c4e57202 1300 The ctor.
23324ae1
FM
1301 */
1302 wxDataViewToggleRenderer(const wxString& varianttype = "bool",
50ec54b6
FM
1303 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1304 int align = wxDVR_DEFAULT_ALIGNMENT);
23324ae1
FM
1305};
1306
1307
e54c96f1 1308
23324ae1 1309/**
5b99d5d8 1310 @class wxDataViewDateRenderer
7c913512 1311
c4e57202 1312 This class is used by wxDataViewCtrl to render calendar controls.
7c913512 1313
5b99d5d8 1314 @library{wxadv}
b321b61c 1315 @category{dvc}
23324ae1 1316*/
5b99d5d8 1317class wxDataViewDateRenderer : public wxDataViewRenderer
23324ae1
FM
1318{
1319public:
23324ae1 1320 /**
c4e57202 1321 The ctor.
23324ae1 1322 */
5b99d5d8 1323 wxDataViewDateRenderer(const wxString& varianttype = "datetime",
50ec54b6
FM
1324 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
1325 int align = wxDVR_DEFAULT_ALIGNMENT);
5b99d5d8 1326};
23324ae1 1327
3c4f71cc 1328
23324ae1 1329
5b99d5d8
RR
1330/**
1331 @class wxDataViewCustomRenderer
23324ae1 1332
5b99d5d8 1333 You need to derive a new class from wxDataViewCustomRenderer in
c4e57202
FM
1334 order to write a new renderer.
1335
1336 You need to override at least wxDataViewRenderer::SetValue, wxDataViewRenderer::GetValue,
1337 wxDataViewCustomRenderer::GetSize and wxDataViewCustomRenderer::Render.
1338
1339 If you want your renderer to support in-place editing then you also need to override
1340 wxDataViewCustomRenderer::HasEditorCtrl, wxDataViewCustomRenderer::CreateEditorCtrl
5b99d5d8 1341 and wxDataViewCustomRenderer::GetValueFromEditorCtrl.
c4e57202
FM
1342
1343 Note that a special event handler will be pushed onto that editor control
1344 which handles @e \<ENTER\> and focus out events in order to end the editing.
23324ae1 1345
5b99d5d8 1346 @library{wxadv}
b321b61c 1347 @category{dvc}
5b99d5d8
RR
1348*/
1349class wxDataViewCustomRenderer : public wxDataViewRenderer
1350{
1351public:
23324ae1 1352 /**
5b99d5d8 1353 Constructor.
23324ae1 1354 */
5b99d5d8
RR
1355 wxDataViewCustomRenderer(const wxString& varianttype = "string",
1356 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
b91c4601 1357 int align = -1, bool no_init = false);
23324ae1
FM
1358
1359 /**
5b99d5d8 1360 Destructor.
23324ae1 1361 */
adaaa686 1362 virtual ~wxDataViewCustomRenderer();
23324ae1 1363
23324ae1 1364 /**
c4e57202
FM
1365 Override this to react to double clicks or ENTER.
1366 This method will only be called in wxDATAVIEW_CELL_ACTIVATABLE mode.
23324ae1 1367 */
5b99d5d8
RR
1368 virtual bool Activate( wxRect cell,
1369 wxDataViewModel* model,
1370 const wxDataViewItem & item,
1371 unsigned int col );
23324ae1
FM
1372
1373 /**
5b99d5d8 1374 Override this to create the actual editor control once editing
c4e57202
FM
1375 is about to start.
1376
1377 @a parent is the parent of the editor control, @a labelRect indicates the
1378 position and size of the editor control and @a value is its initial value:
1379 @code
1380 {
1381 long l = value;
1382 return new wxSpinCtrl( parent, wxID_ANY, wxEmptyString,
1383 labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l );
1384 }
1385 @endcode
23324ae1 1386 */
5b99d5d8
RR
1387 virtual wxControl* CreateEditorCtrl(wxWindow* parent,
1388 wxRect labelRect,
1389 const wxVariant& value);
23324ae1
FM
1390
1391 /**
5b99d5d8 1392 Create DC on request. Internal.
23324ae1 1393 */
5b99d5d8 1394 virtual wxDC* GetDC();
23324ae1
FM
1395
1396 /**
5b99d5d8 1397 Return size required to show content.
23324ae1 1398 */
b91c4601 1399 virtual wxSize GetSize() const = 0;
23324ae1
FM
1400
1401 /**
c4e57202
FM
1402 Overrride this so that the renderer can get the value from the editor
1403 control (pointed to by @a editor):
1404 @code
1405 {
1406 wxSpinCtrl *sc = (wxSpinCtrl*) editor;
1407 long l = sc->GetValue();
1408 value = l;
1409 return true;
1410 }
1411 @endcode
23324ae1 1412 */
5b99d5d8
RR
1413 virtual bool GetValueFromEditorCtrl(wxControl* editor,
1414 wxVariant& value);
23324ae1
FM
1415
1416 /**
c4e57202 1417 Override this and make it return @true in order to
5b99d5d8 1418 indicate that this renderer supports in-place editing.
23324ae1 1419 */
220bfe15 1420 virtual bool HasEditorCtrl() const;
23324ae1
FM
1421
1422 /**
c4e57202
FM
1423 Overrride this to react to a left click.
1424 This method will only be called in @c wxDATAVIEW_CELL_ACTIVATABLE mode.
23324ae1 1425 */
5b99d5d8
RR
1426 virtual bool LeftClick( wxPoint cursor,
1427 wxRect cell,
1428 wxDataViewModel * model,
1429 const wxDataViewItem & item,
1430 unsigned int col );
23324ae1
FM
1431
1432 /**
c4e57202
FM
1433 Override this to render the cell.
1434 Before this is called, wxDataViewRenderer::SetValue was called
5b99d5d8 1435 so that this instance knows what to render.
23324ae1 1436 */
b91c4601 1437 virtual bool Render(wxRect cell, wxDC* dc, int state) = 0;
23324ae1
FM
1438
1439 /**
c4e57202
FM
1440 This method should be called from within Render() whenever you need to
1441 render simple text.
1442 This will ensure that the correct colour, font and vertical alignment will
1443 be chosen so the text will look the same as text drawn by native renderers.
23324ae1 1444 */
50ec54b6 1445 void RenderText(const wxString& text, int xoffset, wxRect cell,
5b99d5d8 1446 wxDC* dc, int state);
23324ae1
FM
1447
1448 /**
c4e57202 1449 Overrride this to start a drag operation. Not yet supported.
23324ae1 1450 */
5b99d5d8
RR
1451 virtual bool StartDrag(wxPoint cursor, wxRect cell,
1452 wxDataViewModel* model,
1453 const wxDataViewItem & item,
1454 unsigned int col);
23324ae1
FM
1455};
1456
1457
e54c96f1 1458
23324ae1 1459/**
5b99d5d8 1460 @class wxDataViewBitmapRenderer
7c913512 1461
c4e57202 1462 This class is used by wxDataViewCtrl to render bitmap controls.
7c913512 1463
23324ae1 1464 @library{wxadv}
b321b61c 1465 @category{dvc}
23324ae1 1466*/
5b99d5d8 1467class wxDataViewBitmapRenderer : public wxDataViewRenderer
23324ae1
FM
1468{
1469public:
1470 /**
c4e57202 1471 The ctor.
23324ae1 1472 */
5b99d5d8
RR
1473 wxDataViewBitmapRenderer(const wxString& varianttype = "wxBitmap",
1474 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
14d922d1 1475 int align = wxDVR_DEFAULT_ALIGNMENT);
5b99d5d8
RR
1476};
1477
23324ae1 1478
c4e57202
FM
1479/**
1480 The flags used by wxDataViewColumn.
02b51ae5 1481 Can be combined together.
c4e57202
FM
1482*/
1483enum wxDataViewColumnFlags
1484{
1485 wxDATAVIEW_COL_RESIZABLE = 1,
1486 wxDATAVIEW_COL_SORTABLE = 2,
1487 wxDATAVIEW_COL_REORDERABLE = 4,
1488 wxDATAVIEW_COL_HIDDEN = 8
1489};
23324ae1 1490
5b99d5d8
RR
1491/**
1492 @class wxDataViewColumn
5b99d5d8
RR
1493
1494 This class represents a column in a wxDataViewCtrl.
739a8399 1495 One wxDataViewColumn is bound to one column in the data model to which the
c4e57202 1496 wxDataViewCtrl has been associated.
5b99d5d8 1497
c4e57202 1498 An instance of wxDataViewRenderer is used by this class to render its data.
5b99d5d8
RR
1499
1500 @library{wxadv}
b321b61c 1501 @category{dvc}
5b99d5d8 1502*/
c9c59db7 1503class wxDataViewColumn : public wxSettableHeaderColumn
5b99d5d8
RR
1504{
1505public:
23324ae1 1506 /**
02b51ae5
FM
1507 Constructs a text column.
1508
1509 @param title
1510 The title of the column.
1511 @param renderer
1512 The class which will render the contents of this column.
1513 @param model_column
1514 The index of the model's column which is associated with this object.
1515 @param width
1516 The width of the column.
1517 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1518 @param align
1519 The alignment of the column title.
1520 @param flags
1521 One or more flags of the ::wxDataViewColumnFlags enumeration.
23324ae1 1522 */
5b99d5d8
RR
1523 wxDataViewColumn(const wxString& title,
1524 wxDataViewRenderer* renderer,
1525 unsigned int model_column,
1526 int width = wxDVC_DEFAULT_WIDTH,
882678eb 1527 wxAlignment align = wxALIGN_CENTER,
5b99d5d8 1528 int flags = wxDATAVIEW_COL_RESIZABLE);
02b51ae5
FM
1529
1530 /**
1531 Constructs a bitmap column.
1532
1533 @param bitmap
1534 The bitmap of the column.
1535 @param renderer
1536 The class which will render the contents of this column.
1537 @param model_column
1538 The index of the model's column which is associated with this object.
1539 @param width
1540 The width of the column.
1541 The @c wxDVC_DEFAULT_WIDTH value is the fixed default value.
1542 @param align
1543 The alignment of the column title.
1544 @param flags
1545 One or more flags of the ::wxDataViewColumnFlags enumeration.
1546 */
5b99d5d8
RR
1547 wxDataViewColumn(const wxBitmap& bitmap,
1548 wxDataViewRenderer* renderer,
1549 unsigned int model_column,
1550 int width = wxDVC_DEFAULT_WIDTH,
882678eb 1551 wxAlignment align = wxALIGN_CENTER,
5b99d5d8 1552 int flags = wxDATAVIEW_COL_RESIZABLE);
23324ae1 1553
23324ae1 1554 /**
5b99d5d8
RR
1555 Returns the index of the column of the model, which this
1556 wxDataViewColumn is displaying.
23324ae1 1557 */
adaaa686 1558 unsigned int GetModelColumn() const;
23324ae1
FM
1559
1560 /**
5b99d5d8 1561 Returns the owning wxDataViewCtrl.
23324ae1 1562 */
e51bf699 1563 wxDataViewCtrl* GetOwner() const;
23324ae1
FM
1564
1565 /**
5b99d5d8 1566 Returns the renderer of this wxDataViewColumn.
c4e57202
FM
1567
1568 @see wxDataViewRenderer.
23324ae1 1569 */
adaaa686 1570 wxDataViewRenderer* GetRenderer() const;
23324ae1
FM
1571};
1572
1573
e54c96f1 1574
832df171
RR
1575/**
1576 @class wxDataViewListCtrl
1577
1578 This class is a wxDataViewCtrl which internally uses a wxDataViewListStore
1579 and forwards most of its API to that class.
1580
1581 The purpose of this class is to offer a simple way to display and
1582 edit a small table of data without having to write your own wxDataViewModel.
1583
23efa4bf 1584 @code
14f73cf1 1585 wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, wxID_ANY );
02b51ae5 1586
95b20f41
RR
1587 listctrl->AppendToggleColumn( "Toggle" );
1588 listctrl->AppendTextColumn( "Text" );
02b51ae5 1589
23efa4bf 1590 wxVector<wxVariant> data;
14f73cf1
FM
1591 data.push_back( wxVariant(true) );
1592 data.push_back( wxVariant("row 1") );
23efa4bf 1593 listctrl->AppendItem( data );
02b51ae5 1594
23efa4bf 1595 data.clear();
14f73cf1
FM
1596 data.push_back( wxVariant(false) );
1597 data.push_back( wxVariant("row 3") );
23efa4bf
RR
1598 listctrl->AppendItem( data );
1599 @endcode
14f73cf1
FM
1600
1601 @beginStyleTable
1602 See wxDataViewCtrl for the list of supported styles.
1603 @endStyleTable
1604
1605 @beginEventEmissionTable
1606 See wxDataViewCtrl for the list of events emitted by this class.
1607 @endEventTable
23efa4bf 1608
832df171
RR
1609 @library{wxadv}
1610 @category{ctrl,dvc}
1611*/
832df171
RR
1612class wxDataViewListCtrl: public wxDataViewCtrl
1613{
b75b04d4 1614public:
832df171
RR
1615 /**
1616 Default ctor.
1617 */
1618 wxDataViewListCtrl();
02b51ae5 1619
832df171
RR
1620 /**
1621 Constructor. Calls Create().
1622 */
1623 wxDataViewListCtrl( wxWindow *parent, wxWindowID id,
1624 const wxPoint& pos = wxDefaultPosition,
1625 const wxSize& size = wxDefaultSize, long style = wxDV_ROW_LINES,
1626 const wxValidator& validator = wxDefaultValidator );
02b51ae5 1627
832df171
RR
1628 /**
1629 Destructor. Deletes the image list if any.
1630 */
1631 ~wxDataViewListCtrl();
1632
1633 /**
1634 Creates the control and a wxDataViewListStore as its internal model.
1635 */
1636 bool Create( wxWindow *parent, wxWindowID id,
1637 const wxPoint& pos = wxDefaultPosition,
1638 const wxSize& size = wxDefaultSize, long style = wxDV_ROW_LINES,
1639 const wxValidator& validator = wxDefaultValidator );
1640
1641 //@{
1642 /**
1643 Returns the store.
1644 */
1645 wxDataViewListStore *GetStore();
1646 const wxDataViewListStore *GetStore() const;
1647 //@}
1648
1649 /**
14f73cf1
FM
1650 @name Column management functions
1651 */
1652 //@{
1653
1654 /**
1655 Appends a column to the control and additionally appends a
1656 column to the store with the type string.
1657 */
1658 virtual void AppendColumn( wxDataViewColumn *column );
1659
1660 /**
1661 Appends a column to the control and additionally appends a
1662 column to the list store with the type @a varianttype.
832df171 1663 */
95b20f41 1664 void AppendColumn( wxDataViewColumn *column, const wxString &varianttype );
02b51ae5 1665
832df171 1666 /**
14f73cf1
FM
1667 Appends a text column to the control and the store.
1668
1669 See wxDataViewColumn::wxDataViewColumn for more info about
1670 the parameters.
832df171 1671 */
14f73cf1
FM
1672 wxDataViewColumn *AppendTextColumn( const wxString &label,
1673 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1674 int width = -1, wxAlignment align = wxALIGN_LEFT,
1675 int flags = wxDATAVIEW_COL_RESIZABLE );
02b51ae5 1676
832df171 1677 /**
14f73cf1
FM
1678 Appends a toggle column to the control and the store.
1679
1680 See wxDataViewColumn::wxDataViewColumn for more info about
1681 the parameters.
832df171 1682 */
14f73cf1
FM
1683 wxDataViewColumn *AppendToggleColumn( const wxString &label,
1684 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
1685 int width = -1, wxAlignment align = wxALIGN_LEFT,
1686 int flags = wxDATAVIEW_COL_RESIZABLE );
02b51ae5 1687
95b20f41 1688 /**
14f73cf1 1689 Appends a progress column to the control and the store.
02b51ae5 1690
14f73cf1
FM
1691 See wxDataViewColumn::wxDataViewColumn for more info about
1692 the parameters.
95b20f41 1693 */
14f73cf1
FM
1694 wxDataViewColumn *AppendProgressColumn( const wxString &label,
1695 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1696 int width = -1, wxAlignment align = wxALIGN_LEFT,
1697 int flags = wxDATAVIEW_COL_RESIZABLE );
02b51ae5 1698
95b20f41 1699 /**
14f73cf1 1700 Appends an icon-and-text column to the control and the store.
02b51ae5 1701
14f73cf1
FM
1702 See wxDataViewColumn::wxDataViewColumn for more info about
1703 the parameters.
95b20f41 1704 */
14f73cf1
FM
1705 wxDataViewColumn *AppendIconTextColumn( const wxString &label,
1706 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
1707 int width = -1, wxAlignment align = wxALIGN_LEFT,
1708 int flags = wxDATAVIEW_COL_RESIZABLE );
02b51ae5 1709
95b20f41 1710 /**
14f73cf1 1711 Inserts a column to the control and additionally inserts a
95b20f41
RR
1712 column to the store with the type string.
1713 */
1714 virtual void InsertColumn( unsigned int pos, wxDataViewColumn *column );
02b51ae5 1715
832df171 1716 /**
14f73cf1
FM
1717 Inserts a column to the control and additionally inserts a
1718 column to the list store with the type @a varianttype.
832df171 1719 */
14f73cf1
FM
1720 void InsertColumn( unsigned int pos, wxDataViewColumn *column,
1721 const wxString &varianttype );
02b51ae5 1722
832df171 1723 /**
14f73cf1
FM
1724 Prepends a column to the control and additionally prepends a
1725 column to the store with the type string.
832df171 1726 */
14f73cf1 1727 virtual void PrependColumn( wxDataViewColumn *column );
02b51ae5 1728
832df171 1729 /**
14f73cf1
FM
1730 Prepends a column to the control and additionally prepends a
1731 column to the list store with the type @a varianttype.
832df171 1732 */
14f73cf1 1733 void PrependColumn( wxDataViewColumn *column, const wxString &varianttype );
02b51ae5 1734
14f73cf1
FM
1735 //@}
1736
1737
832df171 1738 /**
14f73cf1 1739 @name Item management functions
832df171 1740 */
14f73cf1
FM
1741 //@{
1742
832df171
RR
1743 /**
1744 Appends an item (=row) to the control and store.
1745 */
1746 void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
1747
1748 /**
1749 Prepends an item (=row) to the control and store.
1750 */
1751 void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
1752
1753 /**
1754 Inserts an item (=row) to the control and store.
1755 */
14f73cf1 1756 void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
02b51ae5 1757
832df171
RR
1758 /**
1759 Delete the row at position @a row.
1760 */
1761 void DeleteItem( unsigned row );
02b51ae5 1762
832df171
RR
1763 /**
1764 Delete all items (= all rows).
1765 */
1766 void DeleteAllItems();
02b51ae5 1767
832df171
RR
1768 /**
1769 Sets the value in the store and update the control.
1770 */
1771 void SetValue( const wxVariant &value, unsigned int row, unsigned int col );
02b51ae5 1772
832df171
RR
1773 /**
1774 Returns the value from the store.
1775 */
1776 void GetValue( wxVariant &value, unsigned int row, unsigned int col );
02b51ae5 1777
832df171 1778 /**
02b51ae5
FM
1779 Sets the value in the store and update the control.
1780
832df171
RR
1781 This method assumes that the a string is stored in respective
1782 column.
1783 */
1784 void SetTextValue( const wxString &value, unsigned int row, unsigned int col );
02b51ae5 1785
832df171
RR
1786 /**
1787 Returns the value from the store.
02b51ae5 1788
832df171
RR
1789 This method assumes that the a string is stored in respective
1790 column.
1791 */
1792 wxString GetTextValue( unsigned int row, unsigned int col ) const;
02b51ae5 1793
832df171 1794 /**
02b51ae5
FM
1795 Sets the value in the store and update the control.
1796
832df171
RR
1797 This method assumes that the a boolean value is stored in
1798 respective column.
1799 */
1800 void SetToggleValue( bool value, unsigned int row, unsigned int col );
02b51ae5 1801
832df171
RR
1802 /**
1803 Returns the value from the store.
02b51ae5 1804
832df171
RR
1805 This method assumes that the a boolean value is stored in
1806 respective column.
1807 */
1808 bool GetToggleValue( unsigned int row, unsigned int col ) const;
14f73cf1
FM
1809
1810 //@}
832df171
RR
1811};
1812
1813
23324ae1 1814/**
5b99d5d8 1815 @class wxDataViewTreeCtrl
7c913512 1816
c4e57202
FM
1817 This class is a wxDataViewCtrl which internally uses a wxDataViewTreeStore
1818 and forwards most of its API to that class.
1819 Additionally, it uses a wxImageList to store a list of icons.
1820
14f73cf1
FM
1821 The main purpose of this class is to represent a possible replacement for
1822 wxTreeCtrl.
1823
1824 @beginStyleTable
1825 See wxDataViewCtrl for the list of supported styles.
1826 @endStyleTable
1827
1828 @beginEventEmissionTable
1829 See wxDataViewCtrl for the list of events emitted by this class.
1830 @endEventTable
7c913512 1831
8ed522d9 1832 @library{wxadv}
b321b61c 1833 @category{ctrl,dvc}
7e59b885 1834 @appearance{dataviewtreectrl.png}
23324ae1 1835*/
5b99d5d8 1836class wxDataViewTreeCtrl : public wxDataViewCtrl
23324ae1
FM
1837{
1838public:
1839 /**
c4e57202 1840 Default ctor.
5b99d5d8
RR
1841 */
1842 wxDataViewTreeCtrl();
c4e57202
FM
1843
1844 /**
1845 Constructor. Calls Create().
1846 */
5b99d5d8
RR
1847 wxDataViewTreeCtrl(wxWindow* parent, wxWindowID id,
1848 const wxPoint& pos = wxDefaultPosition,
1849 const wxSize& size = wxDefaultSize,
1850 long style = wxDV_NO_HEADER,
1851 const wxValidator& validator = wxDefaultValidator);
3c4f71cc 1852
5b99d5d8
RR
1853 /**
1854 Destructor. Deletes the image list if any.
23324ae1 1855 */
adaaa686 1856 virtual ~wxDataViewTreeCtrl();
23324ae1 1857
5b99d5d8 1858 /**
b75b04d4 1859 Appends a container to the given @a parent.
5b99d5d8
RR
1860 */
1861 wxDataViewItem AppendContainer(const wxDataViewItem& parent,
1862 const wxString& text,
1863 int icon = -1,
1864 int expanded = -1,
1865 wxClientData* data = NULL);
e54c96f1 1866
5b99d5d8 1867 /**
b75b04d4 1868 Appends an item to the given @a parent.
5b99d5d8
RR
1869 */
1870 wxDataViewItem AppendItem(const wxDataViewItem& parent,
1871 const wxString& text,
1872 int icon = -1,
1873 wxClientData* data = NULL);
7c913512 1874
5b99d5d8 1875 /**
c4e57202 1876 Creates the control and a wxDataViewTreeStore as its internal model.
5b99d5d8
RR
1877 */
1878 bool Create(wxWindow* parent, wxWindowID id,
1879 const wxPoint& pos = wxDefaultPosition,
1880 const wxSize& size = wxDefaultSize,
1881 long style = wxDV_NO_HEADER,
1882 const wxValidator& validator = wxDefaultValidator);
1883
1884 /**
1885 Calls the identical method from wxDataViewTreeStore.
1886 */
1887 void DeleteAllItems();
7c913512 1888
23324ae1 1889 /**
5b99d5d8
RR
1890 Calls the identical method from wxDataViewTreeStore.
1891 */
1892 void DeleteChildren(const wxDataViewItem& item);
3c4f71cc 1893
5b99d5d8
RR
1894 /**
1895 Calls the identical method from wxDataViewTreeStore.
23324ae1 1896 */
5b99d5d8 1897 void DeleteItem(const wxDataViewItem& item);
23324ae1 1898
5b99d5d8
RR
1899 /**
1900 Calls the identical method from wxDataViewTreeStore.
1901 */
1902 int GetChildCount(const wxDataViewItem& parent) const;
23324ae1 1903
5b99d5d8
RR
1904 /**
1905 Returns the image list.
1906 */
1907 wxImageList* GetImageList();
05303ccd 1908
5b99d5d8
RR
1909 /**
1910 Calls the identical method from wxDataViewTreeStore.
1911 */
1912 wxClientData* GetItemData(const wxDataViewItem& item) const;
05303ccd 1913
5b99d5d8
RR
1914 /**
1915 Calls the identical method from wxDataViewTreeStore.
1916 */
b91c4601 1917 const wxIcon& GetItemExpandedIcon(const wxDataViewItem& item) const;
05303ccd 1918
05303ccd 1919 /**
5b99d5d8 1920 Calls the identical method from wxDataViewTreeStore.
05303ccd 1921 */
b91c4601 1922 const wxIcon& GetItemIcon(const wxDataViewItem& item) const;
05303ccd
RR
1923
1924 /**
5b99d5d8 1925 Calls the identical method from wxDataViewTreeStore.
05303ccd 1926 */
5b99d5d8
RR
1927 wxString GetItemText(const wxDataViewItem& item) const;
1928
1929 /**
1930 Calls the identical method from wxDataViewTreeStore.
1931 */
1932 wxDataViewItem GetNthChild(const wxDataViewItem& parent,
1933 unsigned int pos) const;
05303ccd 1934
5b99d5d8 1935 //@{
05303ccd 1936 /**
5b99d5d8 1937 Returns the store.
05303ccd 1938 */
882678eb 1939 wxDataViewTreeStore* GetStore();
5b99d5d8
RR
1940 const wxDataViewTreeStore* GetStore() const;
1941 //@}
05303ccd
RR
1942
1943 /**
c4e57202
FM
1944 Calls the same method from wxDataViewTreeStore but uses
1945 an index position in the image list instead of a wxIcon.
05303ccd 1946 */
5b99d5d8
RR
1947 wxDataViewItem InsertContainer(const wxDataViewItem& parent,
1948 const wxDataViewItem& previous,
1949 const wxString& text,
1950 int icon = -1,
1951 int expanded = -1,
1952 wxClientData* data = NULL);
05303ccd
RR
1953
1954 /**
c4e57202
FM
1955 Calls the same method from wxDataViewTreeStore but uses
1956 an index position in the image list instead of a wxIcon.
05303ccd 1957 */
5b99d5d8
RR
1958 wxDataViewItem InsertItem(const wxDataViewItem& parent,
1959 const wxDataViewItem& previous,
1960 const wxString& text,
1961 int icon = -1,
1962 wxClientData* data = NULL);
05303ccd
RR
1963
1964 /**
c4e57202
FM
1965 Calls the same method from wxDataViewTreeStore but uses
1966 an index position in the image list instead of a wxIcon.
05303ccd 1967 */
5b99d5d8
RR
1968 wxDataViewItem PrependContainer(const wxDataViewItem& parent,
1969 const wxString& text,
1970 int icon = -1,
1971 int expanded = -1,
1972 wxClientData* data = NULL);
05303ccd
RR
1973
1974 /**
c4e57202
FM
1975 Calls the same method from wxDataViewTreeStore but uses
1976 an index position in the image list instead of a wxIcon.
05303ccd 1977 */
5b99d5d8
RR
1978 wxDataViewItem PrependItem(const wxDataViewItem& parent,
1979 const wxString& text,
1980 int icon = -1,
1981 wxClientData* data = NULL);
05303ccd
RR
1982
1983 /**
5b99d5d8 1984 Sets the image list.
05303ccd 1985 */
5b99d5d8 1986 void SetImageList(wxImageList* imagelist);
05303ccd
RR
1987
1988 /**
5b99d5d8 1989 Calls the identical method from wxDataViewTreeStore.
05303ccd 1990 */
5b99d5d8 1991 void SetItemData(const wxDataViewItem& item, wxClientData* data);
05303ccd
RR
1992
1993 /**
5b99d5d8 1994 Calls the identical method from wxDataViewTreeStore.
05303ccd 1995 */
5b99d5d8
RR
1996 void SetItemExpandedIcon(const wxDataViewItem& item,
1997 const wxIcon& icon);
05303ccd
RR
1998
1999 /**
5b99d5d8 2000 Calls the identical method from wxDataViewTreeStore.
05303ccd 2001 */
5b99d5d8 2002 void SetItemIcon(const wxDataViewItem& item, const wxIcon& icon);
05303ccd
RR
2003
2004 /**
5b99d5d8 2005 Calls the identical method from wxDataViewTreeStore.
05303ccd 2006 */
5b99d5d8
RR
2007 void SetItemText(const wxDataViewItem& item,
2008 const wxString& text);
05303ccd
RR
2009};
2010
2011
bda698ed
RR
2012/**
2013 @class wxDataViewListStore
2014
2015 wxDataViewListStore is a specialised wxDataViewModel for storing
2016 a simple table of data. Since it derives from wxDataViewIndexListModel
2017 its data is be accessed by row (i.e. by index) instead of only
2018 by wxDataViewItem.
2019
02b51ae5 2020 This class actually stores the values (therefore its name)
bda698ed 2021 and implements all virtual methods from the base classes so it can be
02b51ae5 2022 used directly without having to derive any class from it, but it is
bda698ed
RR
2023 mostly used from within wxDataViewListCtrl.
2024
2025 @library{wxadv}
2026 @category{dvc}
2027*/
2028
2029class wxDataViewListStore: public wxDataViewIndexListModel
2030{
2031public:
2032 /**
02b51ae5 2033 Constructor
bda698ed
RR
2034 */
2035 wxDataViewListStore();
02b51ae5 2036
bda698ed 2037 /**
02b51ae5 2038 Destructor
bda698ed
RR
2039 */
2040 ~wxDataViewListStore();
2041
2042 /**
02b51ae5
FM
2043 Prepends a data column.
2044
2045 @a variantype indicates the type of values store in the column.
2046
2047 This does not automatically fill in any (default) values in
2048 rows which exist in the store already.
bda698ed
RR
2049 */
2050 void PrependColumn( const wxString &varianttype );
2051
2052 /**
02b51ae5
FM
2053 Inserts a data column before @a pos.
2054
2055 @a variantype indicates the type of values store in the column.
2056
2057 This does not automatically fill in any (default) values in
2058 rows which exist in the store already.
bda698ed
RR
2059 */
2060 void InsertColumn( unsigned int pos, const wxString &varianttype );
2061
2062 /**
02b51ae5
FM
2063 Appends a data column.
2064
2065 @a variantype indicates the type of values store in the column.
2066
2067 This does not automatically fill in any (default) values in
2068 rows which exist in the store already.
bda698ed
RR
2069 */
2070 void AppendColumn( const wxString &varianttype );
02b51ae5 2071
bda698ed
RR
2072 /**
2073 Appends an item (=row) and fills it with @a values.
02b51ae5 2074
bda698ed
RR
2075 The values must match the values specifies in the column
2076 in number and type. No (default) values are filled in
2077 automatically.
2078 */
2079 void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
02b51ae5 2080
bda698ed
RR
2081 /**
2082 Prepends an item (=row) and fills it with @a values.
02b51ae5 2083
bda698ed
RR
2084 The values must match the values specifies in the column
2085 in number and type. No (default) values are filled in
2086 automatically.
2087 */
2088 void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
02b51ae5 2089
bda698ed
RR
2090 /**
2091 Inserts an item (=row) and fills it with @a values.
02b51ae5 2092
bda698ed
RR
2093 The values must match the values specifies in the column
2094 in number and type. No (default) values are filled in
2095 automatically.
2096 */
2097 void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
02b51ae5 2098
bda698ed
RR
2099 /**
2100 Delete the item (=row) at position @a pos.
2101 */
2102 void DeleteItem( unsigned pos );
02b51ae5 2103
bda698ed
RR
2104 /**
2105 Delete all item (=all rows) in the store.
2106 */
2107 void DeleteAllItems();
2108
2109 /**
2110 Overriden from wxDataViewModel
2111 */
2112 virtual unsigned int GetColumnCount() const;
2113
2114 /**
2115 Overriden from wxDataViewModel
2116 */
2117 virtual wxString GetColumnType( unsigned int col ) const;
2118
2119 /**
2120 Overriden from wxDataViewIndexListModel
2121 */
2122 virtual void GetValueByRow( wxVariant &value,
2123 unsigned int row, unsigned int col ) const;
2124
2125 /**
2126 Overriden from wxDataViewIndexListModel
2127 */
2128 virtual bool SetValueByRow( const wxVariant &value,
2129 unsigned int row, unsigned int col );
2130};
2131
05303ccd
RR
2132
2133/**
5b99d5d8 2134 @class wxDataViewTreeStore
05303ccd 2135
bda698ed 2136 wxDataViewTreeStore is a specialised wxDataViewModel for stroing simple
c4e57202
FM
2137 trees very much like wxTreeCtrl does and it offers a similar API.
2138
02b51ae5 2139 This class actually stores the entire tree and the values (therefore its name)
8eff6c56 2140 and implements all virtual methods from the base class so it can be used directly
bda698ed
RR
2141 without having to derive any class from it, but it is mostly used from within
2142 wxDataViewTreeCtrl.
05303ccd
RR
2143
2144 @library{wxadv}
b321b61c 2145 @category{dvc}
05303ccd 2146*/
5b99d5d8 2147class wxDataViewTreeStore : public wxDataViewModel
05303ccd
RR
2148{
2149public:
2150 /**
5b99d5d8 2151 Constructor. Creates the invisible root node internally.
05303ccd 2152 */
5b99d5d8 2153 wxDataViewTreeStore();
e54c96f1 2154
5b99d5d8
RR
2155 /**
2156 Destructor.
2157 */
adaaa686 2158 virtual ~wxDataViewTreeStore();
7c913512 2159
5b99d5d8
RR
2160 /**
2161 Append a container.
2162 */
2163 wxDataViewItem AppendContainer(const wxDataViewItem& parent,
2164 const wxString& text,
2165 const wxIcon& icon = wxNullIcon,
2166 const wxIcon& expanded = wxNullIcon,
2167 wxClientData* data = NULL);
7c913512 2168
5b99d5d8
RR
2169 /**
2170 Append an item.
2171 */
2172 wxDataViewItem AppendItem(const wxDataViewItem& parent,
2173 const wxString& text,
2174 const wxIcon& icon = wxNullIcon,
2175 wxClientData* data = NULL);
7c913512 2176
23324ae1 2177 /**
5b99d5d8 2178 Delete all item in the model.
23324ae1 2179 */
5b99d5d8 2180 void DeleteAllItems();
23324ae1
FM
2181
2182 /**
5b99d5d8 2183 Delete all children of the item, but not the item itself.
23324ae1 2184 */
5b99d5d8 2185 void DeleteChildren(const wxDataViewItem& item);
23324ae1
FM
2186
2187 /**
5b99d5d8 2188 Delete this item.
23324ae1 2189 */
5b99d5d8 2190 void DeleteItem(const wxDataViewItem& item);
23324ae1
FM
2191
2192 /**
5b99d5d8 2193 Return the number of children of item.
23324ae1 2194 */
5b99d5d8 2195 int GetChildCount(const wxDataViewItem& parent) const;
23324ae1
FM
2196
2197 /**
5b99d5d8 2198 Returns the client data asoociated with the item.
23324ae1 2199 */
5b99d5d8 2200 wxClientData* GetItemData(const wxDataViewItem& item) const;
23324ae1
FM
2201
2202 /**
5b99d5d8 2203 Returns the icon to display in expanded containers.
23324ae1 2204 */
b91c4601 2205 const wxIcon& GetItemExpandedIcon(const wxDataViewItem& item) const;
23324ae1
FM
2206
2207 /**
5b99d5d8 2208 Returns the icon of the item.
23324ae1 2209 */
b91c4601 2210 const wxIcon& GetItemIcon(const wxDataViewItem& item) const;
23324ae1
FM
2211
2212 /**
5b99d5d8 2213 Returns the text of the item.
23324ae1 2214 */
5b99d5d8 2215 wxString GetItemText(const wxDataViewItem& item) const;
23324ae1
FM
2216
2217 /**
5b99d5d8 2218 Returns the nth child item of item.
23324ae1 2219 */
5b99d5d8
RR
2220 wxDataViewItem GetNthChild(const wxDataViewItem& parent,
2221 unsigned int pos) const;
23324ae1
FM
2222
2223 /**
c4e57202 2224 Inserts a container after @a previous.
23324ae1 2225 */
5b99d5d8
RR
2226 wxDataViewItem InsertContainer(const wxDataViewItem& parent,
2227 const wxDataViewItem& previous,
2228 const wxString& text,
2229 const wxIcon& icon = wxNullIcon,
2230 const wxIcon& expanded = wxNullIcon,
2231 wxClientData* data = NULL);
23324ae1
FM
2232
2233 /**
c4e57202 2234 Inserts an item after @a previous.
23324ae1 2235 */
5b99d5d8
RR
2236 wxDataViewItem InsertItem(const wxDataViewItem& parent,
2237 const wxDataViewItem& previous,
2238 const wxString& text,
2239 const wxIcon& icon = wxNullIcon,
2240 wxClientData* data = NULL);
23324ae1
FM
2241
2242 /**
c4e57202 2243 Inserts a container before the first child item or @a parent.
23324ae1 2244 */
5b99d5d8
RR
2245 wxDataViewItem PrependContainer(const wxDataViewItem& parent,
2246 const wxString& text,
2247 const wxIcon& icon = wxNullIcon,
2248 const wxIcon& expanded = wxNullIcon,
2249 wxClientData* data = NULL);
23324ae1
FM
2250
2251 /**
c4e57202 2252 Inserts an item before the first child item or @a parent.
23324ae1 2253 */
5b99d5d8
RR
2254 wxDataViewItem PrependItem(const wxDataViewItem& parent,
2255 const wxString& text,
2256 const wxIcon& icon = wxNullIcon,
2257 wxClientData* data = NULL);
23324ae1
FM
2258
2259 /**
5b99d5d8 2260 Sets the client data associated with the item.
23324ae1 2261 */
5b99d5d8 2262 void SetItemData(const wxDataViewItem& item, wxClientData* data);
23324ae1
FM
2263
2264 /**
5b99d5d8 2265 Sets the expanded icon for the item.
23324ae1 2266 */
5b99d5d8
RR
2267 void SetItemExpandedIcon(const wxDataViewItem& item,
2268 const wxIcon& icon);
23324ae1
FM
2269
2270 /**
5b99d5d8 2271 Sets the icon for the item.
23324ae1 2272 */
5b99d5d8 2273 void SetItemIcon(const wxDataViewItem& item, const wxIcon& icon);
23324ae1 2274};
e54c96f1 2275
80932a3e
FM
2276
2277/**
2278 @class wxDataViewIconText
2279
2280 wxDataViewIconText is used by wxDataViewIconTextRenderer for data transfer.
2281 This class can be converted to and from a wxVariant.
2282
2283 @library{wxadv}
2284 @category{dvc}
2285*/
2286class wxDataViewIconText : public wxObject
2287{
2288public:
2289 //@{
2290 /**
2291 Constructor.
2292 */
2293 wxDataViewIconText(const wxString& text = wxEmptyString,
2294 const wxIcon& icon = wxNullIcon);
2295 wxDataViewIconText(const wxDataViewIconText& other);
2296 //@}
2297
2298 /**
2299 Gets the icon.
2300 */
2301 const wxIcon& GetIcon() const;
2302
2303 /**
2304 Gets the text.
2305 */
2306 wxString GetText() const;
2307
2308 /**
2309 Set the icon.
2310 */
2311 void SetIcon(const wxIcon& icon);
2312
2313 /**
2314 Set the text.
2315 */
2316 void SetText(const wxString& text);
2317};
2318
2319
2320
2321/**
2322 @class wxDataViewEvent
2323
2324 This is the event class for the wxDataViewCtrl notifications.
2325
14f73cf1
FM
2326 @beginEventTable{wxDataViewEvent}
2327 @event{EVT_DATAVIEW_SELECTION_CHANGED(id, func)}
2328 Process a @c wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event.
2329 @event{EVT_DATAVIEW_ITEM_ACTIVATED(id, func)}
2330 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.
2331 @event{EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func)}
2332 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event.
2333 @event{EVT_DATAVIEW_ITEM_EDITING_DONE(id, func)}
2334 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event.
2335 @event{EVT_DATAVIEW_ITEM_COLLAPSING(id, func)}
2336 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event.
2337 @event{EVT_DATAVIEW_ITEM_COLLAPSED(id, func)}
2338 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event.
2339 @event{EVT_DATAVIEW_ITEM_EXPANDING(id, func)}
2340 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event.
2341 @event{EVT_DATAVIEW_ITEM_EXPANDED(id, func)}
2342 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event.
2343 @event{EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func)}
2344 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event.
2345 @event{EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func)}
2346 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event.
2347 @event{EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func)}
2348 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED event.
2349 @event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
2350 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED event.
2351 @event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
2352 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event.
2353 @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
2354 Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event.
2355 @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
2356 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event.
2357 @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
2358 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event.
2359 @event{EVT_DATAVIEW_ITEM_DROP(id, func)}
2360 Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_DROP event.
47a8b1e1
VZ
2361 @event{EVT_DATAVIEW_CACHE_HINT(id, func)}
2362 Process a @c wxEVT_COMMAND_DATAVIEW_CACHE_HINT event.
14f73cf1
FM
2363 @endEventTable
2364
80932a3e
FM
2365 @library{wxadv}
2366 @category{events,dvc}
2367*/
2368class wxDataViewEvent : public wxNotifyEvent
2369{
2370public:
80932a3e
FM
2371 /**
2372 Constructor. Typically used by wxWidgets internals only.
2373 */
2374 wxDataViewEvent(wxEventType commandType = wxEVT_NULL,
2375 int winid = 0);
80932a3e
FM
2376
2377 /**
2378 Returns the position of the column in the control or -1
2379 if no column field was set by the event emitter.
2380 */
2381 int GetColumn() const;
2382
2383 /**
2384 Returns a pointer to the wxDataViewColumn from which
2385 the event was emitted or @NULL.
2386 */
2387 wxDataViewColumn* GetDataViewColumn() const;
2388
2389 /**
2390 Returns the wxDataViewModel associated with the event.
2391 */
2392 wxDataViewModel* GetModel() const;
2393
2394 /**
2395 Returns a the position of a context menu event in screen coordinates.
2396 */
2397 wxPoint GetPosition() const;
2398
2399 /**
2400 Returns a reference to a value.
2401 */
2402 const wxVariant& GetValue() const;
2403
2404 /**
2405 Sets the column index associated with this event.
2406 */
2407 void SetColumn(int col);
2408
2409 /**
2410 For wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
2411 */
2412 void SetDataViewColumn(wxDataViewColumn* col);
2413
2414 /**
2415 Sets the dataview model associated with this event.
2416 */
2417 void SetModel(wxDataViewModel* model);
2418
2419 /**
2420 Sets the value associated with this event.
2421 */
2422 void SetValue(const wxVariant& value);
02b51ae5 2423
591cc82d 2424 /**
e4de825e 2425 Set wxDataObject for data transfer within a drag operation.
591cc82d
RR
2426 */
2427 void SetDataObject( wxDataObject *obj );
02b51ae5 2428
591cc82d 2429 /**
e4de825e
RR
2430 Used internally. Gets associated wxDataObject for data transfer
2431 within a drag operation.
2432 */
2433 wxDataObject *GetDataObject() const;
02b51ae5 2434
e4de825e
RR
2435 /**
2436 Used internally. Sets the wxDataFormat during a drop operation.
2437 */
2438 void SetDataFormat( const wxDataFormat &format );
02b51ae5 2439
e4de825e
RR
2440 /**
2441 Gets the wxDataFormat during a drop operation.
2442 */
2443 wxDataFormat GetDataFormat() const;
02b51ae5 2444
e4de825e
RR
2445 /**
2446 Used internally. Sets the data size for a drop data transfer.
2447 */
2448 void SetDataSize( size_t size );
02b51ae5 2449
e4de825e
RR
2450 /**
2451 Gets the data size for a drop data transfer.
2452 */
2453 size_t GetDataSize() const;
02b51ae5 2454
e4de825e
RR
2455 /**
2456 Used internally. Sets the data buffer for a drop data transfer.
2457 */
2458 void SetDataBuffer( void* buf );
02b51ae5 2459
e4de825e
RR
2460 /**
2461 Gets the data buffer for a drop data transfer.
591cc82d 2462 */
e4de825e 2463 void *GetDataBuffer() const;
47a8b1e1
VZ
2464
2465 /**
2466 Return the first row that will be displayed.
2467 */
2468 int GetCacheFrom() const;
2469
2470 /**
2471 Return the last row that will be displayed.
2472 */
2473 int GetCacheTo() const;
80932a3e
FM
2474};
2475