| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (5 out of 17)

Configuring Menu Choices and Attributes in Tables

The following clauses affects which menu choices can appear, which attributes and table menu choices can appear in an attribute table, and which non-menu choices can appear for an item:

Clause Purpose
attributes visible for
Configures which of an item's attributes are displayed in the item's table
menu choices for
Configures which system-defined menu choices and user-menu-choices are displayed in the item's menu
non-menu choices for
Configures which system-defined interactive operations for an item (for example, move, scale, show, click-to-edit, and so on).
table menu choices for
Configures which menu choices are available when you select attributes in an item's table

These four clauses have a similar syntax:

For example, the following configuration statement might appear in the Instance-configuration attribute of the definition for the PETRO-VALVE class. The statement summarizes the kinds of features that you can configure with these four clauses:

Configuring Attributes that Appear in Tables

In the developer's environment, every G2 class defines a set of attributes for items based on that class. Use the attributes visible for clause to determine the attributes that appear in the attribute tables for a set of items identified by class. For example:

In the Text Editor, when you specify the attributes visible for clause, G2 prompts you to specify which attributes to include or exclude. The Text Editor presents the following prompts:

Configuring Menu Choices

Each G2 class has a system-defined set of menu choices. Use the menu choices for clause to list the menu choices to include or exclude from the menus of a set of items identified by class. For example:

Configuring Non-Menu Choices

Each G2 system-defined class has a system-defined set of non-menu-based operations. Non-menu choices are operations that are not performed in response to the user's selections from menus, such as dragging the mouse, input from the keyboard, and other user gestures like showing, hiding, resizing, and scaling workspaces. These are the non-menu choices that you can configure:

Non-menu Option: Provides ability to:
move-object
Move an item by selecting it with the mouse and dragging.
move-objects-beyond-workspace-margin
Move an item further than the current workspace edge to expand the workspace size.
move-connection
Click on a connection and move the connection on the workspace.
move-workspace
Move the workspace in the current window. Excluding this option prevents the user from moving the workspace.
move-workspaces-beyond-window-margin
Move the workspace beyond the current window margin.
show-workspace
Show a workspace. Excluding this choice removes named workspaces from the list of workspaces available by choosing:
scale-workspace
Scaling a workspace. Excluding this choice prevents the user from scaling the workspace with keystrokes such as Control + b and Control + s.
click-to-edit
Enter the Text Editor automatically when a user selects, for example, an attribute value. Excluding this option presents a menu from which the user can choose to edit.
full-editor
Invoke the Text Editor when editing an attribute value. Excluding this option causes G2 to invoke a partial editor in place.
option-buttons-for-edit-in-place
Remove buttons from a partial in-place editor when the full-editor option is being excluded. This option thus works in conjunction with excluding the full-editor, further restricting editing capabilities.
menus-for-edit-in-place
Remove the edit in place menu.
do-not-clear-text-for-edit-in-place
Remove the text when editing in place.
allow-selection-of-outside-text-from-editor
Select text from a location outside of the Text Editor and to use that text in the current editing session. Excluding this option prevent the user from sliding over a piece of G2 text and have it appear in the editor.
allow-selection-of-text
Permit text to be selected.

Use the non-menu choices for clause to list one or more non-menu choices to allow or prohibit for a set of items identified by class. For example:

You cannot use the non-menu choices for clause to add a custom non-menu choice for a class of items.

Configuring Table Menu Choices

In the developer's environment, after you display an item's table, you can click the mouse on the table to display a table menu. Use the table menu choices for clause to name one or more system-defined menu choices to include or exclude from the menu of an item's table. For example:

Because some table menu choices apply only to the attribute shown on the row where the mouse was clicked, you can also use the table menu choices for clause to include or exclude attribute-specific table menu choices. For example:

Configuring Attribute Displays

You can restrict access to the attribute displays of items. Unless you restrict access to these displays, users can click on them to open the Text Editor and edit the attribute values themselves.

To do so, specify a configuration clause that names the TABLE class, which is an internal G2 class. For instance, to restrict access to all instances of the CUSTOM-OBJECT class, enter this statement in the Instance-configuration attribute of the CUSTOM-OBJECT class's definition item:

In each item that is an instance of the configured user-defined class, also include a configure the user interface as follows statement that specifies this clause:

Configuring instances of the TABLE class using item configurations also controls the user interface to display items, which include readout tables and digital clocks, and to charts, trend charts, and graphs. Thus, to use item configurations only to restrict access to any item, you must code the configuration to apply only to particular items.

Graphs are a superseded capability. For more information see Appendix F, Superseded Practices.

For example, this Item-configuration statement of a particular procedure restricts access to the attribute display of that procedure's text attribute:


Note: You must use item configurations to restrict access to the attribute displays for items of system-defined classes. However, you also should avoid using an item configuration to restrict access to the attribute displays of an item that has a subworkspace. Any display items below the configured item in the KB's workspace hierarchy are also subject to that item configuration.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (5 out of 17)

Copyright © 1997 Gensym Corporation, Inc.