Text Area Component - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Text Area Component

Insert a text area in a Standard Maple worksheet or document.

 

Description

Component Palette Image

Text Area Properties

Text Area Component Example

Description

• 

The text area component performs an action or a series of actions to communicate with other embedded components when the contents in the text area change.

• 

To perform an action when the contents in the text area change, click the text area, and then select Edit Content Changed Code to open the Code Editor dialog for the text area. Enter the commands you want to perform in the Code Editor dialog.

• 

You need to specify one or more embedded components that will display the output when the text area content changes. For more information, see the Text Area Component Example on this page.

• 

The text area component is customized by setting options in the Text Area context panel. To open the Text Area context panel, click the text area. Actions are associated with components using routines in the DocumentTools package.

• 

The Name property is used to reference the text area when using the routines from the DocumentTools package.

• 

The Automatic Text Wrapping option is only available for multi-line text area components (when the number of visible rows is greater than 1).

• 

The Password option only changes the visibility of the input characters in the text area by displaying them as black circles.  You can still retrieve the text using DocumentTools[Do] or DocumentTools[GetProperty], and there is no encryption on the retrieved text. The Password option is not available for multi-line text areas.

Component Palette Image

Text Area Properties

• 

The following table describes the control and use of the text area component options.

  

An x in the Get column indicates that the option can be read, that is, retrieved by using the DocumentTools[GetProperty] tool.

  

An x in the Set column indicates that the option can be written, that is, set by using the DocumentTools[SetProperty] tool.

  

 

Option

Get

Set

Option Type

editable

x

x

true or false

enabled

x

x

true or false

fillcolor

x

x

color

fontcolor

x

x

color

password

x

x

true or false

showborders

x

x

true or false

tooltip

x

x

string

type

x

 

string

value

x

x

string

visible

x

x

true or false

visiblecharacterwidth

x

x

positive integer

visiblerows

x

x

positive integer

wrapping

x

x

true or false

  

 

  

editable 

  

Indicates whether the contents are editable. By default, the value is true.

  

enabled

  

Indicates whether the component is enabled. If enabled is set to false, the text area is dimmed and you cannot modify, select, or copy its contents. (If enabled is set to false, the value of editable is ignored.)  By default, the value is true.

  

fillcolor

  

Specifies the background color of the component. The color can be given by RGB values (a list of three integers between 0 and 255) or a string representing a color name, for example, [255,0,0] or “Red”. The default value is [255,255,255] which corresponds to white.

  

fontcolor

  

Specifies the font color of the component.  The default value is [0,0,0] which corresponds to black.

  

password 

  

Setting this option to true causes input to be displayed as black circles in place of the actual contents of the field.

  

showborders

  

Specifies if the border of the component is visible. By default, the value is true.

  

tooltip

  

The text that appears when the user hovers the mouse over the text area.

  

type 

  

The type of the component. This returns "TextArea".

  

value

  

The content in the text area.

  

visible

  

Specifies if the text box is visible. By default, the value is true.

  

visiblecharacterwidth

  

The number of visible characters that appear in a row. By default, the value is 10.

  

visiblerows

  

The number of rows that appear in the text area. By default, the value is 1.

  

In a multi-line text area component (when visiblerows is greater than 1), if the number of rows of content exceeds the number of visible rows, a scroll bar appears.

  

wrapping

  

Indicates whether content on one line of the text area which exceeds the horizontal space will automatically wrap to the next line. By default, the value is true.

Text Area Component Example

  

Note: To interact with the examples provided below, open this help page as a worksheet.

  

This example uses a Text Area component and a Mathematical Expression component. When you enter an expression in the text area, the expression is displayed as 2-D Math in the math expression component.

To insert the components and enter the defaults contents for the text area:

1. 

Insert a Text Area component and a Mathematical Expression component using the Components palette. For information on displaying the Maple palettes, see the Show Palettes help page.

2. 

Click in the text area component and type Int(x^2/sin(x), x);.

3. 

Click outside the Text Area component.

4. 

Change the value for the Visible Character Width to 25.

To display the contents of the text area as 2-D Math in the math expression component:

1. 

Click the text area, and then select Edit Content Changed Code.

This launches the Code Editor dialog.

2. 

Before the end use; statement in the dialog, enter the following command:

SetProperty("MathContainer0", value, parse(GetProperty("TextArea0", value)));

Note: Ensure the names of the components are correct (that is, that they match the Name fields for their components).

3. 

Click  or from the File menu, select Save Code to accept all changes.

4. 

From the File menu, select Close Code Editor.

Enter an expression in the text area. When you press Enter or click anywhere in the worksheet outside of the text area, the expression you entered displays as 2-D Math in the math expression component.

  

 

 

with(DocumentTools):

You can verify the syntax of the embedded component action by executing the command in the worksheet.

SetProperty("MathContainer0", value, parse(GetProperty("TextArea0", value)));

 

See Also

DocumentTools

DocumentTools[GetProperty]

DocumentTools[SetProperty]

EmbeddedComponents