Text Area Component - Maple Help

DocumentTools[Components]

 TextArea
 generate XML for a TextArea Component

 Calling Sequence TextArea( str, opts )

Parameters

 str - (optional) string; string of text opts - (optional) ; one or more keyword options as described below

Options

 • action : string; A string which parses to one or more valid statements in 1-D Maple Notation. These statements form the Value Changed Action Component Code that executes when the TextArea selection is manually adjusted.
 • depth : posint:=1; The number of visible rows.
 • editable : truefalse; Indicates whether the text can be edited.
 • enabled : truefalse; Indicates whether the component is enabled. The default is true. If enabled is false then the inserted component is grayed out and interaction with it cannot be initiated.
 • fillcolor : {list(nonnegint),symbol,string}:=[255,255,255] ; Specifies the background color of the component. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [255,255,255] which corresponds to white.
 • fontcolor : {list(nonnegint),symbol,string}:=[0,0,0] ; Specifies the font color of the component. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [0,0,0] which corresponds to black.
 • identity : {name,string}; The reference name of the component.
 • showborders : truefalse; Indicates whether the borders of the component are shown.
 • tooltip : string; The text that appears when the mouse pointer hovers over the component.
 • visible : truefalse; Indicates whether the component is visible. The default is true.
 • width : posint:= 10; The number of visible characters per line.
 • wrap : truefalse; Indicates whether the text is wrapped across lines.

Description

 • The TextArea command in the Component Constructors package returns an XML function call which represents a TextArea Component.
 • The generated XML can be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document can be inserted into the current document using the InsertContent command.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Components}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Layout}\right):$
 > $s≔"This is some text."$
 ${s}{≔}{"This is some text."}$ (1)

Executing the TextArea command produces a function call.

 > $T≔\mathrm{TextArea}\left(s,\mathrm{identity}="TextArea0"\right)$
 ${T}{≔}{\mathrm{_XML_EC-TextArea}}{}\left({"id"}{=}{"TextArea0"}{,}{"visiblecharacterwidth"}{=}{"10"}{,}{"visiblerows"}{=}{"1"}{,}{"contents"}{=}{"This is some text."}{,}{"editable"}{=}{"true"}{,}{"enabled"}{=}{"true"}{,}{"password"}{=}{"false"}{,}{"show-border"}{=}{"true"}{,}{"visible"}{=}{"true"}{,}{"fillcolor"}{=}{"\left[255,255,255\right]"}{,}{"fontcolor"}{=}{"\left[0,0,0\right]"}{,}{"wrapping"}{=}{"true"}\right)$ (2)

By using commands from the DocumentTools:-Layout package a nested function call can be produced which represents a worksheet.

 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(T\right)\right)\right)\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$

The previous example's call to the InsertContent command inserted a component with identity "TextArea0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "TextArea0" incurs a substitution of the input identity in order to avoid a conflict with the identity of the existing component.

 > $s≔"Every individual is equal before and under the law and has the right to the equal protection and equal benefit of the law without discrimination and, in particular, without discrimination based on race, national or ethnic origin, colour, religion, sex, age or mental or physical disability.":$
 > $T≔\mathrm{TextArea}\left(s,\mathrm{identity}="TextArea0",\mathrm{width}=46,\mathrm{depth}=4,\mathrm{showborders}=\mathrm{true},\mathrm{fillcolor}="Orange",\mathrm{fontcolor}="DarkBlue"\right):$
 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(T\right)\right)\right)\right):$

The return value of the following call to InsertContent is a table which can be used to reference the substituted identity of the inserted component.

 > $\mathrm{lookup}≔\mathrm{InsertContent}\left(\mathrm{xml},\mathrm{output}=\mathrm{table}\right)$
 ${\mathrm{lookup}}{≔}{table}{}\left(\left[{"TextArea0"}{=}{"TextArea1"}\right]\right)$ (3)

 > $\mathrm{lookup}\left["TextArea0"\right]$
 ${"TextArea1"}$ (4)
 > $\mathrm{GetProperty}\left(\mathrm{lookup}\left["TextArea0"\right],\mathrm{editable}\right)$
 ${"true"}$ (5)
 > 

Compatibility

 • The DocumentTools:-Components:-TextArea command was introduced in Maple 2015.