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; }
public override void MouseExitEvent(CubeHags.client.input.MouseEvent evt) { WindowManager.Instance.Cursor = WindowManager.CursorType.NORMAL; }
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; } } }
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; }
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); }
public override void MouseExitEvent(CubeHags.client.input.MouseEvent evt) { mouseDown = false; MoveOverStartTime = 0; base.MouseExitEvent(evt); }
public override void MouseEnterEvent(CubeHags.client.input.MouseEvent evt) { MoveOverStartTime = HighResolutionTimer.Ticks; base.MouseEnterEvent(evt); }
public override void MouseDownEvent(CubeHags.client.input.MouseEvent evt) { mouseDown = true; base.MouseDownEvent(evt); }