示例#1
0
 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;
 }
示例#2
0
 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";
 }
示例#3
0
        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;
                }
            }
        }