This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
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
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::WidgetTreeBox Class

Interface for widget treebox handling. See also UnigineScript analog.

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

Unigine::WidgetTreeBox Class

Members


static int type ()

WidgetTreeBox type.

Return value

WidgetTreeBox type identifier.

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

WidgetTreeBox constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

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

WidgetTreeBox constructor.

Arguments

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

virtual void setEditable (int editable) const =0

Sets a value indicating if item hierarchy can be edited.

Arguments

  • int editable - 1 to make the hierarchy editable, 0 to make it read-only.

virtual int isEditable () const =0

Returns a value indicating if item hierarchy can be edited. The default is 0.

Return value

Returns 1 if the hierarchy can be edited; otherwise, 0.

virtual void setMultiSelection (int multi_selection) const =0

Sets a value indicating if multiple selection is enabled for tree box items.

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 items. The image is a vertical strip of square icons.

Arguments

  • const ImagePtr & image - Image to set.

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

Returns the image with mini-icons.

Arguments

  • const ImagePtr & image - 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 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 file name of the image with mini-icons. The texture is a vertical strip of square icons.

Return value

Path to the texture file.

virtual void clear () const =0

Removes all items from the tree box.

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

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

Arguments

  • const char * str - Item text.
  • int texture - Zero-based ID of the icon (i.e. number of the icon in the icon texture). -1 means that an item has no icon.

Return value

ID of the added item.

virtual void getItems (Vector< int > & items) const =0

Returns all items in the tree box.

Arguments

  • Vector< int > & items - An array with item IDs.

virtual void removeItem (int item) const =0

Removes a given item from the tree box. Children items will be kept.

Arguments

  • int item - Item ID.

virtual int getNumItems () const =0

Returns the number of visible items in the tree box. Items that are currently to a parent level are not returned.

Return value

Number of items.

virtual int getItem (int num) const =0

Returns the ID of a given item by its number. The IDs are unique, and the numbers simply point at the place in the list of all items.

Arguments

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

Return value

ID of the item.

virtual void setItemText (int item, const char * str) const =0

Sets a text for a given item.

Arguments

  • int item - Item ID.
  • const char * str - Item text.

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

Returns the text of a given item.

Arguments

  • int item - Item ID.

Return value

Item text.

virtual void setItemData (int item, const char * str) const =0

Sets a custom data for the 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 ID.
  • const char * str - Data to set.

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

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

Return value

Item data.

virtual void setItemColor (int item, const vec4 & color) const =0

Sets a custom color for a given item.

Arguments

  • int item - Item ID.
  • 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 ID.

Return value

Color.

virtual void setItemTexture (int item, int texture) const =0

Sets an icon for a given item.

Arguments

  • int item - Item ID.
  • 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 ID.

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.
  • 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.

Return value

Returns 1 if the item is selectable; otherwise, 0.

virtual void setItemHidden (int item, int hidden) const =0

Sets a value indicating if a given item is hidden.

Arguments

  • int item - Item ID.
  • int hidden - 1 to hide the item, 0 to show it.

virtual int isItemHidden (int item) const =0

Returns a value indicating if an item is hidden or not.

Arguments

  • int item - Item ID.

Return value

Returns 1 if the item is hidden; otherwise, 0.

virtual void setItemFolded (int item, int folded) const =0

Expands or collapses an hierarchy of a given item.

Arguments

  • int item - Item ID.
  • int folded - 1 to collapse the item hierarchy, 0 to expand it.

virtual int isItemFolded (int item) const =0

Returns a value indicating if a given item is collapsed.

Arguments

  • int item - Item ID.

Return value

Returns 1 if the item is collapsed; otherwise, 0.

virtual void setItemParent (int item, int parent) const =0

Sets a parent for a given item.

Arguments

  • int item - Item ID.
  • int parent - Parent item ID. -1 removes the current parent.

virtual int getItemParent (int item) const =0

Returns the parent of a given item.

Arguments

  • int item - Item ID.

Return value

Parent item ID.

virtual void addItemChild (int item, int child) const =0

Adds a child to a given item.

Arguments

  • int item - Item ID.
  • int child - Child item ID.

virtual void removeItemChild (int item, int child) const =0

Removes a child of a given item.

Arguments

  • int item - Item ID.
  • int child - Child item ID.

virtual int getNumItemChilds (int item) const =0

Returns the number of child items of a given item.
Warning
The function is deprecated. It is provided to keep your code working until the next release. Please, replace it with getNumItemChildren().

Arguments

  • int item - Item ID.

Return value

Number of child items.

virtual int getNumItemChildren (int item) const =0

Returns the number of child items of a given item.

Arguments

  • int item - Item ID.

Return value

Number of child items.

virtual int getItemChild (int item, int num) const =0

Returns a child of a given item.

Arguments

  • int item - Item ID.
  • int num - Child number in the list of children in range from 0 to the total number.

Return value

Child item ID.

virtual int isItemChild (int item, int child) const =0

Checks if a given item is a child of another specified item.

Arguments

  • int item - Item ID.
  • int child - Child item ID.

Return value

Returns 1 if child is actually a child of the item; otherwise, 0.

virtual void setCurrentItem (int item) const =0

Places focus on a given item (multi-selection mode).

Arguments

  • int item - Item ID.

virtual int getCurrentItem () const =0

Returns the item currently in focus (multi-selection mode).

Return value

Item ID.

virtual const char * getCurrentItemText () const =0

Returns the text of the currently focused item (multi-selection mode).

Return value

Item text.

virtual const char * getCurrentItemData () const =0

Returns the data of the currently focused item (multi-selection mode). The data can be used as a text identifier of the item (instead of using the number of the item).

Return value

Item data.

virtual int getNumSelectedItems () const =0

Returns number of selected items in the box (multi-selection mode).

Return value

Number of selected items.

virtual int getSelectedItem (int num) const =0

Returns ID of a selected item (multi-selection mode).

Arguments

  • int num - Number of an item in the list of selected items.

Return value

ID of the 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 ID.
  • 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 ID.

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 tree box so that a given item is visible.

Arguments

  • int item - Item ID.
Last update: 03.07.2017
Build: ()