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

Online Help

All Products    Maple    MapleSim


DocumentTools[Components]

  

CheckBox

  

generate XML for a CheckBox Component

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

CheckBox(caption, opts)

Parameters

caption

-

(optional) string:="CheckBox"; the caption on the check box

opts

-

(optional) ; one or more keyword options as described below

Options

• 

action : string:=""; A string which parses to one or more valid statements in 1-D Maple notation. These statements form the Value Changed Action Component Code that executes when the CheckBox value is manually adjusted. The default is the empty string (no action code).

• 

enabled : truefalse; Indicates whether the component is enabled. The default is true. If enabled is false then the inserted component is grayed out and interaction with it cannot be initiated.

• 

fillcolor : {list(nonnegint),symbol,string}:=[255,255,255] ; Specifies the background color of the component. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [255,255,255] which corresponds to white.

• 

fontcolor : {list(nonnegint),symbol,string}:=[0,0,0] ; Specifies the font color of the component. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [0,0,0] which corresponds to black.

• 

group : string:=""; The name of the group with which this component is associated. The default is the empty string (no group).

• 

height : posint; The height in pixels, if custom selectedimage and unselectedimage options are specified.

• 

identity : {name,string}; The reference name of the component.

• 

selectedimage : {string,Matrix,Array}; A custom image that appears on the component when selected, specified as either the name of an external image file or a Matrix or Array as recognized by commands in the ImageTools package.

• 

selected : truefalse; Indicates whether the component is initially selected (checked). The default is false (unchecked).

• 

tooltip : string; The text that appears when the mouse pointer hovers over the component. The default is the empty string (no tooltip).

• 

unselectedimage : {string,Matrix,Array}; A custom image to be displayed on the component when unselected, specified as either the name of an external image file or a Matrix or Array as recognized by commands in the ImageTools package.

• 

visible : truefalse; Indicates whether the component is visible. The default is true.

• 

width : posint; The width in pixels, if custom selectedimage and unselectedimage options are specified.

Description

• 

The CheckBox command in the Component Constructors package returns an XML function call which represents a CheckBox Component.

• 

The generated XML can be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document can be inserted into the current document using the InsertContent command.

Examples

withDocumentTools:

withDocumentTools:-Components:

withDocumentTools:-Layout:

Executing the CheckBox command produces a function call.

SCheckBoxidentity=CheckBox0

S_XML_EC-CheckBoxid=CheckBox0,caption=CheckBox,groupname=,enabled=true,fillcolor=[255,255,255],fontcolor=[0,0,0],visible=true,user-size=false

(1)

By using commands from the Layout Constructors package a nested function call can be produced which represents a worksheet.

xmlWorksheetGroupInputTextfieldS:

That XML representation of a worksheet can be inserted directly.

InsertContentxml:

codestring\ns := true;\n\nt := false;

codestring s := true; t := false;

(2)

SCheckBoxidentity=CheckBox0,selected=true,tooltip=My example check box,action=codestring:

xmlWorksheetGroupInputTextfieldS:

The previous example's call to the InsertContent command inserted a component with identity "CheckBox0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "CheckBox0" incurs a substitution of the input identity in order to avoid a conflict with the identity of the existing component.

The return value of the following call to InsertContent is a table which can be used to reference the substituted identity of the inserted component.

lookupInsertContentxml,output=table

lookuptableCheckBox0=CheckBox1

(3)

lookupCheckBox0

CheckBox1

(4)

GetPropertylookupCheckBox0,value

true

(5)

In the next example a plain green square image of 15-by-15 pixels is used as a custom selectedimage, while a grayscale image of the same size is used as the unselectedimage. Additionally, the size of the component is set to 75 pixels wide and 15 high.

SCheckBoxidentity=CheckBox0,width=75,height=15,selectedimage=Array1..15,1..15,1..3,i,j,k`if`k=2,0.6,0,datatype=float8,unselectedimage=Array1..15,1..15,0.6,datatype=float8:

InsertContentWorksheetGroupInputTextfieldS:

The next example makes use of action code for a Check Box. When the Check Box is manually selected or unselected the action code is executed.

The action code updates a PlotComponent with identity "Plot0", which will be an additional part of the inserted content. This component will be constructed using the Plot Component constructor.

pplotsinx,x=π..π:

PComponents:-Plotp,identity=Plot0:

actioncodeDocumentTools:-SetProperty(':-Plot0',value,\n plots:-display(p,scaling=`if`(DocumentTools:-GetProperty(\"CB0\",value)=\"true\",constrained,unconstrained)));:

SCheckBoxconstrained,identity=CB0,action=actioncode,fillcolor=LightBlue,fontcolor=Blue:xmlWorksheetTableinterior=none,alignment=center,width=500,widthmode=pixels,Column,RowCellTextfieldP,fillcolor=LightBlue,RowCellTextfieldS,fillcolor=LightBlue:

InsertContentxml:

Compatibility

• 

The DocumentTools:-Components:-CheckBox command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

• 

The DocumentTools:-Components:-CheckBox command was updated in Maple 2016.

• 

The fillcolor and fontcolor options were introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

Component Code

Component Constructors

DocumentTools

Embedded Components

Layout Constructors

XMLTools