Ejemplo n.º 1
0
 protected virtual void OnMouseButtonUp(GUIMouseEventArgs e)
 {
     if (MouseButtonUp != null)
     {
         MouseButtonUp(this, e);
     }
 }
Ejemplo n.º 2
0
 protected virtual void OnMouseDoubleClicked(GUIMouseEventArgs e)
 {
     if (MouseDoubleClicked != null)
     {
         MouseDoubleClicked(this, e);
     }
 }
Ejemplo n.º 3
0
        protected internal override bool OnMouseMove(GUIMouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (dragSizing)
            {
                DoDragSizing(e.Position);
            }
            else if (IsHit(e.Position))
            {
                if (Sizable && (e.Position.x > (this.Rect.right - splitterSize)))
                {
                    InitialiseSizingHoverState();
                }
                else
                {
                    splitterHover = false;
                }
            }
            else
            {
                splitterHover = false;
            }
            return(true);
        }
Ejemplo n.º 4
0
 protected virtual void OnMouseWheel(GUIMouseEventArgs e)
 {
     if (MouseWheel != null)
     {
         MouseWheel(this, e);
     }
 }
Ejemplo n.º 5
0
 protected virtual void OnMouseMove(GUIMouseEventArgs e)
 {
     if (MouseMove != null)
     {
         MouseMove(this, e);
     }
 }
Ejemplo n.º 6
0
        protected internal override void OnMouseLeaves(GUIMouseEventArgs e)
        {
            base.OnMouseLeaves(e);

            hovering = false;
            RequestRedraw();
        }
Ejemplo n.º 7
0
 private void window_MouseMove(object sender, GUIMouseEventArgs e)
 {
     mouseValueDX = (int)(e.Position.x - mouseValueX);
     mouseValueDY = (int)(e.Position.y - mouseValueY);
     mouseValueX  = (int)e.Position.x;
     mouseValueY  = (int)e.Position.y;
     OnMouseMove(e);
 }
Ejemplo n.º 8
0
 protected internal override bool OnMouseMove(GUIMouseEventArgs e)
 {
     if (!pushed)
     {
         UpdateInternalState(e.Position);
     }
     return(base.OnMouseMove(e));
 }
Ejemplo n.º 9
0
        protected override void OnMouseMove(GUIMouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (dragMouse)
            {
                this.dragStartLocation = e.Position;
            }
        }
Ejemplo n.º 10
0
        protected override void OnMouseButtonDown(GUIMouseEventArgs e)
        {
            base.OnMouseButtonDown(e);

            this.HostWindow.CaptureInput();
            this.ClickLocationX    = (int)e.Position.x;
            this.ClickLocationY    = (int)e.Position.y;
            this.dragMouse         = true;
            this.dragStartLocation = e.Position;
        }
Ejemplo n.º 11
0
 public override bool OnMouseButtonDown(GUIMouseEventArgs e)
 {
     foreach (UIComp_TreeNodeBase node in treeNodes)
     {
         if (node.OnMouseButtonDown(e))
         {
             return(true);
         }
     }
     return(false);
 }
 void PlayerInput_MouseButtonDown(object sender, GUIMouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
     }
     else if (e.Button == MouseButtons.Right)
     {
         // todo: 测试释放技能
         ClientUseSkill(1909162191);
     }
 }
Ejemplo n.º 13
0
        protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonUp(e);

            if (e.Button == GUISystem.ClickButton)
            {
                ReleaseInput();
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 14
0
        protected internal override bool OnMouseMove(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseMove(e);

            if (dragging)
            {
                CaratPosition = GetTextIndexFromPosition(e.Position);
                SetSelection(caratPosition, dragAnchorIndex);
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 15
0
        protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonDown(e);

            if (e.Button == GUISystem.ClickButton)
            {
                isBeingDragged = true;
                dragPosition   = e.Position;
                return(true);
            }

            return(ret);
        }
Ejemplo n.º 16
0
        protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonUp(e);

            if (e.Button == GUISystem.ClickButton)
            {
                // release our capture on the input data
                ReleaseInput();
                isBeingSized = false;
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 17
0
        protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonDown(e);

            if (e.Button == GUISystem.ClickButton)
            {
                dragging = true;
                CaptureInput();
                dragStartPosition = e.Position;
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 18
0
        protected internal override void OnMouseWheel(GUIMouseEventArgs e)
        {
            // base class processing
            base.OnMouseWheel(e);

            if (verticalScrollBar.Visible && (verticalScrollBar.DocumentSize > verticalScrollBar.PageSize))
            {
                verticalScrollBar.ScrollPosition = verticalScrollBar.ScrollPosition + verticalScrollBar.StepSize * (e.Delta > 0 ? -1 : 1);
            }
            else if (horizontalScrollBar.Visible && (horizontalScrollBar.DocumentSize > horizontalScrollBar.PageSize))
            {
                horizontalScrollBar.ScrollPosition = horizontalScrollBar.ScrollPosition + horizontalScrollBar.StepSize * (e.Delta > 0 ? -1 : 1);
            }
        }
Ejemplo n.º 19
0
        protected internal override bool OnMouseMove(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseMove(e);

            if (isBeingDragged)
            {
                Vector2 delta = e.Position - dragPosition;
                dragPosition = e.Position;

                if (horzFree)
                {
                    UIDim newX = this.X;
                    newX.offest += delta.x;

                    // limit value to within currently set range
                    newX.offest = (newX.offest < horzMin) ? horzMin : (newX.offest > horzMax) ? horzMax : newX.offest;

                    if (newX != this.X)
                    {
                        this.X = newX;
                        // send notification as required
                        if (hotTrack)
                        {
                            OnPositionChanged(new WindowEventArgs(this));
                        }
                    }
                }

                if (vertFree)
                {
                    UIDim newY = this.Y;
                    newY.offest += delta.y;

                    // limit new position to within currently set range
                    newY.offest = (newY.offest < vertMin) ? vertMin : (newY.offest > vertMax) ? vertMax : newY.offest;

                    if (newY != this.Y)
                    {
                        this.Y = newY;
                        // send notification as required
                        if (hotTrack)
                        {
                            OnPositionChanged(new WindowEventArgs(this));
                        }
                    }
                }
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 20
0
        protected internal override bool OnMouseDoubleClicked(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseDoubleClicked(e);

            if (e.Button == GUISystem.ClickButton)
            {
                // 选择所有文本
                dragAnchorIndex = 0;
                CaratPosition   = text.Length;

                SetSelection(dragAnchorIndex, caratPosition);
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 21
0
        protected internal override bool OnMouseMove(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseMove(e);

            Window parentWindow = this.Parent;

            if (dragging && moveable && parentWindow != null && parentWindow != GUISystem.Instance.RootWindow)
            {
                parentWindow.AbsolutePosition += e.Position - dragStartPosition;
                dragStartPosition              = e.Position;

                return(true);
            }
            return(ret);
        }
Ejemplo n.º 22
0
        protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonDown(e);

            if (e.Button == GUISystem.ClickButton)
            {
                CaptureInput();
                pushed = true;
                UpdateInternalState(e.Position);
                RequestRedraw();

                return(true);
            }
            return(ret);
        }
Ejemplo n.º 23
0
 protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
 {
     base.OnMouseButtonDown(e);
     if (e.Button == GUISystem.ClickButton)
     {
         dragPoint = e.Position;
         if (splitterHover)
         {
             if (Sizable)
             {
                 dragSizing = true;
             }
         }
     }
     return(true);
 }
Ejemplo n.º 24
0
        protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonDown(e);

            if (e.Button == GUISystem.ClickButton)
            {
                float adj = GetAdjustDirectionFromPoint(e.Position);

                // adjust scroll bar position in whichever direction as required.
                if (adj != 0)
                {
                    ScrollPosition = (position + ((pageSize - overlapSize) * adj));
                }
                return(true);
            }
            return(ret);
        }
Ejemplo n.º 25
0
        protected internal override bool OnMouseMove(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseMove(e);

            if (SizingEnabled && isBeingSized && sizingLocation != SizingLocation.None)
            {
                Vector2 deltaVector = e.Position - dragStartPosition;
                dragStartPosition = e.Position;

                // 左边
                UIDim xOffest = new UIDim(0, deltaVector.x);
                UIDim yOffest = new UIDim(0, deltaVector.y);
                if (sizingLocation == SizingLocation.Left ||
                    sizingLocation == SizingLocation.TopLeft ||
                    sizingLocation == SizingLocation.BottomLeft)
                {
                    this.X     += xOffest;
                    this.Width -= xOffest;
                }
                // 右边
                if (sizingLocation == SizingLocation.Right ||
                    sizingLocation == SizingLocation.TopRight ||
                    sizingLocation == SizingLocation.BottomRight)
                {
                    this.Width += xOffest;
                }
                // 上方
                if (sizingLocation == SizingLocation.Top ||
                    sizingLocation == SizingLocation.TopLeft ||
                    sizingLocation == SizingLocation.TopRight)
                {
                    this.Y      += yOffest;
                    this.Height -= yOffest;
                }
                // 下方
                if (sizingLocation == SizingLocation.Bottom ||
                    sizingLocation == SizingLocation.BottomLeft ||
                    sizingLocation == SizingLocation.BottomRight)
                {
                    this.Height += yOffest;
                }

                return(true);
            }
            return(ret);
        }
Ejemplo n.º 26
0
        protected internal override bool OnMouseButtonDown(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonDown(e);

            if (e.Button == GUISystem.ClickButton)
            {
                // grab input
                CaptureInput();

                // 处理鼠标点击响应
                ClearSelection();
                dragging        = true;
                dragAnchorIndex = GetTextIndexFromPosition(e.Position);
                CaratPosition   = dragAnchorIndex;

                return(true);
            }
            return(ret);
        }
Ejemplo n.º 27
0
        protected internal override bool OnMouseDoubleClicked(GUIMouseEventArgs e)
        {
            base.OnMouseDoubleClicked(e);

            ClearAllSelections();

            // get mouse position as a local pixel value
            UIComp_TreeNodeBase node = GetNodeAtPoint(e.Position);

            if (node != null)
            {
                BeginUpdate();
                node.Selected = true;
                node.Expand   = !node.Expand;
                EndUpdate();
            }

            return(true);
        }
Ejemplo n.º 28
0
        private void window_MouseButtonUp(object sender, GUIMouseEventArgs e)
        {
            // 显示鼠标并设置鼠标位置到按下时的位置
            NativeMethods.CaptureMouse(Program.game.GameWindow.ViewportControl.Handle, false);
            switch (e.Button)
            {
            case MouseButtons.Left:
                keyState[(int)System.Windows.Forms.Keys.LButton] = false;
                break;

            case MouseButtons.Right:
                keyState[(int)System.Windows.Forms.Keys.RButton] = false;
                break;

            case MouseButtons.Middle:
                keyState[(int)System.Windows.Forms.Keys.MButton] = false;
                break;
            }
            OnMouseButtonUp(e);
        }
Ejemplo n.º 29
0
        protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e)
        {
            bool ret = base.OnMouseButtonUp(e);

            if (e.Button == GUISystem.ClickButton)
            {
                ReleaseInput();

                Window sheet = GUISystem.Instance.RootWindow;
                if (sheet != null)
                {
                    if (this == sheet.GetChildAtPosition(e.Position))
                    {
                        OnCliked(new GUIEventArgs());
                        return(true);
                    }
                }
            }
            return(ret);
        }
Ejemplo n.º 30
0
        /// <summary>
        ///		When the mouse up occurs, we change the selected state.
        /// </summary>
        /// <param name="e"></param>
        protected internal override bool OnMouseButtonUp(GUIMouseEventArgs e)
        {
            if (e.Button == GUISystem.ClickButton)
            {
                Window sheet = GUISystem.Instance.RootWindow;

                if (sheet != null)
                {
                    // if mouse was released over this widget
                    if (this == sheet.GetChildAtPosition(e.Position))
                    {
                        // toggle selected state
                        Checked = !isChecked;
                        return(true);
                    }
                }
            }

            // default processing
            return(base.OnMouseButtonUp(e));
        }