Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: MathiasK on April 28, 2014, 11:25:06 pm
-
Hi,
i can't find the part where the "navigatorControl" with its view buttons and fields is implemented into the "Add-In" window of EA.
I also not sure about the nature of the Add-In window - can i apply a "System.Windows.Forms" to it ?
Best wishes
Mathias
-
Hi Mathias,
If you wish to understand how to integrate your own control as an add-in window it might be easier to use the MyAddin (https://github.com/GeertBellekens/Enterprise-Architect-Add-in-Framework/tree/master/MyAddin) as an example.
The EA Navigator works in exactly the same way.
What you need to do is make a user control that inherits from System.Windows.Forms.UserControl (http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx)
Then you need to make sure it is know in COM.
And then you need to tell EA to load the control as a docked add-in.
/// <summary>
/// called when the selected item changes
/// This operation will show the guid of the selected element in the eaControl
/// </summary>
/// <param name="Repository">the EA.Repository</param>
/// <param name="GUID">the guid of the selected item</param>
/// <param name="ot">the object type of the selected item</param>
public override void EA_OnContextItemChanged(EA.Repository Repository, string GUID, EA.ObjectType ot)
{
if (this.eaControl == null)
this.eaControl = Repository.AddWindow("My Control","MyAddin.MyEAControl") as MyEAControl;
if (this.eaControl != null)
this.eaControl.setNameLabel(GUID);
}
Geert
-
Thx ^^ that really helped :-)