internal override DialogResult Edit(dlgDrawings owner) { DialogResult ret = DialogResult.None; owner.ClearMarks(); dlgEditPolygon dlgEllips = new dlgEditPolygon(); dlgEllips.LoadData(this, owner); ret = dlgEllips.ShowDialog(owner); return(ret); }
protected override DialogResult dlgDrawingsMouseDown(object sender, MouseEventArgs e, ref int nStep, dlgDrawings owner) { ptNew = new Point(e.X, e.Y); if (e.Button == System.Windows.Forms.MouseButtons.Right) { dlgModalMenu menu = new dlgModalMenu(); menu.Left = e.X; menu.Top = e.Y; menu.Width = menu.Width - 1; menu.AddItem("Finish"); menu.AddItem("Continue"); menu.AddItem("Cancel"); if (nStep >= 0 && nStep < PointCount) { menu.AddItem("Delete"); menu.AddItem("Skip"); } menu.ShowDialog(owner); switch (menu.nRet) { case 0: owner.Invalidate(); dlgEditPolygon dlgEllips = new dlgEditPolygon(); dlgEllips.LoadData(this, owner); return(dlgEllips.ShowDialog(owner)); case 2: return(System.Windows.Forms.DialogResult.Cancel); case 3: DeletePoint(nStep); break; case 4: pts[nStep] = ptCur; nStep++; break; } if (nStep >= 0 && nStep < PointCount) { ptCur = pts[nStep]; } return(System.Windows.Forms.DialogResult.None); } else { if (nStep >= 0 && nStep < PointCount) { pts[nStep].X = e.X; pts[nStep].Y = e.Y; } else { AppendPoint(e.X, e.Y); } nStep++; step = nStep; if (nStep >= 0 && nStep < PointCount) { ptCur = pts[nStep]; } return(System.Windows.Forms.DialogResult.None); } }