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
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::WidgetExternBase Class

Unigine Base WidgetExtern class.

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

Unigine::WidgetExternBase Class

Members


ConstructorFunc Type Definition

Description

Full declaration:
typedef WidgetExternBase*(* Unigine::WidgetExternBase::ConstructorFunc)(void *widget)

WidgetExternBase constructor functor.

Arguments

widget - WidgetExtern pointer.

Return value

WidgetExternBase class.

WidgetExternBase (const Ptr< Gui > & gui)

WidgetExternBase constructor.

Arguments

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

WidgetExternBase (void * widget)

WidgetExternBase constructor.

Arguments

  • void * widget - Pointer to an external widget.

virtual ~WidgetExternBase ()

Virtual destructor.

void grab () const

Sets the owner flag to 1 for the widget pointer. The widget should not be handled by the class after this function is called.

void release () const

Sets the owner flag to 0 for the widget pointer. The widget should be handled by the class after this function is called.

int isOwner () const

Returns the owner flag of the pointer. If the pointer is owner, on its deletion the object also will be deleted.

Return value

The owner flag.

virtual int getClassID () =0

Returns a unique class ID.

Return value

Unique class ID.

Ptr< Gui > getGui () const

Returns the Gui smart pointer.

Return value

Gui smart pointer.

Ptr< Widget > getWidget () const

Returns the Widget smart pointer.

Return value

Widget smart pointer.

Ptr< WidgetExtern > getWidgetExtern () const

Returns the WidgetExtern smart pointer.

Return value

WidgetExtern smart pointer.

virtual void update (float ifps)

Widget update function.

Arguments

  • float ifps - Inverse FPS value.

virtual void checkCallbacks (int x, int y)

Checks widget callbacks.

Arguments

  • int x - Mouse X coordinate.
  • int y - Mouse Y coordinate.

virtual void keyPress (unsigned int key)

Keyboard press event.

Arguments

  • unsigned int key - Key code.

virtual int getKeyActivity (unsigned int key)

Checks the keyboard key.

Arguments

  • unsigned int key - Key code.

Return value

Returns 1 if the key is used by widget.

virtual void arrange ()

Calculates the widget size.

virtual void expand (int width, int height)

Expands the widget size.

Arguments

  • int width - Maximum available width.
  • int height - Maximum available height.

virtual void destroy ()

Destroys the widget resources.

virtual void render ()

Renders the widget.

static void addClassID (int class_id, ConstructorFunc func)

Registers a constructor for a specified class ID.

Arguments

  • int class_id - Unique class ID.
  • ConstructorFunc func - Constructor functor.

static void addClassID (int class_id)

Registers a constructor for a specified class type.

Arguments

  • int class_id - Unique class ID.

int get_position_x () const

Returns the current widget X coordinate.

int get_position_y () const

Returns the current widget Y coordinate.

int get_default_width () const

Returns the default widget width.

int get_default_height () const

Returns the default widget height.

void set_width (int width) const

Sets the widget width.

Arguments

  • int width - Widget width.

int get_width () const

Returns the widget width.

void set_height (int height) const

Sets the widget height.

Arguments

  • int height - Widget height.

int get_height () const

Returns the widget height.

void check_default_callbacks (int x, int y) const

Checks default widget callbacks.

Arguments

  • int x - Mouse X coordinate.
  • int y - Mouse Y coordinate.

void check_clicked_callbacks (int x, int y) const

Checks clicked widget callbacks.

Arguments

  • int x - Mouse X coordinate.
  • int y - Mouse Y coordinate.

void check_pressed_callbacks (int x, int y) const

Checks pressed widget callbacks.

Arguments

  • int x - Mouse X coordinate.
  • int y - Mouse Y coordinate.

float get_expose () const

Returns the expose widget coefficient.

float get_clicked_fade () const

Returns the clicked fade coefficient.

float get_selection_fade () const

Returns the selection fade coefficient.

vec4 get_color () const

vec4 get_focus_color () const

vec4 get_selection_color () const

vec4 get_text_color () const

vec4 get_text_color () const

int get_text_height () const

int get_text_width () const

int get_text_space_width () const

void get_text_size () const

void render_text () const

void get_text_size () const

void render_text () const

void push_color () const

Pushes the color multiplier stack.

void pop_color () const

Pops the color multiplier stack.

void set_color (const vec4 & color) const

Sets the color multiplier.

Arguments

  • const vec4 & color - Color multiplier.

void push_transform () const

Pushes the transformations stack.

void pop_transform () const

Pops the transformations stack.

void set_transform (const mat4 & transform) const

Sets the transformation matrix.

Arguments

  • const mat4 & transform - Transformation matrix.

void set_translate (int x, int y) const

Sets the translate transformation.

Arguments

  • int x - X axis translation.
  • int y - Y axis translation.

void set_scale (float x, float y) const

Sets the scale transformation.

Arguments

  • float x - X axis scale.
  • float y - Y axis scale.

void set_blend_func (int src, int dest) const

Sets the blending function.

Arguments

  • int src - Source blending function.
  • int dest - Destination blending function.
Last update: 03.07.2017
Build: ()