Version: 3.0.2
wxDataViewTreeStore Class Reference

#include <wx/dataview.h>

+ Inheritance diagram for wxDataViewTreeStore:

Detailed Description

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.

Library:  wxAdvanced
Category:  wxDataViewCtrl Related Classes

Public Member Functions

 wxDataViewTreeStore ()
 Constructor.
 
virtual ~wxDataViewTreeStore ()
 Destructor.
 
wxDataViewItem AppendContainer (const wxDataViewItem &parent, const wxString &text, const wxIcon &icon=wxNullIcon, const wxIcon &expanded=wxNullIcon, wxClientData *data=NULL)
 Append a container.
 
wxDataViewItem AppendItem (const wxDataViewItem &parent, const wxString &text, const wxIcon &icon=wxNullIcon, wxClientData *data=NULL)
 Append an item.
 
void DeleteAllItems ()
 Delete all item in the model.
 
void DeleteChildren (const wxDataViewItem &item)
 Delete all children of the item, but not the item itself.
 
void DeleteItem (const wxDataViewItem &item)
 Delete this item.
 
int GetChildCount (const wxDataViewItem &parent) const
 Return the number of children of item.
 
wxClientDataGetItemData (const wxDataViewItem &item) const
 Returns the client data associated with the item.
 
const wxIconGetItemExpandedIcon (const wxDataViewItem &item) const
 Returns the icon to display in expanded containers.
 
const wxIconGetItemIcon (const wxDataViewItem &item) const
 Returns the icon of the item.
 
wxString GetItemText (const wxDataViewItem &item) const
 Returns the text of the item.
 
wxDataViewItem GetNthChild (const wxDataViewItem &parent, unsigned int pos) const
 Returns the nth child item of item.
 
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.
 
wxDataViewItem InsertItem (const wxDataViewItem &parent, const wxDataViewItem &previous, const wxString &text, const wxIcon &icon=wxNullIcon, wxClientData *data=NULL)
 Inserts an item after previous.
 
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.
 
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.
 
void SetItemData (const wxDataViewItem &item, wxClientData *data)
 Sets the client data associated with the item.
 
void SetItemExpandedIcon (const wxDataViewItem &item, const wxIcon &icon)
 Sets the expanded icon for the item.
 
void SetItemIcon (const wxDataViewItem &item, const wxIcon &icon)
 Sets the icon for the 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 int Compare (const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned int column, bool ascending) const
 The compare function to be used by control.
 
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 unsigned int GetColumnCount () const =0
 Override this to indicate the number of columns in the model.
 
virtual wxString GetColumnType (unsigned int col) const =0
 Override this to indicate what type of data is stored in the column specified by col.
 
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

wxDataViewTreeStore::wxDataViewTreeStore ( )

Constructor.

Creates the invisible root node internally.

virtual wxDataViewTreeStore::~wxDataViewTreeStore ( )
virtual

Destructor.

Member Function Documentation

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.