
Strings are controlled with stringcontrol objects.
Definition

<stringcontrol name="..."
>
|
|
<static
>
...
</static>
|
Makes the string unmodifiable. The value is the static string itself. |
<empty
>
...
</empty>
|
If the string is empty, the value of the empty tag is written in the field. |
<nodrag
/>
|
Disables drag operations originating from the string. |
<nodrop
/>
|
Dropping strings in the field do not modify the value of the string. |
<nodragselect
/>
|
Disables text selection by mouse dragging. |
<underlineoffset
/>
|
Specifies the distance from the font baseline of an underline when underlining is enabled. |
</stringcontrol>
|
|
Interface

getFont

function getFont(
)
Retrieves the name of the font resource used when rendering the contents of the control.
Return values
(string)
The name of a font resource
hasFocus

function hasFocus(
)
Checks if the control has the keyboard focus.
Return values
(boolean)
Returns true if the control has focus and false if it does not.
isReadOnly

function isReadOnly(
)
Checks if the control is flagged as read only. This setting corresponds with the "static" definition parameter.
Return values
(boolean)
Returns true if the control has the read only flag set, false otherwise
onGainFocus

event
function onGainFocus(
)
Is called when the control gains the keyboard focus.
onLoseFocus

event
function onLoseFocus(
)
Is called when the control loses the keyboard focus.
onValueChanged

event
function onValueChanged(
)
Is called when the value of the string inside the control changes. This may result from finishing the editing of the string or the value changing externally from the control.
setFocus

function setFocus(
[state]
)
This function requests the framework to either set or reset the keyboard focus to this control.
Parameters
state (boolean) [optional]
A value of true sets the focus to this control, a false value resets the focus.
When the parameter is omitted (synonymous to passing a nil value), the value is treated as true.
setFont

function setFont(
fontname
)
Sets the name of the font resource used to render the text in the control.
Parameters
fontname (string)
The name of a font resource
setReadOnly

function setReadOnly(
state
)
Sets the read only flag of the control.
Parameters
state (boolean)
A value of true sets the read only flag and a value of false disables it.
setUnderline

function setUnderline(
state
)
Sets the underline flag.
Parameters
state (boolean)
A value of true indicates the text should be underlined. A value of false disables underlining.