private void handleMouseDown(MouseEventArgs param) { _dxElement.Focusable = true; Keyboard.Focus(_dxElement); if (param == null) { throw new InvalidOperationException(GetFunctionName()); } bool isScreenDirty = false; if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0) { _camera.OnMouseDown(param, ref isScreenDirty); } else { SelectedTool.OnMouseDown(param, ref isScreenDirty); } //_tool.OnMouseDown(param); if (isScreenDirty) { // Render _dxElement.Render(); } }
public override void OnMouseDown(MouseEventArgs e) { SelectedTool?.OnMouseDown(new MouseEventArgs(e.Buttons, e.Modifiers, e.Location * BGI.Scale, e.Delta, e.Pressure)); if (!e.Handled) { base.OnMouseDown(e); } }
public override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (!AllowEditing) { return; } if (SelectedTool != null) { SelectedTool.OnMouseDown(e); } }
public void ButtonPress(double x, double y, int clicks) { StartPressPoint = new Cairo.PointD(x / Zoom, y / Zoom); IsPressed = true; IsMoving = false; if (!IsMoving) { PreviousMousePoint = StartPressPoint; DeltaPoint = new PointD(0, 0); for (int i = 0; i < SectionViews.Count; i++) { var sectionView = SectionViews [i]; if (sectionView.AbsoluteBound.ContainsPoint(StartPressPoint.X, StartPressPoint.Y)) { if (sectionView.HeaderAbsoluteBound.ContainsPoint(StartPressPoint.X, StartPressPoint.Y)) { SelectedControl = sectionView; SelectedTool = null; continue; } else if (sectionView.GripperAbsoluteBound.ContainsPoint(StartPressPoint.X, StartPressPoint.Y)) { SelectedControl = sectionView; } else { if (SelectedTool != null && SelectedTool.CreateMode) { SelectedTool.CreateNewControl(sectionView); SelectedTool.CreateMode = false; } else { SelectedControl = null; for (int j = 0; j < sectionView.Controls.Count; j++) { var controlView = sectionView.Controls [j]; if (controlView.ContainsPoint(StartPressPoint.X, StartPressPoint.Y)) { SelectedControl = controlView; break; } } } } } } } if (SelectedTool != null) { if (clicks == 1) { SelectedTool.OnMouseDown(); } else { SelectedTool.OnDoubleClick(); } } WorkspaceService.InvalidateDesignArea(); }