#include <wx/dataview.h>
wxDataViewTreeStore is a specialised wxDataViewModel for storing simple trees very much like wxTreeCtrl does and it offers a similar API.
This class actually stores the entire tree and the values (therefore its name) and implements all virtual methods from the base class so it can be used directly without having to derive any class from it, but it is mostly used from within wxDataViewTreeCtrl.
Public Member Functions | |
wxDataViewTreeStore () | |
Constructor. More... | |
virtual | ~wxDataViewTreeStore () |
Destructor. More... | |
wxDataViewItem | AppendContainer (const wxDataViewItem &parent, const wxString &text, const wxIcon &icon=wxNullIcon, const wxIcon &expanded=wxNullIcon, wxClientData *data=NULL) |
Append a container. More... | |
wxDataViewItem | AppendItem (const wxDataViewItem &parent, const wxString &text, const wxIcon &icon=wxNullIcon, wxClientData *data=NULL) |
Append an item. More... | |
void | DeleteAllItems () |
Delete all item in the model. More... | |
void | DeleteChildren (const wxDataViewItem &item) |
Delete all children of the item, but not the item itself. More... | |
void | DeleteItem (const wxDataViewItem &item) |
Delete this item. More... | |
int | GetChildCount (const wxDataViewItem &parent) const |
Return the number of children of item. More... | |
wxClientData * | GetItemData (const wxDataViewItem &item) const |
Returns the client data associated with the item. More... | |
const wxIcon & | GetItemExpandedIcon (const wxDataViewItem &item) const |
Returns the icon to display in expanded containers. More... | |
const wxIcon & | GetItemIcon (const wxDataViewItem &item) const |
Returns the icon of the item. More... | |
wxString | GetItemText (const wxDataViewItem &item) const |
Returns the text of the item. More... | |
wxDataViewItem | GetNthChild (const wxDataViewItem &parent, unsigned int pos) const |
Returns the nth child item of item. More... | |
wxDataViewItem | InsertContainer (const wxDataViewItem &parent, const wxDataViewItem &previous, const wxString &text, const wxIcon &icon=wxNullIcon, const wxIcon &expanded=wxNullIcon, wxClientData *data=NULL) |
Inserts a container after previous. More... | |
wxDataViewItem | InsertItem (const wxDataViewItem &parent, const wxDataViewItem &previous, const wxString &text, const wxIcon &icon=wxNullIcon, wxClientData *data=NULL) |
Inserts an item after previous. More... | |
wxDataViewItem | PrependContainer (const wxDataViewItem &parent, const wxString &text, const wxIcon &icon=wxNullIcon, const wxIcon &expanded=wxNullIcon, wxClientData *data=NULL) |
Inserts a container before the first child item or parent. More... | |
wxDataViewItem | PrependItem (const wxDataViewItem &parent, const wxString &text, const wxIcon &icon=wxNullIcon, wxClientData *data=NULL) |
Inserts an item before the first child item or parent. More... | |
void | SetItemData (const wxDataViewItem &item, wxClientData *data) |
Sets the client data associated with the item. More... | |
void | SetItemExpandedIcon (const wxDataViewItem &item, const wxIcon &icon) |
Sets the expanded icon for the item. More... | |
void | SetItemIcon (const wxDataViewItem &item, const wxIcon &icon) |
Sets the icon for the item. More... | |
![]() | |
wxDataViewModel () | |
Constructor. More... | |
void | AddNotifier (wxDataViewModelNotifier *notifier) |
Adds a wxDataViewModelNotifier to the model. More... | |
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. More... | |
virtual bool | Cleared () |
Called to inform the model that all data has been cleared. More... | |
virtual int | Compare (const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned int column, bool ascending) const |
The compare function to be used by control. More... | |
virtual bool | GetAttr (const wxDataViewItem &item, unsigned int col, wxDataViewItemAttr &attr) const |
Override this to indicate that the item has special font attributes. More... | |
virtual bool | IsEnabled (const wxDataViewItem &item, unsigned int col) const |
Override this to indicate that the item should be disabled. More... | |
virtual unsigned int | GetChildren (const wxDataViewItem &item, wxDataViewItemArray &children) const =0 |
Override this so the control can query the child items of an item. More... | |
virtual unsigned int | GetColumnCount () const =0 |
Override this to indicate the number of columns in the model. More... | |
virtual wxString | GetColumnType (unsigned int col) const =0 |
Override this to indicate what type of data is stored in the column specified by col. More... | |
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. More... | |
virtual void | GetValue (wxVariant &variant, const wxDataViewItem &item, unsigned int col) const =0 |
Override this to indicate the value of item. More... | |
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. More... | |
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. More... | |
bool | HasValue (const wxDataViewItem &item, unsigned col) const |
Return true if there is a value in the given column of this item. More... | |
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. More... | |
bool | ItemAdded (const wxDataViewItem &parent, const wxDataViewItem &item) |
Call this to inform the model that an item has been added to the data. More... | |
bool | ItemChanged (const wxDataViewItem &item) |
Call this to inform the model that an item has changed. More... | |
bool | ItemDeleted (const wxDataViewItem &parent, const wxDataViewItem &item) |
Call this to inform the model that an item has been deleted from the data. More... | |
bool | ItemsAdded (const wxDataViewItem &parent, const wxDataViewItemArray &items) |
Call this to inform the model that several items have been added to the data. More... | |
bool | ItemsChanged (const wxDataViewItemArray &items) |
Call this to inform the model that several items have changed. More... | |
bool | ItemsDeleted (const wxDataViewItem &parent, const wxDataViewItemArray &items) |
Call this to inform the model that several items have been deleted. More... | |
void | RemoveNotifier (wxDataViewModelNotifier *notifier) |
Remove the notifier from the list of notifiers. More... | |
virtual void | Resort () |
Call this to initiate a resort after the sort function has been changed. More... | |
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. More... | |
virtual bool | ValueChanged (const wxDataViewItem &item, unsigned int col) |
Call this to inform this model that a value in the model has been changed. More... | |
virtual bool | IsListModel () const |
virtual bool | IsVirtualListModel () const |
![]() | |
wxRefCounter () | |
Default constructor. More... | |
void | DecRef () |
Decrements the reference count associated with this shared data and, if it reaches zero, destroys this instance of wxRefCounter releasing its memory. More... | |
int | GetRefCount () const |
Returns the reference count associated with this shared data. More... | |
void | IncRef () |
Increments the reference count associated with this shared data. More... | |
Additional Inherited Members | |
![]() | |
virtual | ~wxDataViewModel () |
Destructor. More... | |
![]() | |
virtual | ~wxRefCounter () |
Destructor. More... | |
wxDataViewTreeStore::wxDataViewTreeStore | ( | ) |
Constructor.
Creates the invisible root node internally.
|
virtual |
Destructor.
wxDataViewItem wxDataViewTreeStore::AppendContainer | ( | const wxDataViewItem & | parent, |
const wxString & | text, | ||
const wxIcon & | icon = wxNullIcon , |
||
const wxIcon & | expanded = wxNullIcon , |
||
wxClientData * | data = NULL |
||
) |
Append a container.
wxDataViewItem wxDataViewTreeStore::AppendItem | ( | const wxDataViewItem & | parent, |
const wxString & | text, | ||
const wxIcon & | icon = wxNullIcon , |
||
wxClientData * | data = NULL |
||
) |
Append an item.
void wxDataViewTreeStore::DeleteAllItems | ( | ) |
Delete all item in the model.
void wxDataViewTreeStore::DeleteChildren | ( | const wxDataViewItem & | item | ) |
Delete all children of the item, but not the item itself.
void wxDataViewTreeStore::DeleteItem | ( | const wxDataViewItem & | item | ) |
Delete this item.
int wxDataViewTreeStore::GetChildCount | ( | const wxDataViewItem & | parent | ) | const |
Return the number of children of item.
wxClientData* wxDataViewTreeStore::GetItemData | ( | const wxDataViewItem & | item | ) | const |
Returns the client data associated with the item.
const wxIcon& wxDataViewTreeStore::GetItemExpandedIcon | ( | const wxDataViewItem & | item | ) | const |
Returns the icon to display in expanded containers.
const wxIcon& wxDataViewTreeStore::GetItemIcon | ( | const wxDataViewItem & | item | ) | const |
Returns the icon of the item.
wxString wxDataViewTreeStore::GetItemText | ( | const wxDataViewItem & | item | ) | const |
Returns the text of the item.
wxDataViewItem wxDataViewTreeStore::GetNthChild | ( | const wxDataViewItem & | parent, |
unsigned int | pos | ||
) | const |
Returns the nth child item of item.
wxDataViewItem wxDataViewTreeStore::InsertContainer | ( | const wxDataViewItem & | parent, |
const wxDataViewItem & | previous, | ||
const wxString & | text, | ||
const wxIcon & | icon = wxNullIcon , |
||
const wxIcon & | expanded = wxNullIcon , |
||
wxClientData * | data = NULL |
||
) |
Inserts a container after previous.
wxDataViewItem wxDataViewTreeStore::InsertItem | ( | const wxDataViewItem & | parent, |
const wxDataViewItem & | previous, | ||
const wxString & | text, | ||
const wxIcon & | icon = wxNullIcon , |
||
wxClientData * | data = NULL |
||
) |
Inserts an item after previous.
wxDataViewItem wxDataViewTreeStore::PrependContainer | ( | const wxDataViewItem & | parent, |
const wxString & | text, | ||
const wxIcon & | icon = wxNullIcon , |
||
const wxIcon & | expanded = wxNullIcon , |
||
wxClientData * | data = NULL |
||
) |
Inserts a container before the first child item or parent.
wxDataViewItem wxDataViewTreeStore::PrependItem | ( | const wxDataViewItem & | parent, |
const wxString & | text, | ||
const wxIcon & | icon = wxNullIcon , |
||
wxClientData * | data = NULL |
||
) |
Inserts an item before the first child item or parent.
void wxDataViewTreeStore::SetItemData | ( | const wxDataViewItem & | item, |
wxClientData * | data | ||
) |
Sets the client data associated with the item.
void wxDataViewTreeStore::SetItemExpandedIcon | ( | const wxDataViewItem & | item, |
const wxIcon & | icon | ||
) |
Sets the expanded icon for the item.
void wxDataViewTreeStore::SetItemIcon | ( | const wxDataViewItem & | item, |
const wxIcon & | icon | ||
) |
Sets the icon for the item.