/// <summary> /// MouseDownEvent /// </summary> /// <param name="args">args</param> protected override void MouseDownEvent(MouseClickEventArgs args) { if (args.Button == MouseButton.Left) { Frame of = OwnerFrame; if (of != null) { _IsMouseDown = OwnerFrame.RegisterPrecedenceEvent(this); _StartSelection = _EndSelection = args.MousePosition; _DeltaSelection = Vector2.zero; _Shift = args.Shift; _KeepKeysSelected.Clear(); if (!_Shift) { _Selection.Clear(); } else { foreach (var ki in _Selection) { _KeepKeysSelected.Add(ki); } } args.Handled = true; } } base.MouseDownEvent(args); }
/// <summary> /// Occurs when mouse button was pressed.(if WantsMouseEvents = true) /// </summary> /// <param name="args"> MouseClickEventArgs </param> protected override void MouseDownEvent(MouseClickEventArgs args) { if (args.Button == MouseButton.Left) { _IsMouseDown = OwnerFrame.RegisterPrecedenceEvent(this); args.Handled = true; } base.MouseDownEvent(args); }
/// <summary> /// MouseDownEvent /// </summary> /// <param name="args">args</param> protected override void MouseDownEvent(MouseClickEventArgs args) { if (args.Button == MouseButton.Left) { if (Contains(args.MousePosition)) { if (OwnerFrame.RegisterPrecedenceEvent(this)) { _MouseButton = MouseButton.Left; } TimeLine.TimePosition = GetTime(args.MousePosition.x); args.Handled = true; } else { if (_MouseButton != MouseButton.None) { OwnerFrame.UnregisterPrecedenceEvent(this); } _MouseButton = MouseButton.None; } } else if (args.Button == MouseButton.Right) { if (Contains(args.MousePosition)) { double time = GetTime(args.MousePosition.x); if (args.Shift && TimeLine.SelectionLenght > 0) { AddTime(time); } else { _StartSelectionTime = time; TimeLine.SelectTime(time, time); } if (OwnerFrame.RegisterPrecedenceEvent(this)) { _MouseButton = MouseButton.Right; } args.Handled = true; } else { if (_MouseButton != MouseButton.None) { OwnerFrame.UnregisterPrecedenceEvent(this); } _MouseButton = MouseButton.None; } } base.MouseDownEvent(args); }
/// <summary> /// MouseDownEvent /// </summary> /// <param name="args">args</param> protected override void MouseDownEvent(MouseClickEventArgs args) { if (_MouseButton == -1 && Parent != null && (args.Button == MouseButton.Middle || (args.Button == MouseButton.Right && args.Alt))) { Frame of = OwnerFrame; if (of != null) { _IsMouseDown = OwnerFrame.RegisterPrecedenceEvent(this); args.Handled = true; } _MouseButton = args.Button == MouseButton.Right ? 1 : 2; } base.MouseDownEvent(args); }
protected override void MouseDownEvent(MouseClickEventArgs args) { if (Parent != null && args.Button == MouseButton.Left) { Frame of = OwnerFrame; if (of != null) { _IsMouseDown = OwnerFrame.RegisterPrecedenceEvent(this); _StartPosition = _EndPosition = args.MousePosition; _DeltaDrag = Vector2.zero; args.Handled = true; } } base.MouseDownEvent(args); }
public bool BeginConnectionDetect(BaseControl startConnector) { if (InteractiveCreateConnection && !_IsDetecting) { Frame of = OwnerFrame; if (of != null) { _IsDetecting = OwnerFrame.RegisterPrecedenceEvent(this); } if (_IsDetecting) { _StartControl = startConnector; this._EndPreviewConnection = startConnector.RenderArea.center; } return(true); } return(false); }
internal bool BeginConnectionDetect(Connector startConnector) { if (InteractiveCreateConnection && !_IsDetecting) { Frame of = OwnerFrame; if (of != null) { _IsDetecting = OwnerFrame.RegisterPrecedenceEvent(this); } if (_IsDetecting) { _StartConnector = startConnector; this._EndPreviewConnector = startConnector.ConnectionPoint; } return(true); } return(false); }