Name: | Focus |
Version: | 1.0 |
ID: | ID_FOCUS |
Status: | Unspecified |
Category: | GUI |
Date: | May 2001 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems (c) 2000-2001. All rights reserved. |
Short: | The Focus class manages user focussing. |
This class is designed to aid the handling of the 'user focus' on graphical areas. As the user moves the mouse pointer around the display and clicks on the various rendered objects, the system automatically records the object that has the current focus, and notifies those that do not. If you're in a situation where you need to respond to the focus being lost or received, then you'll need to use the Focus class.
In order to create a functional Focus object, all you need to do is set the Object field to point to the object that you are interested in monitoring. By default, the Focus object will only take action when the focus is received. If you want to take action when the focus is lost, set the Lost field to TRUE. When the Focus object receives a positive notification of change, it will do two things:
The following example creates a render object that has the focus, then self-destructs when the focus is lost (which will occur when the user clicks on something else):
<render name="drawable" x="10" y="10" width="100" height="100"> <focus object="[container]" lost> <action static call="free" object="[drawable]"/> </focus> <action call="focus" object="[container]"/> <render>
If you require more examples, the best idea is to search some of the existing DML files that are distributed with Athene.
The Focus object consists of the following public fields:
Drawable Determines the drawable to use for frame setting. Frame Setting this field allows the object to alter rendered frames. Lost Set to TRUE if the Focus object should pay attention to focus loss. Object Set this field to determine what object is to be monitored for the focus.
Field: | Frame | |
Short: | Setting this field allows the object to alter rendered frames. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Lost | |
Short: | Set to TRUE if the Focus object should pay attention to focus loss. | |
Type: | BOOLEAN | |
Status: | Read/Write | |
|
Field: | Object | |
Short: | Set this field to determine what object is to be monitored for the focus. | |
Type: | OBJECTID | |
Status: | Read/Write | |
|