Apply CGM data to objects
This section provides a sample of the CGM data that you can apply to objects. It is divided into three parts:
When you choose an event as the type, only one or more Active CGM commands can function as the value.
When you choose an action as the type, any of the following can function as the value:
•
one or more ActiveCGM commands
•
BasicScript subroutine name
•
operating system command
Sample of WebCGM commands
button1press
•
Description: Triggers when you click any of the members of the group.
•
Value: WebCGM_button1press, or any of the WebCGM actions
content
•
Description: Allows you to declare the first priority when searching the text content of a ‘para’ APS.
cursorenter
•
Description: Triggers when the pointer moves within two
pixels of any of the members of the group.
•
Value: WebCGM_cursorenter, or any of the WebCGM actions
cursorexit
•
Description: Triggers when the pointer moves off all members of the group.
•
Value: WebCGM_cursorexit, or any of the WebCGM actions.
hover
•
Description: Triggers when the pointer moves over any member of the group.
•
Value: any of the WebCGM actions
linkuri
•
Description: Loads a file in the target window as specified by the URI.
•
Value: either one or three strings entered by user input
•
If it is one string, it will represent the URI.
Example: "http://www.corel.com"
•
If it is three strings, the first string is the URI, the second is the empty string, and the third is the target frame.
Example: "http://www.corel.com" "" "_blank"
The target frames are as follows:
•
_blank — viewer loads the content in a new window
•
_self — viewer loads the content in the same window
•
_parent — viewer loads the content in the immediate frameset parent of the active window
•
_top — viewer loads the content in the full original window
name
•
Description: Names the group.
•
Value: entered by user input
Example: "Corel Designer Group"
region
•
Description: Provides an optional spatial region, associated with a graphic object, allowing the user to pick operations for the object. Simple regions of type rectangle, ellipse, polygon, and continuous polybezier can be defined.
•
For a rectangle, two corner points of the viewport are provided, as in (
x1,y1) (x2,y2).
Example: -820084 215104 342822 867138
•
For an ellipse, three points are provided. The first point specifies the center of the ellipse, while the remaining two points specify the CDP points, as in
(x1,y1) (x2,y2) (x3,y3).
Example: -275602 514233 -786474 514233 -275602 282324
•
For a polygon, points are provided where
n is the number of vertices in the polygon using the formula
n*(x.y).
•
For a polybezier, points are provided where n is the number of contiguous cubic segments using the formula
3n+1(x,y).
Example (polybezier with three vertices): 235270 712532 -235270 712532 342822 87386 342822 87386 342822 87386 -235270 87386 -235270 87386 -235270 87386 -235270 712532 -235270 712532
screentip
•
Description: Causes the value to be displayed as a screen-tip when the pointer is positioned over the group.
•
Value: entered by user input as a single string that is associated with a graphic object or a group
Example: "This is a screentip"
viewcontext
•
Description: Lets you specify the initial view of an object when you position the pointer over the graphic object that contains this attribute.
The value of the viewcontext specifies the two corner points of the viewport rectangle as (x1,y1) (x2,y2), where x1, y1 is the top-right point of the viewport rectangle and x2, y2 is the bottom-left point of the viewport rectangle.
Example: -925688030 586990613 -799207691 509452731
•
Value: entered by user input
WebCGM_button1press
•
Description: Erases all usertip message boxes in the target window.
Example: ‘eraseusertip;execute -extension "linkuri"’
•
Value: eraseusertip;execute -ext
WebCGM_cursorenter
•
Description: Displays the specified usertip.
Example: ‘displayusertip -tip "<This is a screentip>"’
•
Value: displayusertip -tip
WebCGM_cursorexit
•
Description: Erases all usertip message boxes in the target window.
Sample of ActiveCGM commands
@ML_button1press
•
Description: Makes the group visible.
@ML_button1release
•
Description: Makes the group invisible.
@ML_cursorenter
•
Description: Changes the group color to red.
@ML_cursorexit
•
Description: Changes the group color to its original color.
@ML_ToInvisible
•
Description: Makes the group invisible.
•
Value: changegroup -vis off
@ML_ToNative
•
Description: Changes the group color to its original color.
•
Value: changegroup -co native
@ML_ToRed
•
Description: Changes the group color to red.
•
Value: changegroup -co red
@ML_ToVisible
•
Description: Makes the group visible.
•
Value: changegroup -vis on
button1press
•
Description: Triggers when you click any of the members of the group.
•
Value: PressButton1, or any of the WebCGM or ActiveCGM actions
button1release
•
Description: Triggers when you release the left mouse button while the pointer is positioned over any of the members of the group.
•
Value: ReleaseButton1, or any of the WebCGM or ActiveCGM actions
cursorenter
•
Description: Triggers when the pointer moves within two pixels of any of the members of the group.
•
Value: ToRed, or any of the WebCGM or ActiveCGM actions
cursorexit
•
Description: Triggers when the pointer moves off all members of the group.
•
Value: ToNative, or any of the WebCGM or ActiveCGM actions
description
•
Description: This behavior is undefined.
•
Value: entered by user input
Example: "product description"
Sample of WebCGM S1000D commands
desc
•
Description: This behavior is undefined.
•
Value: entered by user input
Example: "product description"
linkuri
•
Description: Loads a file in the target window as specified by the URI.
•
Value: either one or three strings entered by user input
•
If it is one string, it will represent the URI.
Example: "http://www.corel.com"
•
If it is three strings, the first string is the URI, the second is the empty string, and the third is the target frame.
Example: "http://www.corel.com" "" "_blank"
The target frames are as follows:
•
_blank — viewer loads the content in a new window
•
_self — viewer loads the content in the same window
•
_parent — viewer loads the content in the immediate frameset parent of the active window
•
_top — viewer loads the content in the full original window
region
•
Description: Provides an optional spatial region, associated with a graphic object, allowing the user to pick operations for the object. Simple regions of type rectangle, ellipse, polygon, and continuous polybezier can be defined.
•
For a rectangle, two corner points of the viewport are provided, as in (
x1,y1) (x2,y2).
Example: -820084 215104 342822 867138
•
For an ellipse, three points are provided. The first point specifies the center of the ellipse, while the remaining two points specify the CDP points, as in
(x1,y1) (x2,y2) (x3,y3).
Example: -275602 514233 -786474 514233 -275602 282324
•
For a polygon, points are provided where
n is the number of vertices in the polygon using the formula
n*(x.y).
•
For a polybezier, points are provided where n is the number of contiguous cubic segments using the formula
3n+1(x,y).
Example (polybezier with three vertices): 235270 712532 -235270 712532 342822 87386 342822 87386 342822 87386 -235270 87386 -235270 87386 -235270 87386 -235270 712532 -235270 712532
screentip
•
Description: Causes the value to be displayed as a screen-tip when the pointer is positioned over the group.
•
Value: entered by user input as a single string that is associated with a graphic object or a group
Example: "This is a screentip"
viewcontext
•
Description: Lets you specify the initial view of an object when you position the pointer over the graphic object that contains this attribute.
The value of the viewcontext specifies the two corner points of the viewport rectangle as (x1,y1) (x2,y2), where x1, y1 is the top-right point of the viewport rectangle and x2, y2 is the bottom-left point of the viewport rectangle.
Example: -925688030 586990613 -799207691 509452731
•
Value: entered by user input