wxWidgets: wxDataViewTreeStore Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxDataViewTreeStore Class Reference
Class List by Category » wxDataViewCtrl Related Classes

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.5-4.x86_64/src/wxWidgets-3.1.5/interface/wx/dataview.h>`

Inheritance diagram for wxDataViewTreeStore:
[legend]

## 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.

Notice that by default this class sorts all items with children before the leaf items. If this behaviour is inappropriate, you need to derive a custom class from this one and override either its HasDefaultCompare() method to return false, which would result in items being sorted just in the order in which they were added, or its Compare() function to compare the items using some other criterion, e.g. alphabetically.

##

Library: wxCore

<>< =''>:</>&;&;< =''>\ </></>

## 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.
wxClientData * | GetItemData (const wxDataViewItem &item) const
| Returns the client data associated with the item.
const wxIcon & | GetItemExpandedIcon (const wxDataViewItem &item) const
| Returns the icon to display in expanded containers.
const wxIcon & | GetItemIcon (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.
bool | Cleared ()
| Called to inform the model that all of its data has been changed.
virtual int | Compare (const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned int column, bool ascending) const
| The compare function to be used by the 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.
virtual 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.
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.
virtual int | DoCompareValues (const wxVariant &value1, const wxVariant &value2) const
| Virtual method that can be overridden to define comparison for values of non-standard types.
Protected Member Functions inherited from wxRefCounter
virtual | ~wxRefCounter ()
| Destructor.

## Constructor & Destructor Documentation

## ◆ wxDataViewTreeStore()

wxDataViewTreeStore::wxDataViewTreeStore | ( |  | ) |

Constructor.

Creates the invisible root node internally.

## ◆ ~wxDataViewTreeStore()

virtual wxDataViewTreeStore::~wxDataViewTreeStore | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ AppendContainer()

wxDataViewItem wxDataViewTreeStore::AppendContainer | ( | const wxDataViewItem & | parent,
|  | const wxString & | text,
|  | const wxIcon & | icon = wxNullIcon,
|  | const wxIcon & | expanded = wxNullIcon,
|  | wxClientData * | data = NULL )

Append a container.

## ◆ AppendItem()

wxDataViewItem wxDataViewTreeStore::AppendItem | ( | const wxDataViewItem & | parent,
|  | const wxString & | text,
|  | const wxIcon & | icon = wxNullIcon,
|  | wxClientData * | data = NULL )

Append an item.

## ◆ DeleteAllItems()

void wxDataViewTreeStore::DeleteAllItems | ( |  | ) |

Delete all item in the model.

## ◆ DeleteChildren()

void wxDataViewTreeStore::DeleteChildren | ( | const wxDataViewItem & | item | ) |

Delete all children of the item, but not the item itself.

## ◆ DeleteItem()

void wxDataViewTreeStore::DeleteItem | ( | const wxDataViewItem & | item | ) |

Delete this item.

## ◆ GetChildCount()

int wxDataViewTreeStore::GetChildCount | ( | const wxDataViewItem & | parent | ) | const

Return the number of children of item.

## ◆ GetItemData()

wxClientData * wxDataViewTreeStore::GetItemData | ( | const wxDataViewItem & | item | ) | const

Returns the client data associated with the item.

## ◆ GetItemExpandedIcon()

const wxIcon & wxDataViewTreeStore::GetItemExpandedIcon | ( | const wxDataViewItem & | item | ) | const

Returns the icon to display in expanded containers.

## ◆ GetItemIcon()

const wxIcon & wxDataViewTreeStore::GetItemIcon | ( | const wxDataViewItem & | item | ) | const

Returns the icon of the item.

## ◆ GetItemText()

wxString wxDataViewTreeStore::GetItemText | ( | const wxDataViewItem & | item | ) | const

Returns the text of the item.

## ◆ GetNthChild()

wxDataViewItem wxDataViewTreeStore::GetNthChild | ( | const wxDataViewItem & | parent,
|  | unsigned int | pos ) const

Returns the nth child item of item.

## ◆ InsertContainer()

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.

## ◆ InsertItem()

wxDataViewItem wxDataViewTreeStore::InsertItem | ( | const wxDataViewItem & | parent,
|  | const wxDataViewItem & | previous,
|  | const wxString & | text,
|  | const wxIcon & | icon = wxNullIcon,
|  | wxClientData * | data = NULL )

Inserts an item after previous.

## ◆ PrependContainer()

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.

## ◆ PrependItem()

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.

## ◆ SetItemData()

void wxDataViewTreeStore::SetItemData | ( | const wxDataViewItem & | item,
|  | wxClientData * | data )

Sets the client data associated with the item.

## ◆ SetItemExpandedIcon()

void wxDataViewTreeStore::SetItemExpandedIcon | ( | const wxDataViewItem & | item,
|  | const wxIcon & | icon )

Sets the expanded icon for the item.

## ◆ SetItemIcon()

void wxDataViewTreeStore::SetItemIcon | ( | const wxDataViewItem & | item,
|  | const wxIcon & | icon )

Sets the icon for the item.