Book a Demo

Author Topic: EA_OnContextItemChanged doesn't fire when needed  (Read 5239 times)

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
EA_OnContextItemChanged doesn't fire when needed
« on: November 17, 2009, 03:21:02 am »
Hi everybody,

im currently implementing an AddIn for EA and need to know which elements are selected in the current diagram.
For that I use the EA_OnContextItemChanged() method to read the context items everytime they have changed. The Problem occures when one Element in an diagram is allready selected and I select another which pushed Ctrl key. In this case the event is not fired, and I can't save the additionaly selected element.

I need these two selected elements to deside if I add an element from the Toolbox or not. If I select an Element in the Toolbox, the collection returned from the method selectedObjects() is empty.  

Is this an error in EA and is there an work around?

Thanks
TheTwo

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA_OnContextItemChanged doesn't fire when need
« Reply #1 on: November 17, 2009, 05:49:41 pm »
AFAIK the EA API doesn't handle multiple selected items. It won't give you a list of selected items either in the getSelected... operations.
This might be a nice feature request.
Please use the link on the bottom of the page to issue an official feature request and mention this forum topic in the request.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA_OnContextItemChanged doesn't fire when need
« Reply #2 on: November 19, 2009, 08:18:02 am »
The Diagram.SelectedElements collection allows access (and changing) of the selection on a diagram.

drcrazy

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: EA_OnContextItemChanged doesn't fire when need
« Reply #3 on: December 18, 2009, 06:33:25 pm »
Quote
The Diagram.SelectedElements collection allows access (and changing) of the selection on a diagram.

Sorry, but I'm unable to find Diagram.SelectedElements. Did u meant Diagram.SelectedObjects ?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA_OnContextItemChanged doesn't fire when need
« Reply #4 on: December 18, 2009, 06:38:36 pm »
I'm pretty sure (without proof) that is what he meant

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA_OnContextItemChanged doesn't fire when need
« Reply #5 on: December 21, 2009, 08:43:53 am »
Yes, I apologize.