Пример #1
0
        /// <summary>
        /// Constructor with parameters
        /// </summary>
        /// <param name="programManager">reference to programManager</param>
        /// <param name="contorDecizie">index for naming</param>
        public DecisionCommandPanel(ProgramManagerCommand programManager, int contorDecizie) : base(programManager)
        {
            TextBox textBox1 = new TextBox();

            textBox1.BackColor = System.Drawing.Color.White;
            textBox1.Location  = new System.Drawing.Point(34, 33);
            textBox1.Name      = "panelDecizie" + contorDecizie;
            textBox1.Size      = new System.Drawing.Size(100, 20);
            textBox1.TabIndex  = 0;
            textBox1.KeyUp    += new KeyEventHandler(this.ProcessString);

            label1           = new Label();
            label1.AutoSize  = true;
            label1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label1.ForeColor = System.Drawing.Color.White;
            label1.Location  = new System.Drawing.Point(76, -3);
            label1.Name      = "label_up" + contorDecizie;
            label1.Size      = new System.Drawing.Size(21, 24);
            label1.TabIndex  = 0;
            label1.Text      = "+";

            label2           = new Label();
            label2.AutoSize  = true;
            label2.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label2.ForeColor = System.Drawing.Color.White;
            label2.Location  = new System.Drawing.Point(-1, 33);
            label2.Name      = "label_left" + contorDecizie;
            label2.Size      = new System.Drawing.Size(21, 24);
            label2.TabIndex  = 0;
            label2.Text      = "+";

            label3           = new Label();
            label3.AutoSize  = true;
            label3.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label3.ForeColor = System.Drawing.Color.White;
            label3.Location  = new System.Drawing.Point(152, 33);
            label3.Name      = "label_right" + contorDecizie;
            label3.Size      = new System.Drawing.Size(21, 24);
            label3.TabIndex  = 0;
            label3.Text      = "+";

            label1.Click += new EventHandler(this.LabelUpClick);
            label2.Click += new EventHandler(this.LabelLeftClick);
            label3.Click += new EventHandler(this.LabelRightClick);


            this.Controls.Add(label1);
            this.Controls.Add(label2);
            this.Controls.Add(label3);
            this.Controls.Add(textBox1);
        }
        /// <summary>
        /// Constructor with parameters
        /// </summary>
        /// <param name="programManager">reference to programManager</param>
        /// <param name="terminal">reference to the terminal that the string will be writen</param>
        /// <param name="contorScrieText">constor used for naming</param>
        public WriteTextCommandPanel(ProgramManagerCommand programManager, ConsoleTextBox terminal, int contorScrieText) : base(programManager)
        {
            _terminal = terminal;

            RichTextBox richTextBox = new RichTextBox();

            richTextBox.BackColor = System.Drawing.Color.White;
            richTextBox.Location  = new System.Drawing.Point(21, 28);
            richTextBox.Name      = "panelScrieText" + contorScrieText;
            richTextBox.Size      = new System.Drawing.Size(136, 53);
            richTextBox.TabIndex  = 0;
            richTextBox.Text      = "";
            richTextBox.KeyUp    += new KeyEventHandler(this.ProcessString);

            label1           = new Label();
            label1.AutoSize  = true;
            label1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label1.ForeColor = System.Drawing.Color.White;
            label1.Location  = new System.Drawing.Point(79, -1);
            label1.Name      = "label_up" + contorScrieText;
            label1.Size      = new System.Drawing.Size(21, 24);
            label1.TabIndex  = 0;
            label1.Text      = "+";

            label2           = new Label();
            label2.AutoSize  = true;
            label2.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label2.ForeColor = System.Drawing.Color.White;
            label2.Location  = new System.Drawing.Point(80, 86);
            label2.Name      = "label_down" + contorScrieText;
            label2.Size      = new System.Drawing.Size(21, 24);
            label2.TabIndex  = 0;
            label2.Text      = "+";

            label1.Click += new EventHandler(this.LabelUpClick);
            label2.Click += new EventHandler(this.LabelLeftClick);

            this.Controls.Add(label1);
            this.Controls.Add(label2);



            this.Controls.Add(richTextBox);
        }
Пример #3
0
        /// <summary>
        /// Constructor with parameters
        /// </summary>
        /// <param name="programManager">reference to programManger</param>
        /// <param name="terminal">Terminal use to write</param>
        /// <param name="contorScrieVar">index used for naming</param>
        public WriteVariableCommandPanel(ProgramManagerCommand programManager, ConsoleTextBox terminal, int contorScrieVar) : base(programManager)
        {
            _terminal = terminal;

            TextBox textBox3 = new TextBox();

            textBox3.BackColor = System.Drawing.Color.White;
            textBox3.Location  = new System.Drawing.Point(13, 30);
            textBox3.Name      = "panelScrieVar" + contorScrieVar;
            textBox3.Size      = new System.Drawing.Size(145, 20);
            textBox3.TabIndex  = 0;
            textBox3.KeyUp    += new KeyEventHandler(this.ProcessString);
            this.Controls.Add(textBox3);


            label1           = new Label();
            label1.AutoSize  = true;
            label1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label1.ForeColor = System.Drawing.Color.White;
            label1.Location  = new System.Drawing.Point(76, -2);
            label1.Name      = "label_up" + contorScrieVar;
            label1.Size      = new System.Drawing.Size(21, 24);
            label1.TabIndex  = 0;
            label1.Text      = "+";

            label2           = new Label();
            label2.AutoSize  = true;
            label2.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label2.ForeColor = System.Drawing.Color.White;
            label2.Location  = new System.Drawing.Point(76, 58);
            label2.Name      = "label_down" + contorScrieVar;
            label2.Size      = new System.Drawing.Size(21, 24);
            label2.TabIndex  = 0;
            label2.Text      = "+";

            label1.Click += new EventHandler(this.LabelUpClick);
            label2.Click += new EventHandler(this.LabelLeftClick);

            this.Controls.Add(label1);
            this.Controls.Add(label2);
        }
        /// <summary>
        /// The parameter constructor
        /// </summary>
        /// <param name="pm">the program manager</param>
        /// <param name="contorAtribuire">contor used for controls names</param>
        public AttribCommandPannel(ProgramManagerCommand pm, int contorAtribuire) : base(pm)
        {
            TextBox textBox = new TextBox();

            textBox.BackColor = Color.White;
            textBox.Location  = new Point(17, 31);
            textBox.Name      = "textBoxAtribuire" + contorAtribuire;
            textBox.Size      = new Size(141, 20);
            textBox.TabIndex  = 0;
            textBox.KeyUp    += new KeyEventHandler(this.ProcessString);

            label2           = new Label();
            label2.AutoSize  = true;
            label2.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label2.ForeColor = System.Drawing.Color.White;
            label2.Location  = new System.Drawing.Point(78, 58);
            label2.Name      = "label_down" + contorAtribuire;
            label2.Size      = new System.Drawing.Size(21, 24);
            label2.TabIndex  = 0;
            label2.Text      = "+";

            label1           = new Label();
            label1.AutoSize  = true;
            label1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label1.ForeColor = System.Drawing.Color.White;
            label1.Location  = new System.Drawing.Point(78, -2);
            label1.Name      = "label_up";
            label1.Size      = new System.Drawing.Size(21, 24);
            label1.TabIndex  = 1;
            label1.Text      = "+";

            label2.Click += new EventHandler(this.LabelLeftClick);
            label1.Click += new EventHandler(this.LabelUpClick);

            this.Controls.Add(label1);
            this.Controls.Add(label2);

            this.Controls.Add(textBox);
        }
Пример #5
0
        /// <summary>
        /// Implicit constructor
        /// </summary>
        public Form1()
        {
            InitializeComponent();

            panelStart            = new StartCommandPanel();
            panelStart.MouseDown += new MouseEventHandler(this.MyControl_MouseDown);
            panelStart.MouseMove += new MouseEventHandler(this.MyControl_MouseMove);

            panelEnd            = new StopCommandPanel();
            panelEnd.MouseDown += new MouseEventHandler(this.MyControl_MouseDown);
            panelEnd.MouseMove += new MouseEventHandler(this.MyControl_MouseMove);

            panelDrawing.Controls.Add(panelStart);
            panelDrawing.Controls.Add(panelEnd);
            pictureBoxDrawing.SendToBack();

            Console.WriteLine("Creating Program Manager...");
            _programManager = new ProgramManagerCommand(panelStart, panelEnd);
            _programManager.ConsoleTextBox = consoleTextBox;
            panelStart.ProgramManager      = _programManager;
            panelEnd.ProgramManager        = _programManager;
            Console.WriteLine("Program Manager created!");

            /*consoleObject = new ConsoleTextBox();
             * panelDrawing.Controls.Add(consoleObject);
             * pictureBoxDrawing.SendToBack();*/


            _drawArea = new Bitmap(1920, 1080);
            pictureBoxDrawing.Image = _drawArea;
            _graphics    = Graphics.FromImage(_drawArea);
            _myPen       = _myPen = new Pen(Brushes.Black);
            _myPen.Color = Color.BlueViolet;
            _myPen.Width = 3;

            AllocConsole();
        }
 /// <summary>
 /// Constructor with parameters
 /// </summary>
 /// <param name="programManager">reference to programManager</param>
 public CommandPanel(ProgramManagerCommand programManager)
 {
     _programManager = programManager;
 }