.. 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.
: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:

      **~~~**

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








   .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)




      :param `variant`: 
      :type `variant`: wx.WindowVariant




      :rtype: :ref:`VisualAttributes`







