Enfusion Script API
Loading...
Searching...
No Matches
ScriptedWidgetEventHandler Interface Reference

An event handler for UI widgets can be attached to any widget using Widget.AddHandler. More...

Inheritance diagram for ScriptedWidgetEventHandler:
Managed ScriptedWidgetComponent

Public Member Functions

bool OnClick (Widget w, int x, int y, int button)
 Called when a button is clicked (including buttons on widgets like checkboxes, scrollbars, combo-boxes).
 
bool OnShow (Widget w)
 Called when a widget's visibility flag has changed and the widget is now flagged as visible.
 
bool OnHide (Widget w)
 Called when a widget's visibility flag has changed and the widget is now flagged as hidden.
 
bool OnModalClosed (Widget modalRoot)
 Called when a modal widget is closed.
 
bool OnModalClickOut (Widget modalRoot, int x, int y, int button)
 Called when the user clicks outside a modal widget.
 
bool OnDoubleClick (Widget w, int x, int y, int button)
 Called when the user double-clicks on a widget.
 
bool OnItemSelected (Widget w, int row, int column, int oldRow, int oldColumn)
 Called when the user selects an item in a listbox.
 
bool OnFocus (Widget w, int x, int y)
 Called when a widget is focused.
 
bool OnFocusLost (Widget w, int x, int y)
 Called when a widget loses focus.
 
bool OnMouseEnter (Widget w, int x, int y)
 Called when a widget gets under the mouse cursor.
 
bool OnMouseLeave (Widget w, Widget enterW, int x, int y)
 Called when a widget is no longer under the mouse cursor.
 
bool OnMouseWheel (Widget w, int x, int y, int wheel)
 Called on a widget under the cursor when the user uses the mouse wheel.
 
bool OnMouseButtonDown (Widget w, int x, int y, int button)
 Called on a widget under the cursor when the user presses a mouse button.
 
bool OnMouseButtonUp (Widget w, int x, int y, int button)
 Called when the user releases a mouse button on the widget under the cursor and also on the widget where the mouse down event was triggered.
 
bool OnController (Widget w, ControlID control, int value)
 Called on a focused widget when the user triggers a controller action via keyboard or game device.
 
bool OnChar (Widget w, int charCode)
 Called when the user types on a focused widget that accepts text input (EditBoxWidget, MultilineEditBox, Listbox widgets).
 
bool OnChange (Widget w, bool finished)
 Called when the internal state of a widget is changed in widgets with internal states (CheckBoxWidget, EditBoxWidget, MultilineEditBox, SliderWidget, ComboBoxWidget).
 
bool OnWriteModeEnter (Widget w)
 Called when the user enter write mode on a edit box (EditBoxWidget, MultilineEditBox).
 
bool OnWriteModeLeave (Widget w)
 Called when the user leave write mode on a edit box (EditBoxWidget, MultilineEditBox).
 
bool OnChildAdd (Widget w, Widget child)
 Called when a child widget is added to a widget.
 
bool OnChildRemove (Widget w, Widget child)
 Called when a child widget is removed from a widget.
 
bool OnUpdate (Widget w)
 Called when a widget is updated due to a layout change.
 
void HandlerAttached (Widget w)
 Called when a new handler (widget component) is attached to a widget.
 
void HandlerDeattached (Widget w)
 Called when a handler (widget component) is detached from a widget.
 
- 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)
 

Detailed Description

An event handler for UI widgets can be attached to any widget using Widget.AddHandler.

It can also be attached to multiple widgets. After attaching, the handler will start to receive events from the widget as well as unprocessed events from all its children. An event is considered processed when the event method returns TRUE. Events are first called on all event handlers of the widget, then on the parent widget in the hierarchy until the event is processed or the hierarchy root widget is reached.

Member Function Documentation

◆ HandlerAttached()

void ScriptedWidgetEventHandler.HandlerAttached ( Widget w)

Called when a new handler (widget component) is attached to a widget.

Parameters
wThe widget on which the event was triggered.

◆ HandlerDeattached()

void ScriptedWidgetEventHandler.HandlerDeattached ( Widget w)

Called when a handler (widget component) is detached from a widget.

Parameters
wThe widget on which the event was triggered.

◆ OnChange()

bool ScriptedWidgetEventHandler.OnChange ( Widget w,
bool finished )

Called when the internal state of a widget is changed in widgets with internal states (CheckBoxWidget, EditBoxWidget, MultilineEditBox, SliderWidget, ComboBoxWidget).

Parameters
wThe widget on which the event was triggered.
finishedIndicates if the change of state is finished or in progress.
Returns
When returning true, the event is considered processed.

◆ OnChar()

bool ScriptedWidgetEventHandler.OnChar ( Widget w,
int charCode )

Called when the user types on a focused widget that accepts text input (EditBoxWidget, MultilineEditBox, Listbox widgets).

Parameters
wThe widget on which the event was triggered.
charCodeTyped character.
Returns
When returning true, the event is considered processed.

◆ OnChildAdd()

bool ScriptedWidgetEventHandler.OnChildAdd ( Widget w,
Widget child )

Called when a child widget is added to a widget.

Parameters
wThe widget on which the event was triggered.
childThe child widget.
Returns
When returning true, the event is considered processed.

◆ OnChildRemove()

bool ScriptedWidgetEventHandler.OnChildRemove ( Widget w,
Widget child )

Called when a child widget is removed from a widget.

Parameters
wThe widget on which the event was triggered.
childThe child widget.
Returns
When returning true, the event is considered processed.

◆ OnClick()

bool ScriptedWidgetEventHandler.OnClick ( Widget w,
int x,
int y,
int button )

Called when a button is clicked (including buttons on widgets like checkboxes, scrollbars, combo-boxes).

Parameters
wThe widget on which the event was triggered.
xMouse position (if triggered by the mouse).
yMouse position (if triggered by the mouse).
buttonIndex of the mouse button (if triggered by the mouse).
Returns
When returning true, the event is considered processed.

◆ OnController()

bool ScriptedWidgetEventHandler.OnController ( Widget w,
ControlID control,
int value )

Called on a focused widget when the user triggers a controller action via keyboard or game device.

Parameters
wThe widget on which the event was triggered.
controlType of the control action.
valueValue of the control action.
Returns
When returning true, the event is considered processed.

◆ OnDoubleClick()

bool ScriptedWidgetEventHandler.OnDoubleClick ( Widget w,
int x,
int y,
int button )

Called when the user double-clicks on a widget.

Parameters
wThe widget on which the event was triggered.
xMouse position.
yMouse position.
buttonIndex of the mouse button.
Returns
When returning true, the event is considered processed.

◆ OnFocus()

bool ScriptedWidgetEventHandler.OnFocus ( Widget w,
int x,
int y )

Called when a widget is focused.

Parameters
wThe widget on which the event was triggered.
xMouse position (if triggered by the mouse).
yMouse position (if triggered by the mouse).
Returns
When returning true, the event is considered processed.

◆ OnFocusLost()

bool ScriptedWidgetEventHandler.OnFocusLost ( Widget w,
int x,
int y )

Called when a widget loses focus.

Parameters
wThe widget on which the event was triggered.
xMouse position (if triggered by the mouse).
yMouse position (if triggered by the mouse).
Returns
When returning true, the event is considered processed.

◆ OnHide()

bool ScriptedWidgetEventHandler.OnHide ( Widget w)

Called when a widget's visibility flag has changed and the widget is now flagged as hidden.

This information does not take into account whether the whole hierarchy is visible or not, only that the widget itself is flagged as hidden.

Parameters
wThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

◆ OnItemSelected()

bool ScriptedWidgetEventHandler.OnItemSelected ( Widget w,
int row,
int column,
int oldRow,
int oldColumn )

Called when the user selects an item in a listbox.

Parameters
wThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

◆ OnModalClickOut()

bool ScriptedWidgetEventHandler.OnModalClickOut ( Widget modalRoot,
int x,
int y,
int button )

Called when the user clicks outside a modal widget.

Parameters
modalRootThe widget on which the event was triggered.
xMouse position (if triggered by the mouse).
yMouse position (if triggered by the mouse).
buttonIndex of the mouse button (if triggered by the mouse).
Returns
When returning true, the event is considered processed.

◆ OnModalClosed()

bool ScriptedWidgetEventHandler.OnModalClosed ( Widget modalRoot)

Called when a modal widget is closed.

Parameters
modalRootThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

◆ OnMouseButtonDown()

bool ScriptedWidgetEventHandler.OnMouseButtonDown ( Widget w,
int x,
int y,
int button )

Called on a widget under the cursor when the user presses a mouse button.

Parameters
wThe widget on which the event was triggered.
xMouse position.
yMouse position.
buttonIndex of the mouse button.
Returns
When returning true, the event is considered processed.

◆ OnMouseButtonUp()

bool ScriptedWidgetEventHandler.OnMouseButtonUp ( Widget w,
int x,
int y,
int button )

Called when the user releases a mouse button on the widget under the cursor and also on the widget where the mouse down event was triggered.

Parameters
wThe widget on which the event was triggered.
xMouse position.
yMouse position.
buttonIndex of the mouse button.
Returns
When returning true, the event is considered processed.

◆ OnMouseEnter()

bool ScriptedWidgetEventHandler.OnMouseEnter ( Widget w,
int x,
int y )

Called when a widget gets under the mouse cursor.

Parameters
wThe widget on which the event was triggered.
xMouse position.
yMouse position.
Returns
When returning true, the event is considered processed.

◆ OnMouseLeave()

bool ScriptedWidgetEventHandler.OnMouseLeave ( Widget w,
Widget enterW,
int x,
int y )

Called when a widget is no longer under the mouse cursor.

Parameters
wThe widget on which the event was triggered.
xMouse position.
yMouse position.
Returns
When returning true, the event is considered processed.

◆ OnMouseWheel()

bool ScriptedWidgetEventHandler.OnMouseWheel ( Widget w,
int x,
int y,
int wheel )

Called on a widget under the cursor when the user uses the mouse wheel.

Parameters
wThe widget on which the event was triggered.
xMouse position.
yMouse position.
wheelValue of the mouse wheel.
Returns
When returning true, the event is considered processed.

◆ OnShow()

bool ScriptedWidgetEventHandler.OnShow ( Widget w)

Called when a widget's visibility flag has changed and the widget is now flagged as visible.

This information does not take into account whether the whole hierarchy is visible or not, only that the widget itself is flagged as visible.

Parameters
wThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

◆ OnUpdate()

bool ScriptedWidgetEventHandler.OnUpdate ( Widget w)

Called when a widget is updated due to a layout change.

Parameters
wThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

◆ OnWriteModeEnter()

bool ScriptedWidgetEventHandler.OnWriteModeEnter ( Widget w)

Called when the user enter write mode on a edit box (EditBoxWidget, MultilineEditBox).

Parameters
wThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

◆ OnWriteModeLeave()

bool ScriptedWidgetEventHandler.OnWriteModeLeave ( Widget w)

Called when the user leave write mode on a edit box (EditBoxWidget, MultilineEditBox).

Parameters
wThe widget on which the event was triggered.
Returns
When returning true, the event is considered processed.

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