Unigine::WidgetListBox Class
Interface for widget listbox handling. See also UnigineScript analog.
To use this class, include the UnigineWidgetListBox.h file.
Unigine::WidgetListBox Class
Members
static Ptr< WidgetListBox > create (const WidgetPtr & widget)
WidgetListBox constructor.Arguments
- const WidgetPtr & widget - Widget smart pointer.
static Ptr< WidgetListBox > create (const Ptr< Gui > & gui)
WidgetListBox constructor.Arguments
- const Ptr< Gui > & gui - Gui pointer.
virtual void setMultiSelection (int multi_selection) const =0
Enables or disables multiple selection of items. The default is 0.Arguments
- int multi_selection - 1 to enable multiple selection, 0 to disable it.
virtual int isMultiSelection () const =0
Returns a value indicating if multiple selection of items is enabled. The default is 0.Return value
Returns 1 if several items can be selected at once; otherwise, 0.virtual void setImage (const ImagePtr & image) const =0
Sets an image with mini-icons to be used with list items. The image is a vertical strip of square icons.Arguments
- const ImagePtr & image - Image to set.
virtual void getImage () const =0
Gets the image with mini-icons, which are used with the list items.Return value
Image with mini-icons (the vertical strip of square icons).virtual void setTexture (const char * name) const =0
Sets a texture with mini-icons to be used with list items. The texture is a vertical strip of square icons.Arguments
- const char * name - Path to a texture with mini-icons (the vertical strip of square icons).
virtual const char * getTexture () const =0
Returns the path to the texture with mini-icons, which are used with the list items.Return value
Path to the texture file.virtual void clear () const =0
Removes all items from the list box.virtual int addItem (const char * str, int texture) const =0
Adds a new item with a given text and an icon. By default, a new item is not selected.Arguments
- const char * str - Item text.
- int texture - Zero-based ID of the icon. -1 means that an item has no icon.
Return value
Number of the added item.virtual void removeItem (int item) const =0
Removes a given item from the list box.Arguments
- int item - Item number in range from 0 to the total number of items.
virtual int getNumItems () const =0
Returns the total number of items in the list box.Return value
Number of items.virtual void setItemText (int item, const char * str) const =0
Sets a text for a given item.Arguments
- int item - Item number in range from 0 to the total number of items.
- const char * str - Item text to be set.
virtual const char * getItemText (int item) const =0
Returns the text of a given item.Arguments
- int item - Item number in range from 0 to the total number of items.
Return value
Item text.virtual void setItemColor (int item, const vec4 & color) const =0
Sets a custom color for a given item.Arguments
- int item - Item number in range from 0 to the total number of items.
- const vec4 & color - Color to set.
virtual vec4 getItemColor (int item) const =0
Returns a color set to a given item.Arguments
- int item - Item number in range from 0 to the total number of items.
Return value
Item color.virtual void setItemTexture (int item, int texture) const =0
Sets an icon for a given item.Arguments
- int item - Item number in range from 0 to the total number of items.
- int texture - Zero-based ID of the icon (i.e. number of the icon in the icon texture).
virtual int getItemTexture (int item) const =0
Returns the icon of a given item.Arguments
- int item - Item number in range from 0 to the total number of items.
Return value
Zero-based ID of the icon (i.e. number of the icon in the icon texture).virtual void setItemSelectable (int item, int selectable) const =0
Sets a value indicating if a given item can be selected.Arguments
- int item - Item number in range from 0 to the total number of items.
- int selectable - 1 to set the item as selectable; otherwise, 0.
virtual int isItemSelectable (int item) const =0
Returns a value indicating if a given item can be selected.Arguments
- int item - Item number in range from 0 to the total number of items.
Return value
Returns 1 if the item is selectable; otherwise, 0.virtual void setCurrentItem (int item) const =0
Places focus on a given item.Arguments
- int item - Item number.
virtual int getCurrentItem () const =0
Returns the number of the item, which is currently in focus.Return value
Item number.virtual const char * getCurrentItemText () const =0
Returns the text of item, which is currently in focus.Return value
Item text if the item is in range from 0 to the total number of items; otherwise, NULL.virtual int getNumSelectedItems () const =0
Returns the number of selected items in the box.Return value
Number of selected items.virtual int getSelectedItem (int num) const =0
Returns ID of the selected item (multi-selection mode).Arguments
- int num - Number in the list of the selected items in range from 0 to the total number of the selected items.
Return value
ID of a selected item.virtual void setItemSelected (int item, int selected) const =0
Sets a value indicating if a given item is selected.Arguments
- int item - Item number in range from 0 to the total number of items.
- int selected - 1 to select the item, 0 to deselect it.
virtual int isItemSelected (int item) const =0
Returns a value indicating if a given item is selected.Arguments
- int item - Item number in range from 0 to the total number of items.
Return value
Returns 1 if the item is selected; otherwise, 0.virtual void clearSelection () const =0
Clears list of selected items.virtual void showItem (int item) const =0
Scrolls a list box so that a given item is visible.Arguments
- int item - Item number in range from 0 to the total number of items.
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)