private void ConfrimBtn_Click(object sender, EventArgs e) { MouseHook.stop(); drawRunning = false; AngleLabel.Visible = true; AngleLabel.Text = calcAngleDegs(listOfClicks).ToString() + "°"; listOfClicks.Clear(); ConfrimBtn.Visible = false; AbortBtn.Visible = false; QuickMessureBtn.Enabled = true; }
private void PrecisionClicksDone() { MouseHook.MouseEvents += MouseHook_MouseEvents; MouseHook.Start(); drawRunning = true; backgroundWorker1.DoWork += backgroundWorker1_DoWork; backgroundWorker1.RunWorkerAsync(); ConfrimBtn.Visible = true; AbortBtn.Visible = true; QuickMessureBtn.Enabled = false; AngleLabel.Text = "Please finely adjust the lines"; }
private void MouseHook_MouseAction(MouseClickEventArgs e) { if (RunStatus != RunType.NotRunning && checkIfNotExists(listOfClicks, e.pt)) { AngleLabel.Text = "Please click a point along the ray"; listOfClicks.Add(e.pt); if (listOfClicks.Count == 3) { MouseHook.stop(); if (RunStatus == RunType.QuickCalc) { AngleLabel.Visible = true; AngleLabel.Text = calcAngleDegs(listOfClicks).ToString() + "°"; } else { PrecisionClicksDone(); } RunStatus = RunType.NotRunning; } } }