EZText is a wrapper class which creates an (optional) StaticText, and a TextField. The value is displayed as a compileString in the text field for editing.
If the parent is nil
, then EZText will create its own Window. See EZGui for more options.
parent |
The parent view or window. If the parent is nil, then EZText will create its own Window, and place it conveniently on the screen if the bounds are a Point. If the bounds are a Rect, then the Rect determines the window bounds. |
bounds | |
label |
The label. Default value is |
action |
A Function called when the value changes. The function is passed the EZText instance as its argument. |
initVal |
The value to initialize the EZText with. |
initAction |
A Boolean indicating whether the action function should be called when setting the initial value. The default is false. |
labelWidth |
Number of pixels width for the label. The default is 60. In the |
textWidth |
Number of pixels width for the number box. The default is 45. In |
labelHeight |
Default is 20. |
layout |
|
gap |
A Point. By default, the view tries to get its parent's gap, otherwise it defaults to |
margin |
A Point. This will inset the bounds occupied by the subviews of view. |
Example:
The contained views can be accessed via the EZText instance variables: labelView
, textField
.
Returns the textField.
A Function to be evaluated when the value changes. Typical use is to type in a new value, and interpret it by hitting the evaluation shortcut. The first argument to the function will be the EZText.
Gets/sets the value of the ezText. Does not perform the action.
inval |
Any object. |
Sets the value and performs the action.
val |
Any object. |
Performs the action.
stringBackground |
An instance of Color. The |
stringColor |
An instance of Color. The |
textBackground |
An instance of Color. The |
textStringColor |
An instance of Color. The |
textNormalColor |
An instance of Color. The |
textTypingColor |
An instance of Color. The |
background |
An instance of Color. The |