Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: putrigmail on September 19, 2012, 12:45:47 am

Title: Fired Event When Click Root/Model Node
Post by: putrigmail on September 19, 2012, 12:45:47 am
Hi all,

I use EA_OnContextItemChanged to handle event when user clicks an object (package/element/diagram). However, it is not fired up when user clicks Root/Model node (while it works with other packages).
Is there any other way to handle clicking Root/Model node?

Thanks :)
Title: Re: Fired Event When Click Root/Model Node
Post by: Paulus on September 19, 2012, 02:52:46 am
I don't think there is a way to do that: there are no events that get fired when clicking on a root node and there is no other way to trap a user click event in EA.

The best you can achieve is to use the EA_GetMenuItems event to define a popup submenu below 'extensions' and react to a click event on that. Use Repository.GetTreeSelectedPackage().name to retrieve the name of the selected package, this works for root nodes as well.
Title: Re: Fired Event When Click Root/Model Node
Post by: putrigmail on September 19, 2012, 04:11:01 pm
Thank you for your answer   ;). It is strange why there's no direct event to handle root node.
Title: Re: Fired Event When Click Root/Model Node
Post by: Geert Bellekens on September 19, 2012, 04:18:57 pm
Send in a bug report (http://www.sparxsystems.com/support/bug_report.html). I don't see any good reason not to fire the event, so it is probably just a bug.

Geert