예제 #1
0
        /// <summary>
        /// Создание нового порта
        /// </summary>
        /// <param name="Direction"></param>
        public void CreateNewPort(Schematix.FSM.My_Port.PortDirection Direction)
        {
            if (Lock == true)
            {
                MessageBox.Show("You must create figure " + SelectedFigure.name + " before.", "Fatal Error :)", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            graph.UnselectAllFigures();

            Schematix.FSM.My_Port port = new Schematix.FSM.My_Port(this, Direction);
            SelectedFigureList.Add(port);
            SelectedFigure = port;
            graph.AddFigure(port);
            Lock = true;
        }
예제 #2
0
        /// <summary>
        /// Создание нового порта используя ToolBox
        /// </summary>
        /// <param name="Direction"></param>
        /// <param name="pt"></param>
        public void CreateNewPort_Dragged(Schematix.FSM.My_Port.PortDirection Direction, 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_Port port = new Schematix.FSM.My_Port("Port" + graph.Ports.Count.ToString(), "STD_LOGIC", pt, this);
            SelectedFigure = port;
            port.Direction = Direction;
            graph.AddFigure(port);
            Lock = false;
            //AddToHistory("New port Draged");
            bitmap.UpdateBitmap();
        }