Actions and Action Lists
The ability to construct and display a directed graph is sufficient for many applications. In addition, however, the dag interface allows you to put actions on a class or node. Actions are SKILL procedures this node or nodes of this class can invoke using pop-up menus. When a node is displayed in the browser tool and has actions associated with it, you can press the right mouse button over the node and a menu of actions is displayed.
Actions are assigned to a node or class using a list. This list is of the form:
( t_actionName t_actionProcedure t_actionArgs [t_actionAccelerator] [g_enabled] )
|
t_actionName
|
The name of the action as it should appear in the popup menu.
|
|
t_actionProcedure
|
The name of the SKILL procedure called when the named action is selected.
|
|
t_actionArgs
|
String specifying all the arguments passed to the actionProcedure or the empty string ("") if there are none. This string and the action procedure name are combined with sprintf to construct the expression evaluated when the action is invoked.
|
|
t_actionAccelerator
|
|
|
Assigns accelerator string by specifying key or mouse button to trigger the specified action. Valid values are as follows:
-
any single alphanumeric (
a-z, A-Z, 0-9) character: Opens by using the equivalent key from the keyboard. -
"mouseLeft": Opens by a single click of the left mouse button -
"mouseMiddle": Opens by a single click of the middle mouse button) -
"mouseRight": Opens by a single click of the middle mouse button) -
"mouseLeft2": Opens by a double click of the left mouse button) -
"mouseMiddle2": Opens by a double click of the middle mouse button) -
"mouseRight2": Opens by a double click of the middle mouse button)
If both "mouseMiddle" and "mouseRight" are defined, then the "mouseRight" binding is ignored. Similarly, if both "mouseMiddle2" and "mouseRight2" are defined, then the "mouseRight2" binding is ignored.
|
|
g_enabled
|
Specifies whether the action is enabled (t) or disabled (nil). Disabled actions are displayed in gray in a popup menu and their action accelerators are not enabled.
|
Examples
Prints hello using the string "println":
"Hello" "println" "\"hello\"" "" t)
=> println("hello")
Adds the two number 1 3 using the string "addTwoNumbers":
("Add" "addTwoNumbers" "1 3" "a" t)
=> addTwoNumbers( 1 3 )
Pressing the a key while the cursor is positioned over a dagNode with this accelerator also triggers this action.
One cautionary note about the action menus is that the popup menu is created the first time the user presses the right mouse button over the node. No changes to the actionList will be reflected after the popup is created.
The context-sensitive bindkeys (action accelerators) supersede the ordinary hi interface bindkey functionality.
Related Topics
Properties of the dagArc
Properties of the dagClass
Properties of the dagNode
Properties of the dagTool
Return to top