Example #1
0
        private void FormMeters_Load(object sender, EventArgs e)
        {
            Point LocatinPoint = new Point(450, 250);
            int PointInterval = 25;

            probe = Resource1.probe;

            TempVp = new VerticalProgressBar();
            OilVp = new VerticalProgressBar();

            TempVp.Location = LocatinPoint;
            TempVp.Width=20;
            TempVp.Height = 100;
            TempVp.Value = 10;
            TempVp.Maximum = 500;
            OilVp.Maximum = 500;
 
            OilVp.Location = new Point(LocatinPoint.X+PointInterval, LocatinPoint.Y);
            OilVp.Width = 20;
            OilVp.Height = 100;
            OilVp.Value = 30;

            this.Controls.Add(TempVp);
            this.Controls.Add(OilVp);


        }
Example #2
0
        //-------------------------------------------------
        public VKStart(Database.Connection db, VerticalProgressBar vBar)
            : base(db, vBar)
        {
            InitializeComponent();

            //insta
        }
Example #3
0
 public output(int num)
 {
     m_num=num;
     InitializeComponent();
     m_Bars = new List<VerticalProgressBar>(m_num);
     mLabels = new List<Label>(m_num);
     VerticalProgressBar temp;
     Label lbl;
     for (int i = 0; i < m_num; i++)
     {
         temp = new VerticalProgressBar();
         temp.Top = 0;
         temp.Width = barW;
         temp.Height=barH;
         temp.Left = (barW + barM) * i;
         temp.Value = 0;
         temp.Maximum = 255;
         temp.Style = Styles.Solid;
         lbl = new Label();
         lbl.Text = string.Format("{0}", i + 1);
         lbl.Top = temp.Bottom + lbl.Margin.Top;
         lbl.Left = temp.Left;
         lbl.Width = barW;
         lbl.Height = 40;
         mLabels.Add(lbl);
         m_Bars.Add(temp);
         this.Controls.Add(temp);
         this.Controls.Add(lbl);
     }
 }
Example #4
0
        public VKWaiting(Database.Connection db, VerticalProgressBar vBar)
            : base(db, vBar)
        {
            InitializeComponent();

            waitingTimer.Tick += new EventHandler(waitingTimer_Waiting);
            waitingTimer.Interval = 1000;
        }
Example #5
0
        public VKQuestion(Database.Connection db, VerticalProgressBar vBar)
            : base(db, vBar)
        {
            InitializeComponent();

            dataGridView.DataSource = bindingSource;
            dataGridView.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
        }
 public AnalogSensorHandler(VerticalProgressBar.VerticalProgressBar[] _pbars, Label[] _labels)
 {
     this.LMotor = _pbars[0];
     this.LMotorLabel = _labels[0];
     this.RMotor = _pbars[1];
     this.RMotorLabel = _labels[1];
     this.Accu = _pbars[2];
     this.AccuLabel = _labels[2];
     this.Temp = _pbars[3];
     this.TempLabel = _labels[3];
 }
Example #7
0
        public OutputLevels(int num,int w,int h,int m)
        {
            bool d = this.Dock == DockStyle.Fill;
            mNum=num;
            if (d)
            {
                mBarMargin = m;
                mBarHeight = this.Height - 25;
                mBarWidth = this.Width / mNum;
            }
            else
            {
                mBarWidth = w;
                mBarHeight = h;
                mBarMargin = m;
            }
            InitializeComponent();
            mBars = new List<VerticalProgressBar>(mNum);
            mLabels = new List<Label>(mNum);
            VerticalProgressBar temp;
            Label lbl;
            this.SuspendLayout();
            for (int i = 0; i < mNum; i++)
            {
                temp = new VerticalProgressBar();
                temp.Top = 0;
                temp.Width = mBarWidth;
                temp.Height=mBarHeight;
                temp.Left = (this.Width + mBarMargin) * i / mNum;
                temp.Value = 0;
                temp.Maximum = 255;
                temp.Style = Styles.Solid;

                lbl = new Label();
                lbl.Text = string.Format("{0}", i + 1);
                lbl.Top = temp.Bottom + lbl.Margin.Top;
                lbl.Left = temp.Left;
                lbl.Width = mBarWidth;
                lbl.Height = 25;
                mLabels.Add(lbl);
                mBars.Add(temp);
                this.Controls.Add(temp);
                this.Controls.Add(lbl);
            }
            this.ResumeLayout(false);
        }
Example #8
0
 public VKFinish(VerticalProgressBar vb)
     : base(null, vb)
 {
     InitializeComponent();
 }
Example #9
0
        //*************************************
        //           GUI Routines
        //*************************************
        private void AddFDVSliceControls(Slice slc)
        {
            lock (this)
            {
                int index = _fdvSlices.IndexOf(slc);
                label1.Visible = false;

                this.SuspendLayout();

                TextBox txtIn = new TextBox();
                TextBox txtOut = new TextBox();
                VerticalProgressBar bar = new VerticalProgressBar();
                GroupBox groupbox = new GroupBox();
                groupbox.SuspendLayout();
                //
                // groupBox
                //
                groupbox.Controls.Add(txtIn);
                groupbox.Controls.Add(txtOut);
                groupbox.Controls.Add(bar);
                groupbox.Location = new Point(10, 10 + index * 110);
                groupbox.Name = "grpSlice" + index;
                groupbox.Size = new Size(260, 100);
                groupbox.Text = "Slice " + SliceIndexToLetter(slc.Index);
                //
                // txtIn
                //
                txtIn.Location = new Point(40, 30);
                txtIn.Name = "txtIn" + slc.Index;
                txtIn.Size = new Size(200, 20);
                txtIn.ReadOnly = true;
                //
                // txtOut
                //
                txtOut.Location = new Point(40, 60);
                txtOut.Name = "txtOut" + slc.Index;
                txtOut.Size = new Size(200, 20);
                txtOut.PreviewKeyDown += new PreviewKeyDownEventHandler(txtOut_PreviewKeyDown);
                //
                // bar
                //
                bar.Location = new Point(10, 20);
                bar.Name = "bar" + slc.Index;
                bar.Size = new Size(20, 70);
                bar.Value = 25;
                //
                // Form1
                //
                if (groupbox.Bottom > this.Height)
                    this.Height += 110;
                this.Controls.Add(groupbox);
                groupbox.ResumeLayout();
                this.ResumeLayout(false);
                this.PerformLayout();
            }
        }
        private void criarGuiches(int quantidade, GuichesSetup[] guiches)
        {
            //declarando os vetores em função da quantidade de guiches
            guichesBotao = new PictureBox[quantidade];

            for (int i = 0; i < quantidade; i++)
            {
                //
                // guiches
                //
                guichesBotao[i] = new System.Windows.Forms.PictureBox();
                int    inicio;
                String aux = "";

                if (i <= 14)
                {
                    inicio = Constantes.TAMANHO_HORIZONTAL - (Constantes.TAMANHO_HORIZONTAL / quantidade * (quantidade - 1)) - (100 - (quantidade * 3));
                }
                else
                {
                    inicio = (Constantes.TAMANHO_VERTICAL - 250) - ((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * (quantidade - 15)) - (100 - (quantidade * 3));
                }

                if (i <= 14)  //gerando os 15 primeiros guiches de baixo
                {
                    this.guichesBotao[i].Location = new System.Drawing.Point((quantidade > 15 ? Constantes.TAMANHO_HORIZONTAL / 15 * i:Constantes.TAMANHO_HORIZONTAL / quantidade * i) + (inicio / 2), Constantes.TAMANHO_VERTICAL - 90);
                }
                else    //gerando os 5 ultimos guiches no lado direito em cima
                {
                    this.guichesBotao[i].Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
                    this.guichesBotao[i].Location = new System.Drawing.Point(1270, (Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * (i - 14) - (inicio / 2));
                }
                //gerando o tamanho dos guiches
                this.guichesBotao[i].Size = new System.Drawing.Size(100 - (quantidade * 3), 100 - (quantidade * 3));

                this.guichesBotao[i].Click    += new System.EventHandler(this.Clique_Guiche);
                this.guichesBotao[i].BackColor = System.Drawing.Color.DarkGray;
                //texto dos guiches
                aux += guiches[i].guiche;
                this.guichesBotao[i].Text = aux;
                aux = "";

                this.Controls.Add(this.guichesBotao[i]);
                this.ResumeLayout(false);
            }


            verticalProgressBar = new VerticalProgressBar[quantidade > 15 ? 15 : quantidade];                    //declarando a quantidade de barras de progresso verticais
            progressBar         = new System.Windows.Forms.ProgressBar[quantidade > 15 ? (quantidade - 15) : 0]; //declarando a quantidade de barras de progressos horizontais

            textoFila    = new System.Windows.Forms.Label[quantidade];                                           //declarando a quantidade de textoFilas
            textoGuiches = new System.Windows.Forms.Label[quantidade];

            //Criando barras de progresso
            for (int j = 0; j < quantidade; j++)
            {
                if (j <= 14)        //criando as 15 primeiras barras de progresso
                {
                    verticalProgressBar[j] = new VerticalProgressBar();

                    int inicio = Constantes.TAMANHO_HORIZONTAL - (Constantes.TAMANHO_HORIZONTAL / quantidade * (quantidade - 1) + 18);

                    if (j + guiches[j].guichesIguais - 1 > 14)
                    {
                        verticalProgressBar[j].Location = new System.Drawing.Point((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * j : Constantes.TAMANHO_HORIZONTAL / quantidade * j) + inicio / 2, 410);
                    }

                    else if (guiches[j].guichesIguais % 2 == 0)
                    {
                        verticalProgressBar[j].Location = new System.Drawing.Point((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * (j + guiches[j].guichesIguais / 2 - 1) : Constantes.TAMANHO_HORIZONTAL / quantidade * (j + guiches[j].guichesIguais / 2 - 1)) + inicio / 2 + (Constantes.TAMANHO_HORIZONTAL / (quantidade > 15 ? 15 : quantidade) / 2), 410);

                        //criando label que conta tamanho da fila e o tipo de guiche
                        textoFila[j]    = new System.Windows.Forms.Label();
                        textoGuiches[j] = new System.Windows.Forms.Label();

                        textoGuiches[j].BackColor = System.Drawing.Color.Transparent;
                        textoGuiches[j].AutoSize  = true;
                        textoGuiches[j].ForeColor = System.Drawing.Color.White;
                        textoGuiches[j].Location  = new System.Drawing.Point((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * (j + guiches[j].guichesIguais / 2 - 1) : Constantes.TAMANHO_HORIZONTAL / quantidade * (j + guiches[j].guichesIguais / 2 - 1)) + inicio / 2 + (Constantes.TAMANHO_HORIZONTAL / (quantidade > 15 ? 15 : quantidade) / 2) - 15, 650);
                        textoGuiches[j].Text      = "Guiche " + postos[j].ToString();
                        Controls.Add(textoGuiches[j]);

                        textoFila[j].BackColor = System.Drawing.Color.Transparent;
                        textoFila[j].ForeColor = System.Drawing.Color.White;
                        textoFila[j].AutoSize  = true;
                        textoFila[j].Location  = new System.Drawing.Point((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * (j + guiches[j].guichesIguais / 2 - 1) : Constantes.TAMANHO_HORIZONTAL / quantidade * (j + guiches[j].guichesIguais / 2 - 1)) + inicio / 2 + (Constantes.TAMANHO_HORIZONTAL / (quantidade > 15 ? 15 : quantidade) / 2), 390);
                        Controls.Add(textoFila[j]);
                    }
                    else
                    {
                        verticalProgressBar[j].Location = new System.Drawing.Point((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * (j + guiches[j].guichesIguais / 2) : Constantes.TAMANHO_HORIZONTAL / quantidade * (j + guiches[j].guichesIguais / 2)) + inicio / 2, 410);

                        //criando label que conta tamanho da fila e o tipo de guiche
                        textoFila[j]    = new System.Windows.Forms.Label();
                        textoGuiches[j] = new System.Windows.Forms.Label();

                        textoGuiches[j].BackColor = System.Drawing.Color.Transparent;
                        textoGuiches[j].AutoSize  = true;
                        textoGuiches[j].ForeColor = System.Drawing.Color.White;
                        textoGuiches[j].Location  = new System.Drawing.Point(((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * (j + guiches[j].guichesIguais / 2) : Constantes.TAMANHO_HORIZONTAL / quantidade * (j + guiches[j].guichesIguais / 2)) - 15 + inicio / 2), 650);
                        textoGuiches[j].Text      = "Guiche " + postos[j].ToString();
                        Controls.Add(textoGuiches[j]);

                        textoFila[j].BackColor = System.Drawing.Color.Transparent;
                        textoFila[j].ForeColor = System.Drawing.Color.White;
                        textoFila[j].AutoSize  = true;
                        textoFila[j].Location  = new System.Drawing.Point((quantidade > 14 ? Constantes.TAMANHO_HORIZONTAL / 15 * (j + guiches[j].guichesIguais / 2) : Constantes.TAMANHO_HORIZONTAL / quantidade * (j + guiches[j].guichesIguais / 2)) + inicio / 2, 390);
                        Controls.Add(textoFila[j]);
                    }

                    verticalProgressBar[j].Size    = new System.Drawing.Size(18, 163);
                    verticalProgressBar[j].Maximum = 10;

                    this.Controls.Add(verticalProgressBar[j]);

                    j += guiches[j].guichesIguais - 1;
                }
                else
                {      //criando as ultimas 5 barras de progresso
                    progressBar[j - 15] = new System.Windows.Forms.ProgressBar();

                    int inicio = (Constantes.TAMANHO_VERTICAL - 250) - (((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * (quantidade - 15) - 60));

                    if (guiches[j].guichesIguais % 2 == 0)
                    {
                        progressBar[j - 15].Location = new System.Drawing.Point(1100, (Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * ((j - 15) + guiches[j].guichesIguais / 2 - 1) + (inicio / 2) + ((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) / 2));

                        //criando label que conta tamanho da fila
                        textoFila[j]    = new System.Windows.Forms.Label();
                        textoGuiches[j] = new System.Windows.Forms.Label();

                        textoGuiches[j].BackColor = System.Drawing.Color.Transparent;
                        textoGuiches[j].AutoSize  = true;
                        textoGuiches[j].ForeColor = System.Drawing.Color.White;
                        textoGuiches[j].Location  = new System.Drawing.Point(1150, ((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * ((j - 15) + guiches[j].guichesIguais / 2 - 1) + (inicio / 2) + ((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) / 2)) - 15);
                        textoGuiches[j].Text      = "Guiche " + postos[j].ToString();
                        Controls.Add(textoGuiches[j]);

                        textoFila[j].BackColor = System.Drawing.Color.Transparent;
                        textoFila[j].ForeColor = System.Drawing.Color.White;
                        textoFila[j].AutoSize  = true;
                        textoFila[j].Location  = new System.Drawing.Point(1080, (Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * ((j - 15) + guiches[j].guichesIguais / 2 - 1) + (inicio / 2) + ((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) / 2));
                        Controls.Add(textoFila[j]);
                    }
                    else
                    {
                        progressBar[j - 15].Location = new System.Drawing.Point(1100, (Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * ((j - 14) + guiches[j].guichesIguais / 2 - 1) + (inicio / 2));

                        //criando label que conta tamanho da fila
                        textoFila[j]    = new System.Windows.Forms.Label();
                        textoGuiches[j] = new System.Windows.Forms.Label();

                        textoGuiches[j].BackColor = System.Drawing.Color.Transparent;
                        textoGuiches[j].AutoSize  = true;
                        textoGuiches[j].ForeColor = System.Drawing.Color.White;
                        textoGuiches[j].Location  = new System.Drawing.Point(1150, ((Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * ((j - 14) + guiches[j].guichesIguais / 2 - 1) + (inicio / 2)) - 20);
                        textoGuiches[j].Text      = "Guiche " + postos[j].ToString();
                        Controls.Add(textoGuiches[j]);

                        textoFila[j].BackColor = System.Drawing.Color.Transparent;
                        textoFila[j].ForeColor = System.Drawing.Color.White;
                        textoFila[j].AutoSize  = true;
                        textoFila[j].Location  = new System.Drawing.Point(1080, (Constantes.TAMANHO_VERTICAL - 250) / (quantidade - 14) * ((j - 14) + guiches[j].guichesIguais / 2 - 1) + (inicio / 2));
                        Controls.Add(textoFila[j]);
                    }

                    progressBar[j - 15].Size = new System.Drawing.Size(163, 18);

                    Controls.Add(progressBar[j - 15]);

                    j += guiches[j].guichesIguais - 1;
                }
            }
        }
        private void BuildUI()
        {
            _menuItemNew      = new MenuItem();
            _menuItemNew.Id   = "_menuItemNew";
            _menuItemNew.Text = "&New";

            _menuItemOpen      = new MenuItem();
            _menuItemOpen.Id   = "_menuItemOpen";
            _menuItemOpen.Text = "&Open";

            _menuItemSave      = new MenuItem();
            _menuItemSave.Id   = "_menuItemSave";
            _menuItemSave.Text = "&Save";

            _menuItemSaveAs      = new MenuItem();
            _menuItemSaveAs.Id   = "_menuItemSaveAs";
            _menuItemSaveAs.Text = "Save &As...";

            var menuSeparator1 = new MenuSeparator();

            _menuItemQuit      = new MenuItem();
            _menuItemQuit.Id   = "_menuItemQuit";
            _menuItemQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuItemNew);
            menuItem1.Items.Add(_menuItemOpen);
            menuItem1.Items.Add(_menuItemSave);
            menuItem1.Items.Add(_menuItemSaveAs);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuItemQuit);

            _menuItemCopy      = new MenuItem();
            _menuItemCopy.Id   = "_menuItemCopy";
            _menuItemCopy.Text = "&Copy";

            _menuItemPaste      = new MenuItem();
            _menuItemPaste.Id   = "_menuItemPaste";
            _menuItemPaste.Text = "&Paste";

            var menuSeparator2 = new MenuSeparator();

            _menuItemUndo      = new MenuItem();
            _menuItemUndo.Id   = "_menuItemUndo";
            _menuItemUndo.Text = "&Undo";

            _menuItemRedo      = new MenuItem();
            _menuItemRedo.Id   = "_menuItemRedo";
            _menuItemRedo.Text = "&Redo";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Edit";
            menuItem2.Items.Add(_menuItemCopy);
            menuItem2.Items.Add(_menuItemPaste);
            menuItem2.Items.Add(menuSeparator2);
            menuItem2.Items.Add(_menuItemUndo);
            menuItem2.Items.Add(_menuItemRedo);

            _menuItemAbout      = new MenuItem();
            _menuItemAbout.Id   = "_menuItemAbout";
            _menuItemAbout.Text = "&About";

            var menuItem3 = new MenuItem();

            menuItem3.Id   = "";
            menuItem3.Text = "&Help";
            menuItem3.Items.Add(_menuItemAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.DrawLinesColor      = Color.White;
            horizontalMenu1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalMenu1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(menuItem2);
            horizontalMenu1.Items.Add(menuItem3);

            var textBlock1 = new TextBlock();

            textBlock1.Text              = "Button:";
            textBlock1.TextColor         = Color.White;
            textBlock1.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock1.Id = "";

            _button                            = new Button();
            _button.Text                       = "Show Window";
            _button.TextColor                  = Color.White;
            _button.ImageTextSpacing           = 8;
            _button.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _button.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _button.Id                         = "_button";
            _button.PaddingLeft                = 8;
            _button.PaddingRight               = 8;
            _button.GridPositionX              = 1;

            var textBlock2 = new TextBlock();

            textBlock2.Text              = "Blue Button:";
            textBlock2.TextColor         = Color.White;
            textBlock2.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock2.Id            = "";
            textBlock2.GridPositionY = 1;

            _blueButton                            = new Button("blue");
            _blueButton.Text                       = "Show Window";
            _blueButton.TextColor                  = Color.White;
            _blueButton.ImageTextSpacing           = 8;
            _blueButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _blueButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _blueButton.Id                         = "_blueButton";
            _blueButton.PaddingLeft                = 8;
            _blueButton.PaddingRight               = 8;
            _blueButton.GridPositionX              = 1;
            _blueButton.GridPositionY              = 1;

            var textBlock3 = new TextBlock();

            textBlock3.Text              = "Text Button:";
            textBlock3.TextColor         = Color.White;
            textBlock3.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock3.Id            = "";
            textBlock3.GridPositionY = 2;

            _textButton           = new TextButton();
            _textButton.Text      = "Show Window";
            _textButton.TextColor = Color.White;
            _textButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _textButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _textButton.Id            = "_textButton";
            _textButton.PaddingLeft   = 8;
            _textButton.PaddingRight  = 8;
            _textButton.GridPositionX = 1;
            _textButton.GridPositionY = 2;

            var textBlock4 = new TextBlock();

            textBlock4.Text              = "Image Button:";
            textBlock4.TextColor         = Color.White;
            textBlock4.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock4.Id            = "";
            textBlock4.GridPositionY = 3;

            _imageButton = new ImageButton();
            _imageButton.ImageVisible = true;
            _imageButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _imageButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _imageButton.Id            = "_imageButton";
            _imageButton.PaddingLeft   = 8;
            _imageButton.PaddingRight  = 8;
            _imageButton.GridPositionX = 1;
            _imageButton.GridPositionY = 3;

            var checkBox1 = new CheckBox();

            checkBox1.Text                       = "This is checkbox";
            checkBox1.TextColor                  = Color.White;
            checkBox1.ImageWidthHint             = 10;
            checkBox1.ImageHeightHint            = 10;
            checkBox1.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            checkBox1.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            checkBox1.GridPositionY              = 4;
            checkBox1.GridSpanX                  = 2;

            var textBlock5 = new TextBlock();

            textBlock5.Text              = "Horizontal Slider:";
            textBlock5.TextColor         = Color.White;
            textBlock5.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock5.Id            = "";
            textBlock5.GridPositionY = 5;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.Maximum             = 100;
            horizontalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalSlider1.GridPositionX       = 1;
            horizontalSlider1.GridPositionY       = 5;

            var textBlock6 = new TextBlock();

            textBlock6.Text              = "Combo Box:";
            textBlock6.TextColor         = Color.White;
            textBlock6.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock6.GridPositionY = 6;

            var listItem1 = new ListItem();

            listItem1.Id    = "";
            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Text  = "Blue";
            listItem3.Color = new Color
            {
                B           = 255,
                G           = 128,
                A           = 255,
                PackedValue = 4294934528,
            };

            var comboBox1 = new ComboBox();

            comboBox1.WidthHint     = 200;
            comboBox1.GridPositionX = 1;
            comboBox1.GridPositionY = 6;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock7 = new TextBlock();

            textBlock7.Text              = "Text Field:";
            textBlock7.TextColor         = Color.White;
            textBlock7.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock7.GridPositionY = 7;

            var textField1 = new TextField();

            textField1.Text              = "";
            textField1.TextColor         = Color.White;
            textField1.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textField1.MessageTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textField1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            textField1.GridPositionX       = 1;
            textField1.GridPositionY       = 7;
            textField1.CanFocus            = true;

            var textBlock8 = new TextBlock();

            textBlock8.Text              = "Spin Button:";
            textBlock8.TextColor         = Color.White;
            textBlock8.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock8.GridPositionY = 8;

            var spinButton1 = new SpinButton();

            spinButton1.Value          = 0;
            spinButton1.DrawLinesColor = Color.White;
            spinButton1.WidthHint      = 100;
            spinButton1.GridPositionX  = 1;
            spinButton1.GridPositionY  = 8;

            var textBlock9 = new TextBlock();

            textBlock9.Text              = "List Box:";
            textBlock9.TextColor         = Color.White;
            textBlock9.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock9.GridPositionY = 9;

            var listItem4 = new ListItem();

            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.DrawLinesColor      = Color.White;
            listBox1.WidthHint           = 200;
            listBox1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            listBox1.GridPositionX       = 1;
            listBox1.GridPositionY       = 9;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock10 = new TextBlock();

            textBlock10.Text              = "Vertical Menu:";
            textBlock10.TextColor         = Color.White;
            textBlock10.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock10.GridPositionY = 10;

            var menuItem4 = new MenuItem();

            menuItem4.Id   = "";
            menuItem4.Text = "Start New Game";

            var menuItem5 = new MenuItem();

            menuItem5.Id   = "";
            menuItem5.Text = "Options";

            var menuItem6 = new MenuItem();

            menuItem6.Id   = "";
            menuItem6.Text = "Quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.DrawLinesColor    = Color.White;
            verticalMenu1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalMenu1.GridPositionX     = 1;
            verticalMenu1.GridPositionY     = 10;
            verticalMenu1.Items.Add(menuItem4);
            verticalMenu1.Items.Add(menuItem5);
            verticalMenu1.Items.Add(menuItem6);

            var textBlock11 = new TextBlock();

            textBlock11.Text              = "Tree";
            textBlock11.TextColor         = Color.White;
            textBlock11.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };
            textBlock11.GridPositionY = 11;

            _gridRight = new Grid();
            _gridRight.DrawLinesColor = Color.White;
            _gridRight.ColumnSpacing  = 8;
            _gridRight.RowSpacing     = 8;
            _gridRight.ColumnsProportions.Add(new Proportion());
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.RowsProportions.Add(new Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _gridRight.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_button);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_blueButton);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(_textButton);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock7);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock8);
            _gridRight.Widgets.Add(spinButton1);
            _gridRight.Widgets.Add(textBlock9);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock10);
            _gridRight.Widgets.Add(verticalMenu1);
            _gridRight.Widgets.Add(textBlock11);

            var scrollPane1 = new ScrollPane();

            scrollPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            scrollPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            scrollPane1.ClipToBounds        = true;
            scrollPane1.CanFocus            = true;
            scrollPane1.Child = _gridRight;

            var textBlock12 = new TextBlock();

            textBlock12.Text              = "Vertical Slider:";
            textBlock12.TextColor         = Color.White;
            textBlock12.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.Maximum             = 100;
            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSlider1.GridPositionY       = 1;

            var grid1 = new Grid();

            grid1.DrawLinesColor = Color.White;
            grid1.RowSpacing     = 8;
            grid1.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Proportion());
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid1.Widgets.Add(textBlock12);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock13 = new TextBlock();

            textBlock13.Text              = "Progress Bars:";
            textBlock13.TextColor         = Color.White;
            textBlock13.DisabledTextColor = new Color
            {
                B           = 170,
                G           = 170,
                R           = 170,
                A           = 255,
                PackedValue = 4289374890,
            };

            _horizontalProgressBar                     = new HorizontalProgressBar();
            _horizontalProgressBar.Maximum             = 100;
            _horizontalProgressBar.DrawLinesColor      = Color.White;
            _horizontalProgressBar.Id                  = "_horizontalProgressBar";
            _horizontalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _horizontalProgressBar.GridPositionY       = 1;

            _verticalProgressBar                     = new VerticalProgressBar();
            _verticalProgressBar.Maximum             = 100;
            _verticalProgressBar.DrawLinesColor      = Color.White;
            _verticalProgressBar.Id                  = "_verticalProgressBar";
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _verticalProgressBar.GridPositionY       = 2;

            var grid2 = new Grid();

            grid2.DrawLinesColor = Color.White;
            grid2.RowSpacing     = 8;
            grid2.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Proportion());
            grid2.RowsProportions.Add(new Proportion());
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid2.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid2.GridPositionY       = 2;
            grid2.Widgets.Add(textBlock13);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            verticalSplitPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSplitPane1.GridPositionX       = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);

            var horizontalSplitPane1 = new HorizontalSplitPane();

            horizontalSplitPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalSplitPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalSplitPane1.GridPositionY       = 1;
            horizontalSplitPane1.Widgets.Add(scrollPane1);
            horizontalSplitPane1.Widgets.Add(verticalSplitPane1);


            DrawLinesColor = Color.White;
            RowSpacing     = 8;
            RowsProportions.Add(new Proportion());
            RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            Widgets.Add(horizontalMenu1);
            Widgets.Add(horizontalSplitPane1);
        }
        private void BuildUI()
        {
            _menuItemOpenFile              = new MenuItem();
            _menuItemOpenFile.Text         = "&Open";
            _menuItemOpenFile.ShortcutText = "Ctrl+O";
            _menuItemOpenFile.Id           = "_menuItemOpenFile";

            _menuItemSaveFile              = new MenuItem();
            _menuItemSaveFile.Text         = "&Save";
            _menuItemSaveFile.ShortcutText = "Ctrl+S";
            _menuItemSaveFile.Id           = "_menuItemSaveFile";

            _menuItemChooseFolder              = new MenuItem();
            _menuItemChooseFolder.Text         = "Choose Fol&der";
            _menuItemChooseFolder.ShortcutText = "Ctrl+D";
            _menuItemChooseFolder.Id           = "_menuItemChooseFolder";

            _menuItemChooseColor              = new MenuItem();
            _menuItemChooseColor.Text         = "Choose Co&lor";
            _menuItemChooseColor.ShortcutText = "Ctrl+L";
            _menuItemChooseColor.Id           = "_menuItemChooseColor";

            var menuSeparator1 = new MenuSeparator();

            _menuItemQuit              = new MenuItem();
            _menuItemQuit.Text         = "&Quit";
            _menuItemQuit.ShortcutText = "Ctrl+Q";
            _menuItemQuit.Id           = "_menuItemQuit";

            _menuFile      = new MenuItem();
            _menuFile.Text = "&File";
            _menuFile.Id   = "_menuFile";
            _menuFile.Items.Add(_menuItemOpenFile);
            _menuFile.Items.Add(_menuItemSaveFile);
            _menuFile.Items.Add(_menuItemChooseFolder);
            _menuFile.Items.Add(_menuItemChooseColor);
            _menuFile.Items.Add(menuSeparator1);
            _menuFile.Items.Add(_menuItemQuit);

            _menuItemCopy              = new MenuItem();
            _menuItemCopy.Text         = "&Copy";
            _menuItemCopy.ShortcutText = "Ctrl+Insert, Ctrl+C";
            _menuItemCopy.Id           = "_menuItemCopy";

            _menuItemPaste              = new MenuItem();
            _menuItemPaste.Text         = "&Paste";
            _menuItemPaste.ShortcutText = "Shift+Insert, Ctrl+V";
            _menuItemPaste.Id           = "_menuItemPaste";

            var menuSeparator2 = new MenuSeparator();

            _menuItemUndo              = new MenuItem();
            _menuItemUndo.Text         = "&Undo";
            _menuItemUndo.ShortcutText = "Ctrl+Z";
            _menuItemUndo.Id           = "_menuItemUndo";

            _menuItemRedo              = new MenuItem();
            _menuItemRedo.Text         = "&Redo";
            _menuItemRedo.ShortcutText = "Ctrl+Y";
            _menuItemRedo.Id           = "_menuItemRedo";

            _menuEdit      = new MenuItem();
            _menuEdit.Text = "&Edit";
            _menuEdit.Id   = "_menuEdit";
            _menuEdit.Items.Add(_menuItemCopy);
            _menuEdit.Items.Add(_menuItemPaste);
            _menuEdit.Items.Add(menuSeparator2);
            _menuEdit.Items.Add(_menuItemUndo);
            _menuEdit.Items.Add(_menuItemRedo);

            _menuItemAbout      = new MenuItem();
            _menuItemAbout.Text = "&About";
            _menuItemAbout.Id   = "_menuItemAbout";

            _menuHelp      = new MenuItem();
            _menuHelp.Text = "&Help";
            _menuHelp.Id   = "_menuHelp";
            _menuHelp.Items.Add(_menuItemAbout);

            _mainMenu = new HorizontalMenu();
            _mainMenu.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _mainMenu.Id = "_mainMenu";
            _mainMenu.Items.Add(_menuFile);
            _mainMenu.Items.Add(_menuEdit);
            _mainMenu.Items.Add(_menuHelp);

            var label1 = new Label();

            label1.Text = "Button:";

            _buttonSaveFile            = new ImageTextButton();
            _buttonSaveFile.Text       = "Save File";
            _buttonSaveFile.Padding    = new Thickness(8, 0);
            _buttonSaveFile.GridColumn = 1;
            _buttonSaveFile.Id         = "_buttonSaveFile";

            _textSaveFile            = new TextBox();
            _textSaveFile.GridColumn = 2;
            _textSaveFile.Id         = "_textSaveFile";

            var label2 = new Label();

            label2.Text    = "Another Button:";
            label2.GridRow = 1;

            _buttonOpenFile            = new ImageTextButton();
            _buttonOpenFile.Text       = "Open File";
            _buttonOpenFile.Padding    = new Thickness(8, 0);
            _buttonOpenFile.GridColumn = 1;
            _buttonOpenFile.GridRow    = 1;
            _buttonOpenFile.Id         = "_buttonOpenFile";

            _textOpenFile            = new TextBox();
            _textOpenFile.GridColumn = 2;
            _textOpenFile.GridRow    = 1;
            _textOpenFile.Id         = "_textOpenFile";

            var label3 = new Label();

            label3.Text    = "Blue Button:";
            label3.GridRow = 2;

            _buttonChooseFolder            = new ImageTextButton("blue");
            _buttonChooseFolder.Text       = "Choose Folder";
            _buttonChooseFolder.Padding    = new Thickness(8, 0);
            _buttonChooseFolder.GridColumn = 1;
            _buttonChooseFolder.GridRow    = 2;
            _buttonChooseFolder.Id         = "_buttonChooseFolder";

            _textChooseFolder            = new TextBox();
            _textChooseFolder.GridColumn = 2;
            _textChooseFolder.GridRow    = 2;
            _textChooseFolder.Id         = "_textChooseFolder";

            _textButtonLabel         = new Label();
            _textButtonLabel.Text    = "Text Button:";
            _textButtonLabel.GridRow = 3;
            _textButtonLabel.Id      = "_textButtonLabel";

            _buttonChooseColor            = new TextButton();
            _buttonChooseColor.Text       = "Choose Color";
            _buttonChooseColor.Padding    = new Thickness(8, 0);
            _buttonChooseColor.GridColumn = 1;
            _buttonChooseColor.GridRow    = 3;
            _buttonChooseColor.Id         = "_buttonChooseColor";

            var label4 = new Label();

            label4.Text    = "Image Button:";
            label4.GridRow = 4;

            _imageButton            = new ImageButton();
            _imageButton.Padding    = new Thickness(8, 0);
            _imageButton.GridColumn = 1;
            _imageButton.GridRow    = 4;
            _imageButton.Id         = "_imageButton";

            var checkBox1 = new CheckBox();

            checkBox1.Text           = "This is checkbox";
            checkBox1.ImageWidth     = 10;
            checkBox1.ImageHeight    = 10;
            checkBox1.GridRow        = 5;
            checkBox1.GridColumnSpan = 2;

            var label5 = new Label();

            label5.Text    = "Horizontal Slider:";
            label5.GridRow = 6;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.GridColumn     = 1;
            horizontalSlider1.GridRow        = 6;
            horizontalSlider1.GridColumnSpan = 2;

            var label6 = new Label();

            label6.Text    = "Combo Box:";
            label6.GridRow = 7;

            var listItem1 = new ListItem();

            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Text  = "Blue";
            listItem3.Color = ColorStorage.CreateColor(0, 128, 255, 255);

            var comboBox1 = new ComboBox();

            comboBox1.Width          = 200;
            comboBox1.GridColumn     = 1;
            comboBox1.GridRow        = 7;
            comboBox1.GridColumnSpan = 2;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var label7 = new Label();

            label7.Text    = "Text Field:";
            label7.GridRow = 8;

            var textBox1 = new TextBox();

            textBox1.GridColumn     = 1;
            textBox1.GridRow        = 8;
            textBox1.GridColumnSpan = 2;

            var label8 = new Label();

            label8.Text    = "Spin Button:";
            label8.GridRow = 9;

            var spinButton1 = new SpinButton();

            spinButton1.Value      = 1;
            spinButton1.Width      = 100;
            spinButton1.GridColumn = 1;
            spinButton1.GridRow    = 9;

            var label9 = new Label();

            label9.Text    = "List Box:";
            label9.GridRow = 10;

            var listItem4 = new ListItem();

            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.Width          = 200;
            listBox1.GridColumn     = 1;
            listBox1.GridRow        = 10;
            listBox1.GridColumnSpan = 2;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var label10 = new Label();

            label10.Text    = "Vertical Menu:";
            label10.GridRow = 11;

            var menuItem1 = new MenuItem();

            menuItem1.Text = "Start New Game";

            var menuItem2 = new MenuItem();

            menuItem2.Text = "Options";

            var menuItem3 = new MenuItem();

            menuItem3.Text = "Quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.GridColumn = 1;
            verticalMenu1.GridRow    = 11;
            verticalMenu1.Items.Add(menuItem1);
            verticalMenu1.Items.Add(menuItem2);
            verticalMenu1.Items.Add(menuItem3);

            var label11 = new Label();

            label11.Text    = "Tree";
            label11.GridRow = 12;

            _gridRight = new Grid();
            _gridRight.ColumnSpacing        = 8;
            _gridRight.RowSpacing           = 8;
            _gridRight.DefaultRowProportion = new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            };
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            _gridRight.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            _gridRight.Id = "_gridRight";
            _gridRight.Widgets.Add(label1);
            _gridRight.Widgets.Add(_buttonSaveFile);
            _gridRight.Widgets.Add(_textSaveFile);
            _gridRight.Widgets.Add(label2);
            _gridRight.Widgets.Add(_buttonOpenFile);
            _gridRight.Widgets.Add(_textOpenFile);
            _gridRight.Widgets.Add(label3);
            _gridRight.Widgets.Add(_buttonChooseFolder);
            _gridRight.Widgets.Add(_textChooseFolder);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_buttonChooseColor);
            _gridRight.Widgets.Add(label4);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(label5);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(label6);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(label7);
            _gridRight.Widgets.Add(textBox1);
            _gridRight.Widgets.Add(label8);
            _gridRight.Widgets.Add(spinButton1);
            _gridRight.Widgets.Add(label9);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(label10);
            _gridRight.Widgets.Add(verticalMenu1);
            _gridRight.Widgets.Add(label11);

            var scrollViewer1 = new ScrollViewer();

            scrollViewer1.Content = _gridRight;

            var label12 = new Label();

            label12.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.GridRow             = 1;

            var grid1 = new Grid();

            grid1.RowSpacing = 8;
            grid1.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid1.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid1.Widgets.Add(label12);
            grid1.Widgets.Add(verticalSlider1);

            var label13 = new Label();

            label13.Text = "Progress Bars:";

            _horizontalProgressBar         = new HorizontalProgressBar();
            _horizontalProgressBar.GridRow = 1;
            _horizontalProgressBar.Id      = "_horizontalProgressBar";

            _verticalProgressBar = new VerticalProgressBar();
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.GridRow             = 2;
            _verticalProgressBar.Id = "_verticalProgressBar";

            var grid2 = new Grid();

            grid2.RowSpacing = 8;
            grid2.ColumnsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            grid2.RowsProportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            grid2.Widgets.Add(label13);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);

            var horizontalSplitPane1 = new HorizontalSplitPane();

            horizontalSplitPane1.Widgets.Add(scrollViewer1);
            horizontalSplitPane1.Widgets.Add(verticalSplitPane1);


            Spacing = 8;
            Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Auto,
            });
            Proportions.Add(new Proportion
            {
                Type = Myra.Graphics2D.UI.ProportionType.Fill,
            });
            Widgets.Add(_mainMenu);
            Widgets.Add(horizontalSplitPane1);
        }
Example #13
0
        protected override void LoadContent()
        {
            base.LoadContent();

            MyraEnvironment.Game = this;

            // Widget.DrawFrames = true;
            _host = new Desktop();

            var grid = new Grid
            {
                RowSpacing    = 3,
                ColumnSpacing = 3,
//				DrawLines = true
            };

            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 1.0f));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 2.0f));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Pixels, 150.0f));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.ColumnsProportions.Add(new Grid.Proportion(Grid.ProportionType.Fill));

            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 1.0f));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Part, 1.0f));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Pixels, 200.0f));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Auto));
            grid.RowsProportions.Add(new Grid.Proportion(Grid.ProportionType.Fill));

            // Create headers
            for (var i = 1; i < grid.ColumnsProportions.Count; ++i)
            {
                var header = new TextBlock
                {
                    Text          = grid.ColumnsProportions[i].ToString(),
                    GridPositionX = i,
                    GridPositionY = 0
                };

                grid.Widgets.Add(header);
            }

            // Combo
            var combo = new ComboBox
            {
                GridPositionX = 1,
                GridPositionY = 1
            };

            combo.Items.Add(new ListItem("Red", Color.Red));
            combo.Items.Add(new ListItem("Green", Color.Green));
            combo.Items.Add(new ListItem("Blue", Color.Blue));
            grid.Widgets.Add(combo);

            // Button
            var button = new Button
            {
                GridPositionX       = 2,
                GridPositionY       = 1,
                GridSpanX           = 2,
                GridSpanY           = 1,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Text = "This is 2 columns button"
            };

            button.Down += (s, a) =>
            {
                var messageBox = Dialog.CreateMessageBox("2C", "2 Columns Button pushed!");
                messageBox.ShowModal(_host);
            };

            grid.Widgets.Add(button);

            // Button
            var button2 = new Button
            {
                GridPositionX       = 2,
                GridPositionY       = 2,
                GridSpanX           = 1,
                GridSpanY           = 2,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Text = "This is 2 rows button"
            };

            button2.Down += (s, a) =>
            {
                var messageBox = Dialog.CreateMessageBox("2R", "2 Rows Button pushed!");
                messageBox.ShowModal(_host);
            };
            grid.Widgets.Add(button2);

            var label = new TextBlock
            {
                Text =
                    "Lorem ipsum [Green]dolor sit amet, [Red]consectetur adipisicing elit, sed do eiusmod [#AAAAAAAA]tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. [white]Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!",
                VerticalSpacing = 0,
                TextColor       = Color.AntiqueWhite,
                Wrap            = true
            };

            var pane = new ScrollPane
            {
                Widget     = label,
                WidthHint  = 200,
                HeightHint = 200
            };

            _window = new Window
            {
                Title   = "Text",
                Content = pane
            };

            var button3 = new Button
            {
                Text          = "Show Window",
                GridPositionX = 4,
                GridPositionY = 3
            };

            grid.Widgets.Add(button3);

            button3.Up += (sender, args) =>
            {
                _window.ShowModal(_host);
            };

            // Horizontal slider
            var hslider = new HorizontalSlider
            {
                GridPositionX = 3,
                GridPositionY = 2
            };

            grid.Widgets.Add(hslider);

            // Horizontal slider value
            var hsliderValue = new TextBlock
            {
                GridPositionX = 4,
                GridPositionY = 2,
                Text          = "HSlider Value: 0"
            };

            hslider.ValueChanged += (sender, args) =>
            {
                hsliderValue.Text = string.Format("HSlider Value: {0:0.00}", hslider.Value);
            };

            grid.Widgets.Add(hsliderValue);

            var textBlock = new TextBlock
            {
                WidthHint     = 125,
                Text          = "This is textblock which spans for several lines to demonstrate row proportion set to Auto",
                GridPositionX = 4,
                GridPositionY = 1
            };

            grid.Widgets.Add(textBlock);

            var checkBox = new CheckBox
            {
                Text          = "This is a checkbox",
                GridPositionX = 3,
                GridPositionY = 3,
            };

            grid.Widgets.Add(checkBox);

            // Spin buttons
            var textField = new TextField
            {
                GridPositionX = 5,
                GridPositionY = 1,
                WidthHint     = 100
            };

            grid.Widgets.Add(textField);

            var spinButton2 = new SpinButton
            {
                GridPositionX = 5,
                GridPositionY = 2,
                WidthHint     = 100,
                Integer       = true
            };

            grid.Widgets.Add(spinButton2);

            // Progress bars
            _horizontalProgressBar = new HorizontalProgressBar
            {
                GridPositionX = 5,
                GridPositionY = 3,
                WidthHint     = 100
            };
            grid.Widgets.Add(_horizontalProgressBar);

            _verticalProgressBar = new VerticalProgressBar
            {
                GridPositionX = 6,
                GridPositionY = 1,
                HeightHint    = 100
            };
            grid.Widgets.Add(_verticalProgressBar);

            // List box
            var list = new ListBox
            {
                GridPositionX = 5,
                GridPositionY = 4
            };

            list.Items.Add(new ListItem("Red", Color.Red));
            list.Items.Add(new ListItem("Green", Color.Green));
            list.Items.Add(new ListItem("Blue", Color.Blue));
            grid.Widgets.Add(list);

            // Vertical slider
            var vslider = new VerticalSlider
            {
                GridPositionX = 2,
                GridPositionY = 4
            };

            grid.Widgets.Add(vslider);

            // Vertical slider value
            var vsliderValue = new TextBlock
            {
                GridPositionX = 4,
                GridPositionY = 4,
                Text          = "VSlider Value: 0"
            };

            vslider.ValueChanged += (sender, args) =>
            {
                vsliderValue.Text = string.Format("VSlider Value: {0:0.00}", vslider.Value);
            };

            grid.Widgets.Add(vsliderValue);

            var tree = new Tree
            {
                HasRoot       = false,
                GridPositionX = 3,
                GridPositionY = 4
            };
            var node1 = tree.AddSubNode("node1");
            var node2 = node1.AddSubNode("node2");
            var node3 = node2.AddSubNode("node3");

            node3.AddSubNode("node4");
            node3.AddSubNode("node5");
            node2.AddSubNode("node6");

            grid.Widgets.Add(tree);

            var textBlock2 = new TextBlock
            {
                Text          = "This is long textblock",
                GridPositionX = 1,
                GridPositionY = 4
            };

            grid.Widgets.Add(textBlock2);

            var hsplitPane = new HorizontalSplitPane
            {
                GridPositionX = 1,
                GridPositionY = 5
            };
            var hsplitPaneLabel1 = new TextBlock
            {
                Text = "Left"
            };

            hsplitPane.Widgets.Add(hsplitPaneLabel1);
            var hsplitPaneLabel2 = new TextBlock
            {
                Text = "Right"
            };

            hsplitPane.Widgets.Add(hsplitPaneLabel2);
            grid.Widgets.Add(hsplitPane);

            var vsplitPane = new VerticalSplitPane
            {
                GridPositionX = 6,
                GridPositionY = 4
            };
            var vsplitPaneLabel1 = new TextBlock
            {
                Text = "Top"
            };

            vsplitPane.Widgets.Add(vsplitPaneLabel1);
            var vsplitPaneLabel2 = new TextBlock
            {
                Text = "Bottom"
            };

            vsplitPane.Widgets.Add(vsplitPaneLabel2);
            grid.Widgets.Add(vsplitPane);

            for (var i = 1; i < grid.RowsProportions.Count; ++i)
            {
                var header = new TextBlock
                {
                    Text          = grid.RowsProportions[i].ToString(),
                    GridPositionX = 0,
                    GridPositionY = i
                };

                grid.Widgets.Add(header);
            }

            _host.Widgets.Add(grid);
        }
Example #14
0
        private void BuildUI()
        {
            var textBlock1 = new TextBlock();

            textBlock1.Text = "Button:";
            textBlock1.Id   = "";

            _button              = new ImageTextButton();
            _button.Text         = "Button";
            _button.Id           = "_button";
            _button.PaddingLeft  = 8;
            _button.PaddingRight = 8;
            _button.GridColumn   = 1;

            _textButtonLabel         = new TextBlock();
            _textButtonLabel.Text    = "Text Button:";
            _textButtonLabel.Id      = "_textButtonLabel";
            _textButtonLabel.GridRow = 1;

            _textButton              = new TextButton();
            _textButton.Text         = "Choose Color";
            _textButton.Id           = "_textButton";
            _textButton.PaddingLeft  = 8;
            _textButton.PaddingRight = 8;
            _textButton.GridColumn   = 1;
            _textButton.GridRow      = 1;

            var textBlock2 = new TextBlock();

            textBlock2.Text    = "Image Button:";
            textBlock2.Id      = "";
            textBlock2.GridRow = 2;

            _imageButton              = new ImageButton();
            _imageButton.Id           = "_imageButton";
            _imageButton.PaddingLeft  = 8;
            _imageButton.PaddingRight = 8;
            _imageButton.GridColumn   = 1;
            _imageButton.GridRow      = 2;

            var checkBox1 = new CheckBox();

            checkBox1.Text           = "This is checkbox";
            checkBox1.ImageWidth     = 10;
            checkBox1.ImageHeight    = 10;
            checkBox1.GridRow        = 3;
            checkBox1.GridColumnSpan = 2;

            var textBlock3 = new TextBlock();

            textBlock3.Text    = "Horizontal Slider:";
            textBlock3.Id      = "";
            textBlock3.GridRow = 4;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.GridColumn = 1;
            horizontalSlider1.GridRow    = 4;

            var textBlock4 = new TextBlock();

            textBlock4.Text    = "Combo Box:";
            textBlock4.GridRow = 5;

            var listItem1 = new ListItem();

            listItem1.Id    = "";
            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Id    = null;
            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Id    = null;
            listItem3.Text  = "Blue";
            listItem3.Color = new Color
            {
                B = 255,
                G = 128,
                R = 0,
                A = 255,
            };

            var comboBox1 = new ComboBox();

            comboBox1.Width      = 200;
            comboBox1.GridColumn = 1;
            comboBox1.GridRow    = 5;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock5 = new TextBlock();

            textBlock5.Text    = "Text Field:";
            textBlock5.GridRow = 6;

            var textField1 = new TextField();

            textField1.Text       = "";
            textField1.GridColumn = 1;
            textField1.GridRow    = 6;

            var textBlock6 = new TextBlock();

            textBlock6.Text    = "List Box:";
            textBlock6.GridRow = 7;

            var listItem4 = new ListItem();

            listItem4.Id    = null;
            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Id    = null;
            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Id    = null;
            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.Width      = 200;
            listBox1.GridColumn = 1;
            listBox1.GridRow    = 7;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock7 = new TextBlock();

            textBlock7.Text    = "Tree";
            textBlock7.GridRow = 8;

            _gridRight = new Grid();
            _gridRight.ColumnSpacing = 8;
            _gridRight.RowSpacing    = 8;
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_button);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_textButton);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock7);

            var scrollPane1 = new ScrollPane();

            scrollPane1.Content = _gridRight;

            var textBlock8 = new TextBlock();

            textBlock8.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.GridRow             = 1;

            var grid1 = new Grid();

            grid1.RowSpacing = 8;
            grid1.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.Widgets.Add(textBlock8);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock9 = new TextBlock();

            textBlock9.Text = "Progress Bars:";

            _horizontalProgressBar         = new HorizontalProgressBar();
            _horizontalProgressBar.Id      = "_horizontalProgressBar";
            _horizontalProgressBar.GridRow = 1;

            _verticalProgressBar = new VerticalProgressBar();
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.Id      = "_verticalProgressBar";
            _verticalProgressBar.GridRow = 2;

            var grid2 = new Grid();

            grid2.RowSpacing = 8;
            grid2.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.GridRow = 2;
            grid2.Widgets.Add(textBlock9);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.GridColumn = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);


            GridRow = 1;
            Widgets.Add(scrollPane1);
            Widgets.Add(verticalSplitPane1);
        }
Example #15
0
 public VKObject(Database.Connection db, VerticalProgressBar vBar)
     : base(db)
 {
     bar = vBar;
     InitializeComponent();
 }
Example #16
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.verticalProgressBar1 = new VerticalProgressBar();
     this.verticalProgressBar2 = new VerticalProgressBar();
     this.verticalProgressBar3 = new VerticalProgressBar();
     this.verticalProgressBar4 = new VerticalProgressBar();
     this.verticalProgressBar5 = new VerticalProgressBar();
     this.verticalProgressBar6 = new VerticalProgressBar();
     this.SuspendLayout();
     //
     // verticalProgressBar1
     //
     this.verticalProgressBar1.BorderStyle = BorderStyles.Classic;
     this.verticalProgressBar1.Color       = System.Drawing.Color.Blue;
     this.verticalProgressBar1.Location    = new System.Drawing.Point(24, 24);
     this.verticalProgressBar1.Maximum     = 100;
     this.verticalProgressBar1.Minimum     = 50;
     this.verticalProgressBar1.Name        = "verticalProgressBar1";
     this.verticalProgressBar1.Size        = new System.Drawing.Size(16, 120);
     this.verticalProgressBar1.Step        = 10;
     this.verticalProgressBar1.Style       = Styles.Classic;
     this.verticalProgressBar1.TabIndex    = 0;
     this.verticalProgressBar1.Value       = 80;
     //
     // verticalProgressBar2
     //
     this.verticalProgressBar2.BorderStyle = BorderStyles.None;
     this.verticalProgressBar2.Color       = System.Drawing.Color.Blue;
     this.verticalProgressBar2.Location    = new System.Drawing.Point(56, 24);
     this.verticalProgressBar2.Maximum     = 100;
     this.verticalProgressBar2.Minimum     = 0;
     this.verticalProgressBar2.Name        = "verticalProgressBar2";
     this.verticalProgressBar2.Size        = new System.Drawing.Size(10, 120);
     this.verticalProgressBar2.Step        = 10;
     this.verticalProgressBar2.Style       = Styles.Solid;
     this.verticalProgressBar2.TabIndex    = 1;
     this.verticalProgressBar2.Value       = 30;
     //
     // verticalProgressBar3
     //
     this.verticalProgressBar3.BorderStyle = BorderStyles.Classic;
     this.verticalProgressBar3.Color       = System.Drawing.Color.Brown;
     this.verticalProgressBar3.Location    = new System.Drawing.Point(88, 24);
     this.verticalProgressBar3.Maximum     = 100;
     this.verticalProgressBar3.Minimum     = -30;
     this.verticalProgressBar3.Name        = "verticalProgressBar3";
     this.verticalProgressBar3.Size        = new System.Drawing.Size(24, 120);
     this.verticalProgressBar3.Step        = 10;
     this.verticalProgressBar3.Style       = Styles.Classic;
     this.verticalProgressBar3.TabIndex    = 2;
     this.verticalProgressBar3.Value       = -20;
     //
     // verticalProgressBar4
     //
     this.verticalProgressBar4.BorderStyle = BorderStyles.Classic;
     this.verticalProgressBar4.Color       = System.Drawing.Color.CornflowerBlue;
     this.verticalProgressBar4.Location    = new System.Drawing.Point(128, 24);
     this.verticalProgressBar4.Maximum     = 100;
     this.verticalProgressBar4.Minimum     = 0;
     this.verticalProgressBar4.Name        = "verticalProgressBar4";
     this.verticalProgressBar4.Size        = new System.Drawing.Size(10, 120);
     this.verticalProgressBar4.Step        = 10;
     this.verticalProgressBar4.Style       = Styles.Classic;
     this.verticalProgressBar4.TabIndex    = 3;
     this.verticalProgressBar4.Value       = 50;
     //
     // verticalProgressBar5
     //
     this.verticalProgressBar5.BorderStyle = BorderStyles.Classic;
     this.verticalProgressBar5.Color       = System.Drawing.Color.Blue;
     this.verticalProgressBar5.Location    = new System.Drawing.Point(192, 24);
     this.verticalProgressBar5.Maximum     = 100;
     this.verticalProgressBar5.Minimum     = 0;
     this.verticalProgressBar5.Name        = "verticalProgressBar5";
     this.verticalProgressBar5.Size        = new System.Drawing.Size(10, 120);
     this.verticalProgressBar5.Step        = 10;
     this.verticalProgressBar5.Style       = Styles.Classic;
     this.verticalProgressBar5.TabIndex    = 1;
     this.verticalProgressBar5.Value       = 50;
     //
     // verticalProgressBar6
     //
     this.verticalProgressBar6.BorderStyle = BorderStyles.Classic;
     this.verticalProgressBar6.Color       = System.Drawing.Color.BurlyWood;
     this.verticalProgressBar6.Location    = new System.Drawing.Point(160, 24);
     this.verticalProgressBar6.Maximum     = 100;
     this.verticalProgressBar6.Minimum     = 0;
     this.verticalProgressBar6.Name        = "verticalProgressBar6";
     this.verticalProgressBar6.Size        = new System.Drawing.Size(10, 120);
     this.verticalProgressBar6.Step        = 10;
     this.verticalProgressBar6.Style       = Styles.Solid;
     this.verticalProgressBar6.TabIndex    = 0;
     this.verticalProgressBar6.Value       = 70;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(240, 166);
     this.Controls.Add(this.verticalProgressBar6);
     this.Controls.Add(this.verticalProgressBar5);
     this.Controls.Add(this.verticalProgressBar4);
     this.Controls.Add(this.verticalProgressBar3);
     this.Controls.Add(this.verticalProgressBar2);
     this.Controls.Add(this.verticalProgressBar1);
     this.Name = "Form1";
     this.Text = "Form1";
     this.ResumeLayout(false);
 }
Example #17
0
        private void BuildUI()
        {
            _menuItemNew      = new MenuItem();
            _menuItemNew.Id   = "_menuItemNew";
            _menuItemNew.Text = "&New";

            _menuItemOpen      = new MenuItem();
            _menuItemOpen.Id   = "_menuItemOpen";
            _menuItemOpen.Text = "&Open";

            _menuItemSave      = new MenuItem();
            _menuItemSave.Id   = "_menuItemSave";
            _menuItemSave.Text = "&Save";

            _menuItemSaveAs      = new MenuItem();
            _menuItemSaveAs.Id   = "_menuItemSaveAs";
            _menuItemSaveAs.Text = "Save &As...";

            var menuSeparator1 = new MenuSeparator();

            _menuItemQuit      = new MenuItem();
            _menuItemQuit.Id   = "_menuItemQuit";
            _menuItemQuit.Text = "&Quit";

            var menuItem1 = new MenuItem();

            menuItem1.Id   = "";
            menuItem1.Text = "&File";
            menuItem1.Items.Add(_menuItemNew);
            menuItem1.Items.Add(_menuItemOpen);
            menuItem1.Items.Add(_menuItemSave);
            menuItem1.Items.Add(_menuItemSaveAs);
            menuItem1.Items.Add(menuSeparator1);
            menuItem1.Items.Add(_menuItemQuit);

            _menuItemCopy      = new MenuItem();
            _menuItemCopy.Id   = "_menuItemCopy";
            _menuItemCopy.Text = "&Copy";

            _menuItemPaste      = new MenuItem();
            _menuItemPaste.Id   = "_menuItemPaste";
            _menuItemPaste.Text = "&Paste";

            var menuSeparator2 = new MenuSeparator();

            _menuItemUndo      = new MenuItem();
            _menuItemUndo.Id   = "_menuItemUndo";
            _menuItemUndo.Text = "&Undo";

            _menuItemRedo      = new MenuItem();
            _menuItemRedo.Id   = "_menuItemRedo";
            _menuItemRedo.Text = "&Redo";

            var menuItem2 = new MenuItem();

            menuItem2.Id   = "";
            menuItem2.Text = "&Edit";
            menuItem2.Items.Add(_menuItemCopy);
            menuItem2.Items.Add(_menuItemPaste);
            menuItem2.Items.Add(menuSeparator2);
            menuItem2.Items.Add(_menuItemUndo);
            menuItem2.Items.Add(_menuItemRedo);

            _menuItemAbout      = new MenuItem();
            _menuItemAbout.Id   = "_menuItemAbout";
            _menuItemAbout.Text = "&About";

            var menuItem3 = new MenuItem();

            menuItem3.Id   = "";
            menuItem3.Text = "&Help";
            menuItem3.Items.Add(_menuItemAbout);

            var horizontalMenu1 = new HorizontalMenu();

            horizontalMenu1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            horizontalMenu1.Items.Add(menuItem1);
            horizontalMenu1.Items.Add(menuItem2);
            horizontalMenu1.Items.Add(menuItem3);

            var textBlock1 = new TextBlock();

            textBlock1.Text = "Button:";
            textBlock1.Id   = "";

            _buttonSaveFile              = new Button();
            _buttonSaveFile.Text         = "Save File";
            _buttonSaveFile.Id           = "_buttonSaveFile";
            _buttonSaveFile.PaddingLeft  = 8;
            _buttonSaveFile.PaddingRight = 8;
            _buttonSaveFile.GridColumn   = 1;

            _textSaveFile            = new TextField();
            _textSaveFile.Text       = "";
            _textSaveFile.Id         = "_textSaveFile";
            _textSaveFile.GridColumn = 2;

            var textBlock2 = new TextBlock();

            textBlock2.Text    = "Another Button:";
            textBlock2.Id      = "";
            textBlock2.GridRow = 1;

            _buttonOpenFile              = new Button();
            _buttonOpenFile.Text         = "Open File";
            _buttonOpenFile.Id           = "_buttonOpenFile";
            _buttonOpenFile.PaddingLeft  = 8;
            _buttonOpenFile.PaddingRight = 8;
            _buttonOpenFile.GridColumn   = 1;
            _buttonOpenFile.GridRow      = 1;

            _textOpenFile            = new TextField();
            _textOpenFile.Text       = "";
            _textOpenFile.Id         = "_textOpenFile";
            _textOpenFile.GridColumn = 2;
            _textOpenFile.GridRow    = 1;

            var textBlock3 = new TextBlock();

            textBlock3.Text    = "Blue Button:";
            textBlock3.Id      = "";
            textBlock3.GridRow = 2;

            _buttonChooseFolder              = new Button("blue");
            _buttonChooseFolder.Text         = "Choose Folder";
            _buttonChooseFolder.Id           = "_buttonChooseFolder";
            _buttonChooseFolder.PaddingLeft  = 8;
            _buttonChooseFolder.PaddingRight = 8;
            _buttonChooseFolder.GridColumn   = 1;
            _buttonChooseFolder.GridRow      = 2;

            _textChooseFolder            = new TextField();
            _textChooseFolder.Text       = "";
            _textChooseFolder.Id         = "_textChooseFolder";
            _textChooseFolder.GridColumn = 2;
            _textChooseFolder.GridRow    = 2;

            _textButtonLabel         = new TextBlock();
            _textButtonLabel.Text    = "Text Button:";
            _textButtonLabel.Id      = "_textButtonLabel";
            _textButtonLabel.GridRow = 3;

            _buttonChooseColor              = new TextButton();
            _buttonChooseColor.Text         = "Choose Color";
            _buttonChooseColor.Id           = "_buttonChooseColor";
            _buttonChooseColor.PaddingLeft  = 8;
            _buttonChooseColor.PaddingRight = 8;
            _buttonChooseColor.GridColumn   = 1;
            _buttonChooseColor.GridRow      = 3;

            var textBlock4 = new TextBlock();

            textBlock4.Text    = "Image Button:";
            textBlock4.Id      = "";
            textBlock4.GridRow = 4;

            _imageButton              = new ImageButton();
            _imageButton.Id           = "_imageButton";
            _imageButton.PaddingLeft  = 8;
            _imageButton.PaddingRight = 8;
            _imageButton.GridColumn   = 1;
            _imageButton.GridRow      = 4;

            var checkBox1 = new CheckBox();

            checkBox1.Text           = "This is checkbox";
            checkBox1.ImageWidth     = 10;
            checkBox1.ImageHeight    = 10;
            checkBox1.GridRow        = 5;
            checkBox1.GridColumnSpan = 2;

            var textBlock5 = new TextBlock();

            textBlock5.Text    = "Horizontal Slider:";
            textBlock5.Id      = "";
            textBlock5.GridRow = 6;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.GridColumn     = 1;
            horizontalSlider1.GridRow        = 6;
            horizontalSlider1.GridColumnSpan = 2;

            var textBlock6 = new TextBlock();

            textBlock6.Text    = "Combo Box:";
            textBlock6.GridRow = 7;

            var listItem1 = new ListItem();

            listItem1.Id    = "";
            listItem1.Text  = "Red";
            listItem1.Color = Color.Red;

            var listItem2 = new ListItem();

            listItem2.Id    = null;
            listItem2.Text  = "Green";
            listItem2.Color = Color.Lime;

            var listItem3 = new ListItem();

            listItem3.Id    = null;
            listItem3.Text  = "Blue";
            listItem3.Color = new Color
            {
                B = 255,
                G = 128,
                R = 0,
                A = 255,
            };

            var comboBox1 = new ComboBox();

            comboBox1.SelectedIndex  = 1;
            comboBox1.Width          = 200;
            comboBox1.GridColumn     = 1;
            comboBox1.GridRow        = 7;
            comboBox1.GridColumnSpan = 2;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock7 = new TextBlock();

            textBlock7.Text    = "Text Field:";
            textBlock7.GridRow = 8;

            var textField1 = new TextField();

            textField1.Text           = "";
            textField1.GridColumn     = 1;
            textField1.GridRow        = 8;
            textField1.GridColumnSpan = 2;

            var textBlock8 = new TextBlock();

            textBlock8.Text    = "Spin Button:";
            textBlock8.GridRow = 9;

            var spinButton1 = new SpinButton();

            spinButton1.Width      = 100;
            spinButton1.GridColumn = 1;
            spinButton1.GridRow    = 9;

            var textBlock9 = new TextBlock();

            textBlock9.Text    = "List Box:";
            textBlock9.GridRow = 10;

            var listItem4 = new ListItem();

            listItem4.Id    = null;
            listItem4.Text  = "Red";
            listItem4.Color = Color.Red;

            var listItem5 = new ListItem();

            listItem5.Id    = null;
            listItem5.Text  = "Green";
            listItem5.Color = Color.Lime;

            var listItem6 = new ListItem();

            listItem6.Id    = null;
            listItem6.Text  = "Blue";
            listItem6.Color = Color.Blue;

            var listBox1 = new ListBox();

            listBox1.Width          = 200;
            listBox1.GridColumn     = 1;
            listBox1.GridRow        = 10;
            listBox1.GridColumnSpan = 2;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock10 = new TextBlock();

            textBlock10.Text    = "Vertical Menu:";
            textBlock10.GridRow = 11;

            var menuItem4 = new MenuItem();

            menuItem4.Id   = "";
            menuItem4.Text = "Start New Game";

            var menuItem5 = new MenuItem();

            menuItem5.Id   = "";
            menuItem5.Text = "Options";

            var menuItem6 = new MenuItem();

            menuItem6.Id   = "";
            menuItem6.Text = "Quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.GridColumn = 1;
            verticalMenu1.GridRow    = 11;
            verticalMenu1.Items.Add(menuItem4);
            verticalMenu1.Items.Add(menuItem5);
            verticalMenu1.Items.Add(menuItem6);

            var textBlock11 = new TextBlock();

            textBlock11.Text    = "Tree";
            textBlock11.GridRow = 12;

            _gridRight = new Grid();
            _gridRight.ColumnSpacing = 8;
            _gridRight.RowSpacing    = 8;
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_buttonSaveFile);
            _gridRight.Widgets.Add(_textSaveFile);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_buttonOpenFile);
            _gridRight.Widgets.Add(_textOpenFile);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(_buttonChooseFolder);
            _gridRight.Widgets.Add(_textChooseFolder);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_buttonChooseColor);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock7);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock8);
            _gridRight.Widgets.Add(spinButton1);
            _gridRight.Widgets.Add(textBlock9);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock10);
            _gridRight.Widgets.Add(verticalMenu1);
            _gridRight.Widgets.Add(textBlock11);

            var scrollPane1 = new ScrollPane();

            scrollPane1.Child = _gridRight;

            var textBlock12 = new TextBlock();

            textBlock12.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.GridRow             = 1;

            var grid1 = new Grid();

            grid1.RowSpacing = 8;
            grid1.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.Widgets.Add(textBlock12);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock13 = new TextBlock();

            textBlock13.Text = "Progress Bars:";

            _horizontalProgressBar         = new HorizontalProgressBar();
            _horizontalProgressBar.Id      = "_horizontalProgressBar";
            _horizontalProgressBar.GridRow = 1;

            _verticalProgressBar = new VerticalProgressBar();
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.Id      = "_verticalProgressBar";
            _verticalProgressBar.GridRow = 2;

            var grid2 = new Grid();

            grid2.RowSpacing = 8;
            grid2.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.GridRow = 2;
            grid2.Widgets.Add(textBlock13);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.GridColumn = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);

            var horizontalSplitPane1 = new HorizontalSplitPane();

            horizontalSplitPane1.GridRow = 1;
            horizontalSplitPane1.Widgets.Add(scrollPane1);
            horizontalSplitPane1.Widgets.Add(verticalSplitPane1);


            RowSpacing = 8;
            RowsProportions.Add(new Grid.Proportion());
            RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            Id = "Root";
            Widgets.Add(horizontalMenu1);
            Widgets.Add(horizontalSplitPane1);
        }
Example #18
0
 private void Form1_Load(object sender, EventArgs e)
 {
     string A = "00";
     string B = "00";
     string C = "1";
     string R = "0"+ B + C;
     img = Resource1.littleprobe;
     gearform = new FormGear();
     alist = new ArrayList();
     alist.Add(PARK);
     alist.Add(D1);
     alist.Add(D2);
     alist.Add(D3);
     alist.Add(D4);
     alist.Add(REVERS);
     ///the following codes
     ///initialize the hashtable
     ///
     htable = new Hashtable();
     htable.Add("speed", 0);
     htable.Add("gear", PARK);
     htable.Add("temp", 0);
     htable.Add("OilHeight",0);
     htable.Add(pressure, 0);
     htable.Add(speedtogo, 0);
     htable.Add(pressuretogo, 0);
     htable.Add(OilHeighttogo, 0);
     htable.Add(temptogo, 0);
     ///
     ///Init the ProgressBars
     ///
     int gap = 30;
     TempVpOnMain = new VerticalProgressBar();
     OilHeightVpOnMain = new VerticalProgressBar();
     TempVpOnMain.Location = new Point(750, 330);
     TempVpOnMain.Width = 20;
     TempVpOnMain.Height = 100;
     TempVpOnMain.Maximum = 500;
     OilHeightVpOnMain.Location = new Point(800+gap, 330);
     OilHeightVpOnMain.Width = 20;
     OilHeightVpOnMain.Height = 100;
     OilHeightVpOnMain.Maximum = 500;
     PressureProgressBar.Maximum = 500;
     
     this.Controls.Add(TempVpOnMain);
     this.Controls.Add(OilHeightVpOnMain);
 }
Example #19
0
        private void BuildUI()
        {
            var textBlock1 = new TextBlock();

            textBlock1.Text = "Button:";
            textBlock1.Id   = "";

            _button      = new Button();
            _button.Text = "Button";
            _button.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _button.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _button.Id            = "_button";
            _button.PaddingLeft   = 8;
            _button.PaddingRight  = 8;
            _button.GridPositionX = 1;

            _textButtonLabel               = new TextBlock();
            _textButtonLabel.Text          = "Text Button:";
            _textButtonLabel.Id            = "_textButtonLabel";
            _textButtonLabel.GridPositionY = 1;

            _textButton      = new TextButton();
            _textButton.Text = "Text Button";
            _textButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _textButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _textButton.Id            = "_textButton";
            _textButton.PaddingLeft   = 8;
            _textButton.PaddingRight  = 8;
            _textButton.GridPositionX = 1;
            _textButton.GridPositionY = 1;

            var textBlock2 = new TextBlock();

            textBlock2.Text          = "Image Button:";
            textBlock2.Id            = "";
            textBlock2.GridPositionY = 2;

            _imageButton = new ImageButton();
            _imageButton.ImageVisible = true;
            _imageButton.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _imageButton.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Center;
            _imageButton.Id            = "_imageButton";
            _imageButton.PaddingLeft   = 8;
            _imageButton.PaddingRight  = 8;
            _imageButton.GridPositionX = 1;
            _imageButton.GridPositionY = 2;

            var checkBox1 = new CheckBox();

            checkBox1.Text                       = "This is checkbox";
            checkBox1.ImageWidthHint             = 10;
            checkBox1.ImageHeightHint            = 10;
            checkBox1.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            checkBox1.ContentVerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            checkBox1.GridPositionY              = 3;
            checkBox1.GridSpanX                  = 2;

            var textBlock3 = new TextBlock();

            textBlock3.Text          = "Horizontal Slider:";
            textBlock3.Id            = "";
            textBlock3.GridPositionY = 4;

            var horizontalSlider1 = new HorizontalSlider();

            horizontalSlider1.Maximum             = 100;
            horizontalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            horizontalSlider1.GridPositionX       = 1;
            horizontalSlider1.GridPositionY       = 4;

            var textBlock4 = new TextBlock();

            textBlock4.Text          = "Combo Box:";
            textBlock4.GridPositionY = 5;

            var listItem1 = new ListItem();

            listItem1.Id   = "";
            listItem1.Text = "Item 1";

            var listItem2 = new ListItem();

            listItem2.Text = "Item 2";

            var listItem3 = new ListItem();

            listItem3.Text = "Item 3";

            var comboBox1 = new ComboBox();

            comboBox1.WidthHint     = 200;
            comboBox1.GridPositionX = 1;
            comboBox1.GridPositionY = 5;
            comboBox1.Items.Add(listItem1);
            comboBox1.Items.Add(listItem2);
            comboBox1.Items.Add(listItem3);

            var textBlock5 = new TextBlock();

            textBlock5.Text          = "Text Field:";
            textBlock5.GridPositionY = 6;

            var textField1 = new TextField();

            textField1.Text = "";
            textField1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            textField1.GridPositionX       = 1;
            textField1.GridPositionY       = 6;
            textField1.ClipToBounds        = true;
            textField1.CanFocus            = true;

            var textBlock6 = new TextBlock();

            textBlock6.Text          = "List Box:";
            textBlock6.GridPositionY = 7;

            var listItem4 = new ListItem();

            listItem4.Text = "Item 1";

            var listItem5 = new ListItem();

            listItem5.Text = "Item 2";

            var listItem6 = new ListItem();

            listItem6.Text = "Item 3";

            var listBox1 = new ListBox();

            listBox1.DrawLinesColor      = Color.White;
            listBox1.WidthHint           = 200;
            listBox1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            listBox1.GridPositionX       = 1;
            listBox1.GridPositionY       = 7;
            listBox1.Items.Add(listItem4);
            listBox1.Items.Add(listItem5);
            listBox1.Items.Add(listItem6);

            var textBlock7 = new TextBlock();

            textBlock7.Text          = "Tree";
            textBlock7.GridPositionY = 8;

            _gridRight = new Grid();
            _gridRight.DrawLinesColor = Color.White;
            _gridRight.ColumnSpacing  = 8;
            _gridRight.RowSpacing     = 8;
            _gridRight.ColumnsProportions.Add(new Grid.Proportion());
            _gridRight.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.RowsProportions.Add(new Grid.Proportion());
            _gridRight.Id = "_gridRight";
            _gridRight.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _gridRight.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _gridRight.Widgets.Add(textBlock1);
            _gridRight.Widgets.Add(_button);
            _gridRight.Widgets.Add(_textButtonLabel);
            _gridRight.Widgets.Add(_textButton);
            _gridRight.Widgets.Add(textBlock2);
            _gridRight.Widgets.Add(_imageButton);
            _gridRight.Widgets.Add(checkBox1);
            _gridRight.Widgets.Add(textBlock3);
            _gridRight.Widgets.Add(horizontalSlider1);
            _gridRight.Widgets.Add(textBlock4);
            _gridRight.Widgets.Add(comboBox1);
            _gridRight.Widgets.Add(textBlock5);
            _gridRight.Widgets.Add(textField1);
            _gridRight.Widgets.Add(textBlock6);
            _gridRight.Widgets.Add(listBox1);
            _gridRight.Widgets.Add(textBlock7);

            var scrollPane1 = new ScrollPane();

            scrollPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            scrollPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            scrollPane1.ClipToBounds        = true;
            scrollPane1.CanFocus            = true;
            scrollPane1.Child = _gridRight;

            var textBlock8 = new TextBlock();

            textBlock8.Text = "Vertical Slider:";

            var verticalSlider1 = new VerticalSlider();

            verticalSlider1.Maximum             = 100;
            verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            verticalSlider1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSlider1.GridPositionY       = 1;

            var grid1 = new Grid();

            grid1.DrawLinesColor = Color.White;
            grid1.RowSpacing     = 8;
            grid1.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.RowsProportions.Add(new Grid.Proportion());
            grid1.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid1.Widgets.Add(textBlock8);
            grid1.Widgets.Add(verticalSlider1);

            var textBlock9 = new TextBlock();

            textBlock9.Text = "Progress Bars:";

            _horizontalProgressBar                     = new HorizontalProgressBar();
            _horizontalProgressBar.Maximum             = 100;
            _horizontalProgressBar.DrawLinesColor      = Color.White;
            _horizontalProgressBar.Id                  = "_horizontalProgressBar";
            _horizontalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            _horizontalProgressBar.GridPositionY       = 1;

            _verticalProgressBar                     = new VerticalProgressBar();
            _verticalProgressBar.Maximum             = 100;
            _verticalProgressBar.DrawLinesColor      = Color.White;
            _verticalProgressBar.Id                  = "_verticalProgressBar";
            _verticalProgressBar.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            _verticalProgressBar.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            _verticalProgressBar.GridPositionY       = 2;

            var grid2 = new Grid();

            grid2.DrawLinesColor = Color.White;
            grid2.RowSpacing     = 8;
            grid2.ColumnsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion());
            grid2.RowsProportions.Add(new Grid.Proportion
            {
                Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill,
            });
            grid2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            grid2.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            grid2.GridPositionY       = 2;
            grid2.Widgets.Add(textBlock9);
            grid2.Widgets.Add(_horizontalProgressBar);
            grid2.Widgets.Add(_verticalProgressBar);

            var verticalSplitPane1 = new VerticalSplitPane();

            verticalSplitPane1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            verticalSplitPane1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            verticalSplitPane1.GridPositionX       = 2;
            verticalSplitPane1.Widgets.Add(grid1);
            verticalSplitPane1.Widgets.Add(grid2);


            HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch;
            VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Stretch;
            GridPositionY       = 1;
            Widgets.Add(scrollPane1);
            Widgets.Add(verticalSplitPane1);
        }
Example #20
0
        private void VisualizeVolumeMeter()
        {
            // Make space for the volume meter
            Width += 25;

            // Visualize the volume meter
            volumeMeter = new VerticalProgressBar()
            {
                Size = new Size(20, groupBox3.Height + groupBox4.Height),
                Location = new Point(groupBox4.Left + groupBox4.Width + 6,
                                     groupBox4.Top + mainMenuStrip.Height + headerBox.Height + 6)
            };

            Controls.Add(volumeMeter);
            volumeMeter.BringToFront();
        }
Example #21
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
       System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
       System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
       System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
       System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AutoScrn));
       this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
       this.dataGridView1 = new System.Windows.Forms.DataGridView();
       this.TimeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
       this.PressureColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
       this.button3 = new System.Windows.Forms.Button();
       this.button2 = new System.Windows.Forms.Button();
       this.button1 = new System.Windows.Forms.Button();
       this.label1 = new System.Windows.Forms.Label();
       this.listBox1 = new System.Windows.Forms.ListBox();
       this.panel1 = new System.Windows.Forms.Panel();
       this.label4 = new System.Windows.Forms.Label();
       this.label6 = new System.Windows.Forms.Label();
       this.label8 = new System.Windows.Forms.Label();
       this.groupBox1 = new System.Windows.Forms.GroupBox();
       this.labelDurations = new System.Windows.Forms.Label();
       this.labelStepsTotal = new System.Windows.Forms.Label();
       this.labelTargetPressure = new System.Windows.Forms.Label();
       this.groupBoxPressure = new System.Windows.Forms.GroupBox();
       this.labelTotalTime = new System.Windows.Forms.Label();
       this.labelStepCurrent = new System.Windows.Forms.Label();
       this.labelPumpState = new System.Windows.Forms.Label();
       this.labelPressure = new System.Windows.Forms.Label();
       this.labelDuration = new System.Windows.Forms.Label();
       this.groupBoxCollectedVolume = new System.Windows.Forms.GroupBox();
       this.verticalProgressBar2 = new LukMachine.VerticalProgressBar();
       this.groupBoxReservoir = new System.Windows.Forms.GroupBox();
       this.verticalProgressBar1 = new LukMachine.VerticalProgressBar();
       this.button4 = new System.Windows.Forms.Button();
       this.linkLabel1 = new System.Windows.Forms.LinkLabel();
       this.buttonSkipSettingTemp = new System.Windows.Forms.Button();
       this.buttonSkipPressure = new System.Windows.Forms.Button();
       this.labelChamber = new System.Windows.Forms.Label();
       ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
       ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
       this.panel1.SuspendLayout();
       this.groupBox1.SuspendLayout();
       this.groupBoxPressure.SuspendLayout();
       this.groupBoxCollectedVolume.SuspendLayout();
       this.groupBoxReservoir.SuspendLayout();
       this.SuspendLayout();
       //
       // chart1
       //
       this.chart1.BorderlineColor = System.Drawing.Color.Black;
       this.chart1.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
       chartArea1.Name = "ChartArea1";
       this.chart1.ChartAreas.Add(chartArea1);
       this.chart1.Location = new System.Drawing.Point(12, 208);
       this.chart1.Name = "chart1";
       series1.ChartArea = "ChartArea1";
       series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
       series1.IsVisibleInLegend = false;
       series1.Name = "Series1";
       this.chart1.Series.Add(series1);
       this.chart1.Size = new System.Drawing.Size(646, 308);
       this.chart1.TabIndex = 0;
       this.chart1.Text = "chart1";
       //
       // dataGridView1
       //
       this.dataGridView1.AllowUserToAddRows = false;
       this.dataGridView1.AllowUserToDeleteRows = false;
       this.dataGridView1.AllowUserToResizeColumns = false;
       this.dataGridView1.AllowUserToResizeRows = false;
       this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
       this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
       this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
       dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
       dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
       dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
       dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
       dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
       dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
       this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
       this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
       this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     this.TimeColumn,
     this.PressureColumn});
       this.dataGridView1.Location = new System.Drawing.Point(664, 208);
       this.dataGridView1.Name = "dataGridView1";
       this.dataGridView1.ReadOnly = true;
       dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
       dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
       dataGridViewCellStyle2.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
       dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
       dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
       dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
       this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2;
       this.dataGridView1.RowHeadersVisible = false;
       dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
       this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3;
       this.dataGridView1.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
       this.dataGridView1.Size = new System.Drawing.Size(231, 308);
       this.dataGridView1.TabIndex = 1;
       //
       // TimeColumn
       //
       this.TimeColumn.HeaderText = "Time(sec)";
       this.TimeColumn.Name = "TimeColumn";
       this.TimeColumn.ReadOnly = true;
       //
       // PressureColumn
       //
       this.PressureColumn.HeaderText = "Flow(mL/min)";
       this.PressureColumn.Name = "PressureColumn";
       this.PressureColumn.ReadOnly = true;
       //
       // button3
       //
       this.button3.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.button3.Image = global::LukMachine.Properties.Resources.base_cog_32;
       this.button3.Location = new System.Drawing.Point(591, 419);
       this.button3.Name = "button3";
       this.button3.Size = new System.Drawing.Size(67, 85);
       this.button3.TabIndex = 5;
       this.button3.Text = "Manual Control";
       this.button3.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
       this.button3.UseVisualStyleBackColor = true;
       this.button3.Visible = false;
       this.button3.Click += new System.EventHandler(this.button3_Click);
       //
       // button2
       //
       this.button2.Enabled = false;
       this.button2.Image = global::LukMachine.Properties.Resources._109_AllAnnotations_Error_32x32_72;
       this.button2.Location = new System.Drawing.Point(664, 528);
       this.button2.Name = "button2";
       this.button2.Size = new System.Drawing.Size(229, 86);
       this.button2.TabIndex = 3;
       this.button2.Text = "Stop Test";
       this.button2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
       this.button2.UseVisualStyleBackColor = true;
       this.button2.Click += new System.EventHandler(this.button2_Click);
       //
       // button1
       //
       this.button1.Image = global::LukMachine.Properties.Resources._1427928241_Play;
       this.button1.Location = new System.Drawing.Point(495, 418);
       this.button1.Name = "button1";
       this.button1.Size = new System.Drawing.Size(67, 85);
       this.button1.TabIndex = 2;
       this.button1.Text = "Start Test";
       this.button1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
       this.button1.UseVisualStyleBackColor = true;
       this.button1.Visible = false;
       this.button1.Click += new System.EventHandler(this.button1_Click);
       //
       // label1
       //
       this.label1.AutoSize = true;
       this.label1.Location = new System.Drawing.Point(9, 528);
       this.label1.Name = "label1";
       this.label1.Size = new System.Drawing.Size(115, 23);
       this.label1.TabIndex = 6;
       this.label1.Text = "Test Status:";
       //
       // listBox1
       //
       this.listBox1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.listBox1.FormattingEnabled = true;
       this.listBox1.ItemHeight = 19;
       this.listBox1.Location = new System.Drawing.Point(12, 553);
       this.listBox1.Name = "listBox1";
       this.listBox1.Size = new System.Drawing.Size(646, 61);
       this.listBox1.TabIndex = 7;
       //
       // panel1
       //
       this.panel1.Controls.Add(this.buttonSkipPressure);
       this.panel1.Controls.Add(this.buttonSkipSettingTemp);
       this.panel1.Controls.Add(this.label4);
       this.panel1.Location = new System.Drawing.Point(30, 272);
       this.panel1.Name = "panel1";
       this.panel1.Size = new System.Drawing.Size(614, 178);
       this.panel1.TabIndex = 13;
       //
       // label4
       //
       this.label4.AutoSize = true;
       this.label4.Location = new System.Drawing.Point(41, 61);
       this.label4.Name = "label4";
       this.label4.Size = new System.Drawing.Size(527, 23);
       this.label4.TabIndex = 0;
       this.label4.Text = "Please wait...  (setting reservoirs / temperature / pressure)";
       //
       // label6
       //
       this.label6.AutoSize = true;
       this.label6.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.label6.Location = new System.Drawing.Point(20, 93);
       this.label6.Name = "label6";
       this.label6.Size = new System.Drawing.Size(132, 21);
       this.label6.TabIndex = 16;
       this.label6.Text = "Temperature  =";
       //
       // label8
       //
       this.label8.AutoSize = true;
       this.label8.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.label8.Location = new System.Drawing.Point(24, 93);
       this.label8.Name = "label8";
       this.label8.Size = new System.Drawing.Size(201, 21);
       this.label8.TabIndex = 14;
       this.label8.Text = "Temperature  =   not set";
       //
       // groupBox1
       //
       this.groupBox1.Controls.Add(this.labelChamber);
       this.groupBox1.Controls.Add(this.labelDurations);
       this.groupBox1.Controls.Add(this.labelStepsTotal);
       this.groupBox1.Controls.Add(this.label8);
       this.groupBox1.Controls.Add(this.labelTargetPressure);
       this.groupBox1.Location = new System.Drawing.Point(467, 12);
       this.groupBox1.Name = "groupBox1";
       this.groupBox1.Size = new System.Drawing.Size(210, 190);
       this.groupBox1.TabIndex = 18;
       this.groupBox1.TabStop = false;
       this.groupBox1.Text = "Programmed Parameters";
       //
       // labelDurations
       //
       this.labelDurations.AutoSize = true;
       this.labelDurations.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelDurations.Location = new System.Drawing.Point(24, 63);
       this.labelDurations.Name = "labelDurations";
       this.labelDurations.Size = new System.Drawing.Size(99, 21);
       this.labelDurations.TabIndex = 21;
       this.labelDurations.Text = "Duration  =";
       //
       // labelStepsTotal
       //
       this.labelStepsTotal.AutoSize = true;
       this.labelStepsTotal.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelStepsTotal.Location = new System.Drawing.Point(24, 33);
       this.labelStepsTotal.Name = "labelStepsTotal";
       this.labelStepsTotal.Size = new System.Drawing.Size(121, 21);
       this.labelStepsTotal.TabIndex = 17;
       this.labelStepsTotal.Text = "Total Steps  =";
       //
       // labelTargetPressure
       //
       this.labelTargetPressure.AutoSize = true;
       this.labelTargetPressure.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelTargetPressure.Location = new System.Drawing.Point(24, 123);
       this.labelTargetPressure.Name = "labelTargetPressure";
       this.labelTargetPressure.Size = new System.Drawing.Size(177, 21);
       this.labelTargetPressure.TabIndex = 17;
       this.labelTargetPressure.Text = "Pressure   =   not set";
       //
       // groupBoxPressure
       //
       this.groupBoxPressure.Controls.Add(this.labelTotalTime);
       this.groupBoxPressure.Controls.Add(this.labelStepCurrent);
       this.groupBoxPressure.Controls.Add(this.labelPumpState);
       this.groupBoxPressure.Controls.Add(this.label6);
       this.groupBoxPressure.Controls.Add(this.labelPressure);
       this.groupBoxPressure.Location = new System.Drawing.Point(683, 12);
       this.groupBoxPressure.Name = "groupBoxPressure";
       this.groupBoxPressure.Size = new System.Drawing.Size(210, 190);
       this.groupBoxPressure.TabIndex = 19;
       this.groupBoxPressure.TabStop = false;
       this.groupBoxPressure.Text = "Current State";
       //
       // labelTotalTime
       //
       this.labelTotalTime.AutoSize = true;
       this.labelTotalTime.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelTotalTime.Location = new System.Drawing.Point(20, 63);
       this.labelTotalTime.Name = "labelTotalTime";
       this.labelTotalTime.Size = new System.Drawing.Size(103, 21);
       this.labelTotalTime.TabIndex = 21;
       this.labelTotalTime.Text = "Total time =";
       //
       // labelStepCurrent
       //
       this.labelStepCurrent.AutoSize = true;
       this.labelStepCurrent.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelStepCurrent.Location = new System.Drawing.Point(20, 33);
       this.labelStepCurrent.Name = "labelStepCurrent";
       this.labelStepCurrent.Size = new System.Drawing.Size(68, 21);
       this.labelStepCurrent.TabIndex = 18;
       this.labelStepCurrent.Text = "Step  =";
       //
       // labelPumpState
       //
       this.labelPumpState.AutoSize = true;
       this.labelPumpState.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelPumpState.Location = new System.Drawing.Point(20, 153);
       this.labelPumpState.Name = "labelPumpState";
       this.labelPumpState.Size = new System.Drawing.Size(133, 21);
       this.labelPumpState.TabIndex = 19;
       this.labelPumpState.Text = "Pump Power  =";
       //
       // labelPressure
       //
       this.labelPressure.AutoSize = true;
       this.labelPressure.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelPressure.Location = new System.Drawing.Point(20, 123);
       this.labelPressure.Name = "labelPressure";
       this.labelPressure.Size = new System.Drawing.Size(98, 21);
       this.labelPressure.TabIndex = 15;
       this.labelPressure.Text = "Pressure =";
       //
       // labelDuration
       //
       this.labelDuration.AutoSize = true;
       this.labelDuration.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelDuration.Location = new System.Drawing.Point(532, 218);
       this.labelDuration.Name = "labelDuration";
       this.labelDuration.Size = new System.Drawing.Size(106, 21);
       this.labelDuration.TabIndex = 20;
       this.labelDuration.Text = "Step time  =";
       this.labelDuration.Visible = false;
       //
       // groupBoxCollectedVolume
       //
       this.groupBoxCollectedVolume.Controls.Add(this.verticalProgressBar2);
       this.groupBoxCollectedVolume.Location = new System.Drawing.Point(236, 12);
       this.groupBoxCollectedVolume.Name = "groupBoxCollectedVolume";
       this.groupBoxCollectedVolume.Size = new System.Drawing.Size(225, 190);
       this.groupBoxCollectedVolume.TabIndex = 20;
       this.groupBoxCollectedVolume.TabStop = false;
       this.groupBoxCollectedVolume.Text = "Collected Volume";
       //
       // verticalProgressBar2
       //
       this.verticalProgressBar2.Location = new System.Drawing.Point(65, 42);
       this.verticalProgressBar2.Name = "verticalProgressBar2";
       this.verticalProgressBar2.Size = new System.Drawing.Size(84, 124);
       this.verticalProgressBar2.TabIndex = 10;
       this.verticalProgressBar2.Value = 50;
       //
       // groupBoxReservoir
       //
       this.groupBoxReservoir.Controls.Add(this.verticalProgressBar1);
       this.groupBoxReservoir.Location = new System.Drawing.Point(13, 12);
       this.groupBoxReservoir.Name = "groupBoxReservoir";
       this.groupBoxReservoir.Size = new System.Drawing.Size(217, 190);
       this.groupBoxReservoir.TabIndex = 21;
       this.groupBoxReservoir.TabStop = false;
       this.groupBoxReservoir.Text = "Reservoir";
       //
       // verticalProgressBar1
       //
       this.verticalProgressBar1.Location = new System.Drawing.Point(68, 42);
       this.verticalProgressBar1.Name = "verticalProgressBar1";
       this.verticalProgressBar1.Size = new System.Drawing.Size(84, 124);
       this.verticalProgressBar1.TabIndex = 9;
       this.verticalProgressBar1.Value = 50;
       //
       // button4
       //
       this.button4.AutoSize = true;
       this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.button4.ForeColor = System.Drawing.Color.Green;
       this.button4.Location = new System.Drawing.Point(665, 528);
       this.button4.Name = "button4";
       this.button4.Size = new System.Drawing.Size(229, 86);
       this.button4.TabIndex = 23;
       this.button4.Text = "Open Report Window";
       this.button4.UseVisualStyleBackColor = true;
       this.button4.Click += new System.EventHandler(this.button4_Click);
       //
       // linkLabel1
       //
       this.linkLabel1.AutoSize = true;
       this.linkLabel1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.linkLabel1.Location = new System.Drawing.Point(528, 525);
       this.linkLabel1.Name = "linkLabel1";
       this.linkLabel1.Size = new System.Drawing.Size(95, 18);
       this.linkLabel1.TabIndex = 24;
       this.linkLabel1.TabStop = true;
       this.linkLabel1.Text = "Open Folder";
       this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
       //
       // buttonSkipSettingTemp
       //
       this.buttonSkipSettingTemp.Location = new System.Drawing.Point(171, 121);
       this.buttonSkipSettingTemp.Name = "buttonSkipSettingTemp";
       this.buttonSkipSettingTemp.Size = new System.Drawing.Size(282, 36);
       this.buttonSkipSettingTemp.TabIndex = 1;
       this.buttonSkipSettingTemp.Text = "Skip Setting Temperature";
       this.buttonSkipSettingTemp.UseVisualStyleBackColor = true;
       this.buttonSkipSettingTemp.Visible = false;
       this.buttonSkipSettingTemp.Click += new System.EventHandler(this.buttonSkipSettingTemp_Click);
       //
       // buttonSkipPressure
       //
       this.buttonSkipPressure.Location = new System.Drawing.Point(171, 118);
       this.buttonSkipPressure.Name = "buttonSkipPressure";
       this.buttonSkipPressure.Size = new System.Drawing.Size(282, 36);
       this.buttonSkipPressure.TabIndex = 2;
       this.buttonSkipPressure.Text = "Skip Setting Pressure";
       this.buttonSkipPressure.UseVisualStyleBackColor = true;
       this.buttonSkipPressure.Visible = false;
       this.buttonSkipPressure.Click += new System.EventHandler(this.buttonSkipPressure_Click);
       //
       // labelChamber
       //
       this.labelChamber.AutoSize = true;
       this.labelChamber.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.labelChamber.Location = new System.Drawing.Point(24, 153);
       this.labelChamber.Name = "labelChamber";
       this.labelChamber.Size = new System.Drawing.Size(104, 21);
       this.labelChamber.TabIndex = 22;
       this.labelChamber.Text = "Chamber  =";
       //
       // AutoScrn
       //
       this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 23F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
       this.ClientSize = new System.Drawing.Size(905, 629);
       this.Controls.Add(this.linkLabel1);
       this.Controls.Add(this.button4);
       this.Controls.Add(this.labelDuration);
       this.Controls.Add(this.groupBoxReservoir);
       this.Controls.Add(this.groupBoxCollectedVolume);
       this.Controls.Add(this.groupBoxPressure);
       this.Controls.Add(this.groupBox1);
       this.Controls.Add(this.panel1);
       this.Controls.Add(this.listBox1);
       this.Controls.Add(this.label1);
       this.Controls.Add(this.button3);
       this.Controls.Add(this.button2);
       this.Controls.Add(this.button1);
       this.Controls.Add(this.dataGridView1);
       this.Controls.Add(this.chart1);
       this.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
       this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
       this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
       this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
       this.MinimumSize = new System.Drawing.Size(923, 468);
       this.Name = "AutoScrn";
       this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
       this.Text = "Form1";
       this.Load += new System.EventHandler(this.AutoScrn_Load);
       ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
       ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
       this.panel1.ResumeLayout(false);
       this.panel1.PerformLayout();
       this.groupBox1.ResumeLayout(false);
       this.groupBox1.PerformLayout();
       this.groupBoxPressure.ResumeLayout(false);
       this.groupBoxPressure.PerformLayout();
       this.groupBoxCollectedVolume.ResumeLayout(false);
       this.groupBoxReservoir.ResumeLayout(false);
       this.ResumeLayout(false);
       this.PerformLayout();
 }
Example #22
0
        public Form1()
        {
            InitializeComponent();

            //Правила
            MessageBox.Show("Перед Вами логическая математическая игра-головоломка. Ваша задача очистить игровое поле заполненное цифрами за ограниченный промежуток времени. Чтобы убрать цифры, Вам нужно будет считать их суммы. В правом верхнем углу игрового поля будет указано число. Ваша задача кликнуть левой кнопкой мыши на 2 цифры, которые дадут в сумме это число. После каждого правильного ответа требуемое число будет меняться.");

            //Интерфейс
            Button Info = new Button();

            Controls.Add(Info);
            Info.Location  = new Point(550, 150);
            Info.Text      = "Rules";
            Info.Size      = new Size(100, 50);
            Info.ForeColor = Color.Navy;
            Info.Font      = new System.Drawing.Font("Comic Sans MS", 10);

            Info.Click += Info_Click;

            New_Game = new Button
            {
                Size     = new Size(100, 50),
                Location = new Point(550, 50),
                Text     = "New Game"
            };
            New_Game.Click    += New_Game_Click;
            New_Game.ForeColor = Color.Navy;
            New_Game.Font      = new System.Drawing.Font("Comic Sans MS", 10);
            Controls.Add(New_Game);

            //Задание свойств формы
            StartPosition   = FormStartPosition.CenterScreen;    //центрирование формы
            BackgroundImage = Properties.Resources.derevo;       //фон
            MaximizeBox     = false;
            MaximumSize     = new System.Drawing.Size(700, 500); //максимальный размер формы
            MinimumSize     = new System.Drawing.Size(700, 500); //минимальный размер формы

            //создание элемента управление VerticalProgressBar
            PrBar = new VerticalProgressBar();
            Controls.Add(PrBar);
            PrBar.Size     = new Size(30, 200);
            PrBar.Location = new Point(450, 80);
            PrBar.Enabled  = true;
            PrBar.Maximum  = 1200;
            PrBar.Value    = 0;

            //создание элемента управления таймер
            clock = new Timer
            {
                Enabled = true
            };
            clock.Tick += Clock_Tick;
            clock.Start();

            //Создания элемента управления Label для значения суммы
            number = new Label();
            Controls.Add(number);
            number.Size      = new Size(50, 50);
            number.Location  = new Point(440, 5);
            number.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            number.Text      = (R.Next(2, 16).ToString());
            number.Font      = new System.Drawing.Font("Comic Sans MS", 20);
            number.BackColor = Color.Transparent;
            number.ForeColor = Color.Navy;

            //Создания элемента управления Label "Score"
            score = new Label();
            Controls.Add(score);
            score.Text      = "Score";
            score.BackColor = Color.Transparent;
            score.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            score.Font      = new System.Drawing.Font("Comic Sans MS", 15);
            score.Location  = new Point(440, 300);
            score.Size      = new Size(75, 50);
            score.ForeColor = Color.Navy;

            ////Создания элемента управления Label для записи очков игрока
            lbl = new Label();
            Controls.Add(lbl);
            lbl.Location  = new Point(440, 350);
            lbl.BackColor = Color.Transparent;
            lbl.Text      = s.ToString();
            lbl.ForeColor = Color.Navy;
            lbl.Font      = new System.Drawing.Font("Comic Sans MS", 20);
            lbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            lbl.Size      = new Size(50, 50);

            ////Создания элемента управления Button
            btn   = new Button[N, N];
            Array = new int[N, N];    //Объявление массива из 0 и 1
            b_num = new string[N, N]; //объявления массива для записи значений кнопок

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    b_num[i, j] = R.Next(0, 11).ToString();
                    btn[i, j]   = new Button
                    {
                        Name = i.ToString() + j.ToString(),
                        Text = b_num[i, j]
                    };
                    Controls.Add(btn[i, j]);
                    btn[i, j].Size     = new Size(40, 40);
                    btn[i, j].Location = new Point(40 * i, 40 * j);
                    btn[i, j].Click   += Form1_Click;
                }
            }
        }