True if there is some text and it passed any validation function. If there is no text then this will be false.
The unique identifier for this control.
This is true if the control can respond to UI events else false.
Use enable() and disable() to enable and disable it.
This is true if the control background is opaque else false.
Use opaque() and transparent() display / hide the background.
True if the text has passed validation. If there is no validation function this is always true.
This is true if the control is visible else false.
Use hide() and show() to set visibility.
The type name for this control.
(type name = class name without the Cvs prefix)
Add a child to this control using its relative position [rx, ry]. If rx and ry are not provided then it uses the values set in the child.
this control
is the actual control or its id
Optional rx: numberOptional ry: numberGet or set the corner radii used for this control.
To set the radii the parameters must be one of the following
If no parameter is passed or does not match one of the above then an array of the currently used radii values.
an array of the currently used radii values
Rest ...c: anyvalid radii combination
Disables this control.
this control
Optional cascade: booleanif true disable child controls
Enables this control.
this control
Optional cascade: booleanif true enable child controls
Make this control invisible.
this control
Optional cascade: booleanif true hide children
Set a unique index number for this text field.
this control
unique index number
Optional deltaIndex: numberrelative link when using up/down arrow keys
Remove this control from its parent
this control
Move this control relative to current position.
this control
horizontal distance
vertical distance
Move this control to an absolute position.
this control
horizontal position
vertical position
Removes the link index from this textfield. After this it will not be possible to move focus to this textfield using the keyboard arrows.
this control
Makes the controls background opaque. The actual color depends on the controls color scheme.
The second parameter, alpha, is optional and controls the level of opaqueness from 0 - transparent to 255 - fully opaque (efault value).
this control
alpha value for controls background color.
Sets this controls display orientation to one of the four cardinal compass points. An invalid parameter will set the orientation to 'east' which is the default value.
this control
'north', 'south', 'east' or 'west'
Adds this control to another control which becomes its parent.
this control
is the parental control or its id
Optional rx: numberx position relative to parent
Optional ry: numbery position relative to parent
Remove a child control from this one so that it stays in same screen position.
this control
the control to remove or its id
If the name of a valid color scheme is provided then it will use it to display the control, non-existant scheme names will be ignored. In both cases this control is returned.
If there is no parameter it returns the name of the current color scheme used by this control.
this control or the control's color scheme
Optional name: stringthe color scheme name e.g. 'blue'
Optional cascade: booleanif true propogate scheme to all child controls.
This sets the event handler to be used when this control fires an event. The parameter can take one of three forms:
this control
the function to handle this control's events.
If the text is invalid this method sets the text as being valid and change the visual appearance accordingly. This will remain in effect until the next time the text is validated.
this control
Make this control visible.
this control
Optional cascade: booleanif true show children
Shrink the control to fit contents.
To shrink on one dimension only pass either 'w' (width) or 'h' (height) to indicate which dimmension to shrink
this control
Optional dim: stringthe dimension to shrink
Gets or sets the current text. Any EOL characters are stripped out of the string. If necessary the string length will be reduced until it will fit inside the textfield. If a validation function has been set then the string will be validated.
this control for setter
Optional t: stringa string representing text to display
Sets or gets the text font for this control.
If the parameter is true-type-font or the name of a system font it will be used as the local font and this control will be returned.
Recognised font names are :-
'arial' 'verdana' 'tahoma' 'trebuchet ms' 'times new roman' 'georgia' 'courier new' 'brush script mt' 'impact' 'serif' 'sans-serif' 'monospace'
Invalid fonts are ignored and the local font is unchanged.
If no parameter is passed then the current local font is returned.
this control
Optional ltf: anyA true-type-font or the name (case-insensitive) of a valid system font.
If there are no paremeters return the currently used text size for this control, otherwise set the text size to use.
this control or the current text size
the text size to use
Sets or gets the local text style.
The 4 recognised font styles are :-
NORMAL BOLD ITALIC BOLDITALIC
Unrecognized styles are ignored and the local style is unchanged.
If no parameter is passed then the current style is returned.
this control
Optional gty: stringthe font style to use.
Sets the size of the text to use in the tooltip.
Optional tsize: numbertext size for this tooltip
Create a tooltip for this control.
this control
the text to appear in the tooltip
Makes the controls background fully transparent.
this control
Set the validation function to be used for this control.
The function is created by the user and should return an array of
two elements e.g. [valid, valid-text]
valid is a boolean indicating if the text is valid and
valid-text can be the original text or amended in some way.
For instance a textfield used for getting a persons name will be valid if there are 2 or more words and the valid-text will be the name but with the first letter of each word being capatilised.
this control
the validation function
Generated using TypeDoc
This class supports a single line text entry field.
The left/right arrow keys move the text-insertion-point within the text. Used in combination with the shift key it enables part or all of the text to be selected. The entire text can be selected with the Ctrl+A or Cmd+A keys.
Selected text can be copied with the Ctrl+C or Cmd+C keys and pasted at the current text-insertion-point with the Ctrl+V or Cmd+V keys. The Ctrl+X or Cmd+X keys will cut (and copy) the selected text.
If no text is selected then the arrows keys can move off the current control to another. This only works if each textfield has a unique index number (>0;).
If the control has the index value 'idx' then the next control depends on the arrow key pressed -
left : idx - 1
right : idx + 1
up : idx - offset
down : idx + offset
The offset value is set when initialising the idx value with the
index(idx, deltaIndex)method.No other controls can be used while a textfield control is active. Pressing 'Enter' or attempting to move to a non-existant textfield deactivates the current textfield.
The user can provide their own validation function which is checked when the control is deativated.