# :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}
Appearance:
Generic Appearance #
# @see Wx::HTML::SimpleHtmlListBox#create # # class SimpleHtmlListBox < HtmlListBox # @overload create(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, choices=nil, style=Wx::HTML::HLB_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::SimpleHtmlListBoxNameStr) # Creates the HTML listbox for two-step construction. # See {Wx::HTML::SimpleHtmlListBox#initialize} for further details. # @param parent [Wx::Window] # @param id [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param choices [Array] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [Boolean] # @overload create(parent, id, pos, size, choices, style=Wx::HTML::HLB_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::SimpleHtmlListBoxNameStr) # Creates the HTML listbox for two-step construction. # See {Wx::HTML::SimpleHtmlListBox#initialize} for further details. # @param parent [Wx::Window] # @param id [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param choices [Array] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [Boolean] def create(*args) end # @overload initialize(parent, id, pos, size, choices, style=Wx::HTML::HLB_DEFAULT_STYLE, validator=Wx::DEFAULT_VALIDATOR, name=Wx::SimpleHtmlListBoxNameStr) # Constructor, creating and showing the HTML list box. # @param parent [Wx::Window] Parent window. Must not be NULL. # @param id [Integer] Window identifier. A value of -1 indicates a default value. # @param pos [Array(Integer, Integer), Wx::Point] Window position. # @param size [Array(Integer, Integer), Wx::Size] Window size. If {Wx::DEFAULT_SIZE} is specified then the window is sized appropriately. # @param choices [Array] An array of strings with which to initialise the control. # @param style [Integer] Window style. See {Wx::HLB_}* flags. # @param validator [Wx::Validator] Window validator. # @param name [String] Window name. # @return [Wx::HTML::SimpleHtmlListBox] # @overload initialize() # Default constructor, you must call {Wx::HTML::SimpleHtmlListBox#create} later. # @return [Wx::HTML::SimpleHtmlListBox] def initialize(*args) end # @overload append(item) # Appends item into the control. # The return value is the index of the newly inserted item. Note that this may be different from the last one if the control is sorted (e.g. has {Wx::LB_SORT} or {Wx::CB_SORT} style). # @param item [String] String to add. # @return [Integer] # @overload append(item, clientData) # Appends item into the control. # The return value is the index of the newly inserted item. Note that this may be different from the last one if the control is sorted (e.g. has {Wx::LB_SORT} or {Wx::CB_SORT} style). # @param item [String] String to add. # @param clientData [Object] Pointer to client data to associate with the new item. # @return [Integer] # @overload append(items) # Appends several items at once into the control. # Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items. # @param items [Array] Array of strings to insert. # @return [Integer] # @overload append(items, clientData) # Appends several items at once into the control. # Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items. # @param items [Array] Array of strings to insert. # @param clientData [Array] Array of client data pointers of the same size as items to associate with the new items. # @return [Integer] def append(*args) end # Returns a pointer to the client data associated with the given item (if any). # It is an error to call this function for a control which doesn't have untyped client data at all although it is OK to call it even if the given item doesn't have any client data associated with it (but other items do). # # A pointer to the client data, or NULL if not present. # @param n [Integer] The zero-based position of the item. # @return [Object] def get_client_data(n) end alias_method :client_data, :get_client_data # Associates the given untyped client data pointer with the given item. # Note that it is an error to call this function if any typed client data pointers had been associated with the control items before. # @param n [Integer] The zero-based item index. # @param data [Object] The client data to associate with the item. # @return [void] def set_client_data(n, data) end # @overload insert(item, pos) # Inserts item into the control. # The return value is the index of the newly inserted item. If the insertion failed for some reason, -1 is returned. # @param item [String] String to add. # @param pos [Integer] Position to insert item before, zero based. # @return [Integer] # @overload insert(item, pos, clientData) # Inserts item into the control. # The return value is the index of the newly inserted item. If the insertion failed for some reason, -1 is returned. # @param item [String] String to add. # @param pos [Integer] Position to insert item before, zero based. # @param clientData [Object] Pointer to client data to associate with the new item. # @return [Integer] # @overload insert(items, pos) # Inserts several items at once into the control. # Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items. # # The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned. # @param items [Array] Array of strings to insert. # @param pos [Integer] Position to insert the items before, zero based. # @return [Integer] # @overload insert(items, pos, clientData) # Inserts several items at once into the control. # Notice that calling this method is usually much faster than inserting them one by one if you need to insert a lot of items. # # The return value is the index of the last inserted item. If the insertion failed for some reason, -1 is returned. # @param items [Array] Array of strings to insert. # @param pos [Integer] Position to insert the items before, zero based. # @param clientData [Array] Array of client data pointers of the same size as items to associate with the new items. # @return [Integer] def insert(*args) end # @overload set(items) # Replaces the current control contents with the given items. # Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items. # @param items [Array] Array of strings to insert. # @return [void] # @overload set(items, clientData) # Replaces the current control contents with the given items. # Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items. # @param items [Array] Array of strings to insert. # @param clientData [Array] Array of client data pointers of the same size as items to associate with the new items. # @return [void] def set(*args) end # Deletes an item from the control. # The client data associated with the item will be also deleted if it is owned by the control. Note that it is an error (signalled by an assert failure in debug builds) to remove an item with the index negative or greater or equal than the number of items in the control. # If there is a currently selected item below the item being deleted, i.e. if {Wx::HTML::SimpleHtmlListBox#get_selection} returns a valid index greater than or equal to n, the selection is invalidated when this function is called. However if the selected item appears before the item being deleted, the selection is preserved unchanged. # @see Wx::HTML::SimpleHtmlListBox#clear # @param n [Integer] The zero-based item index. # @return [void] def delete(n) end # Returns true, if either untyped data (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