Exemplo n.º 1
0
 public override void MouseUpEvent(CubeHags.client.input.MouseEvent evt)
 {
     Window.ReleaseMouseLock();
     // Stop selection if nothing is selected
     if (Math.Abs(SelectStart - SelectEnd) == 0)
         Selection = false;
 }
Exemplo n.º 2
0
 public override void MouseExitEvent(CubeHags.client.input.MouseEvent evt)
 {
     WindowManager.Instance.Cursor = WindowManager.CursorType.NORMAL;
 }
Exemplo n.º 3
0
        public override void MouseMoveEvent(CubeHags.client.input.MouseEvent evt)
        {
            WindowManager.Instance.Cursor = WindowManager.CursorType.CARET;

            // Mouse button0 drag + selection
            if (evt.ButtonState[0] && Selection)
            {
                Point pt = CharPositionFromPoint(new Point(evt.Position.X, evt.Position.Y));
                // If position changed and within bounds..
                if (CaretPosition != pt.X && pt.X <= _Text.Length)
                {
                    SelectEnd = CaretPosition = pt.X;
                }
            }
        }
Exemplo n.º 4
0
        public override void MouseDownEvent(CubeHags.client.input.MouseEvent evt)
        {
            // Grab focus
            Window.FocusControl = this;
            Window.GetMouseLock(this);

            // Set Caret Position
            Point pt = CharPositionFromPoint(new Point(evt.Position.X, evt.Position.Y));

            // Bounds checking
            if (pt.X > _Text.Length)
                pt.X = _Text.Length;

            // Append to selection if shift button is held down
            if ((Input.Instance.KeyModifiers & KeyEvent.Modifiers.SHIFT) > 0)
            {
                if (!Selection)
                {
                    SelectStart = CaretPosition;
                    Selection = true;
                }
                SelectEnd = pt.X;
            }
            else // else Start new selection
            {
                SelectStart = SelectEnd = pt.X;
                Selection = true;
            }

            CaretPosition = pt.X;
        }
Exemplo n.º 5
0
        public override void MouseUpEvent(CubeHags.client.input.MouseEvent evt)
        {
            if (mouseDown)
            {
                if (!Showing)
                    main.ShowItem(this);
                else
                    main.ToggleShowRibbon();
                mouseDown = false;
            }
            MoveOverStartTime = 0;

            base.MouseUpEvent(evt);
        }
Exemplo n.º 6
0
 public override void MouseExitEvent(CubeHags.client.input.MouseEvent evt)
 {
     mouseDown = false;
     MoveOverStartTime = 0;
     base.MouseExitEvent(evt);
 }
Exemplo n.º 7
0
 public override void MouseEnterEvent(CubeHags.client.input.MouseEvent evt)
 {
     MoveOverStartTime = HighResolutionTimer.Ticks;
     base.MouseEnterEvent(evt);
 }
Exemplo n.º 8
0
 public override void MouseDownEvent(CubeHags.client.input.MouseEvent evt)
 {
     mouseDown = true;
     base.MouseDownEvent(evt);
 }