General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Modifying the right click menu in a document.
-
gcrews January 25, 2012 at 12:25 am
Modifying the right click menu in a document.
January 25, 2012 at 12:25 amParticipants 2Replies 3Last Activity 11 years agoI 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?
Derek Read January 25, 2012 at 12:47 am
Reply to: Modifying the right click menu in a document.
January 25, 2012 at 12:47 amThe 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:
gcrews January 26, 2012 at 4:54 pm
Reply to: Modifying the right click menu in a document.
January 26, 2012 at 4:54 pmThank you, that are exactly what I needed. I have another question now but I think the demo_contextMenuElemListAttrInsp.mcr answered it.
gcrews January 26, 2012 at 6:29 pm
Reply to: Modifying the right click menu in a document.
January 26, 2012 at 6:29 pmOk 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? -
AuthorPosts
- You must be logged in to reply to this topic.