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.
Added in version 2.9.0.
Class Hierarchy¶
Control Appearance¶
Methods Summary¶
Default constructor. |
|
Appends a container to the given parent. |
|
Appends an item to the given parent. |
|
Creates the control and a wx.dataview.DataViewTreeStore as its internal model. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Returns the image list. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Returns the item’s parent. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Returns the store. |
|
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
|
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
|
Returns |
|
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
|
Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon. |
|
Sets the image list. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
|
Calls the identical method from wx.dataview.DataViewTreeStore. |
Properties Summary¶
See |
|
See |
Class API¶
- class wx.dataview.DataViewTreeCtrl(DataViewCtrl)¶
Possible constructors:
DataViewTreeCtrl() -> None DataViewTreeCtrl(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator) -> None
This class is a DataViewCtrl which internally uses a DataViewTreeStore and forwards most of its API to that class.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor.
- Return type:
None
__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator)
Constructor.
Calls
Create
.- Parameters:
parent (wx.Window)
id (wx.WindowID)
pos (wx.Point)
size (wx.Size)
style (long)
validator (wx.Validator)
- Return type:
None
- AppendContainer(self, parent, text, icon=-1, expanded=-1, data=None)¶
Appends a container to the given parent.
- Parameters:
parent (wx.dataview.DataViewItem)
text (string)
icon (int)
expanded (int)
data (ClientData)
- Return type:
- AppendItem(self, parent, text, icon=-1, data=None)¶
Appends an item to the given parent.
- Parameters:
parent (wx.dataview.DataViewItem)
text (string)
icon (int)
data (ClientData)
- 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:
parent (wx.Window)
id (wx.WindowID)
pos (wx.Point)
size (wx.Size)
style (long)
validator (wx.Validator)
- Return type:
bool
- DeleteAllItems(self)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Return type:
None
- DeleteChildren(self, item)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
- Return type:
None
- DeleteItem(self, item)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
- Return type:
None
- GetChildCount(self, parent)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
parent (wx.dataview.DataViewItem)
- Return type:
int
- static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
- Parameters:
variant (WindowVariant)
- Return type:
VisualAttributes
- 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
- GetItemParent(self, item)¶
Returns the item’s parent.
- Parameters:
item (wx.dataview.DataViewItem)
- Return type:
Added in version 4.1/wxWidgets-3.1.6.
- GetItemText(self, item)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
- Return type:
str
- GetNthChild(self, parent, pos)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
parent (wx.dataview.DataViewItem)
pos (int)
- Return type:
- GetStore(self)¶
Returns the store.
- Return type:
- 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:
parent (wx.dataview.DataViewItem)
previous (wx.dataview.DataViewItem)
text (string)
icon (int)
expanded (int)
data (ClientData)
- 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:
parent (wx.dataview.DataViewItem)
previous (wx.dataview.DataViewItem)
text (string)
icon (int)
data (ClientData)
- 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:
parent (wx.dataview.DataViewItem)
text (string)
icon (int)
expanded (int)
data (ClientData)
- 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:
parent (wx.dataview.DataViewItem)
text (string)
icon (int)
data (ClientData)
- Return type:
- SetImageList(self, imagelist)¶
Sets the image list.
- Parameters:
imagelist (wx.ImageList)
- Return type:
None
- SetItemData(self, item, data)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
data (ClientData)
- Return type:
None
- SetItemExpandedIcon(self, item, icon)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
icon (wx.BitmapBundle)
- Return type:
None
- SetItemIcon(self, item, icon)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
icon (wx.BitmapBundle)
- Return type:
None
- SetItemText(self, item, text)¶
Calls the identical method from wx.dataview.DataViewTreeStore.
- Parameters:
item (wx.dataview.DataViewItem)
text (string)
- Return type:
None
Properties¶
- ImageList¶
See
GetImageList
andSetImageList