Maplets[Elements] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Maplets : Elements : Command Elements : Maplets/Elements/SetOption

Maplets[Elements]

  

SetOption

  

set an option value in a Maplet application element

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

SetOption(opts, argument)

Parameters

opts

-

equation(s) of the form option=value where option is one of `option`, target, or value; specify options for the SetOption element

argument

-

(optional) Argument element; specifies source of the value to assign to target element option (cannot be used if value option is included)

Description

• 

The SetOption command element sets the value of an option in a specified element.  The value of the attribute can be specified by using the value option, or by including an Argument element. Refer to individual Element help pages or see Maplets/ElementOptions to determine the element options with which SetOption can be used.

• 

The distinction between Set and SetOption is that Set is used within a procedure and SetOption is used within a Maplet application. Element options that can be set by using Set can also be set by using SetOption.

• 

The argument option specifies a reference to an element.  The value of the value option for this element is assigned to the element referenced by target.

• 

The SetOption 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

 

 

name or string equated to anything

target and value options, respectively

 

 

• 

The SetOption element uses additional simplifications. These simplifications are described in the following table where ref is a reference, opt is a symbol (an option for the element), and the right side is any accepted value for the specified option opt for the Maplet application element referenced by ref. The following table lists the simplified equation (in the left column) and its corresponding interpretation (in the right column).

Simplified Equation

Interpretation

 

 

ref = anything

target = ref, value = anything

ref(opt) = anything

target = ref, `option` = opt, value = anything

 

 

• 

A SetOption element can contain an Argument element to specify the value option.

• 

A SetOption 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 wrapped in an Action element as a parameter in an element that accepts an onchange or onclick option without an equation.

• 

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

 

 

 

 

 

`option`

x

 

 

 

target

x

x

 

 

value

x

 

 

 

 

 

 

 

 

• 

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

  

 

  

`option` = symbol

  

The option of the target element to update.  By default, the value option if it exists.

  

 

  

target = reference to an element (name or string)

  

A reference to the element to update.

  

 

  

value = string

  

The value assigned to the target element `option` option. By default, this value is the empty string "".

Examples

withMapletsElements:

maplet1MapletLabelcaption=Enter an expression,Input Field:,TextFieldB120,Output Field:,TextFieldB220,editable=false,ButtonClear 1st Field,SetOptiontarget=B1,value=,ButtonCopy to 2nd Field,SetOptiontarget=B2,ArgumentB1,ButtonReturn 2nd Field,ShutdownB2:

MapletsDisplaymaplet1

This Maplet application uses the SetOption with the reference shortcut.

withMapletsElements:

maplet2MapletLabelcaption=Enter an expression,Input Field:,TextFieldTF120,ButtonChange Font,SetOptionTF1font=F1,ButtonChange Color,SetOptionTF1background=red,ButtonExit,ShutdownTF1,FontF1courier,size=14:

MapletsDisplaymaplet2

See Also

Maplets/CommandElements

Maplets/ElementOptions

Maplets[Display]

Maplets[Elements]

Maplets[Elements][Action]

Maplets[Elements][Argument]

Maplets[Elements][Button]

Maplets[Elements][Label]

Maplets[Elements][Maplet]

Maplets[Elements][Shutdown]

Maplets[Elements][TextField]

Maplets[Tools][Get]

Maplets[Tools][Set]

Overview of Maplet Applications