HtmlListBox is a subclass of VListBox which shows HTML
content in the listbox rows. It is an abstract class, and in order to
use it, you must inherit from it in your own Ruby class. The only method
that must be defined in your subclass is
on_get_item. This method should return the
snippet of HTML that should be displayed for the given
item. Optionally, on_get_item_markup can
also be redefined in your subclass.
This control supports only the limited subset of HTML supported by
Wx::HtmlWindow. In particular, CSS is not supported,
although attributes of the tag may be used to customise the
appearance of text.
To process user interaction with an HtmlListBox, use these event handler
methods to direct input to methods or blocks that take a
HtmlCellEvent argument or a
HtmlLinkEvent.
evt_html_cell_clicked(id) { | event | … } | A HtmlCell was clicked. |
evt_html_cell_hover(id) { | event | … } | The mouse passed over a HtmlCell. |
evt_html_link_clicked(id) { | event | … } | A HtmlCell which contains an hyperlink was clicked. |
The class also responds to the selection and clicking event handlers
offered by Wx::ListBox.
Standard constructor. There are no special styles defined for
HtmlListBox; in particular the ListBox styles (with the
exception of LB_MULTIPLE
) can not be used here.
Returns the FileSystem used by the HTML parser of
this object. The file system object is used to resolve the paths in HTML
fragments displayed in the control and you should use
FileSystem#change_path_to if you use
relative paths for the images or other resources embedded in your HTML.
This virtual function may be overridden to change the appearance of the
background of the selected cells in the same way as
get_selected_text_colour.
This method must be implemented in the derived class and should return
the body (i.e. without <html>
or <body>
tags) of the HTML fragment
for the given item.
Note that this function should always return a text fragment for the n
item which renders with the same height both when it is selected and
when it’s not: i.e. if you call, inside your OnGetItem() implementation,
IsSelected(n)
to make the items appear differently when they are
selected, then you should make sure that the returned HTML fragment will
render with the same height or else you’ll see some artifacts when the
user selects an item.
This method may be overridden to decorate HTML returned by
on_get_item.
[This page automatically generated from the Textile source at 2023-06-03 08:07:38 +0000]