private void CalibrationScreen_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { points.Add(new PointF(e.X, e.Y)); } else if (e.Button == MouseButtons.Middle) { int x = (int)GeometryStyle; x++; x = x % 3; GeometryStyle = (GeometryStyles)x; } else { if (Control.ModifierKeys == Keys.Shift) { selectedPoint++; selectedPoint = selectedPoint % points.Count; } else if (Control.ModifierKeys == Keys.Alt) { selectedPoint = -1; } else { drag = true; } } Invalidate(); }
private static void ParseGeometyCommand(string[] values) { if (values.Length > 5) { GeometryStyle = (GeometryStyles)Enum.Parse(typeof(GeometryStyles), values[4]); selectedPoint = int.Parse(values[5]); if (values.Length > 7) { FillColor = SavedColor.Load(values[6]); LineColor = SavedColor.Load(values[7]); } if (values.Length > 8) { points.Clear(); string[] pointListText = values[8].Split(new char[] { ';' }); foreach (string pointText in pointListText) { string[] parts = pointText.Split(new char[] { ' ' }); if (parts.Length > 1) { points.Add(new PointF(float.Parse(parts[0]), float.Parse(parts[1]))); } } } } }