This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes
This version of documentation is OUTDATED! Please switch to the latest one.

WidgetIcon Class

Interface for widget icon handling. See also UnigineScript analog.

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

WidgetIcon Class

Members


WidgetIcon (const Ptr<Gui> & gui, const char * str = 0, int width = 0, int height = 0)

Constructor. Creates an icon of the specified size using a given texture.

Arguments

  • const Ptr<Gui> & gui - GUI, to which the new icon will belong.
  • const char * str - The path to a texture file.
  • int width - The width.
  • int height - The height.

Ptr<WidgetIcon> create (const Ptr<Widget> & widget)

WidgetIcon constructor.

Arguments

  • const Ptr<Widget> & widget - Widget smart pointer.

Return value

int getTextAlign ()

Returns the current alignment flag set for the floating text over the icon.

Return value

Alignment flag: one of the Gui Enumeration with ALIGN_* prefixes.

int isToggled ()

Returns a value indicating if the icon serving as a toggle button is pressed.

Return value

Returns 1 if the button is pressed; otherwise, 0.

void setText (const char * text)

Sets the floating text over the icon.

Arguments

  • const char * text - Floating text.

int type ()

WidgetIcon type.

Return value

WidgetIcon type identifier.

int isToggleable ()

Returns a value indicating if the icon is a toggle button or a simple button. The default is 0.

Return value

Positive number if the icon is a toggle button; otherwise, 0.

void setTexture (const char * texture)

Sets a texture to be used as the icon image.

Arguments

  • const char * texture - to a texture file.

void setToggled (int toggled)

Sets a state of the icon as a toggle button.

Arguments

  • int toggled - Positive number to press the button, 0 to release it.

const char * getText ()

Returns the current floating text set to be over the icon.

Return value

Floating text.

void getImage (const Ptr<Image> & image)

Returns the icon image.

Arguments

  • const Ptr<Image> & image

void setImage (const Ptr<Image> & image)

Sets an icon image.

Arguments

  • const Ptr<Image> & image - Image to set.

const char * getTexture ()

Returns path to the icon image.

Return value

Path to a texture file.

void setToggleable (int toggleable)

Sets a value indicating if the icon is a toggle button or a simple button. The default is 0.

Arguments

  • int toggleable - Positive number to make the icon a toggle button, 0 to make it a simple button.

void setTextAlign (int align)

Sets the alignment flag for the floating text over the icon. The default is ALIGN_CENTER.

Arguments

  • int align - Alignment flag: one of the Gui Enumeration with ALIGN_* prefixes.
Last update: 2017-07-03
Build: ()