Book a Demo

Author Topic: Request: OnContextItemHelpRequested  (Read 4009 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Request: OnContextItemHelpRequested
« on: March 03, 2013, 07:53:06 pm »
Hi!

I would like the option of having my Add-In open up its help file when the user hits F1 when working with elements or diagrams from an MDG Technology I've created.

This should be doable by adding a context item broadcast event function which identifies the element, package, diagram, attribute, method or connector in focus when F1 was pressed.

The function should return True if the Add-In takes responsibility for the help, False otherwise (like OnContextItemDoubleClicked). To be on the safe side, you could always refrain from firing the event if the context item has a stereotype from one of Sparx' own profiles.

Sound good?

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Request: OnContextItemHelpRequested
« Reply #1 on: March 04, 2013, 06:44:43 pm »
Uffe,

Isn't that what
Code: [Select]
Sub EA_ShowHelp(Repository as EA.Repository, MenuLocation As String, MenuName as String, ItemName as String) is for?

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Request: OnContextItemHelpRequested
« Reply #2 on: March 07, 2013, 03:59:02 am »
Not according to the help file: "... enables the Add-In to show a help topic for a particular menu option."

It is supposed to fire an event specifying which menu item was active when F1 was pressed. I've never actually got that to work, but that's a different story.

What I want is an event which specifies which model element (or diagram, or package, or attribute, etc) was active. That way I can display the help page that describes that specific diagram (etc).

So it'd have the same parameters as EA_OnContextItemDoubleClicked (GUID and ObjectType), rather than the menu-related string parameters of EA_ShowHelp.
My theories are always correct, just apply them to the right reality.