Exemple #1
0
        private Control CreateCombo(TreeNodeAdv node)
        {
            ComboBox c = new ComboBox();

            if (DropDownItems != null)
            {
                c.Items.AddRange(DropDownItems.ToArray());
            }
            var v = GetValue(node);

            if (EditableCombo)
            {
                c.DropDownStyle         = ComboBoxStyle.DropDown;
                c.Text                  = v?.ToString();
                c.KeyDown              += EditorKeyDown;
                c.SelectedValueChanged += EditorDropDownClosed;                 //cannot use DropDownClosed, then control text still not changed etc
            }
            else
            {
                c.DropDownStyle   = ComboBoxStyle.DropDownList;
                c.SelectedItem    = v;
                c.DropDownClosed += EditorDropDownClosed;
            }
            return(c);
        }
Exemple #2
0
        public IEnumerable <Component> GetAllChildComponents()
        {
            List <Component> result = new List <Component>(Buttons.ToArray());

            result.AddRange(DropDownItems.ToArray());

            return(result);
        }
        protected override Control CreateEditor(TreeNodeAdv node)
        {
            AdvComboBox comboBox = new AdvComboBox();

            if (DropDownItems != null)
            {
                comboBox.Items.AddRange(DropDownItems.ToArray());
            }
            comboBox.SelectedItem    = GetValue(node);
            comboBox.DropDownStyle   = dropDownStyle;
            comboBox.DropDownClosed += new EventHandler(EditorDropDownClosed);
            SetEditControlProperties(comboBox, node);

            comboBox.Tag = this;
            OnEditorInitialize(new EditorInitializeEventArgs(node, comboBox));

            return(comboBox);
        }
        protected override Control CreateEditor(TreeNodeAdv node)
        {
            var listBox = new ListBox {
                SelectionMode = SelectionMode.MultiExtended
            };

            if (DropDownItems != null)
            {
                listBox.Items.AddRange(DropDownItems.ToArray());
            }

            var value          = GetValue(node);
            var propertyValues = value as PropertyValues;

            SetSelectionItems(listBox, propertyValues);

            SetEditControlProperties(listBox, node);
            listBox.IntegralHeight      = false;
            listBox.ScrollAlwaysVisible = true;
            return(listBox);
        }
 public IEnumerable <Component> GetAllChildComponents()
 {
     return(DropDownItems.ToArray());
 }