Ejemplo n.º 1
0
            public ComponaCollectionForm(CollectionEditor e) : base(e)
            {
                this.Editor = e as ComponaCollectionEditor;
                GUI         = this.Editor.CreateGUI();
                GUI.Visible = true;
                GUI.Dock    = DockStyle.Fill;
                this.Controls.Add(GUI);
                this.AcceptButton = GUI.btnOK;
                this.CancelButton = GUI.btnCancel;
                this.Size         = new Size(630, 470);
                GUI.Editor        = e as ComponaCollectionEditor;

                Type[] types = this.NewItemTypes;
                if (types.Length > 1)
                {
                    GUI.btnDropdown.Visible     = true;
                    GUI.btnDropdown.ContextMenu = new ContextMenu();
                    for (int i = 0; (i < types.Length); i++)
                    {
                        GUI.btnDropdown.ContextMenu.MenuItems.Add(new TypeMenuItem(types[i], new EventHandler(this.btnDropDownMenuItem_Click)));
                    }
                }

                GUI.btnRemove.Click   += new EventHandler(this.btnRemove_Click);
                GUI.btnAdd.Click      += new EventHandler(this.btnAdd_Click);
                GUI.btnCancel.Click   += new EventHandler(this.btnCancel_Click);
                GUI.btnOK.Click       += new EventHandler(this.btnOK_Click);
                GUI.btnUp.Click       += new EventHandler(this.btnUp_Click);
                GUI.btnDown.Click     += new EventHandler(this.btnDown_Click);
                GUI.btnDropdown.Click += new EventHandler(this.btnDropDown_Click);
            }
            public ComponaCollectionForm(CollectionEditor e)
                : base(e)
            {
                this.Editor = e as ComponaCollectionEditor;
                GUI = this.Editor.CreateGUI();
                GUI.Visible = true;
                GUI.Dock = DockStyle.Fill;
                this.Controls.Add(GUI);
                this.AcceptButton = GUI.btnOK;
                this.CancelButton = GUI.btnCancel;
                this.Size = new Size(630, 470);
                GUI.Editor = e as ComponaCollectionEditor;

                Type[] types = this.NewItemTypes;
                if (types.Length > 1)
                {
                    GUI.btnDropdown.Visible = true;
                    GUI.btnDropdown.ContextMenu = new ContextMenu();
                    for (int i = 0; (i < types.Length); i ++)
                    {
                        GUI.btnDropdown.ContextMenu.MenuItems.Add(new TypeMenuItem(types[i], new EventHandler(this.btnDropDownMenuItem_Click)));
                    }
                }

                GUI.btnRemove.Click += new EventHandler(this.btnRemove_Click);
                GUI.btnAdd.Click += new EventHandler(this.btnAdd_Click);
                GUI.btnCancel.Click += new EventHandler(this.btnCancel_Click);
                GUI.btnOK.Click += new EventHandler(this.btnOK_Click);
                GUI.btnUp.Click += new EventHandler(this.btnUp_Click);
                GUI.btnDown.Click += new EventHandler(this.btnDown_Click);
                GUI.btnDropdown.Click += new EventHandler(this.btnDropDown_Click);
            }