File: wx.lib.combotreebox.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (138 lines) | stat: -rw-r--r-- 5,464 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.combotreebox

.. currentmodule:: wx.lib.combotreebox

.. highlight:: python



.. _wx.lib.combotreebox:

==========================================================================================================================================
|phoenix_title|  **wx.lib.combotreebox**
==========================================================================================================================================

ComboTreeBox provides a ComboBox that pops up a tree instead of a list.

ComboTreeBox tries to provide the same interface as :class:`wx.ComboBox` as much as
possible. However, whereas the ComboBox widget uses indices to access
items in the list of choices, ComboTreeBox uses TreeItemId's instead. If
you add an item to the ComboTreeBox (using Append or Insert), the
:class:`wx.TreeItemId` associated with the added item is returned. You can then use
that `wx.TreeItemId` to add items as children of that first item. For
example::

    from wx.lib.combotreebox import ComboTreeBox
    combo = ComboTreeBox(parent)
    item1 = combo.Append('Item 1') # Add a root item
    item1a = combo.Append('Item 1a', parent=item1) # Add a child to item1


You can also add client data to each of the items like this::

    item1 = combo.Append('Item 1', clientData=somePythonObject)
    item1a = combo.Append('Item 1a', parent=item1,
                           clientData=someOtherPythonObject)


And later fetch the client data like this::

    somePythonObject = combo.GetClientData(item1)


To get the client data of the currently selected item (if any)::

    currentItem = combo.GetSelection()
    if currentItem:
        somePythonObject = combo.GetClientData(currentItem)


Supported styles are the same as for :class:`wx.ComboBox`, i.e. ``wx.CB_READONLY`` and
``wx.CB_SORT``. Provide them as usual::

    combo = ComboTreeBox(parent, style=wx.CB_READONLY|wx.CB_SORT)


Supported platforms: wxMSW and wxMAC natively, wxGTK by means of a
workaround.

.. moduleauthor:: Frank Niessink <frank@niessink.com>

Copyright 2006, 2008, 2010, Frank Niessink
License: wxWidgets license
Version: 1.1
Date: August 1, 2010


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.combotreebox.ComboTreeBox`                                        Factory function to create the right ComboTreeBox depending on
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
:ref:`~wx.lib.combotreebox.BaseComboTreeBox`                                     BaseComboTreeBox is the base class for platform specific versions of the
:ref:`~wx.lib.combotreebox.BasePopupFrame`                                       BasePopupFrame is the base class for platform specific versions of the
:ref:`~wx.lib.combotreebox.GTKComboTreeBox`                                      The ComboTreeBox widget for wxGTK. This is actually a work
:ref:`~wx.lib.combotreebox.GTKPopupFrame`                                        GTKPopupFrame is the base class GTK PopupFrame.
:ref:`~wx.lib.combotreebox.IterableTreeCtrl`                                     TreeCtrl is the same as :class:`TreeCtrl`, with a few convenience methods
:ref:`~wx.lib.combotreebox.MACPopupFrame`                                        MacPopupFrame is the base class Mac PopupFrame.
:ref:`~wx.lib.combotreebox.MSWComboTreeBox`                                      MSWComboTreeBox adds one piece of functionality as compared to
:ref:`~wx.lib.combotreebox.MSWPopupFrame`                                        MSWPopupFrame is the base class Windows PopupFrame.
:ref:`~wx.lib.combotreebox.NativeComboTreeBox`                                   NativeComboTreeBox, and any subclass, uses the native ComboBox as basis,
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.combotreebox.BaseComboTreeBox
   wx.lib.combotreebox.BasePopupFrame
   wx.lib.combotreebox.GTKComboTreeBox
   wx.lib.combotreebox.GTKPopupFrame
   wx.lib.combotreebox.IterableTreeCtrl
   wx.lib.combotreebox.MACPopupFrame
   wx.lib.combotreebox.MSWComboTreeBox
   wx.lib.combotreebox.MSWPopupFrame
   wx.lib.combotreebox.NativeComboTreeBox





Functions
------------

.. function:: ComboTreeBox(\*args, \*\*kwargs)

   Factory function to create the right ComboTreeBox depending on
   platform. You may force a specific class, e.g. for testing
   purposes, by setting the keyword argument 'platform', e.g.
   'platform=GTK' or 'platform=MSW' or 'platform=MAC'.
   
   :keyword string `platform`: 'GTK'|'MSW'|'MAC' can be used to override the
     actual platform for testing