Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
        void Button6Click(object sender, EventArgs e)
        {
            VarEd vared;

            if (listBox2.SelectedIndex != -1)
            {
                vared = new VarEd(storage.GetVar(listBox2.SelectedItem.ToString()));
                vared.ShowDialog();
            }
            storage.RefreshVars(listBox2);
        }