public override void OnMouseDown(MouseEventArgs mouseEvent) { double x = mouseEvent.X; double y = mouseEvent.Y; GetTransform().InverseTransform(ref x, ref y); if (Bounds.HitTest(x, y)) { m_status = !m_status; mouseEvent.Handled = true; } }
public override void OnMouseUp(MouseEventArgs mouseEvent) { }
public override void OnMouseMove(MouseEventArgs mouseEvent) { double x = mouseEvent.X; double y = mouseEvent.Y; GetTransform().InverseTransform(ref x, ref y); if (m_mouse_move) { double xp = x + m_pdx; m_preview_value = (xp - m_xs1) / (m_xs2 - m_xs1); if (m_preview_value < 0.0) m_preview_value = 0.0; if (m_preview_value > 1.0) m_preview_value = 1.0; mouseEvent.Handled = true; } }
public override void OnMouseUp(MouseEventArgs mouseEvent) { if (m_mouse_move) { m_mouse_move = false; NormalizeValue(true); mouseEvent.Handled = true; } }
public override void OnMouseMove(MouseEventArgs mouseEvent) { double x = mouseEvent.X; double y = mouseEvent.Y; if (mouseEvent.Button == MouseButtons.Left && IsOverTitleBar(x, y)) { double dx = mouseX - x; double dy = mouseY - y; double totalExtra = BorderWidth + TextPadding; Affine transform = GetTransform(); transform.Translate(-dx, -dy); SetTransform(transform); m_Bounds.Left -= dx; m_Bounds.Right -= dx; m_Bounds.Top -= dy; m_Bounds.Bottom -= dy; mouseEvent.Handled = true; } mouseX = x; mouseY = y; Invalidate(); }
public override void OnMouseDown(MouseEventArgs mouseEvent) { double x = mouseEvent.X; double y = mouseEvent.Y; GetTransform().InverseTransform(ref x, ref y); double xp = m_xs1 + (m_xs2 - m_xs1) * m_value; double yp = (m_ys1 + m_ys2) / 2.0; if (IsOver(x, y)) { m_pdx = xp - x; m_mouse_move = true; mouseEvent.Handled = true; } }
public virtual void OnMouseMove(MouseEventArgs mouseEvent) { foreach (UIWidget child in children) { if (child.Visible) { child.OnMouseMove(mouseEvent); } } }
public virtual void OnMouseUp(MouseEventArgs mouseEvent) { for (int i = 0; i < children.Count; i++) { if (children[i].Visible) { children[i].OnMouseUp(mouseEvent); } } }
public virtual void OnMouseDown(MouseEventArgs mouseEvent) { int i = 0; foreach (UIWidget child in children) { if (child.Visible) { child.OnMouseDown(mouseEvent); if (child.InRect(mouseEvent.X, mouseEvent.Y)) { if (child.CanFocus) { child.Focus(); } return; } } i++; } }
public override void OnMouseUp(MouseEventArgs mouseEvent) { if (MouseDownOnButton && InRect(mouseEvent.X, mouseEvent.Y)) { if (ButtonClick != null) { ButtonClick(this); } mouseEvent.Handled = true; } MouseDownOnButton = false; }
public override void OnMouseMove(MouseEventArgs mouseEvent) { if (InRect(mouseEvent.X, mouseEvent.Y)) { if (!MouseOverButton) { MouseOverButton = true; if (m_DrawHoverEffect) { Invalidate(); } } } else { if (MouseOverButton) { MouseOverButton = false; if (m_DrawHoverEffect) { Invalidate(); } } } }
public override void OnMouseDown(MouseEventArgs mouseEvent) { if (InRect(mouseEvent.X, mouseEvent.Y)) { MouseDownOnButton = true; MouseOverButton = true; mouseEvent.Handled = true; } else { MouseDownOnButton = false; } }
//public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int wheelDelta) //: this public MouseEventArgs(MouseEventArgs original, double newX, double newY) : this(original.Button, original.Clicks, newX, newY, original.WheelDelta) { }