Extends
- HTMLElement
Signals
common.SIGNALRELEASING
Broadcasted right before the object is about to be released. Offers the opportunity to cancel release using `PreventRelease`.
# | Type | Description |
---|---|---|
args[0] → target |
ui.core.DisposableHTMLElement | Source of the signal ( would be event.target ) |
common.SIGNALRELEASED
Broadcasted when the object has been released.
# | Type | Description |
---|---|---|
args[0] → target |
ui.core.DisposableHTMLElement | Source of the signal ( would be event.target ) |
ui.core.UI_SIGNALFIRST_PAINT
Broadcasted once in the lifetime of the object, the first time it is painted.
# | Type | Description |
---|---|---|
args[0] → target |
ui.core.DisposableHTMLElement | Source of the signal ( would be event.target ) |
ui.core.UI_SIGNALPAINTED
Broadcasted when the object has at least one painted pixel.
# | Type | Description |
---|---|---|
args[0] → target |
ui.core.DisposableHTMLElement | Source of the signal ( would be event.target ) |
ui.core.UI_SIGNALUNPAINTED
Broadcasted when the object was painted but stopped being painted.
# | Type | Description |
---|---|---|
args[0] → target |
ui.core.DisposableHTMLElement | Source of the signal ( would be event.target ) |
Methods
(p_func)
_BindBind a function to this instance.
Parameters:
Name | Type | Description |
---|---|---|
p_func |
function |
Examples:
this._Bind(this.foo);
Members
isPainted
TODO
__usePaintCallback
Determine whether the object uses paint callbacks and thus broadcast paint signals.
Note : this property is set on a per-class basis, rather than on a per-instance basis.
Set this value by overloading it in your class definition.
... extends DisposableHTMLElement{
static __usePaintCallback = true;
}
Methods
()
_OnPaintChangeTODO
This section list the main methods used to watch/unwatch signals on this object. For more info on signals, see signals
Methods
Unwatch(p_signal, p_fn, p_listener) → {ui.core.DisposableHTMLElement}
Unwatch a signal broadcasted by this object
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_signal |
* | The signal that was being watched |
|
p_fn |
function | The callback to be removed |
|
p_listener |
* |
null
|
The callback's 'thisArg', if any |
Watch(p_signal, p_fn, p_listener) → {ui.core.DisposableHTMLElement}
Watch a signal broadcasted by this object.
Note that while you can provide an anonymous function, you won't be able to Unwatch it.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
p_signal |
* | The signal to watch for |
|
p_fn |
function | The callback to trigger when the signal fires |
|
p_listener |
* |
null
|
The callback's 'thisArg', if any |
Examples:
var foo = someFunction;
object.Watch(SIGNAL.RELEASED, foo);
object.Watch(SIGNAL.RELEASED, foo, this);
object.Watch(SIGNAL.RELEASED, (obj)=>{ ... }));
WatchOnce(p_signalId, p_fn, p_listener) → {ui.core.DisposableHTMLElement}
Watch a signal broadcasted by this object, once only; meaning if the signal the listener gets automatically removed right after the next signal broadcast.
Parameters:
Name | Type | Description |
---|---|---|
p_signalId |
* | The signal to watch for |
p_fn |
function | The callback to trigger when the signal fires |
p_listener |
* | The callback's 'thisArg', if any |
(p_signal, …args)
_BroadcastParameters:
Name | Type | Attributes | Description |
---|---|---|---|
p_signal |
* | ||
args |
any |
<repeatable> |
Members
:boolean
isReleasingWhether the object is currently in the process of being released or not.
Methods
()
_WakeWake is called when using UI' ui.core.UI.Rent
when an item is rented. Since objects are pooled,
this acts as a surrogate constructor.
In order to take advantage of the Wake call, override _Wake
.
PreventRelease()
Prevents the object from being released.
Release()
Releases the object and returns it back to the pool.
()
_CleanUpCalled when the object is released. Resets most properties to their initial values.
Override this method in your own implementations to 'reset' the object to the state you want it to be
when it gets rented again through common.POOL.Rent