Prev Next

Custom Docked Window

Custom docked windows can be added into the Enterprise Architect user interface. Once added, they can be shown and docked in the same way as other built-in Enterprise Architect docked windows.

A custom docked window must be designed as an ActiveX Custom Control and inserted via the Automation Interface. ActiveX Custom Controls can be created using most well-known programming tools, including Microsoft Visual Studio. See the documentation provided by the relevant vendor on how to create a custom control to produce an OCX file.

Once the custom control has been created and registered on the target system, it can be added using the AddWindow() method of the Repository object. While it is possible to call AddWindow() from any automation client, it is likely that you would call it from an Add-In, and that the Add-In is defined in the same OCX that provides the custom view.

To view custom docked windows that have been added, select the 'Specialize > Add-Ins > Windows' ribbon option.

Custom docked windows can also be made visible by the automation client or Add-in using the ShowAddinWindow() method, or hidden by using the HideAddinWindow() method.

This is an example in C# code:

           public class Addin

           {

                UserControl1 m_MyControl;

                public void EA_Connect(EA.Repository Rep)

                {

                     m_MyControl = (UserControl1) Rep.AddWindow

                     ("C# Demo","ContDemo.UserControl1");

                }

                public object EA_GetMenuItems(EA.Repository Repository, string Location, string MenuName)

                {

                     if(MenuName == "")

                          return "-&C# Control Demo";

                    else

                    {

                         String() ret = {"Show Window", "Show Button"};

                         return ret;

                    }

                }

                public void EA_MenuClick(EA.Repository Rep, string Location, string MenuName, string ItemName)

                {

                     if(ItemName == "Show Window")

                          Rep.ShowAddinWindow("C# Demo");

                     else if(ItemName == "Show Button")

                          m_MyControl.ShowButton();

                }

     }

Learn more