Пример #1
0
        public override void OnMouseDown(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            if (_UpButtonBounds.Contains(e.Location))
            {
                _UpButtonPressed    = true;
                _DownButtonPressed  = false;
                _DownButtonSelected = false;
                if (UpButtonClicked != null)
                {
                    UpButtonClicked(this, e);
                }
            }
            else if (_DownButtonBounds.Contains(e.Location))
            {
                _DownButtonPressed = true;
                _UpButtonPressed   = false;
                _UpButtonSelected  = false;
                if (DownButtonClicked != null)
                {
                    DownButtonClicked(this, e);
                }
            }
            else if (TextBoxBounds.Contains(e.X, e.Y) && AllowTextEdit)
            {
                StartEdit();
            }
        }
Пример #2
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            base.OnMouseMove(e);

            /* Hack code. Combobox SetBound function should redefine all the bounds (refer to RibbonUpDown) of the
             * Combobox so that the there is no overlap between the textbox and dropdown. However for some reason
             * the two controls don't work the same so the position and rendering of the Combobox end up wrong.
             */
            if (!_disableTextboxCursor)
            {
                if (TextBoxBounds.Contains(e.X, e.Y) && AllowTextEdit)
                {
                    Owner.Cursor = Cursors.IBeam;
                }
                else
                {
                    Owner.Cursor = Cursors.Default;
                }
            }
        }
Пример #3
0
        public override void OnMouseDown(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            if (DropDownButtonBounds.Contains(e.X, e.Y))
            {
                _dropDownPressed = true;

                if (_dropDownVisible)
                {
                    HideDropDown();
                }
                else if (this.DropDownItems.Count > 0)
                {
                    ShowDropDown();
                }
            }
            else if (TextBoxBounds.Contains(e.X, e.Y) && AllowTextEdit)
            {
                StartEdit();
            }
        }
Пример #4
0
        public override void OnMouseEnter(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            base.OnMouseEnter(e);
            if (TextBoxBounds.Contains(e.Location))
            {
                Canvas.Cursor = AllowTextEdit ? Cursors.IBeam : Cursors.Default;
            }
        }
Пример #5
0
        public override void OnMouseDown(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            base.OnMouseDown(e);

            if (TextBoxBounds.Contains(e.X, e.Y))
            {
                StartEdit();
            }
        }
Пример #6
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            base.OnMouseMove(e);

            bool mustRedraw = false;

            if (_UpButtonBounds.Contains(e.Location))
            {
                Owner.Cursor        = Cursors.Default;
                mustRedraw          = !_UpButtonSelected || _DownButtonSelected || _DownButtonPressed;
                _UpButtonSelected   = true;
                _DownButtonSelected = false;
                _DownButtonPressed  = false;
            }
            else if (_DownButtonBounds.Contains(e.Location))
            {
                Owner.Cursor        = Cursors.Default;
                mustRedraw          = !_DownButtonSelected || _UpButtonSelected || _UpButtonPressed;
                _DownButtonSelected = true;
                _UpButtonSelected   = false;
                _UpButtonPressed    = false;
            }
            else if (TextBoxBounds.Contains(e.X, e.Y))
            {
                Owner.Cursor        = Cursors.IBeam;
                mustRedraw          = _DownButtonSelected || _DownButtonPressed || _UpButtonSelected || _UpButtonPressed;
                _UpButtonSelected   = false;
                _UpButtonPressed    = false;
                _DownButtonSelected = false;
                _DownButtonPressed  = false;
            }
            else
            {
                Owner.Cursor = Cursors.Default;
            }

            if (mustRedraw)
            {
                RedrawItem();
            }
        }
Пример #7
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            base.OnMouseMove(e);

            if (TextBoxBounds.Contains(e.X, e.Y))
            {
                Owner.Cursor = Cursors.IBeam;
            }
            else
            {
                Owner.Cursor = Cursors.Default;
            }
        }
Пример #8
0
        public override void OnMouseDown(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }
            // Steve - if allowtextedit is false, allow the textbox to bring up the popup
            if (DropDownButtonBounds.Contains(e.X, e.Y) || (TextBoxBounds.Contains(e.X, e.Y) != AllowTextEdit))
            {
                _dropDownPressed = true;

                ShowDropDown();
            }
            else if (TextBoxBounds.Contains(e.X, e.Y) && AllowTextEdit)
            {
                StartEdit();
            }
        }
Пример #9
0
        public override void OnMouseDown(MouseEventArgs e)
        {
            Console.WriteLine("Hello World!22");
            if (!Enabled)
            {
                return;
            }

            if (DropDownButtonBounds.Contains(e.X, e.Y))
            {
                _dropDownPressed = true;

                ShowDropDown();
            }
            else if (TextBoxBounds.Contains(e.X, e.Y) && AllowTextEdit)
            {
                StartEdit();
            }
        }
Пример #10
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            Console.WriteLine("Hello World!");
            if (!Enabled)
            {
                return;
            }

            base.OnMouseMove(e);

            bool mustRedraw = false;

            if (DropDownButtonBounds.Contains(e.X, e.Y))
            {
                Owner.Cursor = Cursors.Default;

                mustRedraw = !_dropDownSelected;

                _dropDownSelected = true;
            }
            else if (TextBoxBounds.Contains(e.X, e.Y))
            {
                Owner.Cursor = Cursors.IBeam;

                mustRedraw = _dropDownSelected;

                _dropDownSelected = false;
            }
            else
            {
                Owner.Cursor = Cursors.Default;
            }

            if (mustRedraw)
            {
                RedrawItem();
            }
        }
Пример #11
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            base.OnMouseMove(e);

            var mustRedraw = false;

            if (DropDownButtonBounds.Contains(e.X, e.Y))
            {
                Owner.Cursor = Cursors.Default;

                mustRedraw = !_dropDownSelected;

                _dropDownSelected = true;
            }
            else if (TextBoxBounds.Contains(e.X, e.Y))
            {
                Owner.Cursor = AllowTextEdit ? Cursors.IBeam : Cursors.Default;

                mustRedraw = _dropDownSelected;

                _dropDownSelected = false;
            }
            else
            {
                Owner.Cursor = Cursors.Default;
            }

            if (mustRedraw)
            {
                RedrawItem();
            }
        }