Shortcut 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]

  

Shortcut

  

generate XML for a Shortcut Component

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Shortcut( caption, opts )

Parameters

caption

-

(optional) string:=""; the caption on the component

opts

-

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

Options

• 

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.

• 

height : posint; The height in pixels of the component.

• 

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

• 

image : {string,Matrix,Array}; Image to be displayed on the component, specified as either the name of an external image file or a Matrix or Array as recognized by commands in the ImageTools package. The caption parameter and the image option are mutually exclusive; only one can be supplied.

• 

target : string; A string denotes the link target. See the section Valid Link Targets on the Shortcut Component help page for a table of allowed targets. The default is the empty string (no target prespecified).

• 

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

• 

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

• 

width : posint; The width in pixels of the component.

Description

• 

The Shortcut command in the Component Constructors package returns an XML function call which represents a Shortcut 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:-Layout:

withDocumentTools:-Components:

Executing the Shortcut command produces a function call.

SShortcutMy Shortcut,identity=Shortcut0

S_XML_EC-Shortcutid=Shortcut0,caption=My Shortcut,enabled=true,visible=true

(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:


My Shortcut

SShortcutNew Shortcut,identity=Shortcut0,tooltip=my shortcut:

xmlWorksheetGroupInputTextfieldS:

The previous example's call to the InsertContent command inserted a component with identity "Shortcut0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "Shortcut0" 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

lookuptableShortcut0=Shortcut1

(2)


New Shortcut

lookupShortcut0

Shortcut1

(3)

GetPropertylookupShortcut0,caption

New Shortcut

(4)

The next example generates and inserts a shortcut for launching help on the int command.

LShortcutHelp for int,identity=Shortcut17,target=Help:int:

InsertContentWorksheetGroupInputTextfieldL:


Help for int

The following examples insert components with custom images.

imgcatkerneloptsdatadir,/images/antennas.jpg:

LShortcutNew Shortcut,identity=Shortcut17,image=img,width=120,height=120:

InsertContentWorksheetGroupInputTextfieldL:


New Shortcut

imgArray1..60,1..40,1..3,i,j,k`if`k=3,j40,0,datatype=float8,order=C_order:

LShortcutNew Shortcut,identity=Shortcut17,image=img:

InsertContentWorksheetGroupInputTextfieldL:


New Shortcut

LShortcutNew Shortcut,identity=Shortcut17,image=img,width=70,height=20:

InsertContentWorksheetGroupInputTextfieldL:


New Shortcut

Compatibility

• 

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

• 

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

See Also

Component Code

Component Constructors

DocumentTools

Embedded Components

XMLTools