.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.dataview.DataViewTreeCtrl: ========================================================================================================================================== |phoenix_title| **wx.dataview.DataViewTreeCtrl** ========================================================================================================================================== This class is a :ref:`wx.dataview.DataViewCtrl` which internally uses a :ref:`wx.dataview.DataViewTreeStore` and forwards most of its API to that class. Additionally, it uses a :ref:`wx.ImageList` to store a list of icons. The main purpose of this class is to provide a simple upgrade path for code using :ref:`wx.TreeCtrl`. ^^ .. _DataViewTreeCtrl-styles: |styles| Window Styles ================================ This class supports the following styles: See :ref:`wx.dataview.DataViewCtrl` for the list of supported styles. ^^ ^^ .. _DataViewTreeCtrl-events: |events| Events Emitted by this Class ===================================== Event macros for events emitted by this class: See :ref:`wx.dataview.DataViewCtrl` for the list of events emitted by this class. ^^ .. versionadded:: 2.9.0 | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class DataViewTreeCtrl:
| |appearance| Control Appearance =============================== | .. figure:: _static/images/widgets/fullsize/wxmsw/wx.dataview.dataviewtreectrl.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: _static/images/widgets/fullsize/wxmac/wx.dataview.dataviewtreectrl.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: _static/images/widgets/fullsize/wxgtk/wx.dataview.dataviewtreectrl.png :alt: wxGTK :figclass: floatcenter **wxGTK** | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.dataview.DataViewTreeCtrl.__init__` Default constructor. :meth:`~wx.dataview.DataViewTreeCtrl.AppendContainer` Appends a container to the given `parent`. :meth:`~wx.dataview.DataViewTreeCtrl.AppendItem` Appends an item to the given `parent`. :meth:`~wx.dataview.DataViewTreeCtrl.Create` Creates the control and a :ref:`wx.dataview.DataViewTreeStore` as its internal model. :meth:`~wx.dataview.DataViewTreeCtrl.DeleteAllItems` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.DeleteChildren` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.DeleteItem` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetChildCount` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetClassDefaultAttributes` :meth:`~wx.dataview.DataViewTreeCtrl.GetImageList` Returns the image list. :meth:`~wx.dataview.DataViewTreeCtrl.GetItemData` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetItemExpandedIcon` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetItemIcon` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetItemParent` Returns the item's parent. :meth:`~wx.dataview.DataViewTreeCtrl.GetItemText` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetNthChild` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.GetStore` Returns the store. :meth:`~wx.dataview.DataViewTreeCtrl.InsertContainer` Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :meth:`~wx.dataview.DataViewTreeCtrl.InsertItem` Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :meth:`~wx.dataview.DataViewTreeCtrl.IsContainer` Returns ``True`` if item is a container. :meth:`~wx.dataview.DataViewTreeCtrl.PrependContainer` Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :meth:`~wx.dataview.DataViewTreeCtrl.PrependItem` Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :meth:`~wx.dataview.DataViewTreeCtrl.SetImageList` Sets the image list. :meth:`~wx.dataview.DataViewTreeCtrl.SetItemData` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.SetItemExpandedIcon` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.SetItemIcon` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :meth:`~wx.dataview.DataViewTreeCtrl.SetItemText` Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.dataview.DataViewTreeCtrl.ImageList` See :meth:`~wx.dataview.DataViewTreeCtrl.GetImageList` and :meth:`~wx.dataview.DataViewTreeCtrl.SetImageList` :attr:`~wx.dataview.DataViewTreeCtrl.Store` See :meth:`~wx.dataview.DataViewTreeCtrl.GetStore` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: 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. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self)` Default constructor. :html:`

` **__init__** `(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator)` Constructor. Calls :meth:`Create` . :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :param `validator`: :type `validator`: wx.Validator :html:`

` .. method:: AppendContainer(self, parent, text, icon=-1, expanded=-1, data=None) Appends a container to the given `parent`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `text`: :type `text`: string :param `icon`: :type `icon`: int :param `expanded`: :type `expanded`: int :param `data`: :type `data`: ClientData :rtype: :ref:`wx.dataview.DataViewItem` .. method:: AppendItem(self, parent, text, icon=-1, data=None) Appends an item to the given `parent`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `text`: :type `text`: string :param `icon`: :type `icon`: int :param `data`: :type `data`: ClientData :rtype: :ref:`wx.dataview.DataViewItem` .. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator) Creates the control and a :ref:`wx.dataview.DataViewTreeStore` as its internal model. The default tree column created by this method is an editable column using :ref:`wx.dataview.DataViewIconTextRenderer` as its renderer. :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :param `validator`: :type `validator`: wx.Validator :rtype: `bool` .. method:: DeleteAllItems(self) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. .. method:: DeleteChildren(self, item) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem .. method:: DeleteItem(self, item) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem .. method:: GetChildCount(self, parent) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :rtype: `int` .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: `VisualAttributes` .. method:: GetImageList(self) Returns the image list. :rtype: `ImageList` .. method:: GetItemData(self, item) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :rtype: `ClientData` .. method:: GetItemExpandedIcon(self, item) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :rtype: `Icon` .. method:: GetItemIcon(self, item) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :rtype: `Icon` .. method:: GetItemParent(self, item) Returns the item's parent. :param `item`: :type `item`: wx.dataview.DataViewItem :rtype: :ref:`wx.dataview.DataViewItem` .. versionadded:: 4.1/wxWidgets-3.1.6 .. method:: GetItemText(self, item) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :rtype: `string` .. method:: GetNthChild(self, parent, pos) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `pos`: :type `pos`: int :rtype: :ref:`wx.dataview.DataViewItem` .. method:: GetStore(self) Returns the store. :rtype: :ref:`wx.dataview.DataViewTreeStore` .. method:: InsertContainer(self, parent, previous, text, icon=-1, expanded=-1, data=None) Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `previous`: :type `previous`: wx.dataview.DataViewItem :param `text`: :type `text`: string :param `icon`: :type `icon`: int :param `expanded`: :type `expanded`: int :param `data`: :type `data`: ClientData :rtype: :ref:`wx.dataview.DataViewItem` .. method:: InsertItem(self, parent, previous, text, icon=-1, data=None) Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `previous`: :type `previous`: wx.dataview.DataViewItem :param `text`: :type `text`: string :param `icon`: :type `icon`: int :param `data`: :type `data`: ClientData :rtype: :ref:`wx.dataview.DataViewItem` .. method:: IsContainer(self, item) Returns ``True`` if item is a container. :param `item`: :type `item`: wx.dataview.DataViewItem :rtype: `bool` .. method:: PrependContainer(self, parent, text, icon=-1, expanded=-1, data=None) Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `text`: :type `text`: string :param `icon`: :type `icon`: int :param `expanded`: :type `expanded`: int :param `data`: :type `data`: ClientData :rtype: :ref:`wx.dataview.DataViewItem` .. method:: PrependItem(self, parent, text, icon=-1, data=None) Calls the same method from :ref:`wx.dataview.DataViewTreeStore` but uses an index position in the image list instead of a :ref:`wx.Icon`. :param `parent`: :type `parent`: wx.dataview.DataViewItem :param `text`: :type `text`: string :param `icon`: :type `icon`: int :param `data`: :type `data`: ClientData :rtype: :ref:`wx.dataview.DataViewItem` .. method:: SetImageList(self, imagelist) Sets the image list. :param `imagelist`: :type `imagelist`: wx.ImageList .. method:: SetItemData(self, item, data) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :param `data`: :type `data`: ClientData .. method:: SetItemExpandedIcon(self, item, icon) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :param `icon`: :type `icon`: wx.BitmapBundle .. method:: SetItemIcon(self, item, icon) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :param `icon`: :type `icon`: wx.BitmapBundle .. method:: SetItemText(self, item, text) Calls the identical method from :ref:`wx.dataview.DataViewTreeStore`. :param `item`: :type `item`: wx.dataview.DataViewItem :param `text`: :type `text`: string .. attribute:: ImageList See :meth:`~wx.dataview.DataViewTreeCtrl.GetImageList` and :meth:`~wx.dataview.DataViewTreeCtrl.SetImageList` .. attribute:: Store See :meth:`~wx.dataview.DataViewTreeCtrl.GetStore`