+/**
+ @class wxDataViewListCtrl
+
+ This class is a wxDataViewCtrl which internally uses a wxDataViewListStore
+ and forwards most of its API to that class.
+
+ The purpose of this class is to offer a simple way to display and
+ edit a small table of data without having to write your own wxDataViewModel.
+
+ @code
+ wxDataViewListCtrl *listctrl = new wxDataViewListCtrl( parent, wxID_ANY );
+
+ listctrl->AppendToggleColumn( "Toggle" );
+ listctrl->AppendTextColumn( "Text" );
+
+ wxVector<wxVariant> data;
+ data.push_back( wxVariant(true) );
+ data.push_back( wxVariant("row 1") );
+ listctrl->AppendItem( data );
+
+ data.clear();
+ data.push_back( wxVariant(false) );
+ data.push_back( wxVariant("row 3") );
+ listctrl->AppendItem( data );
+ @endcode
+
+ @beginStyleTable
+ See wxDataViewCtrl for the list of supported styles.
+ @endStyleTable
+
+ @beginEventEmissionTable
+ See wxDataViewCtrl for the list of events emitted by this class.
+ @endEventTable
+
+ @library{wxadv}
+ @category{ctrl,dvc}
+
+ @since 2.9.0
+*/
+class wxDataViewListCtrl: public wxDataViewCtrl
+{
+public:
+ /**
+ Default ctor.
+ */
+ wxDataViewListCtrl();
+
+ /**
+ Constructor. Calls Create().
+ */
+ wxDataViewListCtrl( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxDV_ROW_LINES,
+ const wxValidator& validator = wxDefaultValidator );
+
+ /**
+ Destructor. Deletes the image list if any.
+ */
+ ~wxDataViewListCtrl();
+
+ /**
+ Creates the control and a wxDataViewListStore as its internal model.
+ */
+ bool Create( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxDV_ROW_LINES,
+ const wxValidator& validator = wxDefaultValidator );
+
+ //@{
+ /**
+ Returns the store.
+ */
+ wxDataViewListStore *GetStore();
+ const wxDataViewListStore *GetStore() const;
+ //@}
+
+ /**
+ Returns the position of given @e item or wxNOT_FOUND if it's
+ not a valid item.
+
+ @since 2.9.2
+ */
+ int ItemToRow(const wxDataViewItem &item) const;
+
+ /**
+ Returns the wxDataViewItem at the given @e row.
+
+ @since 2.9.2
+ */
+ wxDataViewItem RowToItem(int row) const;
+
+ //@{
+ /**
+ @name Selection handling functions
+ */
+
+ /**
+ Returns index of the selected row or wxNOT_FOUND.
+
+ @see wxDataViewCtrl::GetSelection()
+
+ @since 2.9.2
+ */
+ int GetSelectedRow() const;
+
+ /**
+ Selects given row.
+
+ @see wxDataViewCtrl::Select()
+
+ @since 2.9.2
+ */
+ void SelectRow(unsigned row);
+
+ /**
+ Unselects given row.
+
+ @see wxDataViewCtrl::Unselect()
+
+ @since 2.9.2
+ */
+ void UnselectRow(unsigned row);
+
+ /**
+ Returns true if @a row is selected.
+
+ @see wxDataViewCtrl::IsSelected()
+
+ @since 2.9.2
+ */
+ bool IsRowSelected(unsigned row) const;
+
+ //@}
+
+ /**
+ @name Column management functions
+ */
+ //@{
+
+ /**
+ Appends a column to the control and additionally appends a
+ column to the store with the type string.
+ */
+ virtual bool AppendColumn( wxDataViewColumn *column );
+
+ /**
+ Appends a column to the control and additionally appends a
+ column to the list store with the type @a varianttype.
+ */
+ void AppendColumn( wxDataViewColumn *column, const wxString &varianttype );
+
+ /**
+ Appends a text column to the control and the store.
+
+ See wxDataViewColumn::wxDataViewColumn for more info about
+ the parameters.
+ */
+ wxDataViewColumn *AppendTextColumn( const wxString &label,
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
+ int width = -1, wxAlignment align = wxALIGN_LEFT,
+ int flags = wxDATAVIEW_COL_RESIZABLE );
+
+ /**
+ Appends a toggle column to the control and the store.
+
+ See wxDataViewColumn::wxDataViewColumn for more info about
+ the parameters.
+ */
+ wxDataViewColumn *AppendToggleColumn( const wxString &label,
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
+ int width = -1, wxAlignment align = wxALIGN_LEFT,
+ int flags = wxDATAVIEW_COL_RESIZABLE );
+
+ /**
+ Appends a progress column to the control and the store.
+
+ See wxDataViewColumn::wxDataViewColumn for more info about
+ the parameters.
+ */
+ wxDataViewColumn *AppendProgressColumn( const wxString &label,
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
+ int width = -1, wxAlignment align = wxALIGN_LEFT,
+ int flags = wxDATAVIEW_COL_RESIZABLE );
+
+ /**
+ Appends an icon-and-text column to the control and the store.
+
+ See wxDataViewColumn::wxDataViewColumn for more info about
+ the parameters.
+ */
+ wxDataViewColumn *AppendIconTextColumn( const wxString &label,
+ wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
+ int width = -1, wxAlignment align = wxALIGN_LEFT,
+ int flags = wxDATAVIEW_COL_RESIZABLE );
+
+ /**
+ Inserts a column to the control and additionally inserts a
+ column to the store with the type string.
+ */
+ virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *column );
+
+ /**
+ Inserts a column to the control and additionally inserts a
+ column to the list store with the type @a varianttype.
+ */
+ void InsertColumn( unsigned int pos, wxDataViewColumn *column,
+ const wxString &varianttype );
+
+ /**
+ Prepends a column to the control and additionally prepends a
+ column to the store with the type string.
+ */
+ virtual bool PrependColumn( wxDataViewColumn *column );
+
+ /**
+ Prepends a column to the control and additionally prepends a
+ column to the list store with the type @a varianttype.
+ */
+ void PrependColumn( wxDataViewColumn *column, const wxString &varianttype );
+
+ //@}
+
+
+ /**
+ @name Item management functions
+ */
+ //@{
+
+ /**
+ Appends an item (=row) to the control and store.
+ */
+ void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
+
+ /**
+ Prepends an item (=row) to the control and store.
+ */
+ void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
+
+ /**
+ Inserts an item (=row) to the control and store.
+ */
+ void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
+
+ /**
+ Delete the row at position @a row.
+ */
+ void DeleteItem( unsigned row );
+
+ /**
+ Delete all items (= all rows).
+ */
+ 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.
+ */
+ void SetValue( const wxVariant &value, unsigned int row, unsigned int col );
+
+ /**
+ Returns the value from the store.
+ */
+ void GetValue( wxVariant &value, unsigned int row, unsigned int col );
+
+ /**
+ Sets the value in the store and update the control.
+
+ This method assumes that the string is stored in respective
+ column.
+ */
+ void SetTextValue( const wxString &value, unsigned int row, unsigned int col );
+
+ /**
+ Returns the value from the store.
+
+ This method assumes that the string is stored in respective
+ column.
+ */
+ wxString GetTextValue( unsigned int row, unsigned int col ) const;
+
+ /**
+ Sets the value in the store and update the control.
+
+ This method assumes that the boolean value is stored in
+ respective column.
+ */
+ void SetToggleValue( bool value, unsigned int row, unsigned int col );
+
+ /**
+ Returns the value from the store.
+
+ This method assumes that the boolean value is stored in
+ respective column.
+ */
+ 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);
+
+ //@}
+};
+
+