Beispiel #1
0
        protected Dictionary <string, string> vars = new Dictionary <string, string>();   //skaiciu kintamuju klase

        public Vykdymas(PFiguros psm)
        {
            p   = psm;
            Mat = new Matematika(vars);
            Vk  = new VKeisti(vars, p);
            Vp  = new VPiesk(p);
        }
Beispiel #2
0
        private void NaujaKomanda(object sender, KeyPressEventArgs e)
        {
            //des tarpeliu panaikinimo - palieka tik max po viena
            Matematika m     = new Matematika(null);
            string     ttext = ivestis.Text;

            ttext = m.Nunulinimas(ttext, ' ');

            //pabandyti ivesti nulinima, nes dabar veiks tik su dviem pozicijom
            if (e.KeyChar == (char)13 &&
                (ttext.Length == 1 ||
                 ((ttext.Length > 1 && (ttext[ttext.Length - 2] != ',' && ttext[ttext.Length - 2] != ':')) &&
                  (ttext.Length > 2 && (ttext[ttext.Length - 3] != ',' && ttext[ttext.Length - 3] != ':')))))
            {
                nm = 0;
                mem.Add(ivestis.Text);

                isvestis.Text += mem[mem.Count - 1];
                ivestis.Text   = "";
                try
                {
                    v.Nauja(mem[mem.Count - 1]);
                }
                catch (Exception e2)
                {
                    string tmp = isvestis.Text;
                    isvestis.Text = tmp.Substring(0, tmp.Length - 1) + "   <--- sintaksės klaida!\n";
                }

                //kodo zymejimas
                KodoZymejimas(isvestis);
            }


            //po <
            if (e.KeyChar == 'B' && mem.Count >= 1 && nm < mem.Count)
            {
                ivestis.Text = mem[mem.Count - nm - 1];
                nm++;
            }
            //po >
            if (e.KeyChar == 'F' && nm >= 1 && nm >= 0 && nm < mem.Count)
            {
                ivestis.Text = mem[mem.Count - nm - 1];
                nm--;
            }

            //kodo zymejimas
            KodoZymejimas(ivestis);
            ivestis.SelectionColor = Color.Black;
            ivestis.SelectionFont  = dfnt;
        }