Example #1
0
 public void SelectOption()
 {
     DropdownWindow.ShowDropdown(
         SkillOptions,
         option => Skill = option,
         SkillOptions.IndexOf(Skill));
 }
 protected override void OnDropDownClosed(EventArgs e)
 {
     // Remove wrapper
     mDropdown.ReleaseHandle();
     mDropdown = null;
     base.OnDropDownClosed(e);
     OnSelect(-1, Rectangle.Empty, true);
 }
Example #3
0
 protected override void OnDropDownClosed(EventArgs e)
 {
     // Remove wrapper
     mDropdown.ReleaseHandle();
     mDropdown = null;
     base.OnDropDownClosed(e);
     OnSelect(-1, Rectangle.Empty, true);
 }
 protected override void OnDropDown(EventArgs e)
 {
     // Install wrapper
     base.OnDropDown(e);
     // Retrieve handle to dropdown list
     COMBOBOXINFO info = new COMBOBOXINFO();
     info.cbSize = Marshal.SizeOf(info);
     SendMessageCb(this.Handle, 0x164, IntPtr.Zero, out info);
     mDropdown = new DropdownWindow(this);
     mDropdown.AssignHandle(info.hwndList);
 }
Example #5
0
 public void SelectEnemySkill()
 {
     if (HasOpponent)
     {
         DropdownWindow.ShowDropdown(
             //Opponent.Skills.Select(s => s.Name).ToList(),
             SkillOptions,
             option => OpponentSkill = option,
             SkillOptions.IndexOf(OpponentSkill));
     }
 }
Example #6
0
        public void Draw(Action <Type> onTypeSelected)
        {
            var dropdownItems = GetDropdownItems();
            var selectionTree = new SelectionTree(dropdownItems, _selectedType, onTypeSelected, ProjectSettings.SearchbarMinItemsCount, _attribute.ExcludeNone);

            if (_attribute.ExpandAllFolders)
            {
                selectionTree.ExpandAllFolders();
            }

            DropdownWindow.Create(selectionTree, _attribute.DropdownHeight, GUIUtility.GUIToScreenPoint(Event.current.mousePosition), DropdownWindowType.Dropdown);
        }
Example #7
0
        public void ShowOptions()
        {
            var actualOptions = Options.Where(option =>
            {
                return(option == Data.Name || !panel.Skills.ToList().Exists(o => o.Data.Name == option));
            })
                                .ToList();

            DropdownWindow.ShowDropdown(actualOptions,
                                        option => Data.Name = option,
                                        actualOptions.IndexOf(Data.Name));
        }
Example #8
0
        protected override void OnDropDown(EventArgs e)
        {
            // Install wrapper
            base.OnDropDown(e);
            // Retrieve handle to dropdown list
            COMBOBOXINFO info = new COMBOBOXINFO();

            info.cbSize = Marshal.SizeOf(info);
            SendMessageCb(this.Handle, 0x164, IntPtr.Zero, out info);
            mDropdown = new DropdownWindow(this);
            mDropdown.AssignHandle(info.hwndList);
        }
        public void Draw(Action <Type> onTypeSelected)
        {
            var dropdownItems = GetDropdownItems();
            var selectionTree = new SelectionTree(dropdownItems, _selectedType, onTypeSelected, _attribute.SearchbarMinItemsCount, _attribute.ExcludeNone);

            if (_attribute.ExpandAllFolders)
            {
                selectionTree.ExpandAllFolders();
            }

            DropdownWindow.Create(selectionTree, _attribute.DropdownHeight);
        }
Example #10
0
 public void SelectEnemy()
 {
     if (CharacterModel.Instance.Characters.NPCs.Count == 0)
     {
         NotificationSystem.DisplayNotification("You must create at least one NPC to create an opposed test.");
         return;
     }
     DropdownWindow.ShowDropdown(
         CharacterModel.Instance.Characters.NPCs.Select(c => c.Name).ToList(),
         npc => Opponent = CharacterModel.Instance.Characters.NPCs.Find(c => c.Name == npc),
         CharacterModel.Instance.Characters.NPCs.IndexOf(Opponent));
 }
Example #11
0
        /// <summary>
        /// Push down to open the dropdown panel.
        /// </summary>
        public virtual void PushDown()
        {
            if (this.Cell == null && this.Cell.Worksheet == null)
            {
                return;
            }

            if (this.Cell.IsReadOnly && this.DisableWhenCellReadonly)
            {
                return;
            }

            sheet = base.Cell == null ? null : (base.Cell.Worksheet);

            Point p;

            if (sheet != null && this.DropdownControl != null &&
                Views.CellsViewport.TryGetCellPositionToControl(sheet.ViewportController.FocusView, this.Cell.InternalPos, out p))
            {
                if (this.dropdownPanel == null)
                {
                    this.dropdownPanel = new DropdownWindow(this);
                    //dropdown.VisibleChanged += dropdown_VisibleChanged;

                    //this.dropdownPanel.LostFocus -= DropdownControl_LostFocus;
                    //this.dropdownPanel.OwnerItem = this.dropdownControl;
                    this.dropdownPanel.VisibleChanged += DropdownPanel_VisibleChanged;
                }

                this.dropdownPanel.Width  = Math.Max((int)Math.Round(Bounds.Width * sheet.renderScaleFactor), MinimumDropdownWidth);
                this.dropdownPanel.Height = DropdownPanelHeight;

                this.dropdownPanel.Show(sheet.workbook.ControlInstance,
                                        new System.Drawing.Point((int)Math.Round(p.X), (int)Math.Round(p.Y + Bounds.Height * sheet.renderScaleFactor)));

                this.DropdownControl.Focus();

                this.isDropdown = true;
            }

            DropdownOpened?.Invoke(this, null);
        }
Example #12
0
        public DropdownCell()
        {
            DropdownButtonSize = new Size(20, 20);
            DropdownHeight = 200;
            MinimumDropdownWidth = 120;

            dropdown = new DropdownWindow();
            dropdown.VisibleChanged += dropdown_VisibleChanged;
            dropdown.ListBox.Click += ListBox_Click;
            dropdown.ListBox.KeyDown += ListBox_KeyDown;
        }