#include </home/zeitlin/src/wx/github/interface/wx/htmllbox.h>
wxSimpleHtmlListBox is an implementation of wxHtmlListBox which shows HTML content in the listbox rows.
Unlike wxHtmlListBox, 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 wxSimpleHtmlListBox fully implements the wxControlWithItems interface, thus you should refer to wxControlWithItems's documentation for the API reference for adding/removing/retrieving items in the listbox. Also note that the wxVListBox::SetItemCount function is protected
in wxSimpleHtmlListBox's context so that you cannot call it directly, wxSimpleHtmlListBox 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(const wxArrayString&) function.
Thus the only difference between a wxListBox and a wxSimpleHtmlListBox 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 wxSimpleHtmlListBox should not contain the <html>
or <body>
tags.
This class supports the following styles:
A wxSimpleHtmlListBox emits the same events used by wxListBox and by wxHtmlListBox.
Event macros for events emitted by this class:
wxEVT_COMMAND_LISTBOX_SELECTED
event, when an item on the list is selected. See wxCommandEvent. wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
event, when the listbox is double-clicked. See wxCommandEvent. wxMSW appearance | wxGTK appearance | wxMac appearance |
Public Member Functions | |
wxSimpleHtmlListBox (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=wxHLB_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxSimpleHtmlListBoxNameStr) | |
Constructor, creating and showing the HTML list box. | |
wxSimpleHtmlListBox (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=wxHLB_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxSimpleHtmlListBoxNameStr) | |
Constructor, creating and showing the HTML list box. | |
wxSimpleHtmlListBox () | |
Default constructor, you must call Create() later. | |
virtual | ~wxSimpleHtmlListBox () |
Frees the array of stored items and relative client data. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=wxHLB_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxSimpleHtmlListBoxNameStr) |
Creates the HTML listbox for two-step construction. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=wxHLB_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxSimpleHtmlListBoxNameStr) |
Creates the HTML listbox for two-step construction. |
wxSimpleHtmlListBox::wxSimpleHtmlListBox | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
int | n = 0 , |
||
const wxString | choices[] = NULL , |
||
long | style = wxHLB_DEFAULT_STYLE , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxSimpleHtmlListBoxNameStr |
||
) |
Constructor, creating and showing the HTML list box.
parent | Parent window. Must not be NULL. |
id | Window identifier. A value of -1 indicates a default value. |
pos | Window position. If wxDefaultPosition is specified then a default position is chosen. |
size | Window size. If wxDefaultSize is specified then the window is sized appropriately. |
n | Number of strings with which to initialise the control. |
choices | An array of strings with which to initialise the control. |
style | Window style. See wxHLB_* flags. |
validator | Window validator. |
name | Window name. |
wxSimpleHtmlListBox::wxSimpleHtmlListBox | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
const wxArrayString & | choices, | ||
long | style = wxHLB_DEFAULT_STYLE , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxSimpleHtmlListBoxNameStr |
||
) |
Constructor, creating and showing the HTML list box.
parent | Parent window. Must not be NULL. |
id | Window identifier. A value of -1 indicates a default value. |
pos | Window position. |
size | Window size. If wxDefaultSize is specified then the window is sized appropriately. |
choices | An array of strings with which to initialise the control. |
style | Window style. See wxHLB_* flags. |
validator | Window validator. |
name | Window name. |
wxSimpleHtmlListBox::wxSimpleHtmlListBox | ( | ) |
Default constructor, you must call Create() later.
virtual wxSimpleHtmlListBox::~wxSimpleHtmlListBox | ( | ) | [virtual] |
Frees the array of stored items and relative client data.
bool wxSimpleHtmlListBox::Create | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
int | n = 0 , |
||
const wxString | choices[] = NULL , |
||
long | style = wxHLB_DEFAULT_STYLE , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxSimpleHtmlListBoxNameStr |
||
) |
Creates the HTML listbox for two-step construction.
See wxSimpleHtmlListBox() for further details.
bool wxSimpleHtmlListBox::Create | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
const wxArrayString & | choices, | ||
long | style = wxHLB_DEFAULT_STYLE , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxSimpleHtmlListBoxNameStr |
||
) |
Creates the HTML listbox for two-step construction.
See wxSimpleHtmlListBox() for further details.