public void Delete_Constant(Schematix.FSM.My_Constant c) { DialogResult res = MessageBox.Show("Are you sure want to delete constant " + c.name + " ?", "Delete Constant?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (res == DialogResult.Yes) { RemoveFigure(c); } }
/// <summary> /// Создать новую константу /// </summary> public void CreateNewConstant() { if (Lock == true) { MessageBox.Show("You must create figure " + SelectedFigure.name + " before.", "Fatal Error :)", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } graph.UnselectAllFigures(); Schematix.FSM.My_Constant constant = new Schematix.FSM.My_Constant(this); SelectedFigureList.Add(constant); SelectedFigure = constant; constant.Core = this; graph.AddFigure(constant); Lock = true; }
/// <summary> /// Создать новую константу используя ToolBox /// </summary> /// <param name="pt"></param> public void CreateNewConstant_Dragged(Point pt) { pt = form.PointToClient(pt); if (Lock == true) { MessageBox.Show("You must create figure " + SelectedFigure.name + " before.", "Fatal Error :)", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } graph.UnselectAllFigures(); Schematix.FSM.My_Constant constant = new Schematix.FSM.My_Constant("Constant" + graph.Constants.Count.ToString(), "STD_LOGIC", "'0'", pt, My_Constant.GenerationType.Constant, this); SelectedFigure = constant; graph.AddFigure(constant); Lock = false; //AddToHistory("New constant Draged"); bitmap.UpdateBitmap(); }