Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Widget Interface Reference
Inheritance diagram for Widget:
[legend]

Public Member Functions

proto external void Update ()
 
proto external Widget GetParent ()
 Returns parent in hierarchy, or NULL.
 
proto external Widget GetChildren ()
 Returns children in hierarchy, or NULL.
 
proto external Widget GetSibling ()
 Returns next sibling in hierarchy, or NULL.
 
proto external void AddChild (notnull Widget child)
 Adds given widget as a child. Possible only if this widget accepts more children.
 
proto external void RemoveChild (notnull Widget child)
 
proto external void SetName (string name)
 
proto external string GetName ()
 
proto external void SetUserID (int id)
 Sets user ID.
 
proto external int GetUserID ()
 Gets user ID.
 
proto external bool IsFocusable ()
 
proto external void AddHandler (ScriptedWidgetEventHandler eventHandler)
 Add (hook) handler to widget. Adds reference to the handler.
 
proto external void RemoveHandler (ScriptedWidgetEventHandler eventHandler)
 Unhook handler from widget. Release reference to the handler.
 
proto external int GetNumHandlers ()
 Return number of all handlers attached to widget (C++ & scripted)
 
proto external ScriptedWidgetEventHandler GetHandler (int index)
 return widget event handler on given index, when the event handler is not inherited from ScriptedWidgetEventHandler, null is returned
 
proto external ScriptedWidgetEventHandler FindHandler (TypeName type)
 return first widget event handler of given type, when none of event handlers has the type null is returned
 
proto external void SetVisible (bool show)
 Sets visibility of this widget (VISIBLE flag)
 
proto external void SetEnabled (bool enable)
 Sets enabled state of this widget (DISABLED flag)
 
proto external bool IsVisible ()
 Returns whether is this widget visible (VISIBLE flag is set)
 
proto external bool IsVisibleInHierarchy ()
 Returns whether are this widget and all its ancesstors visible (VISIBLE flag is set)
 
proto external bool IsEnabled ()
 Returns whether is this widget enabled (DISABLED flag is not set)
 
proto external bool IsEnabledInHierarchy ()
 Returns whether are this widget and all its ancesstors enabled (DISABLED flag is not set)
 
proto external bool IsClippingChildren ()
 Returns wheter this widget clips its children.
 
proto external bool GetIsColorInherited ()
 
proto external void SetIsColorInherited (bool isColorInherited)
 Sets whether this widget inherits color from its parent.
 
proto external void SetColor (notnull Color color)
 Sets color of this widget.
 
proto external void SetColorInt (int color)
 Set ARGB color.
 
proto external int GetColorInt ()
 
proto external void SetOpacity (float alpha)
 Sets opacity which applies to this widget and all its descendants.
 
proto external float GetOpacity ()
 
proto external void SetZOrder (int zOrder)
 Changes z-order value.
 
proto external int GetZOrder ()
 Higher values mean more in front.
 
proto external void RemoveFromHierarchy ()
 Removes this widget from its parent and from the WidgetManager.
 
proto external Widget FindWidget (string pathname)
 Find Widget by path. e.g FindWidget("widget1.widget2.widget3.mywidget")
 
proto external Widget FindAnyWidget (string pathname)
 Looks for a widget with given name in this widget's children.
 
proto external Widget FindAnyWidgetById (int user_id)
 Find Widget by userID.
 
proto external string GetStyleName ()
 
proto external bool RemoveCallback (int eventId, int callbackId)
 
proto external bool RemoveCallbackByOwner (int eventId, Class owner)
 
proto external bool EmitCallback (int eventId)
 
proto external WorkspaceWidget GetWorkspace ()
 
proto ref Color GetColor ()
 Returns color of this widget.
 
proto string GetNavigation (WidgetNavigationDirection direction, out WidgetNavigationRuleType rule)
 Gets navigation rule for given direction.
 
proto external void SetNavigation (WidgetNavigationDirection direction, WidgetNavigationRuleType rule, string explicitTarget=string.Empty)
 Sets navigation rule for given direction.
 
proto external string GetTypeName ()
 
proto external int GetFlags ()
 
proto external int SetFlags (int flags)
 Sets given WidgetFlags for this widget.
 
proto external int ClearFlags (int flags)
 Removes all flags.
 
proto external WidgetType GetTypeID ()
 
proto void GetScreenPos (out float x, out float y)
 Returns position of this widget's top left corner in DPI scaled resolution.
 
proto void GetScreenSize (out float width, out float height)
 Returns size of this widget in DPI scaled resolution.
 
proto int AddCallback (int eventId, WidgetEventCallback fn)
 Add callback for given event id and returns callback id.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Member Function Documentation

◆ AddCallback()

proto int Widget.AddCallback ( int  eventId,
WidgetEventCallback  fn 
)

Add callback for given event id and returns callback id.

◆ AddChild()

proto external void Widget.AddChild ( notnull Widget  child)

Adds given widget as a child. Possible only if this widget accepts more children.

◆ AddHandler()

proto external void Widget.AddHandler ( ScriptedWidgetEventHandler  eventHandler)

Add (hook) handler to widget. Adds reference to the handler.

◆ ClearFlags()

proto external int Widget.ClearFlags ( int  flags)

Removes all flags.

Returns
Previous state of the flags

◆ EmitCallback()

proto external bool Widget.EmitCallback ( int  eventId)

◆ FindAnyWidget()

proto external Widget Widget.FindAnyWidget ( string  pathname)

Looks for a widget with given name in this widget's children.

◆ FindAnyWidgetById()

proto external Widget Widget.FindAnyWidgetById ( int  user_id)

Find Widget by userID.

◆ FindHandler()

proto external ScriptedWidgetEventHandler Widget.FindHandler ( TypeName  type)

return first widget event handler of given type, when none of event handlers has the type null is returned

◆ FindWidget()

proto external Widget Widget.FindWidget ( string  pathname)

Find Widget by path. e.g FindWidget("widget1.widget2.widget3.mywidget")

◆ GetChildren()

proto external Widget Widget.GetChildren ( )

Returns children in hierarchy, or NULL.

◆ GetColor()

proto ref Color Widget.GetColor ( )

Returns color of this widget.

◆ GetColorInt()

proto external int Widget.GetColorInt ( )
Returns
ARGB color

◆ GetFlags()

proto external int Widget.GetFlags ( )
Returns
WidgetFlags which are set for this widget

◆ GetHandler()

proto external ScriptedWidgetEventHandler Widget.GetHandler ( int  index)

return widget event handler on given index, when the event handler is not inherited from ScriptedWidgetEventHandler, null is returned

◆ GetIsColorInherited()

proto external bool Widget.GetIsColorInherited ( )
Returns
Whether this widget inherits color from its parent (INHERIT_COLOR flag)

◆ GetName()

proto external string Widget.GetName ( )

◆ GetNavigation()

proto string Widget.GetNavigation ( WidgetNavigationDirection  direction,
out WidgetNavigationRuleType  rule 
)

Gets navigation rule for given direction.

Parameters
ruleOut value of rule in given direction
Returns
Explicit target if rule is EXPLICIT. Otherwise undefined.

◆ GetNumHandlers()

proto external int Widget.GetNumHandlers ( )

Return number of all handlers attached to widget (C++ & scripted)

◆ GetOpacity()

proto external float Widget.GetOpacity ( )
Returns
Opacity which applies to this widget and all its descendants

◆ GetParent()

proto external Widget Widget.GetParent ( )

Returns parent in hierarchy, or NULL.

◆ GetScreenPos()

proto void Widget.GetScreenPos ( out float  x,
out float  y 
)

Returns position of this widget's top left corner in DPI scaled resolution.

◆ GetScreenSize()

proto void Widget.GetScreenSize ( out float  width,
out float  height 
)

Returns size of this widget in DPI scaled resolution.

◆ GetSibling()

proto external Widget Widget.GetSibling ( )

Returns next sibling in hierarchy, or NULL.

◆ GetStyleName()

proto external string Widget.GetStyleName ( )

◆ GetTypeID()

proto external WidgetType Widget.GetTypeID ( )

◆ GetTypeName()

proto external string Widget.GetTypeName ( )

◆ GetUserID()

proto external int Widget.GetUserID ( )

Gets user ID.

Returns
User ID

◆ GetWorkspace()

proto external WorkspaceWidget Widget.GetWorkspace ( )
Returns
Workspace which this widget belongs to. Null if there is no workspace in ancestors

◆ GetZOrder()

proto external int Widget.GetZOrder ( )

Higher values mean more in front.

Returns
Current ZOrder value.

◆ IsClippingChildren()

proto external bool Widget.IsClippingChildren ( )

Returns wheter this widget clips its children.

◆ IsEnabled()

proto external bool Widget.IsEnabled ( )

Returns whether is this widget enabled (DISABLED flag is not set)

◆ IsEnabledInHierarchy()

proto external bool Widget.IsEnabledInHierarchy ( )

Returns whether are this widget and all its ancesstors enabled (DISABLED flag is not set)

◆ IsFocusable()

proto external bool Widget.IsFocusable ( )

◆ IsVisible()

proto external bool Widget.IsVisible ( )

Returns whether is this widget visible (VISIBLE flag is set)

◆ IsVisibleInHierarchy()

proto external bool Widget.IsVisibleInHierarchy ( )

Returns whether are this widget and all its ancesstors visible (VISIBLE flag is set)

◆ RemoveCallback()

proto external bool Widget.RemoveCallback ( int  eventId,
int  callbackId 
)

◆ RemoveCallbackByOwner()

proto external bool Widget.RemoveCallbackByOwner ( int  eventId,
Class  owner 
)

◆ RemoveChild()

proto external void Widget.RemoveChild ( notnull Widget  child)

◆ RemoveFromHierarchy()

proto external void Widget.RemoveFromHierarchy ( )

Removes this widget from its parent and from the WidgetManager.

When there are no more strong references to this widget, it will be destroyed.

◆ RemoveHandler()

proto external void Widget.RemoveHandler ( ScriptedWidgetEventHandler  eventHandler)

Unhook handler from widget. Release reference to the handler.

◆ SetColor()

proto external void Widget.SetColor ( notnull Color  color)

Sets color of this widget.

◆ SetColorInt()

proto external void Widget.SetColorInt ( int  color)

Set ARGB color.

◆ SetEnabled()

proto external void Widget.SetEnabled ( bool  enable)

Sets enabled state of this widget (DISABLED flag)

◆ SetFlags()

proto external int Widget.SetFlags ( int  flags)

Sets given WidgetFlags for this widget.

Returns
Previous state of the flags

◆ SetIsColorInherited()

proto external void Widget.SetIsColorInherited ( bool  isColorInherited)

Sets whether this widget inherits color from its parent.

◆ SetName()

proto external void Widget.SetName ( string  name)

◆ SetNavigation()

proto external void Widget.SetNavigation ( WidgetNavigationDirection  direction,
WidgetNavigationRuleType  rule,
string  explicitTarget = string.Empty 
)

Sets navigation rule for given direction.

Parameters
explicitTargetUsed only when rule is set to EXPLICIT

◆ SetOpacity()

proto external void Widget.SetOpacity ( float  alpha)

Sets opacity which applies to this widget and all its descendants.

◆ SetUserID()

proto external void Widget.SetUserID ( int  id)

Sets user ID.

Parameters
idUser ID

◆ SetVisible()

proto external void Widget.SetVisible ( bool  show)

Sets visibility of this widget (VISIBLE flag)

◆ SetZOrder()

proto external void Widget.SetZOrder ( int  zOrder)

Changes z-order value.

Widget will be moved into appropriate order. Higher values put the widget more to the in front.

Parameters
zOrderZOrder value

◆ Update()

proto external void Widget.Update ( )

The documentation for this interface was generated from the following file: