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

Online Help

All Products    Maple    MapleSim


Label Component

insert a label in a worksheet or document

 

Description

Component Palette Image

Label Properties

Label Component Examples

Description

• 

The label component can display a caption or an image.  

• 

The label component is customized by setting options in the Label context panel. To display the options in the context panel, select the embedded component. Actions are associated with components using routines in the DocumentTools package.

• 

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

Component Palette Image

Label Properties

• 

The following table describes the control and use of the label 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

caption

x

x

string

enabled

x

x

true or false

fillcolor

x

x

color

fontcolor

x

x

color

image

 

x

name or string

pixelheight

x

x

positive integer

pixelwidth

x

x

positive integer

tooltip

x

x

string

type

x

 

string

usespecifiedsize

x

x

true or false

usespecifiedwidth

x

x

true or false

visible

x

x

true or false

visiblecharacterwidth

x

x

positive integer

  

 

  

caption 

  

The text that appears in the label.  By default, the value is Label.

  

enabled 

  

Whether the component is enabled. If enabled is set to false, the component is grayed out and any action associated with it cannot be initiated. 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.

  

image 

  

The image that appears on the label.

  

pixelheight 

  

The height of the image in pixels.

  

pixelwidth 

  

The width of the image in pixels.

  

tooltip 

  

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

  

type 

  

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

  

usespecifiedsize 

  

Whether the specified size of the image is used. By default, the value is false.

  

usespecifiedwidth 

  

Whether the specified character width is used. By default, the value is false.

  

visible 

  

Specifies if the label is visible. By default, the value is true.

  

visiblecharacterwidth 

  

The number of characters that appear in the label. This option only applies when usespecifiedwidth is set.

Label Component Examples

  

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

  

This example launches Student[Calculus1][DiffTutor] and returns the derivative of the function to an embedded Mathematical Expression component.

To insert the components and set the caption for the label component:

1. 

Insert a Label component, a Button 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 the Label component to display the Label context panel.

3. 

In the Caption field, enter Differentiation Help.

To launch the differentiation tutor when you click on the button component:

1. 

Click the Button component to display the Button context panel.

2. 

In the Caption field, enter Run Tutor.

3. 

Click on Run Tutor, and then, from the context panel, select Edit Click Code.

This launches the Code Editor dialog.

4. 

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

a := Student[Calculus1][DiffTutor](sin(x)*cos(x));

SetProperty("MathContainer0", value, a);

Note: Ensure the component name (that is, MathContainer0) is correct.

5. 

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

6. 

From the File menu, select Close Code Editor.

When you click on Run Tutor, the Student[Calculus][DiffTutor] dialog opens. From here you can solve a differentiation problem step-by-step. When you close the dialog, the result from the tutor is displayed in the math expression component.

  

 

with(DocumentTools):

  

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

a:=Student[Calculus1][DiffTutor](sin(x)*cos(x)):

SetProperty("MathContainer0", value, a);

 

See Also

DocumentTools

DocumentTools[GetProperty]

DocumentTools[SetProperty]

EmbeddedComponents

Maplets[Elements][Label]

Student[Calculus1][DiffTutor]