.. 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.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.ItemContainer.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 `). Note that the HTML strings you fetch to :ref:`wx.html.SimpleHtmlListBox` should not contain the ```` or ```` 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 a hyperlink was clicked. See :ref:`wx.html.HtmlLinkEvent` ^^ .. seealso:: :meth:`wx.html.SimpleHtmlListBox.Create` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class SimpleHtmlListBox:
| |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. :meth:`~wx.html.SimpleHtmlListBox.GetClassDefaultAttributes` ================================================================================ ================================================================================ | |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: :html:`

` **__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 :html:`

` **__init__** `(self)` Default constructor, you must call :meth:`Create` later. :html:`

` .. 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` .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: `VisualAttributes`