Example #1
0
        public void DropDown(Control control, DropDownDirection direction)
        {
            if (control != null)
            {
                Point pt;
                switch (direction)
                {
                case DropDownDirection.Left:
                    pt = new Point(-this.Width, 0);
                    break;

                case DropDownDirection.Right:
                    pt = new Point(control.Width, 0);
                    break;

                case DropDownDirection.AboveRight:
                    pt = new Point(control.Width, -this.Height);
                    break;

                case DropDownDirection.AboveLeft:
                    pt = new Point(-this.Width, -this.Height);
                    break;

                case DropDownDirection.BelowRight:
                    pt = new Point(control.Width - this.Width, control.Height);
                    break;

                case DropDownDirection.BelowLeft:
                    pt = new Point(-this.Width, control.Height);
                    break;

                case DropDownDirection.Above:
                    pt = new Point(0, -this.Height);
                    break;

                case DropDownDirection.Below:
                default:
                    pt = new Point(0, control.Height);
                    break;
                }

                DropDown(control, pt);
            }
            else
            {
                throw new ArgumentNullException("control");
            }
        }
Example #2
0
 public DropDown(
     Func <Widget> selectBuilder = null,
     IEnumerable <T> items       = null,
     Func <DropDownState, T, Widget> itemBuilder = null,
     Color overlayColor              = null,
     Border overlayBorder            = null,
     DropDownDirection direction     = DropDownDirection.bottom,
     DropDownOverlayType overlayType = DropDownOverlayType.scrollable
     )
 {
     _selectBuilder = selectBuilder;
     _items         = items;
     _itemBuilder   = itemBuilder;
     _overlayColor  = overlayColor;
     _direction     = direction;
     _overlayBorder = overlayBorder;
     _overlayType   = overlayType;
 }
Example #3
0
        public void ShowDropDown()
        {
            this.multiLineComboBox._RaiseDropDown(new EventArgs());
            Application.AddMessageFilter(this.filter);
            Point p = new Point(0, this.multiLineComboBox.Height);

            p = this.multiLineComboBox.PointToScreen(p);
            if (((p.Y + base.Height) > Screen.GetBounds(this).Height) && (p.Y > ((Screen.GetBounds(this).Height + this.multiLineComboBox.Height) / 2)))
            {
                this.dropDownDir = DropDownDirection.upward;
                p.Offset(0, -this.multiLineComboBox.Height);
            }
            else
            {
                this.dropDownDir = DropDownDirection.downward;
            }
            if ((base.Width < Screen.GetBounds(this).Width) && ((p.X + base.Width) > Screen.PrimaryScreen.WorkingArea.Width))
            {
                p.X = Screen.GetBounds(this).Width - base.Width;
            }
            if ((p.X < 0) && (base.Width <= Screen.GetBounds(this).Width))
            {
                p.X = 0;
            }
            this.dropDownListBox.Height = this.CalcDropDownHeight() + 2;
            this.dropDownOrigin         = p;
            if (ExAppearanceManager.GetAppearanceManager().DoSlideOpenComboBox() && (this.multiLineComboBox.SlidingDropDown == MultiLineComboBoxEffect.Standard))
            {
                dropDownAnimFrameNum = 10;
            }
            else
            {
                dropDownAnimFrameNum = 1;
            }
            this.dropDownAnimTimer.Interval = dropDownAnimOpenTime / dropDownAnimFrameNum;
            this.DropDownAnimation();
            base.Visible = true;
            this.dropDownListBox.Height = this.CalcDropDownHeight() + 2;
            this.dropDownAnimCount      = 0;
            this.DropDownAnimation();
        }