Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.4   11.5   12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1    Statistic    FMM    Blog  

Menu.DefineQuickMenuXML

Defines a menu based on a xml description.

Component Version macOS Windows Linux Server iOS SDK
Menu 5.2 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "Menu.DefineQuickMenuXML"; XML )   More

Parameters

Parameter Description Example
XML The description XML.

Result

Returns menu reference or error.

Description

Defines a menu based on a xml description.
The xml has a root entry called "menu". Each menu entry can have attributes title, tag, groupID, scriptname, filename and modifierkeys. A menu can have subnodes of name menu or item. The item can have attributes title, tag, scriptname, filename, tag, enabled, selectable, Separator, mark, style, GroupID or modifierkeys.

ModifierKeys can include shift, control, option or command.
Mark can include mixed, bullet, diamond or checked.
Style can include bold, italic or underline.
If an item has name "-" or Separator=1 attribute, the plugin will mark it as being a separator.

If the root menu entry has a name, we can use that name as menu reference.
Added FontColor and BackColor in version 9.4.

Added FontName and FontSize in version 13.0 to control the font for a menu item.

Examples

Defines a quick menu with XML:

MBS( "Menu.DefineQuickMenuXML"; "<menu name=\"menue\">
        <menuitem name=\"Red\" value=\"1\" />
        <menuitem name=\"Blue\" value=\"2\" />
        <menuitem name=\"Yellow\" value=\"3\" />
</menu>" )

Define a menu with submenus:

MBS( "Menu.DefineQuickMenuXML"; "<menu name=\"menue\">
        <submenu name=\"Warm Colors\">
            <menuitem name=\"Red\" value=\"1\" />
            <menuitem name=\"Blue\" value=\"2\" />
            <menuitem name=\"Yellow\" value=\"3\" />
        </submenu>
        <submenu name=\"Cool Colors\">
            <menuitem name=\"Blue\" value=\"4\" />
            <menuitem name=\"Green\" value=\"5\" />
            <menuitem name=\"Purple\" value=\"6\" />
        </submenu>
</menu>\")" )

See also

Release notes

Example Databases

Blog Entries

This function checks for a paid license.

Created 6th June 2015, last changed 6th January 2023


Menu.DefineQuickMenu - Menu.FindItemWithTag

💬 Ask a question or report a problem


Start Chat