예제 #1
0
        /// <summary>
        /// Called when the parent is shown.
        /// </summary>
        void _parentShown(object sender, System.EventArgs e)
        {
            try
            {
                _documentNew = CadKit.Plugins.Manager.Instance.getAll <CadKit.Interfaces.IDocumentNew>();

                for (uint i = 0; i < _documentNew.Length; ++i)
                {
                    CadKit.Documents.Document   doc  = this._createDocument(i);
                    CadKit.Interfaces.IDocument iDoc = doc as CadKit.Interfaces.IDocument;

                    if (null != doc && null != iDoc)
                    {
                        System.Windows.Forms.LinkLabel label = new System.Windows.Forms.LinkLabel();
                        label.Name   = iDoc.TypeName;
                        label.Text   = iDoc.TypeName;
                        label.Click += new System.EventHandler(_labelClick);

                        CadKit.Interfaces.IDocumentIcon docIcon = iDoc as CadKit.Interfaces.IDocumentIcon;
                        if (docIcon == null || docIcon.Icon == null)
                        {
                            label.Image = CadKit.Images.Image.load(CadKit.Helios.Application.Instance.IconDir + "/new_document.png");
                        }
                        else
                        {
                            label.Image = docIcon.Icon as System.Drawing.Image;
                        }

                        label.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
                        label.TextAlign  = System.Drawing.ContentAlignment.MiddleRight;
                        _flowLayoutPanel.Controls.Add(label);
                    }

                    doc = null;
                }

                System.Windows.Forms.Form parent = sender as System.Windows.Forms.Form;
                CadKit.Tools.ToolWindow.configure(this, parent, "New Document", false);

                _configureDockWindow(sender, this);

                CadKit.Interfaces.IWindowMenu windowMenu = sender as CadKit.Interfaces.IWindowMenu;
                if (null != windowMenu)
                {
                    windowMenu.addFormWindowMenu(this.Text, this);
                }

                parent.Activate();
            }
            catch (System.Exception ex)
            {
                System.Console.WriteLine("Error 3980677532: building new document form: {0}", ex.Message);
            }
        }
예제 #2
0
파일: Component.cs 프로젝트: perryiv/cadkit
        /// <summary>
        /// Called when parent form is shown.
        /// </summary>
        private void _parentShown(object sender, System.EventArgs args)
        {
            try
            {
                CadKit.Plugins.Windows.Properties.Editor editor = new CadKit.Plugins.Windows.Properties.Editor();
                System.Windows.Forms.Form parent = sender as System.Windows.Forms.Form;

                Component._configureDockWindow(sender, editor);

                CadKit.Interfaces.IWindowMenu windowMenu = sender as CadKit.Interfaces.IWindowMenu;
                if (null != windowMenu)
                {
                    windowMenu.addFormWindowMenu(editor.Text, editor);
                }

                parent.Activate();
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine("Error 3209302884: {0}", e.Message);
            }
        }
예제 #3
0
파일: Component.cs 프로젝트: perryiv/cadkit
        /// <summary>
        /// Called when parent form is shown.
        /// </summary>
        private void _parentShown(object sender, System.EventArgs args)
        {
            try
            {
                CadKit.Plugins.Windows.SnapShot.SnapShotWindow form = new CadKit.Plugins.Windows.SnapShot.SnapShotWindow();
                System.Windows.Forms.Form parent = sender as System.Windows.Forms.Form;

                Component._configureDockWindow(sender, form);

                CadKit.Interfaces.IWindowMenu windowMenu = sender as CadKit.Interfaces.IWindowMenu;
                if (null != windowMenu)
                {
                    windowMenu.addFormWindowMenu(form.Text, form);
                }

                parent.Activate();
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine("Error 1771862310: {0}", e.Message);
            }
        }
예제 #4
0
파일: Component.cs 프로젝트: perryiv/cadkit
        /// <summary>
        /// Called when parent form is shown.
        /// </summary>
        private void _parentShown(object sender, System.EventArgs args)
        {
            try
            {
                CadKit.Plugins.LayerManager.Layers form   = new CadKit.Plugins.LayerManager.Layers();
                System.Windows.Forms.Form          parent = sender as System.Windows.Forms.Form;
                CadKit.Tools.ToolWindow.configure(form, parent, "Layers", false);

                _configureDockWindow(sender, form);

                CadKit.Interfaces.IWindowMenu windowMenu = sender as CadKit.Interfaces.IWindowMenu;
                if (null != windowMenu)
                {
                    windowMenu.addFormWindowMenu(form.Text, form);
                }

                parent.Activate();
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine("Error 2363874639: {0}", e.Message);
            }
        }