Author Topic: Right Click Problem  (Read 2779 times)

marano

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Right Click Problem
« on: March 12, 2006, 11:53:09 pm »
Hi. If i right click on a selected element i can get it. But when i right click an element that is not selected i can't get it altough   it becomes selected. Look at that code please(C#):
Code: [Select]

public object EA_GetMenuItems(EA.Repository Repository, string Location, string MenuName)
{
EA.Collection ec = Repository.GetCurrentDiagram().SelectedObjects;
MessageBox.Show(ec.Count.ToString());

}

I got "0" when i only right click, but "1" or when if I first left click or select objects before i right click. Somebody help please.


thomaskilian

  • Guest
Re: Right Click Problem
« Reply #1 on: March 13, 2006, 12:53:20 am »
Hmm. I use GEtMenuItems only to build the menu. As soon as MenuClick is called, the collection is as expected. Maybe you're too early?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Right Click Problem
« Reply #2 on: March 13, 2006, 10:22:39 am »
For what it's worth...

EA seems to have occasional problems identifying which item in the project view was right-clicked. For an example, try exporting a package that has not already first been selected by (say) left-clicking it; you'll find that EA might not bring up the dialog, even though it will provide the expected context menu. [NB: This may well be a limitation imposed by how Windows handles events when drag-and-drop is involved.]

Perhaps your problem is related to this. Try forcing the selected item to the one you want to work with, and see if the expected behavior returns.
No, you can't have it!