Label Component
insert a label in a worksheet or document
Description
Component Palette Image
Label Properties
Label Component Examples
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.
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
string
enabled
true or false
fillcolor
color
fontcolor
image
name or string
pixelheight
positive integer
pixelwidth
tooltip
type
usespecifiedsize
usespecifiedwidth
visible
visiblecharacterwidth
The text that appears in the label. By default, the value is Label.
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.
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.
Specifies the font color of the component. The default value is [0,0,0] which corresponds to black.
The image that appears on the label.
The height of the image in pixels.
The width of the image in pixels.
The text that appears when the user hovers the mouse over the label.
The type of the component. This returns "Label".
Whether the specified size of the image is used. By default, the value is false.
Whether the specified character width is used. By default, the value is false.
Specifies if the label is visible. By default, the value is true.
The number of characters that appear in the label. This option only applies when usespecifiedwidth is set.
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:
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.
Click the Label component to display the Label context panel.
In the Caption field, enter Differentiation Help.
To launch the differentiation tutor when you click on the button component:
Click the Button component to display the Button context panel.
In the Caption field, enter Run Tutor.
Click on Run Tutor, and then, from the context panel, select Edit Click Code.
This launches the Code Editor dialog.
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.
Click or from the File menu, select Save Code to accept all changes.
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)):
See Also
DocumentTools
DocumentTools[GetProperty]
DocumentTools[SetProperty]
EmbeddedComponents
Maplets[Elements][Label]
Student[Calculus1][DiffTutor]
Download Help Document