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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
|
.. 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
.. _wx.html.SimpleHtmlListBox:
==========================================================================================================================================
|phoenix_title| **wx.html.SimpleHtmlListBox**
==========================================================================================================================================
:ref:`wx.html.SimpleHtmlListBox` is an implementation of :ref:`wx.html.HtmlListBox` which shows HTML content in the listbox rows.
Unlike :ref:`wx.html.HtmlListBox`, this is not an abstract class and thus it has the advantage that you can use it without deriving your own class from it. However, it also has the disadvantage that this is not a virtual control and thus it's not well-suited for those cases where you need to show a huge number of items: every time you add/insert a string, it will be stored internally and thus will take memory.
The interface exposed by :ref:`wx.html.SimpleHtmlListBox` fully implements the :ref:`wx.ControlWithItems` interface, thus you should refer to :ref:`wx.ControlWithItems`'s documentation for the API reference for adding/removing/retrieving items in the listbox. Also note that the :meth:`wx.VListBox.SetItemCount` function is ``protected`` in :ref:`wx.html.SimpleHtmlListBox`'s context so that you cannot call it directly, :ref:`wx.html.SimpleHtmlListBox` will do it for you.
Note: in case you need to append a lot of items to the control at once, make sure to use the :meth:`~wx.html.SimpleHtmlListBox.Append` function.
Thus the only difference between a :ref:`wx.ListBox` and a :ref:`wx.html.SimpleHtmlListBox` is that the latter stores strings which can contain HTML fragments (see the list of :ref:`tags supported by wxHTML <tags supported by wxhtml>`).
Note that the HTML strings you fetch to :ref:`wx.html.SimpleHtmlListBox` should not contain the ``<html>`` or ``<body>`` tags.
.. _SimpleHtmlListBox-styles:
|styles| Window Styles
================================
This class supports the following styles:
- ``wx.html.HLB_DEFAULT_STYLE``: The default style: ``wx.BORDER_SUNKEN``
- ``wx.html.HLB_MULTIPLE``: Multiple-selection list: the user can toggle multiple items on and off.
A
:ref:`wx.html.SimpleHtmlListBox` emits the same events used by :ref:`wx.ListBox` and by :ref:`wx.html.HtmlListBox`.
.. _SimpleHtmlListBox-events:
|events| Events Emitted by this Class
=====================================
Event macros for events emitted by this class:
- EVT_LISTBOX: Process a ``wxEVT_LISTBOX`` event, when an item on the list is selected. See :ref:`wx.CommandEvent`.
- EVT_LISTBOX_DCLICK: Process a ``wxEVT_LISTBOX_DCLICK`` event, when the listbox is double-clicked. See :ref:`wx.CommandEvent`.
- EVT_HTML_CELL_CLICKED: A :ref:`wx.html.HtmlCell` was clicked. See :ref:`wx.html.HtmlCellEvent`.
- EVT_HTML_CELL_HOVER: The mouse passed over a :ref:`wx.html.HtmlCell`. See :ref:`wx.html.HtmlCellEvent`.
- EVT_HTML_LINK_CLICKED: A :ref:`wx.html.HtmlCell` which contains an hyperlink was clicked. See :ref:`wx.html.HtmlLinkEvent`
.. seealso:: :meth:`wx.html.SimpleHtmlListBox.Create`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>SimpleHtmlListBox</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.html.SimpleHtmlListBox_inheritance.png" alt="Inheritance diagram of SimpleHtmlListBox" usemap="#dummy" class="inheritance"/></center>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.VScrolledWindow.html" title="wx.VScrolledWindow" alt="" coords="207,315,355,344"/> <area shape="rect" id="node12" href="wx.VListBox.html" title="wx.VListBox" alt="" coords="233,392,329,421"/> <area shape="rect" id="node2" href="wx.Panel.html" title="wx.Panel" alt="" coords="171,237,247,267"/> <area shape="rect" id="node3" href="wx.VarVScrollHelper.html" title="wx.VarVScrollHelper" alt="" coords="280,237,428,267"/> <area shape="rect" id="node4" href="wx.ItemContainer.html" title="wx.ItemContainer" alt="" coords="44,469,177,499"/> <area shape="rect" id="node13" href="wx.html.SimpleHtmlListBox.html" title="wx.html.SimpleHtmlListBox" alt="" coords="97,547,292,576"/> <area shape="rect" id="node5" href="wx.ItemContainerImmutable.html" title="wx.ItemContainerImmutable" alt="" coords="5,392,208,421"/> <area shape="rect" id="node6" href="wx.Object.html" title="wx.Object" alt="" coords="107,5,188,35"/> <area shape="rect" id="node8" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="149,83,260,112"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="161,160,249,189"/> <area shape="rect" id="node9" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="213,5,315,35"/> <area shape="rect" id="node10" href="wx.VarScrollHelperBase.html" title="wx.VarScrollHelperBase" alt="" coords="274,160,445,189"/> <area shape="rect" id="node11" href="wx.html.HtmlListBox.html" title="wx.html.HtmlListBox" alt="" coords="203,469,355,499"/> </map>
</p>
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.html.SimpleHtmlListBox.__init__` Constructor, creating and showing the HTML list box.
:meth:`~wx.html.SimpleHtmlListBox.Create` Creates the HTML listbox for two-step construction.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.html.SimpleHtmlListBox(HtmlListBox, ItemContainer)
**Possible constructors**::
SimpleHtmlListBox(parent, id=ID_ANY, pos=DefaultPosition,
size=DefaultSize, choices=[], style=HLB_DEFAULT_STYLE,
validator=DefaultValidator, name=SimpleHtmlListBoxNameStr)
SimpleHtmlListBox()
SimpleHtmlListBox is an implementation of HtmlListBox which shows
HTML content in the listbox rows.
.. method:: __init__(self, *args, **kw)
|overload| Overloaded Implementations:
**~~~**
**__init__** `(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=HLB_DEFAULT_STYLE, validator=DefaultValidator, name=SimpleHtmlListBoxNameStr)`
Constructor, creating and showing the HTML list box.
:param `parent`: Parent window. Must not be ``None``.
:type `parent`: wx.Window
:param `id`: Window identifier. A value of -1 indicates a default value.
:type `id`: wx.WindowID
:param `pos`: Window position.
:type `pos`: wx.Point
:param `size`: Window size. If DefaultSize is specified then the window is sized appropriately.
:type `size`: wx.Size
:param `choices`: An array of strings with which to initialise the control.
:type `choices`: list of strings
:param `style`: Window style. See ``HLB_`` flags.
:type `style`: long
:param `validator`: Window validator.
:type `validator`: wx.Validator
:param `name`: Window name.
:type `name`: string
**~~~**
**__init__** `(self)`
Default constructor, you must call :meth:`Create` later.
**~~~**
.. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=HLB_DEFAULT_STYLE, validator=DefaultValidator, name=SimpleHtmlListBoxNameStr)
Creates the HTML listbox for two-step construction.
See :ref:`wx.html.SimpleHtmlListBox` for further details.
: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 `choices`:
:type `choices`: list of strings
:param `style`:
:type `style`: long
:param `validator`:
:type `validator`: wx.Validator
:param `name`:
:type `name`: string
:rtype: `bool`
|