Author Topic: EA_MenuClick and use of Location  (Read 6477 times)

ZuluTen

  • EA User
  • **
  • Posts: 56
  • Karma: +0/-0
    • View Profile
EA_MenuClick and use of Location
« on: August 10, 2014, 08:43:02 pm »
The Sparx produced VB Framework which Sparx has very kindly provided to me includes the following code:
Code: [Select]
Public Sub EA_MenuClick(ByVal Repository As EA.Repository, ByVal Location As String, ByVal MenuName As String, ByVal ItemName As String)
Repository.WriteOutput(My.Resources.OutputTabName, "event: EA_MenuClick Location=" + Location + ";MenuName=" + MenuName + ";ItemName=" + ItemName, 0)
        Select Case ItemName
etc ……

However, having used it, it seems to me that no matter which means of menu click (TreeView, MainMenu or Diagram) is used to trigger the function, the Location string is always set to “Diagram”.

I note that the EA User Manual is slightly contradictory for the functionality of the MenuClick command and variously includes and then ignores the Location argument.

This makes me unsure of whether it’s a bug or a feature?

Oops, nearly forgot: EA v11 build 1107
« Last Edit: August 10, 2014, 08:44:25 pm by ZuluTen »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA_MenuClick and use of Location
« Reply #1 on: August 11, 2014, 12:38:21 am »
Just tried it with and it returned either MainMenu, TreeView or Diagram. So probably you must be doing something wrong. I use it within a compiled Perl add-in within build 1103.

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: EA_MenuClick and use of Location
« Reply #2 on: August 11, 2014, 11:46:08 am »
There is a known issue at the moment where EA_MenuClick will only return Location values "Diagram" or "TreeView".  "MainMenu" is not correctly reported by EA_MenuClick at the moment.  The Location value currently appears to depend on where the focus was rather than where the menu was opened from.

No timeframe for a fix as yet.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA_MenuClick and use of Location
« Reply #3 on: August 11, 2014, 06:28:15 pm »
Would it help ZuluTen to downgrade to build 1103 or was it pure luck that my test succeeded?

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: EA_MenuClick and use of Location
« Reply #4 on: August 12, 2014, 10:07:29 am »
I'm pretty sure the issue has been there for some time now.  Not sure exactly how your test succeeded.  Curious.  Can you provide a sample of your EA_MenuClick test code and describe what actions you performed in EA?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA_MenuClick and use of Location
« Reply #5 on: August 12, 2014, 06:53:16 pm »
Well, I created a DLL from Perl source with ActiveState's PerlCtrl. So the EA_OnXXX routines get called and I can print the parameters. It's pretty straight forward. I can provide the source but I doubt you have the PerlCtrl available. I just called one add-in menu from the different locations and that worked. I'll try with the latest EA version later the day.

q.

P.S. I have upgraded to 1107 and it still works as expected. So it has probably to do with some environment differences - whatever....
« Last Edit: August 12, 2014, 09:13:07 pm by qwerty »