# wxDataViewTreeCtrl Class Reference
[Controls, wxDataViewCtrl Related Classes]

`#include <wx/dataview.h>`

Inheritance diagram for wxDataViewTreeCtrl:
[legend]

## Detailed Description

This class is a wxDataViewCtrl which internally uses a wxDataViewTreeStore and forwards most of its API to that class.

Additionally, it uses a wxImageList to store a list of icons.

The main purpose of this class is to provide a simple upgrade path for code using wxTreeCtrl.

## Styles

This class supports the following styles:

See wxDataViewCtrl for the list of supported styles.

## Events emitted by this class

Event macros for events emitted by this class:

See wxDataViewCtrl for the list of events emitted by this class.

##

Library: wxAdvanced

Category: Controls, wxDataViewCtrl Related Classes
Appearance:

wxMSW appearance | wxGTK appearance | wxMac appearance

## Public Member Functions
| wxDataViewTreeCtrl ()
| Default ctor.
| wxDataViewTreeCtrl (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDV_NO_HEADER|wxDV_ROW_LINES, const wxValidator &validator=wxDefaultValidator)
| Constructor.
virtual | ~wxDataViewTreeCtrl ()
| Destructor.
wxDataViewItem | AppendContainer (const wxDataViewItem &parent, const wxString &text, int icon=-1, int expanded=-1, wxClientData *data=NULL)
| Appends a container to the given parent.
wxDataViewItem | AppendItem (const wxDataViewItem &parent, const wxString &text, int icon=-1, wxClientData *data=NULL)
| Appends an item to the given parent.
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDV_NO_HEADER|wxDV_ROW_LINES, const wxValidator &validator=wxDefaultValidator)
| Creates the control and a wxDataViewTreeStore as its internal model.
void | DeleteAllItems ()
| Calls the identical method from wxDataViewTreeStore.
void | DeleteChildren (const wxDataViewItem &item)
| Calls the identical method from wxDataViewTreeStore.
void | DeleteItem (const wxDataViewItem &item)
| Calls the identical method from wxDataViewTreeStore.
int | GetChildCount (const wxDataViewItem &parent) const
| Calls the identical method from wxDataViewTreeStore.
wxImageList * | GetImageList ()
| Returns the image list.
wxClientData * | GetItemData (const wxDataViewItem &item) const
| Calls the identical method from wxDataViewTreeStore.
const wxIcon & | GetItemExpandedIcon (const wxDataViewItem &item) const
| Calls the identical method from wxDataViewTreeStore.
const wxIcon & | GetItemIcon (const wxDataViewItem &item) const
| Calls the identical method from wxDataViewTreeStore.
wxString | GetItemText (const wxDataViewItem &item) const
| Calls the identical method from wxDataViewTreeStore.
wxDataViewItem | GetNthChild (const wxDataViewItem &parent, unsigned int pos) const
| Calls the identical method from wxDataViewTreeStore.
wxDataViewItem | InsertContainer (const wxDataViewItem &parent, const wxDataViewItem &previous, const wxString &text, int icon=-1, int expanded=-1, wxClientData *data=NULL)
| Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.
wxDataViewItem | InsertItem (const wxDataViewItem &parent, const wxDataViewItem &previous, const wxString &text, int icon=-1, wxClientData *data=NULL)
| Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.
bool | IsContainer (const wxDataViewItem &item)
| Returns true if item is a container.
wxDataViewItem | PrependContainer (const wxDataViewItem &parent, const wxString &text, int icon=-1, int expanded=-1, wxClientData *data=NULL)
| Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.
wxDataViewItem | PrependItem (const wxDataViewItem &parent, const wxString &text, int icon=-1, wxClientData *data=NULL)
| Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.
void | SetImageList (wxImageList *imagelist)
| Sets the image list.
void | SetItemData (const wxDataViewItem &item, wxClientData *data)
| Calls the identical method from wxDataViewTreeStore.
void | SetItemExpandedIcon (const wxDataViewItem &item, const wxIcon &icon)
| Calls the identical method from wxDataViewTreeStore.
void | SetItemIcon (const wxDataViewItem &item, const wxIcon &icon)
| Calls the identical method from wxDataViewTreeStore.
void | SetItemText (const wxDataViewItem &item, const wxString &text)
| Calls the identical method from wxDataViewTreeStore.
wxDataViewTreeStore * | GetStore ()
| Returns the store.
const wxDataViewTreeStore * | GetStore () const
| Returns the store.

List of all members.

## Constructor & Destructor Documentation

wxDataViewTreeCtrl::wxDataViewTreeCtrl | ( |  | ) |

Default ctor.

wxDataViewTreeCtrl::wxDataViewTreeCtrl | ( | wxWindow * | parent,
|  | wxWindowID | id,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | long | style = `wxDV_NO_HEADER|wxDV_ROW_LINES`,
|  | const wxValidator & | validator = `wxDefaultValidator` |
| ) |  |  |

Constructor.

Calls Create().

virtual wxDataViewTreeCtrl::~wxDataViewTreeCtrl | ( |  | ) | `[virtual]`

Destructor.

Deletes the image list if any.

## Member Function Documentation

wxDataViewItem wxDataViewTreeCtrl::AppendContainer | ( | const wxDataViewItem & | parent,
|  | const wxString & | text,
|  | int | icon = `-1`,
|  | int | expanded = `-1`,
|  | wxClientData * | data = `NULL` |
| ) |  |  |

Appends a container to the given parent.

wxDataViewItem wxDataViewTreeCtrl::AppendItem | ( | const wxDataViewItem & | parent,
|  | const wxString & | text,
|  | int | icon = `-1`,
|  | wxClientData * | data = `NULL` |
| ) |  |  |

Appends an item to the given parent.

bool wxDataViewTreeCtrl::Create | ( | wxWindow * | parent,
|  | wxWindowID | id,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | long | style = `wxDV_NO_HEADER|wxDV_ROW_LINES`,
|  | const wxValidator & | validator = `wxDefaultValidator` |
| ) |  |  |

Creates the control and a wxDataViewTreeStore as its internal model.

The default tree column created by this method is an editable column using wxDataViewIconTextRenderer as its renderer.

void wxDataViewTreeCtrl::DeleteAllItems | ( |  | ) |

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

wxImageList* wxDataViewTreeCtrl::GetImageList | ( |  | ) |

Returns the image list.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

const wxDataViewTreeStore* wxDataViewTreeCtrl::GetStore | ( |  | ) | const

Returns the store.

wxDataViewTreeStore* wxDataViewTreeCtrl::GetStore | ( |  | ) |

Returns the store.

wxDataViewItem wxDataViewTreeCtrl::InsertContainer | ( | const wxDataViewItem & | parent,
|  | const wxDataViewItem & | previous,
|  | const wxString & | text,
|  | int | icon = `-1`,
|  | int | expanded = `-1`,
|  | wxClientData * | data = `NULL` |
| ) |  |  |

Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.

wxDataViewItem wxDataViewTreeCtrl::InsertItem | ( | const wxDataViewItem & | parent,
|  | const wxDataViewItem & | previous,
|  | const wxString & | text,
|  | int | icon = `-1`,
|  | wxClientData * | data = `NULL` |
| ) |  |  |

Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.

bool wxDataViewTreeCtrl::IsContainer | ( | const wxDataViewItem & | item | ) |

Returns true if item is a container.

wxDataViewItem wxDataViewTreeCtrl::PrependContainer | ( | const wxDataViewItem & | parent,
|  | const wxString & | text,
|  | int | icon = `-1`,
|  | int | expanded = `-1`,
|  | wxClientData * | data = `NULL` |
| ) |  |  |

Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.

wxDataViewItem wxDataViewTreeCtrl::PrependItem | ( | const wxDataViewItem & | parent,
|  | const wxString & | text,
|  | int | icon = `-1`,
|  | wxClientData * | data = `NULL` |
| ) |  |  |

Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon.

void wxDataViewTreeCtrl::SetImageList | ( | wxImageList * | imagelist | ) |

Sets the image list.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

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

Calls the identical method from wxDataViewTreeStore.

void wxDataViewTreeCtrl::SetItemText | ( | const wxDataViewItem & | item,
|  | const wxString & | text |
| ) |  |  |

Calls the identical method from wxDataViewTreeStore.

|  | [ top ]