Label Component - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Document Tools : Embedded Components : LabelComponent

Label Component

• 

The label component defines a label in a Standard Maple worksheet or document. The label component can display a caption or an image.  

• 

The label component is customized by setting options in Label Properties. To display Label Properties, right-click (Control-click for Macintosh) the embedded component and select Component Properties. 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 G column indicates that the option can be read, that is, retrieved by using the DocumentTools[GetProperty] tool.

  

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

Option                G  S  Option Type      
                                             
caption               x  x  string           
enabled               x  x  true or false    
image                    x  name or string   
pixelHeight           x  x  positive integer
pixelWidth            x  x  positive integer
tooltip               x  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.

  

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.

  

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. 

Right-click the Label component, and then select Component Properties.

3. 

In the Caption field, enter Differentiation Help, and then click OK.

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

1. 

Right-click the Button component, and then select Component Properties.

2. 

In the Caption field, enter Run Tutor, and then click OK.

3. 

Right-click (Control-click for Macintosh) on Run Tutor, and then select Edit Click Action.

This launches the Code Editor dialog with preset statements and additional information on how to program actions between embedded components.

4. 

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

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

Do(%MathContainer0=a);

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

5. 

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.

  

 

  

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)):

DocumentTools[Do](%MathContainer0 = a);

ⅆⅆxsinxcosx=cosx2sinx2

(3.1)

See Also

ButtonComponent, CheckBoxComponent, ComboBoxComponent, DataTableComponent, DialComponent, DocumentTools, DocumentTools[Do], DocumentTools[GetProperty], DocumentTools[SetProperty], EmbeddedComponents, ListBoxComponent, MathExpressionComponent, MeterComponent, PlotComponent, RadioButtonComponent, RotaryGaugeComponent, SliderComponent, Student[Calculus1][DiffTutor], TextAreaComponent, ToggleButtonComponent, VideoPlayerComponent, VolumeGaugeComponent


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam