Description | This tag allows you to update the attributes of any menu item on any menu you have previously defined. The <updatemenuitem> tag is useful for enabling a previously disabled menu item (or vice versa), placing a mark next to an item, or changing any other attribute assocated with a menu item. This tag is used by itself and does not need to appear within <menu> or <submenu> tags. This tag is an almost exact replica of the <menuitem> tag, except that instead of specifying just the name of the menu item, you must specify the “path” to the menu item so that CNS Menu knows which item to update. Only those attributes that you define will replace the original menu item’s attributes. You need to at least define the name attribute to have a valid <updatemenuitem> tag. This is an empty tag, so you can either use a forward-slash before the closing angled bracket (“/>”) or follow the tag immediately with a closing </updatemenuitem> tag.
Format
<updatemenuitem
name="path to menu item"
db="mydb"
script="myscript"
value="47"
enabled="yes"
groupid="abc"
modifierkeys="shift+ctrl"
style="bold"
mark="check"
bgcolor="#FFFF00"
fgcolor="#000"
/>
Required Attributes
- name
Defines the "path" to the menu item that you are updating. The "path" is made up of the menu name, followed by any submenu names, followed by the actual name of the menu item, all separated by the forward-slash, and looks like "menu name/submenu name/menu item name".
Optional Attributes
- db
Defines the database that contains the script for this menu item. If this is not defined, the default database from the parent submenu or menu will be used. If the parent submenu or menu does not have a default database, the current database will be used. If the attribute is missing, the original database attribute will be unchanged; if the attribute exists, but is set to "", the original database attribute will be cleared.
- script
Defines the script to be called when the user selects this menu item. If this is not defined, the default script from the parent submenu or menu will be used. If the attribute is missing, the original script attribute will be unchanged; if the attribute exists, but is set to "", the original script attribute will be cleared.
- value
Defines a user-supplied value for this menu item. This value can be retrieved using the CNSMenu_GetMenuValue function and is also the "Script Parameter" if a script is called. If the attribute is missing, the original value attribute will be unchanged; if the attribute exists, but is set to "", the original value attribute will be cleared.
- enabled
Defines whether or not this menu item is enabled. Specify either "yes" or "no". If the menu item is disabled, it will appear greyed and the user will not be able to select it. If the attribute is missing, the original enabled attribute will be unchanged.
- groupid
Defines a user-supplied group identifier for this menu item. This is used in conjunction with the modifierkeys attribute to selectively show alternative menu items depending on which modifier keys are held down. See the Hidden Items Example in the CNS Menu example database for examples that use this attribute. If the attribute is missing, the original groupid attribute will be unchanged; if the attribute exists, but is set to "", the original groupid attribute will be cleared.
- modifierkeys
Defines the modifier keys that are required in order to show this menu item. Specify "none" or "shift", "ctrl", "opt", "cmd", or combinations using the plus sign ("shift+ctrl+cmd"). If the specified modifier keys are not held down when this menu is shown, this menu item will not be shown. If you are making a cross-platform solution, you will only want to use the "ctrl" and "shift" modifier keys because windows does not have the "opt" and "cmd" keys. If the attribute is missing, the original modifierkeys attribute will be unchanged; if the attribute is "none", the original modifierkeys attribute will be cleared.
- style
Defines the font style of this menu item. Specify "none" or "bold", "italic", "underline", or combinations using the plus sign ("bold+italic"). If the attribute is missing, the original style attribute will be unchanged; if the attribute is "none", the original style attribute will be cleared.
- mark
Defines the mark for this menu item. Specify "none", "check", "bullet", or "diamond". The mark is displayed to the left of the menu item. If the attribute is missing, the original mark attribute will be unchanged; if the attribute is "none", the original mark attribute will be cleared.
- bgcolor
Defines the background color of the item. See the menuitem Tag for an explanation of how to define the color. If the attribute is missing, the original bgcolor attribute will be unchanged; if the attribute exists, but is set to "", the original bgcolor attribute will be cleared.
- fgcolor
Defines the foreground/font color of the item. See the menuitem Tag for an explanation of how to define the color. If the attribute is missing, the original fgcolor attribute will be unchanged; if the attribute exists, but is set to "", the original fgcolor attribute will be cleared.
|
---|