Author Topic: HS2's k_context_menu macro isn't working anymore for 2014?  (Read 2743 times)

flethuseo

  • Senior Community Member
  • Posts: 177
  • Hero Points: 2
HS2's k_context_menu macro isn't working anymore for 2014?
« on: September 25, 2014, 08:22:14 PM »
I think it is because the context_menu(...) command no longer accepts arguments...


hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: HS2's k_context_menu macro isn't working anymore for 2014?
« Reply #1 on: September 25, 2014, 09:34:45 PM »
That's a pitty indeed  :-\ I've planned to check some published macros soon/with the next beta. I also got a problem report regarding the ,open local symbol' macro. Hopefully there are alternatives to the broken (internal) macro APIs..
Thanks for early reporting,
HS2

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: HS2's k_context_menu macro isn't working anymore for 2014?
« Reply #2 on: September 25, 2014, 09:54:30 PM »
hs2. If there's anything I can do to help, let me know. If we've broken an API you need, I'll check if its fixable.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: HS2's k_context_menu macro isn't working anymore for 2014?
« Reply #3 on: September 25, 2014, 10:18:58 PM »
Thanks a lot Clark :)
In the past you guys obviously tried hard to keep the macro API very, very stable over an impressive long time !
Seems you know the importance of this ;D I'm sure we'll find a solution !
Regards, HS2

flethuseo

  • Senior Community Member
  • Posts: 177
  • Hero Points: 2
Re: HS2's k_context_menu macro isn't working anymore for 2014?
« Reply #4 on: September 26, 2014, 04:19:03 PM »
I realize that the k_context_menu.e worked because I had a modified version of the mouse.e file. Not sure if it can be modified the same way for 2014:

Code: [Select]
// HS2-ADD: x,y opt. args
_command void context_menu(int x = MAXINT, int y = MAXINT) name_info(','VSARG2_MARK|VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_ICON|VSARG2_NOEXIT_SCROLL)
{
   if (x == MAXINT) x = p_client_width intdiv 2;
   if (y == MAXINT) x = p_client_height intdiv 2;
   _mou_mode_menu(x,y);
}

Code: [Select]
// HS2-ADD: mx,my opt. args
static void _mou_menu(_str mark_type, int mx = MAXINT, int my = MAXINT)
{
   gInMouseMoveHandler=true;
   if (command_state()) {
      call_event(defeventtab _ul2_textbox,RBUTTON_DOWN,'e');
      gInMouseMoveHandler=false;
      return;
   }
   // HS2-CHG: use mouse pos by default if mx,my aren't specified by caller
   if (mx == MAXINT) mx=mou_last_x();
   if (my == MAXINT) my=mou_last_y();