wxSimpleHtmlListBoxwxSimpleHtmlListBox 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. Derived from
wxHtmlListBox, wxControlWithItems Include files <wx/htmllbox.h> Window styles
See also window styles overview. Event handling A wxSimpleHtmlListBox emits the same events used by wxListBox and by wxHtmlListBox. The event handlers for the following events take a wxCommandEvent:
The event handlers for the following events take a wxHtmlCellEvent or a wxHtmlLinkEvent:
Members
wxSimpleHtmlListBox::wxSimpleHtmlListBox
wxSimpleHtmlListBox::wxSimpleHtmlListBoxwxHtmlListBox(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 = "simpleHtmlListBox") wxHtmlListBox(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 = "simpleHtmlListBox") Constructor, creating and showing the HTML list box. Parameters parent
id
pos
size
n
choices
style
validator
name
See also
wxSimpleHtmlListBox() Default constructor, you must call Create() later.
wxSimpleHtmlListBox::~wxSimpleHtmlListBox~wxSimpleHtmlListBox() Frees the array of stored items and relative client data.
wxSimpleHtmlListBox::Createbool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n, const wxString choices[] = NULL, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "simpleHtmlListBox") 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 = "simpleHtmlListBox") Creates the HTML listbox for two-step construction. See wxSimpleHtmlListBox::wxSimpleHtmlListBox for further details.
|