Defines custom menu. Supersedes DefItem.
DefMenu [/immediate] [/shortcut] [/norepeat] [/id <command-id>] [/comgroup <command-group>] <menu-path> [ <command-string> [ <when-enabled> ]] |
/comgroup |
This can be used with the function GetLastCommand. GetLastCommand returns the text of the most recent command executed which specifed the supplied command group value. The command DefButton also uses this feature. |
||||||||||||||||||||||||||||||||||||||
/forceUpdateCommand |
If set, this will force any update that occurs to also update the command, even if the command is an empty string. |
||||||||||||||||||||||||||||||||||||||
/forceUpdateExpression |
If set, this will force any update that occurs to also update the expression, even if the expression is an empty string. |
||||||||||||||||||||||||||||||||||||||
/id |
This item is used by the edit menu GUI. It is not needed for regular use. |
||||||||||||||||||||||||||||||||||||||
/immediate |
Immediate mode. Command is executed immediately even if another operation - such as a simulation run or schematic editing operation - is currently in progress. For other options the command is not executed until the current operation is completed. Only a few commands can be assigned with this option. These are:
|
||||||||||||||||||||||||||||||||||||||
/noRepeat |
Do not save menu action in "repeat last menu" buffer. This must be used for any menu that recalls a previously executed menu. |
||||||||||||||||||||||||||||||||||||||
/pos |
Position of menu. '1' means the top position. If omitted, the menu is placed at the bottom. Position must also take into account any link breaks within a menu. |
||||||||||||||||||||||||||||||||||||||
/shortcut |
Specify key or key combination to activate menu. Key description is placed on right hand side of menu item. For list of possible values see DefKey , but note that key pad keys (e.g. NUM1, NUM* etc.) cannot be assigned as menu shortcuts. Also note that DefKey has precedence in the event of the key or key combination being defined by both DefKey and DefMenu. |
||||||||||||||||||||||||||||||||||||||
menuname |
Composed of strings separated by pipe symbol: '|'. First name must be one of the following:
The menuname for fixed menus must be followed by two or more names separated by '|' . The first is the menu name as it appears on the menu bar. The second can be the name of a menu item (which is actioned when selected) or a sub menu containing menu items or further sub menus. Sub menus can be nested to any level. Use the '&' symbol to define an underlined ALT-key access letter. The menuname for context menus must be followed by at least one name. Sub menus may also be defined for these. To define a menu separator use the item text '-' Note that if any of the menu name contains spaces it must be enclosed in quotation marks. Names defined using the CombineMenu command may also be used. The names SchemMain and Schem are defined in the standard startup script using CombineMenu and provide compatibility with version 7.2 and earlier See examples below. |
||||||||||||||||||||||||||||||||||||||
when-enabled |
A Boolean expression specifying under what circumstances the menu should be enabled. (The menu text turns grey when disabled). If omitted the menu will always be enabled. The expression may contain the following values:
Expressions enclosed in curly braces may also be used. Such expressions may contain any script expression to make customised menu enables. Care should be taken when using this feature and it should be used sparingly. Expressions can take a long time to evaluate and this will lead to sluggish menu activation response. |
The following are definitions for some of the standard menus. Definitions for all the standard menus can be found on the install CD in the Scripts folder. (A CD image may be downloaded from our web site if you do not have the physical CD). Change value schematic popup menu by calling the value script. (Note this must be entered on one line)
DefMenu "Schem|Change &Value" "value /ne" "InstSelected && !LiveMode" |
DefMenu "Schem|-" |
DefMenu "Graph|Cursors &On" "cursormode /ne on" "!LiveMode" |
|