X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/43868fdedccaf829134f7d8e8bfefb4857a72d38..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/interface/wx/dataview.h diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index b17c229060..e45d0fced1 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -2315,17 +2315,17 @@ public: /** Appends an item (=row) to the control and store. */ - void AppendItem( const wxVector &values, wxClientData *data = NULL ); + void AppendItem( const wxVector &values, wxUIntPtr data = NULL ); /** Prepends an item (=row) to the control and store. */ - void PrependItem( const wxVector &values, wxClientData *data = NULL ); + void PrependItem( const wxVector &values, wxUIntPtr data = NULL ); /** Inserts an item (=row) to the control and store. */ - void InsertItem( unsigned int row, const wxVector &values, wxClientData *data = NULL ); + void InsertItem( unsigned int row, const wxVector &values, wxUIntPtr data = NULL ); /** Delete the row at position @a row. @@ -2337,6 +2337,22 @@ public: */ void DeleteAllItems(); + /** + Returns the number of items (=rows) in the control + + @since 2.9.4 + */ + unsigned int GetItemCount() const; + + /** + 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 +2395,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); + //@} }; @@ -2658,7 +2687,7 @@ public: in number and type. No (default) values are filled in automatically. */ - void AppendItem( const wxVector &values, wxClientData *data = NULL ); + void AppendItem( const wxVector &values, wxUIntPtr data = NULL ); /** Prepends an item (=row) and fills it with @a values. @@ -2667,7 +2696,7 @@ public: in number and type. No (default) values are filled in automatically. */ - void PrependItem( const wxVector &values, wxClientData *data = NULL ); + void PrependItem( const wxVector &values, wxUIntPtr data = NULL ); /** Inserts an item (=row) and fills it with @a values. @@ -2676,7 +2705,7 @@ public: in number and type. No (default) values are filled in automatically. */ - void InsertItem( unsigned int row, const wxVector &values, wxClientData *data = NULL ); + void InsertItem( unsigned int row, const wxVector &values, wxUIntPtr data = NULL ); /** Delete the item (=row) at position @a pos. @@ -2688,6 +2717,22 @@ public: */ void DeleteAllItems(); + /** + Returns the number of items (=rows) in the control + + @since 2.9.4 + */ + unsigned int GetItemCount() const; + + /** + 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 +2743,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 */ @@ -2934,6 +2991,8 @@ public: Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event. @event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)} Process a @c wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event. + Currently this even is only generated when using the native OSX + version. @event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)} Process a @c wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event. @event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}