Beispiel #1
0
        public Inc4()
        {
            input0 = new Nibble();
            output0 = new Nibble();

            input0.Deletable = false;
            input0.Draggable = false;
            output0.Deletable = false;
            output0.Draggable = false;

            one = new Bit();
            add = new Add4();

            Connections.CrossConnect(input0.OutputPoint0, add.Input0.InputPoint0);
            Connections.CrossConnect(input0.OutputPoint1, add.Input0.InputPoint1);
            Connections.CrossConnect(input0.OutputPoint2, add.Input0.InputPoint2);
            Connections.CrossConnect(input0.OutputPoint3, add.Input0.InputPoint3);
            Connections.CrossConnect(one.OutputPoint, add.Input1.InputPoint1);
            Connections.CrossConnect(add.Output0.OutputPoint0, output0.InputPoint0);
            Connections.CrossConnect(add.Output0.OutputPoint1, output0.InputPoint1);
            Connections.CrossConnect(add.Output0.OutputPoint2, output0.InputPoint2);
            Connections.CrossConnect(add.Output0.OutputPoint3, output0.InputPoint3);

            one.Input = true;

            this.Controls.Add(input0);
            this.Controls.Add(output0);
            this.ContextMenuStrip = cms;
        }
 private void addToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Add4 g = new Add4();
     g.Location = calcLocation();
     g.Size = s.Equals(LogicGate.small) ? LGComponent4.small : s.Equals(LogicGate.medium) ? LGComponent4.medium : LGComponent4.large;
     g.Font = new Font(g.Font.FontFamily, fs);
     g.Name = g.GetType().Name + namecntr++;
     this.Controls.Add(g);
 }