Class EventsKt
-
- All Implemented Interfaces:
public final class EventsKt
-
-
Method Summary
Modifier and Type Method Description final static <S extends Inputtable> Sevents(S $self, Function1<EventDSL<S>, Unit> dsl)final static <S extends Inputtable> SonInit(S $self, Function2<S, Event.Lifetime.Init, Unit> function)final static <S extends Inputtable> SafterInit(S $self, Function2<S, Event.Lifetime.PostInit, Unit> function)final static <S extends Inputtable> SafterParentInit(S $self, Integer depth, Function1<S, Unit> handler)Add an event handler to this drawable's parent, and (optionally) it's parent's parent (depth). final static <S extends Inputtable> SonFocusLost(S $self, Function2<S, Event.Focused.Lost, Unit> func)final static <S extends Inputtable> SonFocusGained(S $self, Function2<S, Event.Focused.Gained, Unit> func)final static <S extends Inputtable> SonScroll(S $self, Function2<S, Event.Mouse.Scrolled, Unit> func)final static <S extends Inputtable> SonClickZ(S $self, Function2<S, Event.Mouse.Clicked, Boolean> func)final static <S extends Inputtable> SonClick(S $self, Function2<S, Event.Mouse.Clicked, Unit> func)final static <S extends Inputtable> SonRightClick(S $self, Function2<S, Event.Mouse.Clicked, Unit> func)final static <S extends Inputtable> SonPress(S $self, Function2<S, Event.Mouse.Pressed, Unit> func)final static <S extends Inputtable> SonRelease(S $self, Function2<S, Event.Mouse.Released, Unit> func)final static <S extends Inputtable> SonChangeString(S $self, Function2<S, String, Boolean> func)Add a listener for changes to the given String-type property. final static <S extends Inputtable> SonChangeState(S $self, Function2<S, Boolean, Boolean> func)Add a listener for changes to the given Boolean-type property. final static <S extends Inputtable> SonChangeIndex(S $self, Function2<S, Integer, Boolean> func)Add a listener for changes to the given Int-type property. final static <S extends Inputtable> SonChangeNumber(S $self, Function2<S, Float, Boolean> func)Add a listener for changes to the given Float-type property. final static <S extends Inputtable> SonToggle(S $self, Function2<S, Boolean, Unit> func)Use this to add a simple listener for the Event.Change.State event. final static <S extends Inputtable> SsetSliderValue(S $self, Float value, Float min, Float max, Boolean dispatch)Set the value on this slider. final static <S extends Drawable> Stoggle(S $self, Boolean state)Toggle any element to the given state provided it was made with the toggleable method. final static <S extends Inputtable> SsetRadiobuttonEntry(S $self, Integer index)Set the currently selected entry of this radiobutton to index (input is range-checked). -
-
Method Detail
-
events
final static <S extends Inputtable> S events(S $self, Function1<EventDSL<S>, Unit> dsl)
-
onInit
final static <S extends Inputtable> S onInit(S $self, Function2<S, Event.Lifetime.Init, Unit> function)
-
afterInit
final static <S extends Inputtable> S afterInit(S $self, Function2<S, Event.Lifetime.PostInit, Unit> function)
-
afterParentInit
final static <S extends Inputtable> S afterParentInit(S $self, Integer depth, Function1<S, Unit> handler)
Add an event handler to this drawable's parent, and (optionally) it's parent's parent (depth).
This is used to run functions that may move or resize this drawable, as if they were ran under this Event.Lifetime.PostInit they would be overwritten by the positioning logic.
-
onFocusLost
final static <S extends Inputtable> S onFocusLost(S $self, Function2<S, Event.Focused.Lost, Unit> func)
-
onFocusGained
final static <S extends Inputtable> S onFocusGained(S $self, Function2<S, Event.Focused.Gained, Unit> func)
-
onScroll
final static <S extends Inputtable> S onScroll(S $self, Function2<S, Event.Mouse.Scrolled, Unit> func)
-
onClickZ
final static <S extends Inputtable> S onClickZ(S $self, Function2<S, Event.Mouse.Clicked, Boolean> func)
-
onClick
final static <S extends Inputtable> S onClick(S $self, Function2<S, Event.Mouse.Clicked, Unit> func)
-
onRightClick
final static <S extends Inputtable> S onRightClick(S $self, Function2<S, Event.Mouse.Clicked, Unit> func)
-
onPress
final static <S extends Inputtable> S onPress(S $self, Function2<S, Event.Mouse.Pressed, Unit> func)
-
onRelease
final static <S extends Inputtable> S onRelease(S $self, Function2<S, Event.Mouse.Released, Unit> func)
-
onChangeString
final static <S extends Inputtable> S onChangeString(S $self, Function2<S, String, Boolean> func)
Add a listener for changes to the given String-type property.
- Since:
1.0.6
-
onChangeState
final static <S extends Inputtable> S onChangeState(S $self, Function2<S, Boolean, Boolean> func)
Add a listener for changes to the given Boolean-type property.
In PolyUI, this is for Checkbox and Switch only.
- Since:
1.0.6
-
onChangeIndex
final static <S extends Inputtable> S onChangeIndex(S $self, Function2<S, Integer, Boolean> func)
Add a listener for changes to the given Int-type property.
In PolyUI, this is for Radiobutton, and Dropdown only.
- Since:
1.0.6
-
onChangeNumber
final static <S extends Inputtable> S onChangeNumber(S $self, Function2<S, Float, Boolean> func)
Add a listener for changes to the given Float-type property.
In PolyUI, this is for Slider only.
- Since:
1.0.6
-
onToggle
final static <S extends Inputtable> S onToggle(S $self, Function2<S, Boolean, Unit> func)
Use this to add a simple listener for the Event.Change.State event.
- Since:
1.5.0
-
setSliderValue
final static <S extends Inputtable> S setSliderValue(S $self, Float value, Float min, Float max, Boolean dispatch)
Set the value on this slider. Unfortunately due to current limitations you must provide the min and max values that were used for this slider.
Ensure this object is a slider before running this method, as otherwise strange errors may occur.
- Since:
1.7.2
-
toggle
final static <S extends Drawable> S toggle(S $self, Boolean state)
Toggle any element to the given state provided it was made with the toggleable method.
- Since:
1.7.2
-
setRadiobuttonEntry
final static <S extends Inputtable> S setRadiobuttonEntry(S $self, Integer index)
Set the currently selected entry of this radiobutton to index (input is range-checked).
Ensure this object is a radiobutton before running this method, as otherwise strange errors may occur.
- Since:
1.7.2
-
-
-
-