Dial Component - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Dial Component

Insert a dial in a Standard Maple worksheet or document.

 

Description

Image of the Components Palette Item

Image of an Inserted Dial

Dial Properties

Dial Component Example

Description

• 

The dial component performs an action or a series of actions to communicate with other embedded components when adjusting the needle in the dial, although assigning an action to a component is not required.  

• 

To perform an action when the dial, right-click (Control-click for Macintosh) the dial component, and then select Edit Value Changed Action to open the Code Editor dialog for the dial component. 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 adjusting the dial. For more information, see the Dial Component Example on this page.

• 

The dial component is customized by setting options in the Dial Properties. To open the Dial Properties, right-click (Control-click for Macintosh) the dial component, and then select Component Properties. Actions are associated with components using routines in the DocumentTools package.

• 

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

• 

The Show Axis Label and Show Axis Tick Marks properties displays an axis label and axis tick marks on the dial respectively when selected.

• 

The Update Continuously while Dragging property performs a continuous action on one or more components when selected. The Maple commands in the Action When Value Changes property must be programmed as such to perform this continuous action.

Image of the Components Palette Item

Image of an Inserted Dial

Dial Properties

• 

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

angleRange

continuousupdate

enabled

image

lower

majorTicks

minorTicks

pixelHeight

pixelWidth

showLabels

showTicks

startAngle

tooltip

upper

value

visible

x

x

x

 

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

integer

true or false

true or false

name or string

integer or floating-point number

positive integer or positive floating-point number

positive integer or positive floating-point number

positive integer

positive integer

true or false

true or false

integer

string

integer or floating-point number

integer or floating-point number

true or false

  

                                   

  

angleRange 

  

The range from 0 to 360 degrees of the dial. By default, the value is 270.

  

continuousupdate 

  

Indicates whether the component should update continuously during drag operations. By default, the value is false.

  

enabled 

  

Whether the component is enabled. If enabled is set to false, any action associated with this component cannot be initiated. By default, the value is true.

  

image

  

The image that appears on the dial.

  

lower 

  

The lower bound on the dial. By default, the value is 0.

  

majorTicks 

  

The interval between the major ticks on the dial. By default, the value is 20.

  

minorTicks 

  

The interval between the minor ticks on the dial. By default, the value is 10.

  

pixelHeight 

  

The height of the dial image in pixels.

  

pixelWidth 

  

The width of the dial image in pixels.

  

showLabels 

  

Indicates if labels are shown. By default, the value is false.

  

showTicks 

  

Indicates if tick marks are shown. By default, the value is true.

  

startAngle

  

The start angle from 0 to 360 degrees for the dial. By default, the value is 45.  

  

tooltip 

  

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

  

upper 

  

The upper bound on the dial. By default, the value is 100.

  

value 

  

The current position of the dial marker. By default, the value is 0.

  

visible 

  

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

Dial Component Example

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

This example shows how you can alter a Meter component using a Dial component.

 

1. 

Insert a Dial component and a Meter component using the Components palette.  For information on displaying the Maple palettes, see the Show Palettes help page.

2. 

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

3. 

Adjust the size of the Dial by entering 180 for both Width in Pixels and Height in Pixels.

Note: To use the entire area of the dial, change Start angle to 0 and Angle range to 360 degrees.

4. 

Click Change and then Clear to remove the default blue dial. To select a different image, click Select.

5. 

Click OK to save changes.

6. 

Right-click (Control-click for Macintosh) the Dial component, and then select Edit Value Changed Action.

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

7. 

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

Do(%Meter0=%Dial0);

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

8. 

From the File menu, select Save Code to accept all changes.

9. 

From the File menu, select Close Code Editor.

When you change the value of the Dial component by turning it, the value on the Meter component changes accordingly.

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

DocumentTools[Do](%Meter0=%Dial0);

See Also

ButtonComponent

CheckBoxComponent

ComboBoxComponent

DataTableComponent

DocumentTools

DocumentTools[Do]

DocumentTools[GetProperty]

DocumentTools[SetProperty]

EmbeddedComponents

LabelComponent

ListBoxComponent

MathExpressionComponent

MeterComponent

PlotComponent

RadioButtonComponent

RotaryGaugeComponent

SliderComponent

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