<command name = NMTOKEN (optionally preceded by a command namespace in XMLmind XML Editor - Configuration and Deployment) > Content: class | menu | macro | process </command> <menu label = non empty token > Content: [ menu | separator | item ]+ </menu> <separator /> <item label = non empty token icon = anyURI command = NMTOKEN (optionally preceded by a command namespace in XMLmind XML Editor - Configuration and Deployment) parameter = string />
Define a popup menu of commands. This special type of command, typically invoked from contextual macro-commands, allow to redefine or extend the right-click, contextual, popup menu. See below.
The parameter passed to a command containing a menu may be used to parameterize the items of this menu. This parameter is split like in a command line. A part of the split parameter may be referenced as variable %0
, %1
, %2
, ..., %9
. Variable %*
may be used to reference the whole parameter of the command.
Note that the %-variable substitution is performed on in the label
and in the parameter
attributes of an item
element. There is no %-variable substitution in the command
attribute.
Example:
<command name="greetings"> <menu> <item label="Say '%0'" command="alert" parameter="%0"/> <item label="Say '%1'" command="alert" parameter="%1"/> </menu> </command>
Invoking <command name="greetings" parameter="'Hello world!' 'Goodbye world.'"/>
displays a popup menu equivalent to:
<menu> <item label="Say 'Hello world!'" command="alert" parameter="Hello world!"/> <item label="Say 'Goodbye world.'" command="alert" parameter="Goodbye world."/> </menu>
The
|