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. |
You can use DefMenu to redefine an existing menu. In this situation the position of the menu will not change but the command it executes and any shortcut key can be altered. Note that menuname is not case-sensitive, so if an existing menu exists the existing menu will be modified. This allows filenames to be used for menu names. Note that it isn't possible to add or remove a top level main menu definition while the window is open. For schematic, graph and symbol editor windows, this means that the definition of a new top level menu will not take effect until the windows are closed and reopened. For the command shell, top level main menu definitions can only be made in the startup script which runs before the command shell is visible. This restriction only applies to the top level menu, that is the menu name that is permanently visible in the menu bar. Menu items and sub menus under the top level menu can be added, removed and redefined at will.
DefMenu "Schem|Change &Value" "value /ne" "InstSelected && !LiveMode"Separator in schematic popup
DefMenu "Schem|-"Graph popup to enable cursors
DefMenu "Graph|Cursors &On" "cursormode /ne on" "!LiveMode"
▲ Command Summary ▲ | ||
◄ DefKey | Del ▶ |