Display Control of Menu Item Labels

You can disable (gray out) menu item labels, making them unavailable to the user, or mark them with a check mark.

Labels can also contain DIESEL string expressions to modify the contents of the label. These can disable, mark, or interactively change the text of the displayed label.

Note: When disabling and marking menu item labels, be sure to use an appropriate technique to keep track of changes that affect the state of the label.

Disabling Labels

A menu item label that begins with a tilde (~) is displayed as disabled (grayed out). By convention, this indicates that the item is not currently a valid selection. Any commands associated with the item are not issued, and any submenus are not accessible.

For example, the following menu labels are disabled.

[~Line]
[~->Pline]

The child menu of a disabled label is inaccessible.

Menu item labels can contain DIESEL string expressions that conditionally disable or enable labels each time they are displayed. For example, the DIESEL string expression within the following menu item label disables the label while a command is active.

[$(if,$(getvar,cmdactive),~)MOVE]move

Marking Labels

You can mark a menu item label with a leading check mark by including an exclamation point and period (!.). Marking a menu item does not restrict your ability to choose the item, although a marked item can be disabled.

In the following example, the Line menu item is marked with a check.

[!.Line]

Menu item labels can contain DIESEL string expressions that conditionally mark labels each time they are displayed. The following example places a check mark to the left of menu labels whose related system variables are currently enabled.

[$(if,$(getvar,orthomode),!.)Ortho]^O
[$(if,$(getvar,snapmode),!.)Snap]^B
[$(if,$(getvar,gridmode),!.)Grid]^G

Simultaneous Disabling and Marking

You can mark and disable menu items at the same time. The format is

[~!. labeltext]
or
[!.~ labeltext]

where ~ is the special character code to disable a menu item and !. is the special character code to mark a menu item.

In the example that follows, the Line menu item is disabled and marked with a check mark.

[~!.Line]

A DIESEL expression can be used to simultaneously disable and mark a menu item label.


See Also
DIESEL Expressions in Menus