WidgetComboBox Class
WidgetComboBox Class
This class inherits from WidgetMembers
WidgetComboBox (Gui gui)
Constructor. Creates an empty combobox.Arguments
- Gui gui - GUI, to which the new combobox will belong.
int addItem (string text, int icon = -1)
Adds a new item with a given text and an icon.Arguments
- string text - Item text.
- int icon - Zero-based ID of the icon.
Return value
Number of the added item.void clear ()
Removes all items from the combobox.string getCurrentItemData ()
Returns the data of a given item.Return value
Item data.string getCurrentItemText ()
Returns a text value of the currently selected item.Return value
Item text.int getCurrentItem ()
Returns the currently selected item.Return value
Item number.Image getImage ()
Returns the image with mini-icons.Return value
Image with mini-icons.string getItemData (int item)
Returns the data of the currently selected item.Arguments
- int item - Item number in range from 0 to the total number of items.
Return value
Item data.string getItemText (int item)
Returns the text of a given item.Arguments
- int item - Item number.
Return value
Item text.int getItemTexture (int item)
Returns the icon of a given item.Arguments
- int item - Item number.
Return value
Zero-based ID of the icon.int getNumItems ()
Returns the number of items in the combobox.Return value
Number of items.string getTexture ()
Returns file name of the image with mini-icons.Return value
Path to the texture file.void removeItem (int item)
Removes a given item from the combobox.Arguments
- int item - Item number.
void setCurrentItem (int item)
Selects a given item.Arguments
- int item - Item number.
void setImage (Image image)
Sets an image with mini-icons to be used with items. The image is a vertical strip of square icons.Arguments
- Image image - Image to set.
void setItemData (int item, string data)
Sets the data for a given item. The data can be used as a text identifier of the item (instead of using the number of the item).Arguments
- int item - Item number in range from 0 to the total number of items.
- string data - Data to set.
void setItemText (int item, string text)
Sets a text for a given item.Arguments
- int item - Item number.
- string text - Item text.
void setItemTexture (int item, int icon)
Sets an icon for a given item.Arguments
- int item - Item number.
- int icon - Zero-based ID of the icon.
void setTexture (string texture)
Sets a texture with mini-icons to be used with items. The texture is a vertical strip of square icons.Arguments
- string texture - Path to a texture file.
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)