phoenix_title wx.html.SimpleHtmlListBox

wx.html.SimpleHtmlListBox is an implementation of wx.html.HtmlListBox which shows HTML content in the listbox rows.

Unlike 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 wx.html.SimpleHtmlListBox fully implements the wx.ControlWithItems interface, thus you should refer to wx.ControlWithItems’s documentation for the API reference for adding/removing/retrieving items in the listbox. Also note that the wx.VListBox.SetItemCount function is protected in wx.html.SimpleHtmlListBox’s context so that you cannot call it directly, 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 Append function.

Thus the only difference between a wx.ListBox and a wx.html.SimpleHtmlListBox is that the latter stores strings which can contain HTML fragments (see the list of tags supported by wxHTML).

Note that the HTML strings you fetch to wx.html.SimpleHtmlListBox should not contain the <html> or <body> tags.

^^

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 wx.html.SimpleHtmlListBox emits the same events used by wx.ListBox and by wx.html.HtmlListBox.

^^

events Events Emitted by this Class

Event macros for events emitted by this class:


class_hierarchy Class Hierarchy

Inheritance diagram for class SimpleHtmlListBox:

method_summary Methods Summary

__init__

Constructor, creating and showing the HTML list box.

Create

Creates the HTML listbox for two-step construction.

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.


Methods

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

Parameters
  • parent (wx.Window) – Parent window. Must not be None.

  • id (wx.WindowID) – Window identifier. A value of -1 indicates a default value.

  • pos (wx.Point) – Window position.

  • size (wx.Size) – Window size. If DefaultSize is specified then the window is sized appropriately.

  • choices (list of strings) – An array of strings with which to initialise the control.

  • style (long) – Window style. See HLB_ flags.

  • validator (wx.Validator) – Window validator.

  • name (string) – Window name.



__init__ (self)

Default constructor, you must call Create later.





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 wx.html.SimpleHtmlListBox for further details.

Parameters
Return type

bool



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)
Parameters

variant (WindowVariant) –

Return type

VisualAttributes