Beispiel #1
0
        void CB5SelectedIndexChanged(object sender, EventArgs e)
        {
            AddSmth addsmth = new AddSmth();

            if ((sender as ComboBox).Text == "New variable...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddVar(addsmth.Input);
                VarEd vared = new VarEd(store.GetVar(addsmth.Input));
                vared.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
            if ((sender as ComboBox).Text == "New block...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddGBlock(addsmth.Input);
                CmbEd cmbed = new CmbEd(store.GetGBlock(addsmth.Input), null, store);

                cmbed.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
            if ((sender as ComboBox).Text == "New location...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddLoc(addsmth.Input);
                LocEd loced = new LocEd(store.GetLoc(addsmth.Input), store);

                loced.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
            if ((sender as ComboBox).Text == "New item...")
            {
                addsmth.ShowDialog();
                if (addsmth.Input == "")
                {
                    return;
                }
                store.AddItm(addsmth.Input);
                ItmEd itmed = new ItmEd(store.GetItm(addsmth.Input), store);

                itmed.ShowDialog();
                (sender as ComboBox).Items.Add(addsmth.Input);
                (sender as ComboBox).Text = addsmth.Input;
            }
        }
Beispiel #2
0
 void Button2Click(object sender, EventArgs e)
 {
     addsmth.ShowDialog();
     if (addsmth.Input != "")
     {
         storage.AddVar(addsmth.Input);
         VarEd vared = new VarEd(storage.GetVar(addsmth.Input));
         vared.ShowDialog();
     }
     storage.RefreshVars(listBox2);
 }
Beispiel #3
0
        void Button3Click(object sender, EventArgs e)
        {
            CmBlock tmp     = new CmBlock();
            AddSmth addsmth = new AddSmth();

            addsmth.ShowDialog();
            tmp.name = addsmth.Input;
            if (addsmth.Input != "")
            {
                loca.AddCmBlock(tmp);
                CmbEd cmbed = new CmbEd(loca.GetCmBlock(addsmth.Input), null, store);
                cmbed.Show();
                loca.RefreshActions(comboBox2);
                comboBox2.Text = "";
            }
        }
Beispiel #4
0
 void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.Text == "New block...")
     {
         AddSmth addsmth = new AddSmth();
         addsmth.ShowDialog();
         if (addsmth.Input != "")
         {
             store.AddGBlock(addsmth.Input);
             CmBlock cmb   = store.GetGBlock(addsmth.Input);
             CmbEd   cmbed = new CmbEd(cmb, null, store);
             cmbed.ShowDialog();
             comboBox1.Items.Add(addsmth.Input);
             comboBox1.Text = cmb.name;
         }
     }
 }