示例#1
0
 public void OnDropStateChange(eDropState state)
 {
     if (DropStateChange != null)
     {
         DropStateChange(state);
     }
 }
示例#2
0
 protected void OnDropStateChange(eDropState state)
 {
     if (DropStateChange != null)
     {
         DropStateChange(state);
     }
 }
示例#3
0
 protected override void OnMouseEnter(EventArgs e)
 {
     base.OnMouseEnter(e);
     if (_dropState == eDropState.Closing)
     {
         _dropState = eDropState.Dropping;
     }
 }
示例#4
0
 public void CloseDropDown()
 {
     if (dropContainer != null)
     {
         _dropState = eDropState.Closing;
         dropContainer.DropDownForm.Freeze = false;
         dropContainer.DropDownForm.Close();
     }
 }
示例#5
0
 public void InitializeDropDown(Control dropDownItem)
 {
     if (_dropDownItem != null)
         throw new Exception("The drop down item has already been implemented!");
     _DesignView = false;
     _dropState = eDropState.Closed;
     this.Size = _AnchorSize;
     this._AnchorClientBounds = new Rectangle(2, 2, _AnchorSize.Width - 21, _AnchorSize.Height - 4);
     //removes the dropDown item from the controls list so it 
     //won't be seen until the drop-down window is active
     if (this.Controls.Contains(dropDownItem))
         this.Controls.Remove(dropDownItem);
     _dropDownItem = dropDownItem;
 }
示例#6
0
 void dropContainer_Closed(object sender, FormClosedEventArgs e)
 {
     if (!dropContainer.DropDownForm.IsDisposed)
     {
         dropContainer.DropDownForm.DropStateChange -= dropContainer_DropStateChange;
         dropContainer.DropDownForm.FormClosed      -= dropContainer_Closed;
         this.ParentForm.Move -= ParentForm_Move;
         dropContainer.DropDownForm.Dispose();
     }
     dropContainer        = null;
     closedWhileInControl = (this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position));
     _dropState           = eDropState.Closed;
     this.Invalidate();
 }
示例#7
0
 void DropContainer_Closed(object sender, FormClosedEventArgs e)
 {
     if (!_dropContainer.IsDisposed)
     {
         _dropContainer.DropStateChange -= DropContainer_DropStateChange;
         _dropContainer.FormClosed      -= DropContainer_Closed;
         this.ParentForm.Move           -= ParentForm_Move;
         _dropContainer.Dispose();
     }
     _dropContainer        = null;
     _closedWhileInControl = (this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position));
     _dropState            = eDropState.Closed;
     tmrAnimate.Enabled    = false;
     this.Invalidate();
 }
示例#8
0
 public void InitializeDropDown(Control dropDownItem)
 {
     if (_dropDownItem != null)
     {
         throw new Exception("The drop down item has already been implemented!");
     }
     _DesignView = false;
     _dropState  = eDropState.Closed;
     this.Size   = _AnchorSize;
     this._AnchorClientBounds = new Rectangle(2, 2, _AnchorSize.Width - 21, _AnchorSize.Height - 4);
     //removes the dropDown item from the controls list so it
     //won't be seen until the drop-down window is active
     if (this.Controls.Contains(dropDownItem))
     {
         this.Controls.Remove(dropDownItem);
     }
     _dropDownItem = dropDownItem;
 }
示例#9
0
        public void InitializeDropDown(Control dropDownItem)
        {
            if (_dropDownItem != null)
            {
                throw new Exception("The drop down item has already been implemented!");
            }
            _designView = false;
            _dropState  = eDropState.Closed;
            this.Size   = _anchorSize;

            // Removes the dropDown item from the controls list so it
            // Won't be seen until the drop-down window is active
            if (this.Controls.Contains(dropDownItem))
            {
                this.Controls.Remove(dropDownItem);
            }

            _dropDownItem = dropDownItem;
        }
示例#10
0
        public void CloseDropDown()
        {
            if (_dropContainer != null)
            {
                _dropState = eDropState.Closing;

                if (_useAnimation)
                {
                    _dropContainer.Freeze = true;
                    tmrAnimate.Enabled    = true;
                }
                else
                {
                    _dropContainer.Freeze = false;
                    _dropContainer.Close();
                    _dropState = eDropState.Closed;
                }
            }
        }
示例#11
0
        private void Animate_Tick(object sender, EventArgs e)
        {
            int Height = 0;

            switch (_dropState)
            {
            case eDropState.Closing:
                Height = _dropContainer.Height - _dropDownSize.Height / 10;
                if (Height < 0)
                {
                    _dropContainer.Freeze = false;
                    _dropContainer.Close();
                    _dropState         = eDropState.Closed;
                    tmrAnimate.Enabled = false;
                }
                else
                {
                    _dropContainer.Height = Height;
                }
                break;

            case eDropState.Dropping:
                Height = _dropContainer.Height + _dropDownSize.Height / 10;
                if (Height >= _dropDownSize.Height)
                {
                    _dropContainer.Height = _dropDownSize.Height;
                    _dropState            = eDropState.Dropped;
                    tmrAnimate.Enabled    = false;
                }
                else
                {
                    _dropContainer.Height = Height;
                }
                break;

            case eDropState.Closed:
            case eDropState.Dropped:
            default:
                tmrAnimate.Enabled = false;
                return;
            }
        }
示例#12
0
        protected void OpenDropDown()
        {
            if (_dropDownItem == null)
            {
                throw new NotImplementedException("The drop down item has not been initialized!  Use the InitializeDropDown() method to do so.");
            }

            if (!CanDrop)
            {
                return;
            }

            dropContainer = new DropDownContainer(_dropDownItem);
            dropContainer.DropDownForm.Bounds           = GetDropDownBounds();
            dropContainer.DropDownForm.DropStateChange += new DropDownForm.DropWindowArgs(dropContainer_DropStateChange);
            dropContainer.DropDownForm.FormClosed      += new FormClosedEventHandler(dropContainer_Closed);
            this.ParentForm.Move += new EventHandler(ParentForm_Move);
            _dropState            = eDropState.Dropping;
            dropContainer.Show();
            _dropState = eDropState.Dropped;
            this.Invalidate();
        }
示例#13
0
        protected virtual void OpenDropDown()
        {
            if (_dropDownItem == null)
            {
                return;
            }
            //throw new NotImplementedException("The drop down item has not been initialized!  Use the InitializeDropDown() method to do so.");

            if (!CanDrop)
            {
                return;
            }

            _dropContainer = new DropDownContainer(_dropDownItem, _dropDownSize)
            {
                Bounds = GetDropDownBounds()
            };
            _dropContainer.DropStateChange += new DropDownContainer.DropWindowArgs(DropContainer_DropStateChange);
            _dropContainer.FormClosed      += new FormClosedEventHandler(DropContainer_Closed);
            this.ParentForm.Move           += new EventHandler(ParentForm_Move);
            _dropState = eDropState.Dropping;

            if (_useAnimation)
            {
                tmrAnimate.Enabled    = true;
                _dropContainer.Height = 0;
                _dropContainer.Show(this);
            }
            else
            {
                _dropContainer.Show(this);
                _dropState = eDropState.Dropped;
            }

            this.Invalidate();
        }
示例#14
0
        protected void OpenDropDown()
        {
            if (_dropDownItem == null)
                throw new NotImplementedException("The drop down item has not been initialized!  Use the InitializeDropDown() method to do so.");

            if (!CanDrop) return;

            dropContainer = new DropDownContainer(_dropDownItem);
            dropContainer.Bounds = GetDropDownBounds();
            dropContainer.DropStateChange += new DropDownContainer.DropWindowArgs(dropContainer_DropStateChange);
            dropContainer.FormClosed += new FormClosedEventHandler(dropContainer_Closed);
            this.ParentForm.Move += new EventHandler(ParentForm_Move);
            _dropState = eDropState.Dropping;
            dropContainer.Show(this);
            _dropState = eDropState.Dropped;
            this.Invalidate();
        }
示例#15
0
 void dropContainer_Closed(object sender, FormClosedEventArgs e)
 {
     if (!dropContainer.IsDisposed)
     {
         dropContainer.DropStateChange -= dropContainer_DropStateChange;
         dropContainer.FormClosed -= dropContainer_Closed;
         this.ParentForm.Move -= ParentForm_Move;
         dropContainer.Dispose();
     }
     dropContainer = null;
     closedWhileInControl = (this.RectangleToScreen(this.ClientRectangle).Contains(Cursor.Position));
     _dropState = eDropState.Closed;
     this.Invalidate();
 }
示例#16
0
 void dropContainer_DropStateChange(DropDownControl.eDropState state)
 {
     _dropState = state;
 }
示例#17
0
 void dropContainer_DropStateChange(DropDownControl.eDropState state)
 {
     _dropState = state;
 }
示例#18
0
 protected void OnDropStateChange(eDropState state)
 {
     if (DropStateChange != null)
         DropStateChange(state);
 }
示例#19
0
 private void dropContainer_DropStateChange(eDropState state)
 {
     _dropState = state;
 }
示例#20
0
 private void OnDropStateChange(eDropState state)
 {
     DropStateChange?.Invoke(state);
 }
示例#21
0
        public void CloseDropDown()
        {

            if (dropContainer != null)
            {
                _dropState = eDropState.Closing;
                dropContainer.Freeze = false;
                dropContainer.Close();
            }
        }