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

Online Help

All Products    Maple    MapleSim


Maplets[Elements]

  

Action

  

define an action

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Action(opts, element_content)

Action[refID](opts, element_content)

Parameters

opts

-

equation(s) of the form reference=value; specify options for the Action element

element_content

-

any number of Action or command elements

refID

-

name or string; reference to the element

Description

• 

The Action element defines an action in a Maplet application.

• 

The Action element features can be modified by using options.  To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.

Elements, Symbols, or Types

Assumed Option or Content

 

 

refID

reference option

 

 

• 

An Action element can contain any number of other Action elements or command elements such as CloseWindow, Evaluate, SetOption, RunWindow, RunDialog, and Shutdown.

• 

An Action element can be contained in a Maplet element; in an equation for the onapprove, oncancel, onchange, onclick, ondecline, or onstartup option for an element; or as a parameter in an element that accepts an onchange or onclick option without an equation.

• 

The contents of an Action element are evaluated in order. Each action is completed before the next is started.  The contents of any nested Action elements are evaluated in order.

• 

The following table describes the control and use of the Action element options.

  

An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).

  

An x in the R column indicates that the option is required in the calling sequence.

  

An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.

  

An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.

Option

I

R

G

S

 

 

 

 

 

reference

x

 

 

 

run

 

 

 

x

 

 

 

 

 

• 

The opts argument can contain one or more of the following equations that set Maplet application options.

  

 

  

reference = name or string

  

A reference for the Action element.

  

If the reference is specified by both an index, for example, Action[refID], and a reference in the calling sequence, the index reference takes precedence.

  

 

  

run = true

  

This is a settable field that indicates that the specified action be run as soon as control returns to the Maplet application. This is useful for specifying the conditional shutdown of a window.

Examples

A Maplet application that has actions associated with buttons:

withMapletsElements:

maplet1MapletTextFieldTF1,ButtonB1Clear,onclick=A1,ButtonB2OK,onclick=A2,ActionA1SetOptiontarget=TF1,ActionA2ShutdownTF1:

MapletsDisplaymaplet1

Note that this Maplet application can more easily be written as:

maplet2MapletTextFieldTF1,ButtonB1Clear,SetOptiontarget=TF1,ButtonB2OK,ShutdownTF1:

MapletsDisplaymaplet2

See Also

Maplets/CommandElements

Maplets[Display]

Maplets[Elements]

Maplets[Elements][Button]

Maplets[Elements][Maplet]

Maplets[Elements][SetOption]

Maplets[Elements][Shutdown]

Maplets[Elements][TextField]

Maplets[Tools][Get]

Maplets[Tools][Set]

Overview of Maplet Applications