The actors field of the compound object of a face is a map of the functions that define the behavior of the face. Whenever an event or other action occurs, these are the functions that handle it. (In some GUI systems, these are called interactors.)
If a style object is derived from a parent style, the parent actors are inherited from the parent object. But the derived actors are not bound to the parent. This allows the functions of the actor to be more efficiently reused in all instances of the face. Within an actor, a reference to a facet is made via special access functions.
Typical actors are:
-
on-make - when face is first created to initialize special values
-
on-click - when mouse button clicked on face
-
on-drag - when dragging inside a face
-
on-drag-over - when dragging and are over a target face
-
on-drop - when drag has stopped or when a file is dropped
-
on-focus - when we have been given or are losing focus
-
on-get - to fetch state values
-
on-set - when state values are set
-
on-clear - when the state values are cleared
-
on-key - when key has been pressed (for our focus)
|
-
on-move - when mouse has moved
-
on-over - when mouse passes over or away
-
on-reset - when reset is needed
-
on-resize - when size values have changed
-
on-draw - when system starts to draw the face (create DRAW block)
-
on-scroll - when scrolling is needed
-
on-scroll-event - when the mouse wheel is used
-
on-init - when face and its parent pane are ready (including initial sizing)
-
on-attach - when a face is attached to another face
|
There is no need to define actors that are not needed. New actors can be created as required.
Actor functions are called using the DO-STYLE function. For example:
do-style face 'on-click true
The action is ignored if the face has no on-click actor.