Add wxDataViewListCtrl::{Set,Get}ItemData() methods.

These methods are convenient when migrating the code that previously used
wxListCtrl to wxDataViewCtrl.

Closes #11088.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-25 17:02:35 +00:00
parent 41abc29aa6
commit 518cef0470
4 changed files with 68 additions and 0 deletions

View File

@@ -2337,6 +2337,15 @@ public:
*/
void DeleteAllItems();
/**
Returns the client data associated with the item.
@see SetItemData()
@since 2.9.4
*/
wxUIntPtr GetItemData(const wxDataViewItem& item) const;
/**
Sets the value in the store and update the control.
*/
@@ -2379,6 +2388,19 @@ public:
*/
bool GetToggleValue( unsigned int row, unsigned int col ) const;
/**
Associates a client data pointer with the given item.
Notice that the control does @e not take ownership of the pointer for
compatibility with wxListCtrl. I.e. it will @e not delete the pointer
(if it is a pointer and not a number) itself, it is up to you to do it.
@see GetItemData()
@since 2.9.4
*/
void SetItemData(const wxDataViewItem& item, wxUIntPtr data);
//@}
};
@@ -2688,6 +2710,15 @@ public:
*/
void DeleteAllItems();
/**
Returns the client data associated with the item.
@see SetItemData()
@since 2.9.4
*/
wxUIntPtr GetItemData(const wxDataViewItem& item) const;
/**
Overridden from wxDataViewModel
*/
@@ -2698,6 +2729,18 @@ public:
*/
virtual wxString GetColumnType( unsigned int col ) const;
/**
Sets the client data associated with the item.
Notice that this class does @e not take ownership of the passed in
pointer and will not delete it.
@see GetItemData()
@since 2.9.4
*/
void SetItemData(const wxDataViewItem& item, wxUIntPtr data);
/**
Overridden from wxDataViewIndexListModel
*/