Ejemplo n.º 1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            try
            {
                Logica    logicaAux = (Logica)logicas[logica];
                ArrayList instAux   = logicaAux.obterArrayList();
                Instrucao inst      = (Instrucao)instAux[pos];
                txtNovoNome.Text         = inst.obterNome();
                txtNovoNome.SelectedText = null;
                rbn1.Visible             = true;
                rbn2.Visible             = true;
                label2.Visible           = true;
                switch (inst.obterTipo())
                {
                case "SEL": rbn1.Text = "SEL";
                    rbn2.Text         = "SED";
                    rbn1.Select();
                    break;

                case "SED": rbn1.Text = "SEL";
                    rbn2.Text         = "SED";
                    rbn2.Select();
                    break;

                case "E": rbn1.Text = "E";
                    rbn2.Text       = "EN";
                    rbn1.Select();
                    break;

                case "EN": rbn1.Text = "E";
                    rbn2.Text        = "EN";
                    rbn2.Select();
                    break;

                case "OU": rbn1.Text = "OU";
                    rbn2.Text        = "OUN";
                    rbn1.Select();
                    break;

                case "OUN": rbn1.Text = "OU";
                    rbn2.Text         = "OUN";
                    rbn2.Select();
                    break;

                case "MEMO":
                    rbn1.Text      = "MEMO";
                    rbn1.Visible   = false;
                    rbn2.Visible   = false;
                    label2.Visible = false;
                    break;

                default: break;
                }
                panelAlterar.Visible = true;
            }
            catch
            {
                MessageBox.Show("Nada para alterar");
            }
        }
Ejemplo n.º 2
0
        private void redraw()
        {
            int index = 0;

            upAtual   = upIni;
            leftAtual = leftIni;
            List <String> logicaML = new List <String>();

            limpaTela();
            while (logicas.Count != 0)
            {
                Logica    logicaAux  = (Logica)logicas[0];
                ArrayList instrucoes = logicaAux.obterArrayList();
                logicaML.Add("");
                for (int j = 0; j < instrucoes.Count; j++)
                {
                    Instrucao instAux = (Instrucao)instrucoes[j];
                    logicaML[index] += instAux.obterTipo();
                    logicaML[index] += "(";
                    logicaML[index] += instAux.obterNome();
                    logicaML[index] += ")";
                    logicaML[index] += System.Environment.NewLine;
                }
                logicas.Remove(logicas[0]);
                logica--;
                index++;
            }
            for (int i = 0; i < index; i++)
            {
                pos = 0;
                colarML(logicaML[i]);
            }
            for (int i = 0; i < buttonsAdded.Count; i++)
            {
                buttonsAdded[i].BackColor = Color.White;
            }
        }
Ejemplo n.º 3
0
 private void insereMEMO(String nome)
 {
     panelAlterar.Visible = false;
     try
     {
         leftAtual += 150;
         Button btnAux = buttonsAdded[0];
         upAtual = btnAux.Location.Y;
         Logica    aux        = (Logica)logicas[logica];
         ArrayList instrucoes = aux.obterArrayList();
         pos = instrucoes.Count;
         aux.insereMEMO(nome, pos);
         Panel pnl = panelsAdded[logica];
         #region peçaMEMO
         Button btn = new Button();
         btn.Location          = new Point(leftAtual, upAtual);
         btn.Height            = 120;
         btn.Width             = 150;
         btn.Text              = nome;
         btn.Image             = imageList1.Images[8];
         btn.TextImageRelation = TextImageRelation.TextAboveImage;
         btn.FlatStyle         = FlatStyle.Flat;
         btn.Tag    = pos;
         btn.Click += delegate { btnLadder(btn, pnl); };
         pnl.Controls.Add(btn);
         buttonsAdded.Add(btn);
         btnLadder(btn, pnl);
         #endregion
         txtNome.Text = "";
         btn.AccessibleDescription = "Full";
     }
     catch
     {
         MessageBox.Show("Deve se iniciar com SEL ou SED");
     }
 }