Home | All Classes | Grouped Classes | Index | Search

# Class CL_ListBox

Listbox component More...

Derived from: CL_Component
Derived by: none
Group: GUI (Controls)

#include <ClanLib/gui.h>

Construction:

CL_ListBox | Listbox constructor

Attributes:

get_count | Returns the number of items in the list box.
get_items | Returns items in the list.
get_selected_items | Returns selected items as strings.
get_current_text | Returns the text of the current item.
get_item | Returns an item.
get_text | Returns the text for an item.
get_current_item | Returns the index of the current item of the listbox, or -1 if no item has been selected.
is_selected | Returns true if item index is selected. Returns false if it is not selected or if there is an error.
is_multi_selection | Returns true if the listbox is in multiselection mode.
get_item_height | Returns the height of one item.
get_top_item | Returns the index of the item at the top of the screen.

Operations:

insert_item | Inserts a listitem into the list at index.
remove_item | Removes and deletes the item at position index.
change_item | Replaces the item at position index with new item.
set_current_item | Sets the highlighted item to the item index.
set_selected | Selects item at index if select is true, or unselects it if select is false.
clear_selection | Deselects current selected item.
select_all | If select is true, all items get selected, else all get unselected. This works only in Multi selection mode.
invert_selection | Inverts the selection. Works only in Multi selection mode.
set_multi_selection | Sets the listbox to multiselection if enable is true, single selection otherwise.
set_item_height | Sets the height of each item.
set_top_item | Scrolls the list box so the item at position index in the list is displayed in the top row of the listbox.
sort | Sorts the items in ascending order, if ascending is true, or descending otherwise.
clear | Deletes all items in the list.

Signals:

sig_highlighted | This signal is emitted when the user highlights a new current item.
sig_activated | This signal is emitted when the user double clicks, presses space or return on an item.
sig_selection_changed | This signal is emitted when the selection set of a listbox changes.
sig_item_added | This signal is emitted when a new item is added to the listbox.
sig_item_removed | This signal is emitted when an item is removed from the listbox.
sig_clear | This signal is emitted when the listbox is cleared.

Detailed description:

!group=GUI/Controls! !header=gui.h!
Questions or comments, write to the ClanLib mailing list.