Version: 3.1.0
wxDataViewListStore Class Reference

#include <wx/dataview.h>

+ Inheritance diagram for wxDataViewListStore:

Detailed Description

wxDataViewListStore is a specialised wxDataViewModel for storing a simple table of data.

Since it derives from wxDataViewIndexListModel its data is be accessed by row (i.e. by index) instead of only by wxDataViewItem.

This class actually stores the values (therefore its name) and implements all virtual methods from the base classes so it can be used directly without having to derive any class from it, but it is mostly used from within wxDataViewListCtrl.

Library:  wxAdvanced
Category:  wxDataViewCtrl Related Classes

Public Member Functions

 wxDataViewListStore ()
 Constructor.
 
 ~wxDataViewListStore ()
 Destructor.
 
void PrependColumn (const wxString &varianttype)
 Prepends a data column.
 
void InsertColumn (unsigned int pos, const wxString &varianttype)
 Inserts a data column before pos.
 
void AppendColumn (const wxString &varianttype)
 Appends a data column.
 
void AppendItem (const wxVector< wxVariant > &values, wxUIntPtr data=NULL)
 Appends an item (=row) and fills it with values.
 
void PrependItem (const wxVector< wxVariant > &values, wxUIntPtr data=NULL)
 Prepends an item (=row) and fills it with values.
 
void InsertItem (unsigned int row, const wxVector< wxVariant > &values, wxUIntPtr data=NULL)
 Inserts an item (=row) and fills it with values.
 
void DeleteItem (unsigned pos)
 Delete the item (=row) at position pos.
 
void DeleteAllItems ()
 Delete all item (=all rows) in the store.
 
unsigned int GetItemCount () const
 Returns the number of items (=rows) in the control.
 
wxUIntPtr GetItemData (const wxDataViewItem &item) const
 Returns the client data associated with the item.
 
virtual unsigned int GetColumnCount () const
 Overridden from wxDataViewModel.
 
virtual wxString GetColumnType (unsigned int col) const
 Overridden from wxDataViewModel.
 
void SetItemData (const wxDataViewItem &item, wxUIntPtr data)
 Sets the client data associated with the item.
 
virtual void GetValueByRow (wxVariant &value, unsigned int row, unsigned int col) const
 Overridden from wxDataViewIndexListModel.
 
virtual bool SetValueByRow (const wxVariant &value, unsigned int row, unsigned int col)
 Overridden from wxDataViewIndexListModel.
 
- Public Member Functions inherited from wxDataViewIndexListModel
 wxDataViewIndexListModel (unsigned int initial_size=0)
 Constructor.
 
wxDataViewItem GetItem (unsigned int row) const
 Returns the wxDataViewItem at the given row.
 
void Reset (unsigned int new_size)
 Call this after if the data has to be read again from the model.
 
void RowAppended ()
 Call this after a row has been appended to the model.
 
void RowChanged (unsigned int row)
 Call this after a row has been changed.
 
void RowDeleted (unsigned int row)
 Call this after a row has been deleted.
 
void RowInserted (unsigned int before)
 Call this after a row has been inserted at the given position.
 
void RowPrepended ()
 Call this after a row has been prepended to the model.
 
void RowValueChanged (unsigned int row, unsigned int col)
 Call this after a value has been changed.
 
void RowsDeleted (const wxArrayInt &rows)
 Call this after rows have been deleted.
 
- Public Member Functions inherited from wxDataViewListModel
virtual ~wxDataViewListModel ()
 Destructor.
 
int Compare (const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned int column, bool ascending) const
 Compare method that sorts the items by their index.
 
virtual bool GetAttrByRow (unsigned int row, unsigned int col, wxDataViewItemAttr &attr) const
 Override this to indicate that the row has special font attributes.
 
virtual bool IsEnabledByRow (unsigned int row, unsigned int col) const
 Override this if you want to disable specific items.
 
unsigned int GetCount () const =0
 Returns the number of items (or rows) in the list.
 
unsigned int GetRow (const wxDataViewItem &item) const =0
 Returns the position of given item.
 
- Public Member Functions inherited from wxDataViewModel
 wxDataViewModel ()
 Constructor.
 
void AddNotifier (wxDataViewModelNotifier *notifier)
 Adds a wxDataViewModelNotifier to the model.
 
bool ChangeValue (const wxVariant &variant, const wxDataViewItem &item, unsigned int col)
 Change the value of the given item and update the control to reflect it.
 
virtual bool Cleared ()
 Called to inform the model that all data has been cleared.
 
virtual bool GetAttr (const wxDataViewItem &item, unsigned int col, wxDataViewItemAttr &attr) const
 Override this to indicate that the item has special font attributes.
 
virtual bool IsEnabled (const wxDataViewItem &item, unsigned int col) const
 Override this to indicate that the item should be disabled.
 
virtual unsigned int GetChildren (const wxDataViewItem &item, wxDataViewItemArray &children) const =0
 Override this so the control can query the child items of an item.
 
virtual wxDataViewItem GetParent (const wxDataViewItem &item) const =0
 Override this to indicate which wxDataViewItem representing the parent of item or an invalid wxDataViewItem if the root item is the parent item.
 
virtual void GetValue (wxVariant &variant, const wxDataViewItem &item, unsigned int col) const =0
 Override this to indicate the value of item.
 
virtual bool HasContainerColumns (const wxDataViewItem &item) const
 Override this method to indicate if a container item merely acts as a headline (or for categorisation) or if it also acts a normal item with entries for further columns.
 
virtual bool HasDefaultCompare () const
 Override this to indicate that the model provides a default compare function that the control should use if no wxDataViewColumn has been chosen for sorting.
 
bool HasValue (const wxDataViewItem &item, unsigned col) const
 Return true if there is a value in the given column of this item.
 
virtual bool IsContainer (const wxDataViewItem &item) const =0
 Override this to indicate of item is a container, i.e. if it can have child items.
 
bool ItemAdded (const wxDataViewItem &parent, const wxDataViewItem &item)
 Call this to inform the model that an item has been added to the data.
 
bool ItemChanged (const wxDataViewItem &item)
 Call this to inform the model that an item has changed.
 
bool ItemDeleted (const wxDataViewItem &parent, const wxDataViewItem &item)
 Call this to inform the model that an item has been deleted from the data.
 
bool ItemsAdded (const wxDataViewItem &parent, const wxDataViewItemArray &items)
 Call this to inform the model that several items have been added to the data.
 
bool ItemsChanged (const wxDataViewItemArray &items)
 Call this to inform the model that several items have changed.
 
bool ItemsDeleted (const wxDataViewItem &parent, const wxDataViewItemArray &items)
 Call this to inform the model that several items have been deleted.
 
void RemoveNotifier (wxDataViewModelNotifier *notifier)
 Remove the notifier from the list of notifiers.
 
virtual void Resort ()
 Call this to initiate a resort after the sort function has been changed.
 
virtual bool SetValue (const wxVariant &variant, const wxDataViewItem &item, unsigned int col)=0
 This gets called in order to set a value in the data model.
 
virtual bool ValueChanged (const wxDataViewItem &item, unsigned int col)
 Call this to inform this model that a value in the model has been changed.
 
virtual bool IsListModel () const
 
virtual bool IsVirtualListModel () const
 
- Public Member Functions inherited from wxRefCounter
 wxRefCounter ()
 Default constructor.
 
void DecRef ()
 Decrements the reference count associated with this shared data and, if it reaches zero, destroys this instance of wxRefCounter releasing its memory.
 
int GetRefCount () const
 Returns the reference count associated with this shared data.
 
void IncRef ()
 Increments the reference count associated with this shared data.
 

Additional Inherited Members

- Protected Member Functions inherited from wxDataViewModel
virtual ~wxDataViewModel ()
 Destructor.
 

Constructor & Destructor Documentation

wxDataViewListStore::wxDataViewListStore ( )

Constructor.

wxDataViewListStore::~wxDataViewListStore ( )

Destructor.

Member Function Documentation

void wxDataViewListStore::AppendColumn ( const wxString varianttype)

Appends a data column.

variantype indicates the type of values store in the column.

This does not automatically fill in any (default) values in rows which exist in the store already.

void wxDataViewListStore::AppendItem ( const wxVector< wxVariant > &  values,
wxUIntPtr  data = NULL 
)

Appends an item (=row) and fills it with values.

The values must match the values specifies in the column in number and type. No (default) values are filled in automatically.

void wxDataViewListStore::DeleteAllItems ( )

Delete all item (=all rows) in the store.

void wxDataViewListStore::DeleteItem ( unsigned  pos)

Delete the item (=row) at position pos.

virtual unsigned int wxDataViewListStore::GetColumnCount ( ) const
virtual

Overridden from wxDataViewModel.

Implements wxDataViewModel.

virtual wxString wxDataViewListStore::GetColumnType ( unsigned int  col) const
virtual

Overridden from wxDataViewModel.

Implements wxDataViewModel.

unsigned int wxDataViewListStore::GetItemCount ( ) const

Returns the number of items (=rows) in the control.

Since
2.9.4
wxUIntPtr wxDataViewListStore::GetItemData ( const wxDataViewItem item) const

Returns the client data associated with the item.

See Also
SetItemData()
Since
2.9.4
virtual void wxDataViewListStore::GetValueByRow ( wxVariant value,
unsigned int  row,
unsigned int  col 
) const
virtual

Overridden from wxDataViewIndexListModel.

Implements wxDataViewListModel.

void wxDataViewListStore::InsertColumn ( unsigned int  pos,
const wxString varianttype 
)

Inserts a data column before pos.

variantype indicates the type of values store in the column.

This does not automatically fill in any (default) values in rows which exist in the store already.

void wxDataViewListStore::InsertItem ( unsigned int  row,
const wxVector< wxVariant > &  values,
wxUIntPtr  data = NULL 
)

Inserts an item (=row) and fills it with values.

The values must match the values specifies in the column in number and type. No (default) values are filled in automatically.

void wxDataViewListStore::PrependColumn ( const wxString varianttype)

Prepends a data column.

variantype indicates the type of values store in the column.

This does not automatically fill in any (default) values in rows which exist in the store already.

void wxDataViewListStore::PrependItem ( const wxVector< wxVariant > &  values,
wxUIntPtr  data = NULL 
)

Prepends an item (=row) and fills it with values.

The values must match the values specifies in the column in number and type. No (default) values are filled in automatically.

void wxDataViewListStore::SetItemData ( const wxDataViewItem item,
wxUIntPtr  data 
)

Sets the client data associated with the item.

Notice that this class does not take ownership of the passed in pointer and will not delete it.

See Also
GetItemData()
Since
2.9.4
virtual bool wxDataViewListStore::SetValueByRow ( const wxVariant value,
unsigned int  row,
unsigned int  col 
)
virtual

Overridden from wxDataViewIndexListModel.

Implements wxDataViewListModel.