This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::WidgetComboBox Class

Interface for widget combobox handling. See also UnigineScript analog.

To use this class, include the UnigineWidgetComboBox.h file.

Unigine::WidgetComboBox Class

Members


static int type ()

WidgetComboBox type.

Return value

WidgetComboBox type identifier.

static Ptr< WidgetComboBox > create (const WidgetPtr & widget)

WidgetComboBox constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

static Ptr< WidgetComboBox > create (const Ptr< Gui > & gui)

WidgetComboBox constructor.

Arguments

  • const Ptr< Gui > & gui - Gui pointer.

virtual void setImage (const ImagePtr & image) const =0

Sets an image with mini-icons to be used with items. The image is a vertical strip of square icons.

Arguments

  • const ImagePtr & image - Image to set.

virtual void getImage () const =0

Returns the image with mini-icons, which are used with the combobox items.

Return value

image Image with mini-icons.

virtual void setTexture (const char * name) const =0

Sets a texture with mini-icons to be used with items. The texture is a vertical strip of square icons.

Arguments

  • const char * name - Path to a texture file.

virtual const char * getTexture () const =0

Returns path to the image with mini-icons, which are used with combobox items.

Return value

Path to the texture file.

virtual void clear () const =0

Removes all items from the combobox.

virtual int addItem (const char * str, int texture) const =0

Adds a new item with a given text and an icon.

Arguments

  • const char * str - Item text.
  • int texture - Zero-based ID of the icon.

Return value

Number of the added item.

virtual void removeItem (int item) const =0

Removes a given item from the combobox.

Arguments

  • int item - Item number in range from 0 to the total number of items.

virtual int getNumItems () const =0

Returns the number of items in the combobox.

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.

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 setItemData (int item, const char * str) const =0

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.
  • const char * str - Item data to set.

virtual const char * getItemData (int item) const =0

Returns the data of 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.

Return value

Item data.

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.

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.

virtual void setCurrentItem (int item) const =0

Sets a given item as selected.

Arguments

  • int item - Item number.

virtual int getCurrentItem () const =0

Returns the currently selected item.

Return value

Item number.

virtual const char * getCurrentItemText () const =0

Returns a text value of the currently selected item.

Return value

Item text.

virtual const char * getCurrentItemData () const =0

Returns the data of the currently selected item. The data can be used as a text identifier of the item (instead of using the number of the item).

Return value

Item data.
Last update: 2017-07-03
Build: ()