Enfusion Script API
|
An event handler for UI widgets can be attached to any widget using Widget.AddHandler. More...
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. | |
![]() | |
proto external ref Managed | Clone () |
Return shallow copy of object, or null if it is not allowed (not public constructor) | |
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.
void ScriptedWidgetEventHandler.HandlerAttached | ( | Widget | w | ) |
Called when a new handler (widget component) is attached to a widget.
w | The widget on which the event was triggered. |
void ScriptedWidgetEventHandler.HandlerDeattached | ( | Widget | w | ) |
Called when a handler (widget component) is detached from a widget.
w | The widget on which the event was triggered. |
Called when the internal state of a widget is changed in widgets with internal states (CheckBoxWidget, EditBoxWidget, MultilineEditBox, SliderWidget, ComboBoxWidget).
w | The widget on which the event was triggered. |
finished | Indicates if the change of state is finished or in progress. |
Called when the user types on a focused widget that accepts text input (EditBoxWidget, MultilineEditBox, Listbox widgets).
w | The widget on which the event was triggered. |
charCode | Typed character. |
Called when a child widget is added to a widget.
w | The widget on which the event was triggered. |
child | The child widget. |
Called when a child widget is removed from a widget.
w | The widget on which the event was triggered. |
child | The child widget. |
Called when a button is clicked (including buttons on widgets like checkboxes, scrollbars, combo-boxes).
w | The widget on which the event was triggered. |
x | Mouse position (if triggered by the mouse). |
y | Mouse position (if triggered by the mouse). |
button | Index of the mouse button (if triggered by the mouse). |
Called on a focused widget when the user triggers a controller action via keyboard or game device.
w | The widget on which the event was triggered. |
control | Type of the control action. |
value | Value of the control action. |
Called when the user double-clicks on a widget.
w | The widget on which the event was triggered. |
x | Mouse position. |
y | Mouse position. |
button | Index of the mouse button. |
Called when a widget is focused.
w | The widget on which the event was triggered. |
x | Mouse position (if triggered by the mouse). |
y | Mouse position (if triggered by the mouse). |
Called when a widget loses focus.
w | The widget on which the event was triggered. |
x | Mouse position (if triggered by the mouse). |
y | Mouse position (if triggered by the mouse). |
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.
w | The widget on which the event was triggered. |
bool ScriptedWidgetEventHandler.OnItemSelected | ( | Widget | w, |
int | row, | ||
int | column, | ||
int | oldRow, | ||
int | oldColumn ) |
Called when the user selects an item in a listbox.
w | The widget on which the event was triggered. |
Called when the user clicks outside a modal widget.
modalRoot | The widget on which the event was triggered. |
x | Mouse position (if triggered by the mouse). |
y | Mouse position (if triggered by the mouse). |
button | Index of the mouse button (if triggered by the mouse). |
Called when a modal widget is closed.
modalRoot | The widget on which the event was triggered. |
Called on a widget under the cursor when the user presses a mouse button.
w | The widget on which the event was triggered. |
x | Mouse position. |
y | Mouse position. |
button | Index of the mouse 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.
w | The widget on which the event was triggered. |
x | Mouse position. |
y | Mouse position. |
button | Index of the mouse button. |
Called when a widget gets under the mouse cursor.
w | The widget on which the event was triggered. |
x | Mouse position. |
y | Mouse position. |
Called when a widget is no longer under the mouse cursor.
w | The widget on which the event was triggered. |
x | Mouse position. |
y | Mouse position. |
Called on a widget under the cursor when the user uses the mouse wheel.
w | The widget on which the event was triggered. |
x | Mouse position. |
y | Mouse position. |
wheel | Value of the mouse wheel. |
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.
w | The widget on which the event was triggered. |
Called when a widget is updated due to a layout change.
w | The widget on which the event was triggered. |
Called when the user enter write mode on a edit box (EditBoxWidget, MultilineEditBox).
w | The widget on which the event was triggered. |
Called when the user leave write mode on a edit box (EditBoxWidget, MultilineEditBox).
w | The widget on which the event was triggered. |