Book a Demo

Author Topic: What is MenuLocation in Add-Ins Event-Methods  (Read 5493 times)

Kaspatoo

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
What is MenuLocation in Add-Ins Event-Methods
« on: October 30, 2014, 11:12:45 pm »
Hello,

I have an Add-In which I use by right clicking in the project browser on any package and chose the specific function through the context menu.

In my code (c#) the function EA_MenuClick is called.
The functions header is as follows:
Code: [Select]
public void EA_MenuClick(EA.Repository rep, string Location, string MenuName, string ItemName)
When using my specific function chosen via context menu the very first time after EA was started the parameter "Location" is defined as "MainMenu".

When running the exactly same function via the exactly same way (in both cases as described: right click on package in projectbrowser navigate to "the" specific function via context menu) it then shows "TreeView" as value of parameter "Location".

I do not understand why it differs. I just could imagine either a bug or that something is "selcted" by the code when executed the first time.
Well its not rep.GetTreeSelectedPackage(), this is in both cases the same.

I tried a look into
http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/eaadd_insea_menuclick.html
which was just confusing:
There a function with the following header is described:
Code: [Select]
Sub EA_MenuClick(Repository As EA.Repository, ByVal MenuName As String, ByVal ItemName As String)furthermore below only these three parameters are described for "detail".
But directly below "Syntax" stands the following:
Code: [Select]
Syntax:

Sub EA_MenuClick(Repository As EA.Repository, MenuLocation As String, MenuName As String, ItemName As String)
Suddenly the documentation talks about a fourth parameter "MenuLocation".

I am not able to find a further definition of this parameter and what it does or what were typically values returned.

If I knew this I may could find out why it is changed by my code or if it changed by my code at all or it may is still something like a bug, I dont know.

Thanks for any hints.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What is MenuLocation in Add-Ins Event-Methods
« Reply #1 on: October 30, 2014, 11:20:27 pm »
I remember a recent thread where Geert Bellekens posted something similar. Try to find it (good luck, use the Search button top left, extend to one year).

q.

Kaspatoo

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: What is MenuLocation in Add-Ins Event-Methods
« Reply #2 on: October 31, 2014, 12:05:57 am »
I did but no results (now my post is a result).
I searched in EA Search and forum search before opening this thread.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile

Kaspatoo

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: What is MenuLocation in Add-Ins Event-Methods
« Reply #4 on: October 31, 2014, 09:40:50 pm »
Well thank you very much.

Ok now I know that search only is looking for posts created a week ago. I need to switch it manally to "all". I never met such a "uncommon" defaulsetting for a forum search.
So quick-search is not usable for such searches, but goog to know.

Well I then do not ever try any possible word familiy like "menu Location"....

Sorry for frustrating you, I think did my best.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What is MenuLocation in Add-Ins Event-Methods
« Reply #5 on: October 31, 2014, 10:02:24 pm »
No worries. We got used to that and know that every new user falls into that pit. Sparx does not care in this case :(

q.

Kaspatoo

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: What is MenuLocation in Add-Ins Event-Methods
« Reply #6 on: October 31, 2014, 11:26:08 pm »
Allright, so the conclusion ist that
- its a bug
- EA documentation is not the best here
- EA forum search is not very practicable

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: What is MenuLocation in Add-Ins Event-Methods
« Reply #7 on: November 01, 2014, 03:01:17 am »
- yes
- yes, though I think Roy is doing a good job
- yes, yes, yes

q.