BB___TEXTBOX

=TEXTBOX= toc

Description
> The TEXTBOX is a //control// on a GUI window on which a single line of text can be displayed and/or edited. It is typically used for getting user INPUT.

Textbox Features
>> code format="lb" code >> code format="lb" code > or by the user selecting and deleting the text. Printing a new string to the textbox will clear the original text.
 * **//Display Text//.**Text is displayed by printing a literal text string or a string variable:
 * 1) handle.ext "a text string"
 * 2) handle.ext aStringVariable
 * **//No Word Wrap.//** Because a textbox only displays a single line, there is no word wrapping. The line can be as long as you like, or as long as necessary, and even though it will not fully display in the textbox, its value is still retained in the variable the text is assigned to.
 * **//Clear Text//.**Text is cleared by printing an empty string,
 * 1) handle.ext ""
 * **//The Dead Textbox Problem//.** Be sure that the textbox **height** is enough to display the text in the current font, else the text may not display and the textbox will appear to be "dead". Also, too many controls on a window can sometimes make it appear as though a textbox is dead.

Textbox Commands
The following commands (Methods) can be used with textbox controls. See the individual pages for discussion. print #handle.ext, "!contents? varName$" print #handle.ext, "!disable" print #handle.ext, "!enable" print #handle.ext, "!setfocus" print #handle.ext, "!font fontName pointsize"

Textbox Variables
The following variables can be used with textbox controls. See the individual pages for discussion. TextboxColor$

Example
code format="lb" nomainwin

WindowWidth = 350 WindowHeight = 90

textbox #hndl.txt, 20, 10, 260, 25 button #hndl, "OK", [titleGraph], LR, 5, 0

open "What do you want to name this graph?" for window_nf as #hndl #hndl "trapclose [quit]"

print #hndl.txt, "untitled"

[mainLoop] 'wait until user enters a name in the textbox wait

[titleGraph] print #hndl.txt, "!contents? graphTitle$" 'graph name is now stored in variable graphTitle$

notice "The title for your graph is: "; graphTitle$

[quit] close #hndl end code

Useful Functions
code format="lb" Place a useful function using this command here code