.. 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.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 <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>
   <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  is an implementation of wx.html.HtmlListBox  which shows HTML content in the listbox rows." alt="" coords="179,547,384,576"/> <area shape="rect" id="node2" href="wx.html.HtmlListBox.html" title="wx.html.HtmlListBox  is an implementation of wx.VListBox  which shows HTML content in the listbox rows." alt="" coords="115,469,275,499"/> <area shape="rect" id="node3" href="wx.ItemContainer.html" title="This class is an abstract base class for some wxWidgets controls which contain several items such as wx.ListBox, wx.CheckListBox, wx.ComboBox  or wx.Choice." alt="" coords="301,469,441,499"/> <area shape="rect" id="node4" href="wx.VListBox.html" title="wx.VListBox  is a ListBox-like control with the following two main differences from a regular wx.ListBox: it can have an arbitrarily huge number of items because it doesn't store them itself but uses the wx.VListBox.OnDrawItem  callback to draw them (so it is a virtual listbox) and its items can have variable height as determined by wx.VListBox.OnMeasureItem  (so it is also a listbox with the lines of variable height)." alt="" coords="141,392,243,421"/> <area shape="rect" id="node5" href="wx.VScrolledWindow.html" title="In the name of this class, 'V' may stand for 'variable' because it can be used for scrolling rows of variable heights; 'virtual', because it is not necessary to know the heights of all rows in advance" alt="" coords="112,315,272,344"/> <area shape="rect" id="node6" href="wx.Panel.html" title="A panel is a window on which controls are placed." alt="" coords="79,237,161,267"/> <area shape="rect" id="node7" href="wx.VarVScrollHelper.html" title="This class provides functions wrapping the wx.VarScrollHelperBase  class, targeted for vertical-specific scrolling." alt="" coords="191,237,348,267"/> <area shape="rect" id="node8" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="62,160,159,189"/> <area shape="rect" id="node9" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="51,83,170,112"/> <area shape="rect" id="node10" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="5,5,93,35"/> <area shape="rect" id="node11" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="118,5,229,35"/> <area shape="rect" id="node12" href="wx.VarScrollHelperBase.html" title="This class provides all common base functionality for scroll calculations shared among all variable scrolled window implementations as well as automatic scrollbar functionality, saved scroll positions, controlling target windows to be scrolled, as well as defining all required virtual functions that need to be implemented for any orientation specific work." alt="" coords="184,160,365,189"/> <area shape="rect" id="node13" href="wx.ItemContainerImmutable.html" title="wx.ItemContainer  defines an interface which is implemented by all controls which have string subitems each of which may be selected." alt="" coords="267,392,479,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: `VisualAttributes`