Inheritance: System.Windows.Forms.UserControl
            public ComponaCollectionForm(CollectionEditor e) : base(e)
            {
                Editor = e as ComponaCollectionEditor;

                if (Editor != null)
                    GUI = Editor.CreateGUI();

                GUI.Visible = true;
                GUI.Dock = DockStyle.Fill;
                Controls.Add(GUI);
                AcceptButton = GUI.btnOK;
                CancelButton = GUI.btnCancel;
                Size = new Size(630, 470);
                GUI.Editor = e as ComponaCollectionEditor;

                Type[] types = 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], btnDropDownMenuItem_Click));
                    }
                }

                GUI.btnRemove.Click += btnRemove_Click;
                GUI.btnAdd.Click += btnAdd_Click;
                GUI.btnCancel.Click += btnCancel_Click;
                GUI.btnOK.Click += btnOK_Click;
                GUI.btnUp.Click += btnUp_Click;
                GUI.btnDown.Click += btnDown_Click;
                GUI.btnDropdown.Click += btnDropDown_Click;
            }
Beispiel #2
0
            public ComponaCollectionForm(CollectionEditor e) : base(e)
            {
                Editor = e as ComponaCollectionEditor;

                if (Editor != null)
                {
                    GUI = Editor.CreateGUI();
                }

                GUI.Visible = true;
                GUI.Dock    = DockStyle.Fill;
                Controls.Add(GUI);
                AcceptButton = GUI.btnOK;
                CancelButton = GUI.btnCancel;
                Size         = new Size(630, 470);
                GUI.Editor   = e as ComponaCollectionEditor;

                Type[] types = NewItemTypes;
                if (types.Length > 1)
                {
                    GUI.btnDropdown.Visible          = true;
                    GUI.btnDropdown.ContextMenuStrip = new ContextMenuStrip();
                    for (int i = 0; (i < types.Length); i++)
                    {
                        //GUI.btnDropdown.ContextMenuStrip.Items.Add(types[i].Name, null, btnDropDownMenuItem_Click);
                        GUI.btnDropdown.ContextMenuStrip.Items.Add(types[i].Name);
                    }
                }

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