wx.dataview.DataViewTreeCtrl¶This class is a wx.dataview.DataViewCtrl which internally uses a wx.dataview.DataViewTreeStore and forwards most of its API to that class.
Additionally, it uses a wx.ImageList to store a list of icons.
The main purpose of this class is to provide a simple upgrade path for code using wx.TreeCtrl.
Window Styles¶This class supports the following styles:
See wx.dataview.DataViewCtrl for the list of supported styles.
Events Emitted by this Class¶Event macros for events emitted by this class:
See wx.dataview.DataViewCtrl for the list of events emitted by this class.
New in version 2.9.0.
Methods Summary¶__init__ |
Default constructor. |
AppendContainer |
Appends a container to the given parent. |
AppendItem |
Appends an item to the given parent. |
Create |
Creates the control and a wx.dataview.DataViewTreeStore as its internal model. |
DeleteAllItems |
Calls the identical method from wx.dataview.DataViewTreeStore. |
DeleteChildren |
Calls the identical method from wx.dataview.DataViewTreeStore. |
DeleteItem |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetChildCount |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetImageList |
Returns the image list. |
GetItemData |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetItemExpandedIcon |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetItemIcon |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetItemText |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetNthChild |
Calls the identical method from wx.dataview.DataViewTreeStore. |
GetStore |
Returns the store. |
InsertContainer |
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
InsertItem |
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
IsContainer |
Returns True if item is a container. |
PrependContainer |
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
PrependItem |
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
SetImageList |
Sets the image list. |
SetItemData |
Calls the identical method from wx.dataview.DataViewTreeStore. |
SetItemExpandedIcon |
Calls the identical method from wx.dataview.DataViewTreeStore. |
SetItemIcon |
Calls the identical method from wx.dataview.DataViewTreeStore. |
SetItemText |
Calls the identical method from wx.dataview.DataViewTreeStore. |
Class API¶wx.dataview.DataViewTreeCtrl(DataViewCtrl)¶Possible constructors:
DataViewTreeCtrl()
DataViewTreeCtrl(parent, id=ID_ANY, pos=DefaultPosition,
size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES,
validator=DefaultValidator)
This class is a DataViewCtrl which internally uses a DataViewTreeStore and forwards most of its API to that class.
__init__(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator)
Constructor.
Calls Create .
| Parameters: |
|
|---|
AppendContainer(self, parent, text, icon=-1, expanded=-1, data=None)¶Appends a container to the given parent.
| Parameters: |
|
|---|---|
| Return type: |
AppendItem(self, parent, text, icon=-1, data=None)¶Appends an item to the given parent.
| Parameters: |
|
|---|---|
| Return type: |
Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator)¶Creates the control and a wx.dataview.DataViewTreeStore as its internal model.
The default tree column created by this method is an editable column using wx.dataview.DataViewIconTextRenderer as its renderer.
| Parameters: |
|
|---|---|
| Return type: | bool |
DeleteAllItems(self)¶Calls the identical method from wx.dataview.DataViewTreeStore.
DeleteChildren(self, item)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|
DeleteItem(self, item)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|
GetChildCount(self, parent)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | parent (wx.dataview.DataViewItem) – |
|---|---|
| Return type: | int |
GetItemData(self, item)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|---|
| Return type: | ClientData |
GetItemExpandedIcon(self, item)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|---|
| Return type: | Icon |
GetItemIcon(self, item)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|---|
| Return type: | Icon |
GetItemText(self, item)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|---|
| Return type: | string |
GetNthChild(self, parent, pos)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: |
|
|---|---|
| Return type: |
GetStore(self)¶Returns the store.
| Return type: | wx.dataview.DataViewTreeStore |
|---|
InsertContainer(self, parent, previous, text, icon=-1, expanded=-1, data=None)¶Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.
| Parameters: |
|
|---|---|
| Return type: |
InsertItem(self, parent, previous, text, icon=-1, data=None)¶Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.
| Parameters: |
|
|---|---|
| Return type: |
IsContainer(self, item)¶Returns True if item is a container.
| Parameters: | item (wx.dataview.DataViewItem) – |
|---|---|
| Return type: | bool |
PrependContainer(self, parent, text, icon=-1, expanded=-1, data=None)¶Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.
| Parameters: |
|
|---|---|
| Return type: |
PrependItem(self, parent, text, icon=-1, data=None)¶Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.
| Parameters: |
|
|---|---|
| Return type: |
SetImageList(self, imagelist)¶Sets the image list.
| Parameters: | imagelist (wx.ImageList) – |
|---|
SetItemData(self, item, data)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: |
|
|---|
SetItemExpandedIcon(self, item, icon)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: |
|
|---|
SetItemIcon(self, item, icon)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: |
|
|---|
SetItemText(self, item, text)¶Calls the identical method from wx.dataview.DataViewTreeStore.
| Parameters: |
|
|---|
ImageList¶See GetImageList and SetImageList