Preview #
About #
GraffitiTextField is an enhanced functionality TextField and TextArea host control that provides the following advanced functionality:
- Unfocused text alignment
- Autocomplete
- Extensive custom colorization
- Embedded icon
- Embedded clear button
- Dropdown menu support (via GraffitiMenuItem)
- Animated pulsing for drawing users’ attention
- Unvalidated, Valid, and Invalid state displays
- Bordered or Solid display types
- And more…
Enumerations #
Name | Values |
---|---|
IconPositions | Left Right |
States | Unvalidated Valid Invalid |
Types | Bordered Solid |
Constants #
This class exposes no constants.
Events #
Name | Parameters | Return Type | Description |
---|---|---|---|
ClearPressed | None | Boolean | Raised when the user presses the clear button. Return True to cancel default action of clearing the value text. |
IconPressed | None | None | Raised when the user presses the icon. |
KeyPressed | key as String | Boolean | Raised when the user presses a keyboard key. Return True to cancel default action. |
MenuItemSelected | item as GraffitiMenuItem | None | Raised when the user selects an item from the dropdown menu. |
ReturnPressed | None | Boolean | Raised when the user presses the Return key. Return True to cancel default action. |
TextChanged | None | None | Raised when the content of the input control has changed. |
Methods #
This class exposes no methods.
Properties #
Name | Type | Default Value | Description |
---|---|---|---|
Alignment | MobileTextControl.Alignments | MobileTextControl.Alignments.Default | Alignment of the text relative to the outer bounds of the control. |
Autocomplete | Boolean | False | When enabled and values are provided to the AutocompleteValues property, the control will attempt to autocomplete user input based on those values. |
BackgroundColor | ColorGroup | Nil | Custom background color. |
BorderColor | ColorGroup | Nil | Custom border color. |
BorderRadius | Integer | 8 | Size, in points, of the border’s corner radii. |
BorderSize | Integer | 1 | Size, in points, of the border. |
ClearButtonColor | ColorGroup | Nil | Custom clear button color. |
ClearButtonSize | Integer | 12 | Dimensions used to draw the clear button. |
Font | Font | Font.SystemFont | Font used for drawing the text and applied to the hosted MobileTextControl. |
HasBorder | Boolean | True | Controls the visibility of the border. |
HasClearButton | Boolean | False | Controls the visibility of the clear button when the hosted control does not have focus. |
Hint | String | “” | Placeholder text that is drawn when the hosted control does not have focus and has no text value. |
HintColor | ColorGroup | Nil | Custom color used to draw the Hint text. |
Icon | Picture | Nil | Icon picture to be drawn within the control. |
IconColor | ColorGroup | Nil | Custom color overlaid on Icon when IconColorized = True. |
IconColorized | Boolean | False | When True, the icon will be colorized to match the content or using the IconColor property value. |
IconPosition | GraffitiTextField.IconPositions | GraffitiTextField.IconPositions.Left | Location of the icon within the display. |
IconSize | Integer | 16 | Size, in points, to use when drawing the icon. |
InputControl (Read-Only) | MobileTextControl | Automatic | Returns a reference to the currently active, hosted control. Either MobileTextArea or MobileTextField. |
IsPulsing | Boolean | False | Control will display a pulsing animation when True. Useful for drawing users’ attention to the control. |
Menu (Read-Only) | GraffitiMenuItem | Automatic | The parent GraffitiMenuItem of all items that the developer wishes to display in the menu dropdown. |
MenuIconSize | Integer | 12 | Size, in points, to use when drawing the menu icon. |
Multiline | Boolean | False | Controls various aspects of display and functionality. |
ReadOnly | Boolean | False | When True, users will not be able to modify the value of the control by direct input. |
State | GraffitiTextField.States | GraffitiTextField.States.Unvalidated | Controls the displayed validation state. |
StateInvalidColor | ColorGroup | Nil | Custom color to use when drawing the Invalid state. |
StateUnvalidatedColor | ColorGroup | Nil | Custom color to use when drawing the Unvalidated state. |
StateValidColor | ColorGroup | Nil | Custom color to use when drawing the Valid state. |
Text | String | “” | Text value of the control. |
TextColor | ColorGroup | Nil | Custom text color when editing the control’s value or when a value exists and the control does not have focus. |
Type | GraffitiTextField.Types | GraffitiTextField.Types.Bordered | Controls how the component is drawn. |
Notes #
Accessing Other Functionality #
The InputControl property can be used to obtain a reference to the embedded MobileTextControl, which can then be cast to MobileTextArea or MobileTextField to directly modify that control or access its member functions and properties. This allows, for example, changing the selection range within the control.