Volume Gauge Component - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Volume Gauge Component

Insert a volume gauge in a Standard Maple worksheet or document.

 

Description

Image of the Component Palette Item

Image of an Inserted Volume Gauge

VolumeGauge Properties

Volume Gauge Component Example

Description

• 

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

• 

To perform an action when the volume is altered, click the Volume Gauge component to open the Volume Gage context panel. and then select Edit Value Changed Code to open the Code Editor dialog for the volume gauge. 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 volume in the gauge. For more information, see the Volume Gauge Component Example on this page.

• 

The volume gauge component is customized by setting options in the Volume Gauge context panel. To view the Volume Gauge context panel, select the volume gauge. Actions are associated with components using routines in the DocumentTools package.

• 

The Name property is used to reference the volume gauge 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 volume gauge respectively when selected.

• 

The Continuous Update on Drag property performs a continuous action on one or more components when selected. The Maple commands in the Edit Value Changed Code property must be programmed as such to perform this continuous action.

Image of the Component Palette Item

Image of an Inserted Volume Gauge

VolumeGauge Properties

• 

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

continuousupdate

x

x

true or false

enabled

x

x

true or false

lower

x

x

integer or floating-point number

majorTicks

x

x

positive integer or positive floating-point number

minorTicks

x

x

positive integer or positive floating-point number

pixelHeight

x

x

positive integer

pixelWidth

x

x

positive integer

showLabels

x

x

true or false

showTicks

x

x

true or false

tooltip

x

x

string

type

x

 

string

upper

x

x

integer or floating-point number

value

x

x

integer or floating-point number

visible

x

x

true or false

  

 

  

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 true, any action associated with this component cannot be initiated. By default, the value is true.

  

lower 

  

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

  

majorTicks 

  

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

  

minorTicks 

  

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

  

pixelHeight 

  

The height of the volume gauge image in pixels. By default, the value is 150.

  

pixelWidth 

  

The width of the volume gauge image in pixels. By default, the value is 110.

  

showLabels 

  

Indicates if axis range values are shown. By default, the value is true.

  

showTicks 

  

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

  

tooltip 

  

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

  

type 

  

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

  

upper 

  

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

  

value 

  

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

  

visible 

  

Specifies if the volume gauge is visible. By default, the value is true.

Volume Gauge 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 to connect a volume gauge and a dial component so that when the needle in the dial is adjusted, the volume in the volume gauge adjusts at the same time; conversely, adjusting the volume in the volume gauge causes the needle in the dial component to move.

To insert the components and configure the dial component:

1. 

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

2. 

Click the Dial component, and then select Edit Value Changed Code.

This launches the Code Editor dialog.

3. 

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

SetProperty("VolumeGauge0", value, GetProperty("Dial0", value));

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

4. 

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

5. 

From the File menu, select Close Code Editor.

To configure the volume gauge component:

1. 

Click the Volume Gauge component to display the context panel and then select Edit Value Changed Code.

This launches the Code Editor dialog.

2. 

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

SetProperty("Dial0", value, GetProperty("VolumeGauge0", 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.

When you change the value of the VolumeGauge component, the value of the Dial component value changes to match it; similarly, when you change the value of the Dial component, the VolumeGauge component value changes to match it.

 

with(DocumentTools):

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

SetProperty("Dial0", value, GetProperty("VolumeGauge0", value));

 

See Also

DocumentTools

DocumentTools[GetProperty]

DocumentTools[SetProperty]

EmbeddedComponents