Author Topic: Add a Custom Macro / Tool to the Right Click Context Menu? _ext_menu_default  (Read 8298 times)

JPN

  • Community Member
  • Posts: 9
  • Hero Points: 0
Hello,

I would like to add my own macro to the right click context menu a.k.a. " _ext_menu_default " so I can simply right click and execute it. I see there are many system designed commands in the menu editor, but how do I reference my own tool / macro?

I would mainly like to launch a tool I've created in "Project-->Properties-->Tools" where I have this command line currently working:

"C:\Inetpub\VMS.exe"  "%f" %M current-line-number%


Thank you


Jeff N.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Seems that menu commands don't support parameters. Therefore you'd need a wrapper macro invoking your added build command in your own macro module (e.g. 'vusrmacs.e'):
Code: [Select]
#include 'slick.sh'  // in case it's not already there
_command void exec_my_build_command
{
   project_build ( "<name of your build command" );
}
After re-loading vusrmacs.e you can add this macro command to the menu (rclick -> Edit this menu).

Hope it works for you,
HS2

JPN

  • Community Member
  • Posts: 9
  • Hero Points: 0
Re: Add a Custom Macro / Tool to the Right Click Context Menu? _ext_menu_def
« Reply #2 on: October 11, 2007, 06:01:25 PM »
Thank You!!  ;D

That was it, just for other people if they have this same problem my steps were:

Find vusrmacs.e file in slick edit config folder (my documents).

I had added this text in the file which is I think is probably the same as yours.

_command SendInfoVMS() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
   _macro('R',1);
      execute(' project_usertool VMS Recent');
}

Then reloaded that file with Macro-->Load Module.

In the above, "VMS Recent" was the name of my tool.
"SendInfoVMS" is the name that appeared when I right clicked and did the "Edit This Menu" option.
I chose it as the command, and voila. Works like a charm. Thanks again!