# :stopdoc:
# This file is automatically generated by the WXRuby3 documentation
# generator. Do not alter this file.
# :startdoc:
module Wx::HTML
#
HLB_DEFAULT_STYLE = 134217728
#
HLB_MULTIPLE = 64
# {Wx::HTML::HtmlListBox} is an implementation of {Wx::VListBox} which shows HTML content in the listbox rows.
# This is still an abstract base class and you will need to derive your own class from it (see htlbox sample for the example), but you will only need to override a single {Wx::HTML::HtmlListBox#on_get_item} function.
# === Events emitted by this class
#
# The following event-handler methods redirect the events to member method or handler blocks for {Wx::HTML::HtmlLinkEvent} events.
# Event handler methods for events emitted by this class:
#
# - {Wx::EvtHandler#evt_html_cell_clicked}(id, meth = nil, &block): A {Wx::HTML::HtmlCell} was clicked.
#
# - {Wx::EvtHandler#evt_html_cell_hover}(id, meth = nil, &block): The mouse passed over a {Wx::HTML::HtmlCell}.
#
# - {Wx::EvtHandler#evt_html_link_clicked}(id, meth = nil, &block): A {Wx::HTML::HtmlCell} which contains a hyperlink was clicked.
#
# ===
#
# Category: {Wx::Controls}
# @see Wx::HTML::SimpleHtmlListBox
#
#
class HtmlListBox < VListBox
# @overload initialize(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::HtmlListBoxNameStr)
# Normal constructor which calls {Wx::HTML::HtmlListBox#create} internally.
# @param parent [Wx::Window]
# @param id [Integer]
# @param pos [Array(Integer, Integer), Wx::Point]
# @param size [Array(Integer, Integer), Wx::Size]
# @param style [Integer]
# @param name [String]
# @return [Wx::HTML::HtmlListBox]
# @overload initialize()
# Default constructor, you must call {Wx::HTML::HtmlListBox#create} later.
# @return [Wx::HTML::HtmlListBox]
def initialize(*args) end
# Creates the control and optionally sets the initial number of items in it (it may also be set or changed later with {Wx::VListBox#set_item_count}).
# There are no special styles defined for {Wx::HTML::HtmlListBox}, in particular the {Wx::ListBox} styles (with the exception of {Wx::LB_MULTIPLE}) cannot be used here.
# Returns true on success or false if the control couldn't be created
# @param parent [Wx::Window]
# @param id [Integer]
# @param pos [Array(Integer, Integer), Wx::Point]
# @param size [Array(Integer, Integer), Wx::Size]
# @param style [Integer]
# @param name [String]
# @return [Boolean]
def create(parent, id=Wx::StandardID::ID_ANY, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::HtmlListBoxNameStr) end
protected
# Called when the user clicks on hypertext link.
# Does nothing by default. Overloading this method is deprecated; intercept the event instead.
# @see Wx::HTML::HtmlLinkInfo.
# @param n [Integer] Index of the item containing the link.
# @param link [Wx::HTML::HtmlLinkInfo] Description of the link.
# @return [void]
def on_link_clicked(n, link) end
# This virtual function may be overridden to change the appearance of the background of the selected cells in the same way as {Wx::HTML::HtmlListBox#get_selected_text_colour}.
# It should be rarely, if ever, used because {Wx::VListBox#set_selection_background} allows changing the selection background for all cells at once and doing anything more fancy is probably going to look strangely.
# @see Wx::HTML::HtmlListBox#get_selected_text_colour
# @param colBg [Wx::Colour,String,Symbol]
# @return [Wx::Colour]
def get_selected_text_bg_colour(colBg) end
alias_method :selected_text_bg_colour, :get_selected_text_bg_colour
# This virtual function may be overridden to customize the appearance of the selected cells.
# It is used to determine how the colour colFg is going to look inside selection. By default all original colours are completely ignored and the standard, system-dependent, selection colour is used but the program may wish to override this to achieve some custom appearance.
# @see Wx::HTML::HtmlListBox#get_selected_text_bg_colour
# @see Wx::VListBox#set_selection_background
# @see Wx::SystemSettings.get_colour
# @param colFg [Wx::Colour,String,Symbol]
# @return [Wx::Colour]
def get_selected_text_colour(colFg) end
alias_method :selected_text_colour, :get_selected_text_colour
# This function may be overridden to decorate HTML returned by {Wx::HTML::HtmlListBox#on_get_item}.
# @param n [Integer]
# @return [String]
def on_get_item_markup(n) end
# This method must be implemented in the derived class and should return the body (i.e. without html nor 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 {Wx::HTML::HtmlListBox#on_get_item} 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.
# @param n [Integer]
# @return [String]
def on_get_item(n) end
end # HtmlListBox
# {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#set_item_count} 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(const wxArrayString&) 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 or
tags.
# === Styles
#
# This class supports the following styles:
#
# - {Wx::HTML::HLB_DEFAULT_STYLE}: The default style: {Wx::Border::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 emitted by this class
#
# Event handler methods for events emitted by this class:
#
# - {Wx::EvtHandler#evt_listbox}(id, meth = nil, &block): Process a {Wx::EVT_LISTBOX} event, when an item on the list is selected. See {Wx::CommandEvent}.
#
# - {Wx::EvtHandler#evt_listbox_dclick}(id, meth = nil, &block): Process a {Wx::EVT_LISTBOX_DCLICK} event, when the listbox is double-clicked. See {Wx::CommandEvent}.
#
# - {Wx::EvtHandler#evt_html_cell_clicked}(id, meth = nil, &block): A {Wx::HTML::HtmlCell} was clicked. See {Wx::HTML::HtmlCellEvent}.
#
# - {Wx::EvtHandler#evt_html_cell_hover}(id, meth = nil, &block): The mouse passed over a {Wx::HTML::HtmlCell}. See {Wx::HTML::HtmlCellEvent}.
#
# - {Wx::EvtHandler#evt_html_link_clicked}(id, meth = nil, &block): A {Wx::HTML::HtmlCell} which contains a hyperlink was clicked. See {Wx::HTML::HtmlLinkEvent}
#
# ===
#
# Category: {Wx::Controls}
Generic Appearance # |
void*
) or object data ({Wx::ClientData}*) is associated with the items of the control.
# @return [Boolean]
def has_client_data; end
alias_method :has_client_data?, :has_client_data
end # SimpleHtmlListBox
end