Shortcut Component
insert an icon in a worksheet or document
Description
Component Palette Image
Shortcut Properties
Valid Link Targets
Shortcut Component Examples
The shortcut component displays a caption, as well as an image, and can be used as a hyperlink to various types of content, including help pages, MapleCloud documents, and URLs.
The shortcut component is customized by setting options in the Shortcut context panel. To display the Shortcut context panel, click the embedded component. Actions are associated with components using routines in the DocumentTools package.
You can click the shortcut component to execute a line of code. To do this, select Maple code as the Link Target.
The Name property is used to reference the component when using routines from the DocumentTools package.
The following table describes the control and use of the shortcut 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
caption
x
string
enabled
true or false
image
name or string
linktarget
pixelheight
positive integer
pixelwidth
tooltip
type
usespecifiedsize
usespecifiedwidth
visible
visiblecharacterwidth
The text that appears in the shortcut component. By default, the value is Shortcut.
Whether the component is enabled. If enabled is set to false, the component is dimmed and any action associated with it cannot be initiated. By default, the value is true.
The image that appears on the shortcut component.
The hyperlink target.
The height of the image in pixels.
The width of the image in pixels.
The text that appears when the user hovers the mouse over the shortcut component.
The type of the component. This returns "Shortcut".
Whether the specified size of the image is used. By default, the value is true.
Whether the specified character width is used. By default, the value is false.
Specifies if the shortcut component is visible. By default, the value is true.
The number of characters that appear in the caption. This option only applies when useSpecifiedwidth is set.
Valid link targets are given in the following table:
Link Target Type
Link Target
linktarget for SetProperty or GetProperty
linktarget example
Worksheet File
pathname to worksheet file
Wks:<filename>
Wks:c:/mytest.mw
Help Topic
help topic name
Help:<help topic>
Help:int
Task
task name
Task:<task name>
Task:BezierCurves
MapleCloud
numeric id from URL copied from the MapleCloud
Cloud:<numeric id>
Cloud:4520928
URL
URL to open in web browser
any http or https URL
http://www.maplesoft.com
New Document
title of new Maple document
Newdoc:<document name>
Newdoc:my new document
New Worksheet
title of new Maple worksheet
Newwks:<worksheet name>
Newwks:my new worksheet
Maple code
one line of valid Maple code
Mpl:<maple code>
Mpl:a:=2+2;
Workbook Attachment
URI of file copied from Workbook Explorer palette.
<URI of workbook file>
maple://mydata.xlsx
Workbook File
pathname to workbook file
Wks:c:/mytest.maple
Note: To interact with the examples provided below, open this help page as a worksheet and then execute the worksheet.
In this example, we'll make a link to a MapleCloud document.
To insert the components and set the caption for the shortcut component:
Insert a Shortcut component using the Components palette. For information on displaying the Maple palettes, see the Show Palettes help page.
Shortcut
Go to the MapleCloud and click Generate Sharing Link ( ) for the document you want to link to. Alternatively, right-click the document and select Copy Link to Clipboard.
Click the Shortcut component to display the context panel.
In the Link Target field, select MapleCloud from the drop-down box and paste the ID from the URL into the text field. For example, if the link is https://maple.cloud/app/4523951/Lines+-+The+Devil+Is+in+the+Details paste 4523951 into the text field
To try the Shortcut component:
Click the Shortcut component that you have inserted. The worksheet that it links to is downloaded from the MapleCloud and opened in a new tab.
See Also
DocumentTools
DocumentTools[GetProperty]
DocumentTools[SetProperty]
EmbeddedComponents
Download Help Document