Name: | Input |
Version: | 1.0 |
ID: | ID_INPUT |
Status: | Beta |
Category: | GUI |
Date: | January 2004 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems, 2003-2004. All rights reserved. |
Short: | The Input class manages the display and interactivity of user input boxes. |
The Input class simplifies the creation and management of input boxes as part of the user interface. New input areas can be created by specifying as little as the graphical dimensions for the box area. The Input class allows for the specifics of the graphics to be altered, such as the colours and the font used.
The definitions for new input boxes are loaded by default from the environment file "templates:inputdef.xml". You can change the template file prior to initialisation by setting the Template field. Note that any values set in the template will override your original field settings for the input object.
You may need to set the object up so that when the user clicks or tabs away from the input box, it performs an action. There are three accepted methods that you can use to achieve this. The first is to set the ActionScript field so that it refers to a script that executes when the input box is activated. The second is to initialise child objects to the input object and they will be executed on activation. The third option is to listen to the Activate action by calling the SubscribeAction() function on the input.
The following example illustrates how you might create an input box in DML. Notice that the Set object is initialised as static and will be executed when the input object is activated:
<input xoffset="[window.leftmargin]" yoffset="[window.bottommargin]" text="Hello World" width="70"> <set static object="[text]" &string="[owner.text]"/> </input>
The Input class supports the following actions:
Activate Activates the input object's response mechanism. Disable Turns the input box off. Enable Turns the input box back on if it has previously been disabled. Focus Sets the focus on the input box. Hide Removes the input box from the display. MoveToBack Moves the input box to the back of the display area. MoveToFront Moves the input box to the front of the display area. Redimension Changes the size and position of the input box. Resize Alters the size of the input box. Show Puts the input box on display.
The Input object consists of the following public fields:
ActionScript Script to be executed when the input box is clicked. Bottom The bottom coordinate of the input box. Colour String-based field for setting the colour inside of the input box. ColourRGB Defines the internal colour of the input box in RGB format. Drawable The drawable that will contain the input graphic. EnterFrame The graphics frame to display when the user's pointer enters the input area. ExitFrame The graphics frame to display when the user's pointer leaves the input area. Flags Optional flags may be set here. FocusActivate If set to TRUE, the input box will automatically activate itself if the user leaves the input area. FocusFrame The graphics frame to display when the input box has the focus. Height Defines the height of an input box. Highlight String-based field for setting the border highlight. HighlightRGB Defines border highlight of the input box, in RGB format. Label The label is a string displayed to the left of the input area. LabelWidth The width of the input label. Raised If set to TRUE the input box will appear to be raised into the foreground. Region The drawable that represents the input box is referenced through this field. ReleaseFrame The graphics frame to display when the input box loses the focus. Right The right-most coordinate of the input box. Shadow String-based field for setting the input box shadow. ShadowRGB Defines the border shadow of the input box, in RGB format. String The string that is to be printed inside the input box is declared here. Sunken Set to TRUE to make the input box appear to sink into the background. TabFocus Setting this field to a valid TabFocus object will cause the input to add itself to the tab list. Template Defines the makeup of the input using a pre-defined template. Thickness The thickness of the input border. Width Defines the width of a input. XCoord The horizontal position of a input. XOffset The horizontal offset of a input. YCoord The vertical position of a input. YOffset The vertical offset of a input.
Field: | Bottom | |
Short: | The bottom coordinate of the input box. | |
Type: | LONG | |
Status: | Get | |
|
Field: | Colour | |
Short: | String-based field for setting the colour inside of the input box. | |
Type: | STRING | |
Status: | Set | |
|
Field: | ColourRGB | |
Short: | Defines the internal colour of the input box in RGB format. | |
Type: | RGB | |
Status: | Read | |
|
Field: | Drawable | |
Short: | The drawable that will contain the input graphic. | |
Type: | OBJECTID | |
Status: | Read/Init | |
|
Field: | EnterFrame | |
Short: | The graphics frame to display when the user's pointer enters the input area. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | ExitFrame | |
Short: | The graphics frame to display when the user's pointer leaves the input area. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Flags | |||||||||||||||||||
Short: | Optional flags may be set here. | |||||||||||||||||||
Type: | LONG | |||||||||||||||||||
Status: | Read/Init | |||||||||||||||||||
|
Field: | FocusActivate | |
Short: | If set to TRUE, the input box will automatically activate itself if the user leaves the input area. | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | FocusFrame | |
Short: | The graphics frame to display when the input box has the focus. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Height | |
Short: | Defines the height of an input box. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | Highlight | |
Short: | String-based field for setting the border highlight. | |
Type: | STRING | |
Status: | Set | |
|
Field: | HighlightRGB | |
Short: | Defines border highlight of the input box, in RGB format. | |
Type: | RGB | |
Status: | Read | |
|
Field: | Label | |
Short: | The label is a string displayed to the left of the input area. | |
Type: | STRING | |
Status: | Get/Set | |
|
Field: | LabelWidth | |
Short: | The width of the input label. | |
Type: | LONG | |
Status: | Read/Set | |
|
Field: | Raised | |
Short: | If set to TRUE the input box will appear to be raised into the foreground. | |
Type: | BOOLEAN | |
Status: | Write | |
|
Field: | Region | |
Short: | The drawable that represents the input box is referenced through this field. | |
Type: | OBJECTID | |
Status: | Read | |
|
Field: | ReleaseFrame | |
Short: | The graphics frame to display when the input box loses the focus. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Right | |
Short: | The right-most coordinate of the input box. | |
Type: | LONG | |
Status: | Get | |
|
Field: | Shadow | |
Short: | String-based field for setting the input box shadow. | |
Type: | STRING | |
Status: | Set | |
|
Field: | ShadowRGB | |
Short: | Defines the border shadow of the input box, in RGB format. | |
Type: | RGB | |
Status: | Read | |
|
Field: | String | |
Short: | The string that is to be printed inside the input box is declared here. | |
Type: | STRING | |
Status: | Get/Set | |
|
Field: | Sunken | |
Short: | Set to TRUE to make the input box appear to sink into the background. | |
Type: | BOOLEAN | |
Status: | Write | |
|
Field: | TabFocus | |
Short: | Setting this field to a valid TabFocus object will cause the input to add itself to the tab list. | |
Type: | OBJECTID | |
Status: | Set | |
|
Field: | Template | |
Short: | Defines the makeup of the input using a pre-defined template. | |
Type: | STRING | |
Status: | Init | |
|
Field: | Thickness | |
Short: | The thickness of the input border. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Width | |
Short: | Defines the width of a input. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | XCoord | |
Short: | The horizontal position of a input. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | XOffset | |
Short: | The horizontal offset of a input. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | YCoord | |
Short: | The vertical position of a input. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | YOffset | |
Short: | The vertical offset of a input. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|