General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Modifying the right click menu in a document.

  • gcrews

    Modifying the right click menu in a document.

    Participants 2
    Replies 3
    Last Activity 10 years, 8 months ago

    I searched though the Xmetal documentation and all I could find on modifying the right-click menu was the function Application.AppendMacro(). It seems as though you can't use that to add submenus or position the new item though. Is there some way to do that?

    Reply

    Derek Read

    Reply to: Modifying the right click menu in a document.

    The context menu can be modified using the same APIs as the regular menus (same names but on the ActiveContextMenu object, and you should do it inside the On_Context_Menu event).

    If you add a menu item to the context menu you can then add a menu item to that item (treat what you just added as an object), and as soon as you do so the first one becomes a sub-menu, with the second item(s) inside it.

    The documentation doesn't have any good examples for doing this, but this demo script contains an example:

    http://forums.xmetal.com/index.php/topic,738.0.html

    Reply

    gcrews

    Reply to: Modifying the right click menu in a document.

    Thank you, that are exactly what I needed. I have another question now but I think the demo_contextMenuElemListAttrInsp.mcr answered it.

    Reply

    gcrews

    Reply to: Modifying the right click menu in a document.

    Ok I got my macro code write, now I’m trying to figure out what macro file to put it in.
    I was just coding it in topic_ditabase.mcr but I want my code to apply to topics, concept, task, and reference.
    I also don’t want put the code in any macro files that may have custom macros by users.
    What would be the best file to put my macro code in? 
    I tried in the startup folder, database.mcr, ditabase_ditabase.mcr , macros.mcr, and xmetal.mcr but none of those places seemed to  have my On_Context_Menu code triggered in a topic file.
    Would I have to  copy and paste my  macro code into 4 different  dtd macros?

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support