Name

lcdui.textbox — Creates a text box for editing larger blocks of text.

Synopsis

lcdui.textbox -title title -text text -maxlen maxlen -type any | emailaddr | numeric | phonenumber | decimal

$textboxcmd [cget -type | -text | -maxlen | -password | -uneditable | -sensitive | -non_predictive | -initial_caps_word | -caretposition ] [ configure -type type | -text text | -maxlen maxlen | -password 1 | 0 | -uneditable 1 | 0 | -sensitive 1 | 0 | -non_predictive 1 | 0 | -initial_caps_word 1 | 0 ]

Description

The lcdui.textbox command creates a full-screen text editing widget that can be used for editing longer, multi-line chunks of text. For an in-depth look at the Java code that this command is based on, see: javax.microedition.lcdui.TextBox

There are several options governing the functionality of this widget. Note that more than one constraint may be selected at a time:

  • -password: If 1, obscure the data as it is entered.

  • -uneditable: If 1, the user is not allowed to edit the displayed text.

  • -sensitive: If 1, "indicates that the text entered is sensitive data that the implementation must never store into a dictionary or table for use in predictive, auto-completing, or other accelerated input schemes."

  • -non_predictive: Don't use the local text-completion system if this option is set.

  • -initial_caps_word: The initial letter of each word should be capitalized if this option is set.

  • -initial_caps_sentence: The initial letter of each sentence should be capitalized if this option is set.

Example

set evalcmd [lcdui.command -label Evaluate -longlabel Evaluate]
set textbox [lcdui.textbox -text {[lcdui.alert -text "hi!"] setcurrent} \
	-commandaction runCode]
$textbox setcurrent
$textbox addcommand $evalcmd

proc runCode {cmd txtbox} {
    eval [$txtbox cget -text]
}

Live example: http://www.heclbuilder.com/scripts/show/153