.. 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.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 a 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>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.html.SimpleHtmlListBox.html" title="wx.html.SimpleHtmlListBox" alt="" coords="176,547,380,576"/> <area shape="rect" id="node2" href="wx.html.HtmlListBox.html" title="wx.html.HtmlListBox" alt="" coords="112,469,271,499"/> <area shape="rect" id="node3" href="wx.ItemContainer.html" title="wx.ItemContainer" alt="" coords="297,469,435,499"/> <area shape="rect" id="node4" href="wx.VListBox.html" title="wx.VListBox" alt="" coords="137,392,240,421"/> <area shape="rect" id="node5" href="wx.VScrolledWindow.html" title="wx.VScrolledWindow" alt="" coords="109,315,268,344"/> <area shape="rect" id="node6" href="wx.Panel.html" title="wx.Panel" alt="" coords="78,237,158,267"/> <area shape="rect" id="node7" href="wx.VarVScrollHelper.html" title="wx.VarVScrollHelper" alt="" coords="187,237,342,267"/> <area shape="rect" id="node8" href="wx.Window.html" title="wx.Window" alt="" coords="60,160,157,189"/> <area shape="rect" id="node9" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="50,83,167,112"/> <area shape="rect" id="node10" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> <area shape="rect" id="node11" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="117,5,223,35"/> <area shape="rect" id="node12" href="wx.VarScrollHelperBase.html" title="wx.VarScrollHelperBase" alt="" coords="181,160,359,189"/> <area shape="rect" id="node13" href="wx.ItemContainerImmutable.html" title="wx.ItemContainerImmutable" alt="" coords="264,392,473,421"/> </map> 
   </p>
   </div>

|


|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:`<hr class="overloadsep" /><br />`

      
      **__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:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor, you must call :meth:`Create`   later.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. 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: :ref:`VisualAttributes`







