Exemplo n.º 1
0
        public void add_element(byte type, int x, int y, Panel group, Neyron_DB n_DB)
        {
            if (type == NEYRON)
            {
                normalize_ n = new normalize_();
                n.index_ = neyrons_.Count;
                n.type   = 'n';
                element_neyron el = new element_neyron(neyrons_.Count,
                                                       x, y, group, n_DB);

                neyrons_.Add(el);
                steks_.Add(n);
            }
            else if (type == SWITCH)
            {
                normalize_ n = new normalize_();
                n.index_ = switchs_.Count;
                n.type   = 's';
                element_switch el = new element_switch();
                switchs_.Add(el);
                steks_.Add(n);
            }
            else if (type == BOX)
            {
                normalize_ n = new normalize_();
                n.index_ = boxings_.Count;
                n.type   = 'b';
                element_boxing el = new element_boxing();
                boxings_.Add(el);
                steks_.Add(n);
            }
            else if (type == UNBOX)
            {
                normalize_ n = new normalize_();
                n.index_ = unboxings_.Count;
                n.type   = 'u';
                element_unboxing el = new element_unboxing();
                unboxings_.Add(el);
                steks_.Add(n);
            }
            else if (type == CODE)
            {
                normalize_ n = new normalize_();
                n.index_ = code_blocks_.Count;
                n.type   = 'c';
                element_code el = new element_code();
                code_blocks_.Add(el);
                steks_.Add(n);
            }
        }
Exemplo n.º 2
0
            //Neyron_DB neyron_s;

            public element_code(int inde_x, int x, int y, Panel group, Neyron_DB n)
            {
                //index__ = inde_x;
                group_box = new Panel();
                __neyros  = new ComboBox();
                //name = new TextBox();
                neyron_next = new ComboBox();
                code        = new TextBox();
                //neyron_s = n;

                group_box.Height    = 150;
                group_box.Width     = 93;
                group_box.BackColor = Color.White;
                group_box.Controls.Add(__neyros);
                group_box.Controls.Add(neyron_next);
                //group_box.Controls.Add(name);
                group_box.Controls.Add(code);


                __neyros.Width    = 72;
                __neyros.Height   = 70;
                __neyros.Location = new Point(10, 10);


                neyron_next.Width    = 72;
                neyron_next.Height   = 20;
                neyron_next.Location = new Point(10, 90);
                foreach (string item in n.names)
                {
                    neyron_next.Items.Add(item);
                }
                neyron_next.TextChanged += Neyron_next_TextChanged;
                neyron_next.Name         = inde_x.ToString();

                //name.Width = 72;
                //name.Height = 20;
                //name.TextChanged += Name_TextChanged;
                //name.Location = new Point(10, 120);


                int index = group.Controls.Count;

                group.Controls.Add(group_box);
                group.Controls[index].Location = new Point(x, y);
            }