Exemplo n.º 1
0
 private void InitializeComponent()
 {
     this.vbtnAreaToOCR  = new System.Windows.Forms.Styled.VistaButton();
     this.vbtnAreaToHide = new System.Windows.Forms.Styled.VistaButton();
     this.vbtnSave       = new System.Windows.Forms.Styled.VistaButton();
     this.SuspendLayout();
     //
     // vbtnAreaToOCR
     //
     this.vbtnAreaToOCR.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this.vbtnAreaToOCR.BackColor  = System.Drawing.Color.Transparent;
     this.vbtnAreaToOCR.ButtonText = "Barcode Area";
     this.vbtnAreaToOCR.Font       = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
     this.vbtnAreaToOCR.Location   = new System.Drawing.Point(32, 18);
     this.vbtnAreaToOCR.Name       = "vbtnAreaToOCR";
     this.vbtnAreaToOCR.Size       = new System.Drawing.Size(159, 32);
     this.vbtnAreaToOCR.TabIndex   = 0;
     //
     // vbtnAreaToHide
     //
     this.vbtnAreaToHide.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                        | System.Windows.Forms.AnchorStyles.Right)));
     this.vbtnAreaToHide.BackColor  = System.Drawing.Color.Transparent;
     this.vbtnAreaToHide.ButtonText = "Area to hide";
     this.vbtnAreaToHide.Font       = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
     this.vbtnAreaToHide.Location   = new System.Drawing.Point(31, 60);
     this.vbtnAreaToHide.Name       = "vbtnAreaToHide";
     this.vbtnAreaToHide.Size       = new System.Drawing.Size(159, 32);
     this.vbtnAreaToHide.TabIndex   = 1;
     //
     // vbtnSave
     //
     this.vbtnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.vbtnSave.BackColor  = System.Drawing.Color.Transparent;
     this.vbtnSave.ButtonText = "Save";
     this.vbtnSave.Font       = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
     this.vbtnSave.Location   = new System.Drawing.Point(32, 103);
     this.vbtnSave.Name       = "vbtnSave";
     this.vbtnSave.Size       = new System.Drawing.Size(159, 32);
     this.vbtnSave.TabIndex   = 2;
     //
     // AdjustOCRControl
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 19F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.vbtnSave);
     this.Controls.Add(this.vbtnAreaToHide);
     this.Controls.Add(this.vbtnAreaToOCR);
     this.Margin      = new System.Windows.Forms.Padding(5, 4, 5, 4);
     this.MinimumSize = new System.Drawing.Size(192, 100);
     this.Name        = "AdjustOCRControl";
     this.Padding     = new System.Windows.Forms.Padding(5);
     this.Shape       = System.Windows.Forms.Styled.ShapeType.RoundedRectangle;
     this.Size        = new System.Drawing.Size(220, 150);
     this.ResumeLayout(false);
 }
Exemplo n.º 2
0
        public void Button_Click(object sender, EventArgs e)
        {
            VistaButton bt = (VistaButton)sender;

            switch (bt.ButtonText)
            {
            case "Starten":
                showMenu(false);
                bt.ButtonText = "Fortsetzen";
                break;

            case "Fortsetzen":
                if (Game.GameState.Failed.Equals(game.State))
                {
                    initGame();
                }
                showMenu(false);
                break;

            case "Laden":
                showMenu(false);
                //erzeuge neues GamePanel
                break;

            case "Speichern":
                //Datenbank ...
                break;

            case "Beenden":
                System.Environment.Exit(0);
                break;

            case "Highscore":
                if (highscoreView != null && menuHolder.Controls.Contains(highscoreView))
                {
                    menuHolder.Controls.Remove(highscoreView);
                }
                else
                {
                    highscoreView          = new HighscoreControlView();
                    highscoreView.Size     = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height - 7);
                    highscoreView.Location = new Point(220, 2);
                    //highscoreView.BackColor = Color.DimGray;
                    menuHolder.Controls.Add(highscoreView);
                }
                break;

            case "Pong spielen":
                playPong = true;
                showMenu(false);
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
 private void SetCMenuState(VistaButton btn, bool nomalORCurrent = true)
 {
     if (nomalORCurrent)
     {
         btn.ForeColor = Color.Black;
         btn.Enabled   = true;
     }
     else if (btn != btn1 && btn != btn2)
     {
         btn.ForeColor = Color.FromArgb(245, 130, 31);
     }
 }
Exemplo n.º 4
0
        private void SetMenuCurrent(VistaButton curButton)
        {
            SetCMenuState(btn1);
            SetCMenuState(btn2);
            SetCMenuState(btn3);
            SetCMenuState(MAPbtn);
            SetCMenuState(btn7);
            SetCMenuState(btn8);
            SetCMenuState(btn9);
            SetCMenuState(OBDSETBtn);

            SetCMenuState(curButton, false);
        }
Exemplo n.º 5
0
        private void btnNumber_Click(object sender, EventArgs e)
        {
            VistaButton btn = sender as VistaButton;

            if (string.IsNullOrEmpty(m_ActiveTextBox.Text))
            {
                m_ActiveTextBox.Text = btn.ButtonText;
            }
            else
            {
                m_ActiveTextBox.Text += btn.ButtonText;
            }
        }
Exemplo n.º 6
0
        private void Initialize()
        {
            if (!_initialized)
            {
                Fullscreen();
                _Dimension = GetResolution();
                Size size = new Size((int)(_Dimension.Width * 1.2), (int)(_Dimension.Height * 1.2));
                img = Properties.Resources._3;
                img = CT_Helper.resizeImage(img, size);

                initGame();

                #region Menu
                int drawingPointWidth = _Dimension.Width / 2;
                int drawingPointHeight = _Dimension.Height / 2;
                Point menu = new Point(drawingPointWidth - 683 / 2, drawingPointHeight - 384 / 2);
                menuContainer = new DoubleBufferedPanel(menu);

                menuContainer.Width = _Dimension.Width;
                menuContainer.Height = _Dimension.Height;

                menuContainer.Location = new Point(0, 0);
                menuContainer.Name = "Menu";

                menuHolder = new DoubleBufferedPanel();

                string[] buttonTexts = { "Starten", "Laden", "Speichern", "Highscore","Pong spielen","Beenden" };
                int positionMultiplicator = 1;
                int offset = 10;
                foreach (string text in buttonTexts)
                {

                    VistaButton button = new VistaButton();
                    button.ButtonText = text;

                    button.Width = 160;
                    button.Height = 38;
                    button.Location = new Point(offset + button.Width / 4, (button.Height + offset) * positionMultiplicator);
                    menuHolder.Controls.Add(button);
                    positionMultiplicator++;
                    button.Click += Button_Click;
                    button.KeyDown += CT_UI_KeyDown;
                    button.KeyUp += CT_UI_KeyUp;
                    button.BackColor = Color.Transparent;
                    button.BaseColor = Color.Transparent;
                    button.ButtonColor = Color.FromArgb(155, Color.DarkSlateGray);
                    button.GlowColor = Color.LightGray;
                    button.Font = new System.Drawing.Font("Pricedown", 16.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    button.CornerRadius = 8;
                }

                this.Controls.Add(menuContainer);
                this.Controls.Add(menuHolder);
                menuHolder.BringToFront();
                menuHolder.BorderStyle = BorderStyle.Fixed3D;
                menuHolder.Width = 683;
                menuHolder.Height = 384;
                menuHolder.Location = menu;
                menuHolder.BackColor = Color.Black;
                menuContainer.BackColor = Color.FromArgb(150, Color.Black);

                #endregion

                setCursor();
                this.Focus();
                this.TransparencyKey = Color.FromArgb(255, 255, 254);

                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

                pong=new Pong(new Size(_Dimension.Width,_Dimension.Height));

                gameBox.Size = new Size(_Dimension.Width, _Dimension.Height);

                // Resize our backbuffer
                backbuffer = new Bitmap(gameBox.Size.Width,gameBox.Size.Height, PixelFormat.Format32bppPArgb);
                backBufferGraphics = Graphics.FromImage(backbuffer);

                Updater.Interval = UPDATE_INTERVAL;

                _initialized = true;
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.vistaButton1 = new HD.MyControls.VistaButton();
     this.vistaButton2 = new HD.MyControls.VistaButton();
     this.vistaButton3 = new HD.MyControls.VistaButton();
     this.vistaButton4 = new HD.MyControls.VistaButton();
     this.vistaButton5 = new HD.MyControls.VistaButton();
     this.vistaButton6 = new HD.MyControls.VistaButton();
     this.vistaButton7 = new HD.MyControls.VistaButton();
     this.vistaButton8 = new HD.MyControls.VistaButton();
     this.SuspendLayout();
     //
     // vistaButton1
     //
     this.vistaButton1.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton1.ButtonText = "Default";
     this.vistaButton1.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton1.Location = new System.Drawing.Point(48, 9);
     this.vistaButton1.Name = "vistaButton1";
     this.vistaButton1.Size = new System.Drawing.Size(163, 43);
     this.vistaButton1.TabIndex = 0;
     //
     // vistaButton2
     //
     this.vistaButton2.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton2.BackImage = ((System.Drawing.Image)(resources.GetObject("vistaButton2.BackImage")));
     this.vistaButton2.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton2.ButtonText = "Image";
     this.vistaButton2.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton2.Location = new System.Drawing.Point(250, 9);
     this.vistaButton2.Name = "vistaButton2";
     this.vistaButton2.Size = new System.Drawing.Size(153, 43);
     this.vistaButton2.TabIndex = 0;
     //
     // vistaButton3
     //
     this.vistaButton3.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton3.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton3.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(211)))), ((int)(((byte)(40)))));
     this.vistaButton3.ButtonStyle = HD.MyControls.VistaButton.Style.Flat;
     this.vistaButton3.ButtonText = "Yes (hover)";
     this.vistaButton3.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton3.Image = ((System.Drawing.Image)(resources.GetObject("vistaButton3.Image")));
     this.vistaButton3.Location = new System.Drawing.Point(48, 103);
     this.vistaButton3.Name = "vistaButton3";
     this.vistaButton3.Size = new System.Drawing.Size(163, 43);
     this.vistaButton3.TabIndex = 0;
     //
     // vistaButton4
     //
     this.vistaButton4.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton4.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton4.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButton4.ButtonStyle = HD.MyControls.VistaButton.Style.Flat;
     this.vistaButton4.ButtonText = "No (hover)";
     this.vistaButton4.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton4.Image = ((System.Drawing.Image)(resources.GetObject("vistaButton4.Image")));
     this.vistaButton4.Location = new System.Drawing.Point(250, 103);
     this.vistaButton4.Name = "vistaButton4";
     this.vistaButton4.Size = new System.Drawing.Size(163, 43);
     this.vistaButton4.TabIndex = 0;
     //
     // vistaButton5
     //
     this.vistaButton5.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton5.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton5.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(202)))), ((int)(((byte)(0)))));
     this.vistaButton5.ButtonText = "Transparent";
     this.vistaButton5.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton5.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(189)))), ((int)(((byte)(141)))));
     this.vistaButton5.Location = new System.Drawing.Point(250, 198);
     this.vistaButton5.Name = "vistaButton5";
     this.vistaButton5.Size = new System.Drawing.Size(163, 43);
     this.vistaButton5.TabIndex = 0;
     this.vistaButton5.Click += new System.EventHandler(this.vistaButton5_Click);
     //
     // vistaButton6
     //
     this.vistaButton6.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton6.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton6.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(163)))), ((int)(((byte)(211)))));
     this.vistaButton6.ButtonText = "Transparent";
     this.vistaButton6.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton6.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
     this.vistaButton6.Location = new System.Drawing.Point(48, 198);
     this.vistaButton6.Name = "vistaButton6";
     this.vistaButton6.Size = new System.Drawing.Size(163, 43);
     this.vistaButton6.TabIndex = 0;
     //
     // vistaButton7
     //
     this.vistaButton7.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton7.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton7.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(211)))), ((int)(((byte)(40)))));
     this.vistaButton7.ButtonText = "Rounded Corners";
     this.vistaButton7.CornerRadius = 20;
     this.vistaButton7.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton7.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(141)))), ((int)(((byte)(255)))), ((int)(((byte)(189)))));
     this.vistaButton7.Location = new System.Drawing.Point(48, 310);
     this.vistaButton7.Name = "vistaButton7";
     this.vistaButton7.Size = new System.Drawing.Size(163, 43);
     this.vistaButton7.TabIndex = 0;
     //
     // vistaButton8
     //
     this.vistaButton8.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton8.BaseColor = System.Drawing.Color.Transparent;
     this.vistaButton8.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButton8.ButtonText = "Sharp Corners";
     this.vistaButton8.CornerRadius = 0;
     this.vistaButton8.Cursor = System.Windows.Forms.Cursors.Hand;
     this.vistaButton8.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(141)))), ((int)(((byte)(189)))));
     this.vistaButton8.Location = new System.Drawing.Point(250, 310);
     this.vistaButton8.Name = "vistaButton8";
     this.vistaButton8.Size = new System.Drawing.Size(163, 43);
     this.vistaButton8.TabIndex = 0;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
     this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
     this.ClientSize = new System.Drawing.Size(520, 425);
     this.Controls.Add(this.vistaButton1);
     this.Controls.Add(this.vistaButton2);
     this.Controls.Add(this.vistaButton3);
     this.Controls.Add(this.vistaButton4);
     this.Controls.Add(this.vistaButton5);
     this.Controls.Add(this.vistaButton6);
     this.Controls.Add(this.vistaButton7);
     this.Controls.Add(this.vistaButton8);
     this.MaximizeBox = false;
     this.Name = "Form1";
     this.Text = "Vista Button Test";
     this.Load += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.vistaButton1 = new VistaButton();
     this.vistaButton2 = new VistaButton();
     this.vistaButton3 = new VistaButton();
     this.vistaButton4 = new VistaButton();
     this.vistaButton5 = new VistaButton();
     this.vistaButton6 = new VistaButton();
     this.vistaButton7 = new VistaButton();
     this.vistaButton8 = new VistaButton();
     this.vistaButton9 = new VistaButton();
     this.SuspendLayout();
     //
     // vistaButton1
     //
     this.vistaButton1.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton1.ButtonText = "Default";
     this.vistaButton1.Location = new System.Drawing.Point(40, 8);
     this.vistaButton1.Name = "vistaButton1";
     this.vistaButton1.Size = new System.Drawing.Size(136, 40);
     this.vistaButton1.TabIndex = 0;
     //
     // vistaButton2
     //
     this.vistaButton2.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton2.BackImage = ((System.Drawing.Image)(resources.GetObject("vistaButton2.BackImage")));
     this.vistaButton2.ButtonText = "Image";
     this.vistaButton2.Location = new System.Drawing.Point(208, 8);
     this.vistaButton2.Name = "vistaButton2";
     this.vistaButton2.Size = new System.Drawing.Size(128, 40);
     this.vistaButton2.TabIndex = 0;
     //
     // vistaButton3
     //
     this.vistaButton3.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton3.ButtonStyle = VistaButton.Style.Flat;
     this.vistaButton3.ButtonText = "Yes (hover)";
     this.vistaButton3.Image = ((System.Drawing.Image)(resources.GetObject("vistaButton3.Image")));
     this.vistaButton3.Location = new System.Drawing.Point(40, 96);
     this.vistaButton3.Name = "vistaButton3";
     this.vistaButton3.Size = new System.Drawing.Size(136, 40);
     this.vistaButton3.TabIndex = 0;
     //
     // vistaButton4
     //
     this.vistaButton4.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton4.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButton4.ButtonStyle = VistaButton.Style.Flat;
     this.vistaButton4.ButtonText = "No (hover)";
     this.vistaButton4.Image = ((System.Drawing.Image)(resources.GetObject("vistaButton4.Image")));
     this.vistaButton4.Location = new System.Drawing.Point(208, 96);
     this.vistaButton4.Name = "vistaButton4";
     this.vistaButton4.Size = new System.Drawing.Size(136, 40);
     this.vistaButton4.TabIndex = 0;
     //
     // vistaButton5
     //
     this.vistaButton5.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton5.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(202)))), ((int)(((byte)(0)))));
     this.vistaButton5.ButtonText = "Transparent";
     this.vistaButton5.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(189)))), ((int)(((byte)(141)))));
     this.vistaButton5.Location = new System.Drawing.Point(208, 184);
     this.vistaButton5.Name = "vistaButton5";
     this.vistaButton5.Size = new System.Drawing.Size(136, 40);
     this.vistaButton5.TabIndex = 0;
     //
     // vistaButton6
     //
     this.vistaButton6.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton6.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(163)))), ((int)(((byte)(211)))));
     this.vistaButton6.ButtonText = "Transparent";
     this.vistaButton6.Location = new System.Drawing.Point(40, 184);
     this.vistaButton6.Name = "vistaButton6";
     this.vistaButton6.Size = new System.Drawing.Size(136, 40);
     this.vistaButton6.TabIndex = 0;
     //
     // vistaButton7
     //
     this.vistaButton7.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton7.ButtonText = "Rounded Corners";
     this.vistaButton7.Location = new System.Drawing.Point(40, 288);
     this.vistaButton7.Name = "vistaButton7";
     this.vistaButton7.Size = new System.Drawing.Size(136, 40);
     this.vistaButton7.TabIndex = 0;
     //
     // vistaButton8
     //
     this.vistaButton8.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton8.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButton8.ButtonText = "Sharp Corners";
     this.vistaButton8.CornerRadius = 0;
     this.vistaButton8.GlowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(141)))), ((int)(((byte)(189)))));
     this.vistaButton8.Location = new System.Drawing.Point(208, 288);
     this.vistaButton8.Name = "vistaButton8";
     this.vistaButton8.Size = new System.Drawing.Size(136, 40);
     this.vistaButton8.TabIndex = 0;
     //
     // vistaButton9
     //
     this.vistaButton9.BackColor = System.Drawing.Color.Transparent;
     this.vistaButton9.ButtonText = null;
     this.vistaButton9.Location = new System.Drawing.Point(40, 334);
     this.vistaButton9.Name = "vistaButton9";
     this.vistaButton9.Size = new System.Drawing.Size(136, 40);
     this.vistaButton9.TabIndex = 1;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
     this.ClientSize = new System.Drawing.Size(584, 453);
     this.Controls.Add(this.vistaButton9);
     this.Controls.Add(this.vistaButton1);
     this.Controls.Add(this.vistaButton2);
     this.Controls.Add(this.vistaButton3);
     this.Controls.Add(this.vistaButton4);
     this.Controls.Add(this.vistaButton5);
     this.Controls.Add(this.vistaButton6);
     this.Controls.Add(this.vistaButton7);
     this.Controls.Add(this.vistaButton8);
     this.MaximizeBox = false;
     this.Name = "Form1";
     this.Text = "Vista Button Test";
     this.Load += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.label1         = new System.Windows.Forms.Label();
     this.txtInput       = new System.Windows.Forms.TextBox();
     this.cmdMakeBarcode = new System.Windows.Forms.VistaButton();
     this.printDocument1 = new System.Drawing.Printing.PrintDocument();
     this.cmdPrint       = new System.Windows.Forms.VistaButton();
     this.pictBarcode    = new System.Windows.Forms.PictureBox();
     this.btnSave        = new System.Windows.Forms.VistaButton();
     ((System.ComponentModel.ISupportInitialize)(this.pictBarcode)).BeginInit();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.BackColor = System.Drawing.Color.Transparent;
     this.label1.ForeColor = System.Drawing.Color.White;
     this.label1.Location  = new System.Drawing.Point(8, 9);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(43, 17);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Data:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // txtInput
     //
     this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                  | System.Windows.Forms.AnchorStyles.Right)));
     this.txtInput.Location = new System.Drawing.Point(57, 8);
     this.txtInput.Name     = "txtInput";
     this.txtInput.Size     = new System.Drawing.Size(475, 20);
     this.txtInput.TabIndex = 1;
     //
     // cmdMakeBarcode
     //
     this.cmdMakeBarcode.BackColor  = System.Drawing.Color.Transparent;
     this.cmdMakeBarcode.BaseColor  = System.Drawing.Color.Transparent;
     this.cmdMakeBarcode.ButtonText = "Make barcode";
     this.cmdMakeBarcode.Location   = new System.Drawing.Point(8, 168);
     this.cmdMakeBarcode.Name       = "cmdMakeBarcode";
     this.cmdMakeBarcode.Size       = new System.Drawing.Size(121, 33);
     this.cmdMakeBarcode.TabIndex   = 2;
     this.cmdMakeBarcode.Click     += new System.EventHandler(this.cmdMakeBarcode_Click);
     //
     // printDocument1
     //
     this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
     //
     // cmdPrint
     //
     this.cmdPrint.Anchor     = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.cmdPrint.BackColor  = System.Drawing.Color.Transparent;
     this.cmdPrint.BaseColor  = System.Drawing.Color.Transparent;
     this.cmdPrint.ButtonText = "Print";
     this.cmdPrint.Location   = new System.Drawing.Point(368, 168);
     this.cmdPrint.Name       = "cmdPrint";
     this.cmdPrint.Size       = new System.Drawing.Size(79, 33);
     this.cmdPrint.TabIndex   = 6;
     this.cmdPrint.Click     += new System.EventHandler(this.cmdPrint_Click);
     //
     // pictBarcode
     //
     this.pictBarcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.pictBarcode.BackColor   = System.Drawing.Color.AliceBlue;
     this.pictBarcode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.pictBarcode.Location    = new System.Drawing.Point(8, 34);
     this.pictBarcode.Name        = "pictBarcode";
     this.pictBarcode.Size        = new System.Drawing.Size(528, 128);
     this.pictBarcode.SizeMode    = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
     this.pictBarcode.TabIndex    = 3;
     this.pictBarcode.TabStop     = false;
     //
     // btnSave
     //
     this.btnSave.Anchor     = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.btnSave.BackColor  = System.Drawing.Color.Transparent;
     this.btnSave.BaseColor  = System.Drawing.Color.Transparent;
     this.btnSave.ButtonText = "Save";
     this.btnSave.Location   = new System.Drawing.Point(453, 168);
     this.btnSave.Name       = "btnSave";
     this.btnSave.Size       = new System.Drawing.Size(79, 33);
     this.btnSave.TabIndex   = 6;
     this.btnSave.Click     += new System.EventHandler(this.btnSave_Click);
     //
     // FrmGenBarcode
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.BackColor         = System.Drawing.Color.SteelBlue;
     this.ClientSize        = new System.Drawing.Size(540, 213);
     this.Controls.Add(this.btnSave);
     this.Controls.Add(this.cmdPrint);
     this.Controls.Add(this.txtInput);
     this.Controls.Add(this.pictBarcode);
     this.Controls.Add(this.cmdMakeBarcode);
     this.Controls.Add(this.label1);
     this.MaximizeBox   = false;
     this.MinimizeBox   = false;
     this.Name          = "FrmGenBarcode";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "Barcode Generator";
     ((System.ComponentModel.ISupportInitialize)(this.pictBarcode)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 10
0
        private void Initialize()
        {
            if (!_initialized)
            {
                Fullscreen();
                _Dimension = GetResolution();
                Size size = new Size((int)(_Dimension.Width * 1.2), (int)(_Dimension.Height * 1.2));
                img = Properties.Resources._3;
                img = CT_Helper.resizeImage(img, size);

                initGame();

                #region Menu
                int   drawingPointWidth  = _Dimension.Width / 2;
                int   drawingPointHeight = _Dimension.Height / 2;
                Point menu = new Point(drawingPointWidth - 683 / 2, drawingPointHeight - 384 / 2);
                menuContainer = new DoubleBufferedPanel(menu);

                menuContainer.Width  = _Dimension.Width;
                menuContainer.Height = _Dimension.Height;

                menuContainer.Location = new Point(0, 0);
                menuContainer.Name     = "Menu";

                menuHolder = new DoubleBufferedPanel();

                string[] buttonTexts           = { "Starten", "Laden", "Speichern", "Highscore", "Pong spielen", "Beenden" };
                int      positionMultiplicator = 1;
                int      offset = 10;
                foreach (string text in buttonTexts)
                {
                    VistaButton button = new VistaButton();
                    button.ButtonText = text;

                    button.Width    = 160;
                    button.Height   = 38;
                    button.Location = new Point(offset + button.Width / 4, (button.Height + offset) * positionMultiplicator);
                    menuHolder.Controls.Add(button);
                    positionMultiplicator++;
                    button.Click       += Button_Click;
                    button.KeyDown     += CT_UI_KeyDown;
                    button.KeyUp       += CT_UI_KeyUp;
                    button.BackColor    = Color.Transparent;
                    button.BaseColor    = Color.Transparent;
                    button.ButtonColor  = Color.FromArgb(155, Color.DarkSlateGray);
                    button.GlowColor    = Color.LightGray;
                    button.Font         = new System.Drawing.Font("Pricedown", 16.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    button.CornerRadius = 8;
                }

                this.Controls.Add(menuContainer);
                this.Controls.Add(menuHolder);
                menuHolder.BringToFront();
                menuHolder.BorderStyle  = BorderStyle.Fixed3D;
                menuHolder.Width        = 683;
                menuHolder.Height       = 384;
                menuHolder.Location     = menu;
                menuHolder.BackColor    = Color.Black;
                menuContainer.BackColor = Color.FromArgb(150, Color.Black);

                #endregion

                setCursor();
                this.Focus();
                this.TransparencyKey = Color.FromArgb(255, 255, 254);

                this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                this.SetStyle(ControlStyles.UserPaint, true);
                this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

                pong = new Pong(new Size(_Dimension.Width, _Dimension.Height));

                gameBox.Size = new Size(_Dimension.Width, _Dimension.Height);

                // Resize our backbuffer
                backbuffer         = new Bitmap(gameBox.Size.Width, gameBox.Size.Height, PixelFormat.Format32bppPArgb);
                backBufferGraphics = Graphics.FromImage(backbuffer);

                Updater.Interval = UPDATE_INTERVAL;

                _initialized = true;
            }
        }
Exemplo n.º 11
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.vistaButton1 = new HD.MyControls.VistaButton();
     this.vistaButton2 = new HD.MyControls.VistaButton();
     this.vistaButton3 = new HD.MyControls.VistaButton();
     this.vistaButton4 = new HD.MyControls.VistaButton();
     this.vistaButton5 = new HD.MyControls.VistaButton();
     this.vistaButton6 = new HD.MyControls.VistaButton();
     this.vistaButton7 = new HD.MyControls.VistaButton();
     this.vistaButton8 = new HD.MyControls.VistaButton();
     this.SuspendLayout();
     //
     // vistaButton1
     //
     this.vistaButton1.BackColor  = System.Drawing.Color.Transparent;
     this.vistaButton1.ButtonText = "Default";
     this.vistaButton1.Cursor     = System.Windows.Forms.Cursors.Hand;
     this.vistaButton1.Location   = new System.Drawing.Point(48, 9);
     this.vistaButton1.Name       = "vistaButton1";
     this.vistaButton1.Size       = new System.Drawing.Size(163, 43);
     this.vistaButton1.TabIndex   = 0;
     //
     // vistaButton2
     //
     this.vistaButton2.BackColor  = System.Drawing.Color.Transparent;
     this.vistaButton2.BackImage  = ((System.Drawing.Image)(resources.GetObject("vistaButton2.BackImage")));
     this.vistaButton2.BaseColor  = System.Drawing.Color.Transparent;
     this.vistaButton2.ButtonText = "Image";
     this.vistaButton2.Cursor     = System.Windows.Forms.Cursors.Hand;
     this.vistaButton2.Location   = new System.Drawing.Point(250, 9);
     this.vistaButton2.Name       = "vistaButton2";
     this.vistaButton2.Size       = new System.Drawing.Size(153, 43);
     this.vistaButton2.TabIndex   = 0;
     //
     // vistaButton3
     //
     this.vistaButton3.BackColor   = System.Drawing.Color.Transparent;
     this.vistaButton3.BaseColor   = System.Drawing.Color.Transparent;
     this.vistaButton3.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(211)))), ((int)(((byte)(40)))));
     this.vistaButton3.ButtonStyle = HD.MyControls.VistaButton.Style.Flat;
     this.vistaButton3.ButtonText  = "Yes (hover)";
     this.vistaButton3.Cursor      = System.Windows.Forms.Cursors.Hand;
     this.vistaButton3.Image       = ((System.Drawing.Image)(resources.GetObject("vistaButton3.Image")));
     this.vistaButton3.Location    = new System.Drawing.Point(48, 103);
     this.vistaButton3.Name        = "vistaButton3";
     this.vistaButton3.Size        = new System.Drawing.Size(163, 43);
     this.vistaButton3.TabIndex    = 0;
     //
     // vistaButton4
     //
     this.vistaButton4.BackColor   = System.Drawing.Color.Transparent;
     this.vistaButton4.BaseColor   = System.Drawing.Color.Transparent;
     this.vistaButton4.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButton4.ButtonStyle = HD.MyControls.VistaButton.Style.Flat;
     this.vistaButton4.ButtonText  = "No (hover)";
     this.vistaButton4.Cursor      = System.Windows.Forms.Cursors.Hand;
     this.vistaButton4.Image       = ((System.Drawing.Image)(resources.GetObject("vistaButton4.Image")));
     this.vistaButton4.Location    = new System.Drawing.Point(250, 103);
     this.vistaButton4.Name        = "vistaButton4";
     this.vistaButton4.Size        = new System.Drawing.Size(163, 43);
     this.vistaButton4.TabIndex    = 0;
     //
     // vistaButton5
     //
     this.vistaButton5.BackColor   = System.Drawing.Color.Transparent;
     this.vistaButton5.BaseColor   = System.Drawing.Color.Transparent;
     this.vistaButton5.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(202)))), ((int)(((byte)(0)))));
     this.vistaButton5.ButtonText  = "Transparent";
     this.vistaButton5.Cursor      = System.Windows.Forms.Cursors.Hand;
     this.vistaButton5.GlowColor   = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(189)))), ((int)(((byte)(141)))));
     this.vistaButton5.Location    = new System.Drawing.Point(250, 198);
     this.vistaButton5.Name        = "vistaButton5";
     this.vistaButton5.Size        = new System.Drawing.Size(163, 43);
     this.vistaButton5.TabIndex    = 0;
     this.vistaButton5.Click      += new System.EventHandler(this.vistaButton5_Click);
     //
     // vistaButton6
     //
     this.vistaButton6.BackColor   = System.Drawing.Color.Transparent;
     this.vistaButton6.BaseColor   = System.Drawing.Color.Transparent;
     this.vistaButton6.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(163)))), ((int)(((byte)(211)))));
     this.vistaButton6.ButtonText  = "Transparent";
     this.vistaButton6.Cursor      = System.Windows.Forms.Cursors.Hand;
     this.vistaButton6.GlowColor   = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
     this.vistaButton6.Location    = new System.Drawing.Point(48, 198);
     this.vistaButton6.Name        = "vistaButton6";
     this.vistaButton6.Size        = new System.Drawing.Size(163, 43);
     this.vistaButton6.TabIndex    = 0;
     //
     // vistaButton7
     //
     this.vistaButton7.BackColor    = System.Drawing.Color.Transparent;
     this.vistaButton7.BaseColor    = System.Drawing.Color.Transparent;
     this.vistaButton7.ButtonColor  = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(211)))), ((int)(((byte)(40)))));
     this.vistaButton7.ButtonText   = "Rounded Corners";
     this.vistaButton7.CornerRadius = 20;
     this.vistaButton7.Cursor       = System.Windows.Forms.Cursors.Hand;
     this.vistaButton7.GlowColor    = System.Drawing.Color.FromArgb(((int)(((byte)(141)))), ((int)(((byte)(255)))), ((int)(((byte)(189)))));
     this.vistaButton7.Location     = new System.Drawing.Point(48, 310);
     this.vistaButton7.Name         = "vistaButton7";
     this.vistaButton7.Size         = new System.Drawing.Size(163, 43);
     this.vistaButton7.TabIndex     = 0;
     //
     // vistaButton8
     //
     this.vistaButton8.BackColor    = System.Drawing.Color.Transparent;
     this.vistaButton8.BaseColor    = System.Drawing.Color.Transparent;
     this.vistaButton8.ButtonColor  = System.Drawing.Color.FromArgb(((int)(((byte)(210)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButton8.ButtonText   = "Sharp Corners";
     this.vistaButton8.CornerRadius = 0;
     this.vistaButton8.Cursor       = System.Windows.Forms.Cursors.Hand;
     this.vistaButton8.GlowColor    = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(141)))), ((int)(((byte)(189)))));
     this.vistaButton8.Location     = new System.Drawing.Point(250, 310);
     this.vistaButton8.Name         = "vistaButton8";
     this.vistaButton8.Size         = new System.Drawing.Size(163, 43);
     this.vistaButton8.TabIndex     = 0;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
     this.BackgroundImage   = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
     this.ClientSize        = new System.Drawing.Size(520, 425);
     this.Controls.Add(this.vistaButton1);
     this.Controls.Add(this.vistaButton2);
     this.Controls.Add(this.vistaButton3);
     this.Controls.Add(this.vistaButton4);
     this.Controls.Add(this.vistaButton5);
     this.Controls.Add(this.vistaButton6);
     this.Controls.Add(this.vistaButton7);
     this.Controls.Add(this.vistaButton8);
     this.MaximizeBox = false;
     this.Name        = "Form1";
     this.Text        = "Vista Button Test";
     this.Load       += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
Exemplo n.º 12
0
        private void Initilize()
        {
            if (!_initialized)
            {
                Fullscreen();
                _Dimension = GetResolution();
                Size size = new Size((int)(_Dimension[0] * 1.2), (int)(_Dimension[1] * 1.2));
                img = Properties.Resources._3;
                img = CT_Helper.resizeImage(img, size);

                #region Menu
                int   drawingPointWidth  = _Dimension[0] / 2;
                int   drawingPointHeight = _Dimension[1] / 2;
                Point menu = new Point(drawingPointWidth - 683 / 2, drawingPointHeight - 384 / 2);
                menuContainer = new DoubleBufferedPanel(menu);



                menuContainer.Width  = _Dimension[0];
                menuContainer.Height = _Dimension[1];

                menuContainer.Location = new Point(0, 0);
                menuContainer.Name     = "Menu";

                menuHolder = new DoubleBufferedPanel();

                string[] buttonTexts           = { "Starten", "Laden", "Speichern", "Fortsetzen", "Beenden", "Highscore" };
                int      positionMultiplicator = 1;
                int      offset = 10;
                foreach (string text in buttonTexts)
                {
                    VistaButton button = new VistaButton();
                    button.ButtonText = text;

                    button.Width    = 136;
                    button.Height   = 38;
                    button.Location = new Point(offset + button.Width / 4, (button.Height + offset) * positionMultiplicator);
                    menuHolder.Controls.Add(button);
                    positionMultiplicator++;
                    button.Click       += Button_Click;
                    button.KeyDown     += CT_UI_KeyDown;
                    button.KeyUp       += CT_UI_KeyUp;
                    button.BackColor    = Color.Transparent;
                    button.BaseColor    = Color.Transparent;
                    button.ButtonColor  = Color.FromArgb(155, Color.DarkSlateGray);
                    button.GlowColor    = Color.LightGray;
                    button.Font         = new System.Drawing.Font("Pricedown", 16.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    button.CornerRadius = 8;
                }

                this.Controls.Add(menuContainer);
                this.Controls.Add(menuHolder);
                menuHolder.BringToFront();
                menuHolder.BorderStyle  = BorderStyle.Fixed3D;
                menuHolder.Width        = 683;
                menuHolder.Height       = 384;
                menuHolder.Location     = menu;
                menuHolder.BackColor    = Color.Black;
                menuContainer.BackColor = Color.FromArgb(150, Color.Black);

                #endregion

                #region car
                carpanel = new CarPanel(_Dimension);
                //this.Controls.Add(carpanel);
                #endregion

                setCursor();
                this.Focus();

                //Bilderordner angeben
                MapParser.ImagePath = string.Format(@"{0}{1}MapImages", Directory.GetCurrentDirectory(), Path.DirectorySeparatorChar);
                //Karte aus XML laden
                //map = MapParser.Load(@"C:\Users\Bongo\Desktop\Berufsschule\Diagramme AE\Game\CrazyTaxi\testmap.xml");
                map = MapParser.Load(20, 20);
                //Karte vergrößert sich automatisch mit GUI
                //Karte im GUI anzeigen

                //Karte an Größe des GUIs anpassen
                map.Initialize(new Size(_Dimension[0], _Dimension[1]));
                this.BackgroundImage = map.DrawImage(new Size(_Dimension[0], _Dimension[1]));
                this.TransparencyKey = Color.FromArgb(255, 255, 254);
                this.Controls.Add(carpanel);
                map.Collision.SetDebugTarget(this);
                entity = map.Collision.AddEntity(new Size(12, 23));

                _initialized = true;
            }
        }
Exemplo n.º 13
0
        public void Button_Click(object sender, EventArgs e)
        {
            VistaButton bt = (VistaButton)sender;

            switch (bt.ButtonText)
            {
            case "Starten":
                if (Backgroundfader.Enabled)
                {
                    Backgroundfader.Stop();
                    menuFader.Start();
                    img     = Properties.Resources.back3;
                    started = true;
                }
                else if (fade >= 150)
                {
                    menuFader.Start();
                }
                //Erzeuge neues GamePanel
                break;

            case "Laden":
                started = true;
                //erzeuge neues GamePanel
                break;

            case "Speichern":
                //Datenbank ...
                break;

            case "Fortsetzen":
                if (fade >= 150)
                {
                    menuFader.Start();
                }
                //zurück zu Game Panel
                break;

            case "Beenden":
                this.Close();

                break;

            case "Highscore":
                if (highscoreView != null && menuHolder.Controls.Contains(highscoreView))
                {
                    menuHolder.Controls.Remove(highscoreView);
                }
                else
                {
                    highscoreView          = new HighscoreControlView();
                    highscoreView.Size     = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height - 7);
                    highscoreView.Location = new Point(220, 2);
                    //highscoreView.BackColor = Color.DimGray;
                    menuHolder.Controls.Add(highscoreView);
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 14
0
 public void BindView(string property_name, VistaButton view)
 {
     view.Tag = property_name;
     mVistaButtons[property_name] = view;
 }
Exemplo n.º 15
0
        private void Initilize()
        {
            if (!_initialized)
            {
                Fullscreen();
                _Dimension = GetResolution();
                Size size = new Size((int)(_Dimension[0] * 1.2), (int)(_Dimension[1] * 1.2));
                img = Properties.Resources._3;
                img = CT_Helper.resizeImage(img, size);

                #region Menu
                int drawingPointWidth = _Dimension[0] / 2;
                int drawingPointHeight = _Dimension[1] / 2;
                Point menu = new Point(drawingPointWidth - 683 / 2, drawingPointHeight - 384 / 2);
                menuContainer = new DoubleBufferedPanel(menu);

                menuContainer.Width = _Dimension[0];
                menuContainer.Height = _Dimension[1];

                menuContainer.Location = new Point(0, 0);
                menuContainer.Name = "Menu";

                menuHolder = new DoubleBufferedPanel();

                string[] buttonTexts = { "Starten", "Laden", "Speichern", "Fortsetzen", "Beenden", "Highscore" };
                int positionMultiplicator = 1;
                int offset = 10;
                foreach (string text in buttonTexts)
                {

                    VistaButton button = new VistaButton();
                    button.ButtonText = text;

                    button.Width = 136;
                    button.Height = 38;
                    button.Location = new Point(offset + button.Width / 4, (button.Height + offset) * positionMultiplicator);
                    menuHolder.Controls.Add(button);
                    positionMultiplicator++;
                    button.Click += Button_Click;
                    button.KeyDown += CT_UI_KeyDown;
                    button.KeyUp += CT_UI_KeyUp;
                    button.BackColor = Color.Transparent;
                    button.BaseColor = Color.Transparent;
                    button.ButtonColor = Color.FromArgb(155, Color.DarkSlateGray);
                    button.GlowColor = Color.LightGray;
                    button.Font = new System.Drawing.Font("Pricedown", 16.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    button.CornerRadius = 8;
                }

                this.Controls.Add(menuContainer);
                this.Controls.Add(menuHolder);
                menuHolder.BringToFront();
                menuHolder.BorderStyle = BorderStyle.Fixed3D;
                menuHolder.Width = 683;
                menuHolder.Height = 384;
                menuHolder.Location = menu;
                menuHolder.BackColor = Color.Black;
                menuContainer.BackColor = Color.FromArgb(150, Color.Black);

                #endregion

                #region car
                carpanel = new CarPanel(_Dimension);
                //this.Controls.Add(carpanel);
                #endregion

                setCursor();
                this.Focus();

                //Bilderordner angeben
                MapParser.ImagePath = string.Format(@"{0}{1}MapImages", Directory.GetCurrentDirectory(), Path.DirectorySeparatorChar);
                //Karte aus XML laden
                //map = MapParser.Load(@"C:\Users\Bongo\Desktop\Berufsschule\Diagramme AE\Game\CrazyTaxi\testmap.xml");
                map = MapParser.Load(20, 20);
                //Karte vergrößert sich automatisch mit GUI
                //Karte im GUI anzeigen

                //Karte an Größe des GUIs anpassen
                map.Initialize(new Size(_Dimension[0], _Dimension[1]));
                this.BackgroundImage = map.DrawImage(new Size(_Dimension[0],_Dimension[1]));
                this.TransparencyKey = Color.FromArgb(255, 255, 254);
                this.Controls.Add(carpanel);
                map.Collision.SetDebugTarget(this);
                entity = map.Collision.AddEntity(new Size(12,23));

                _initialized = true;
            }
        }
Exemplo n.º 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.lvList = new System.Windows.Forms.ListView();
     this.Descripcion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.PUnitario = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.Cantidad = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.Total = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.lbltotal = new System.Windows.Forms.Label();
     this.lbltotalprod = new System.Windows.Forms.Label();
     this.keyboardcontrol1 = new KeyboardClassLibrary.Keyboardcontrol();
     this.txtcodigobarras = new System.Windows.Forms.TextBox();
     this.lblCodigo = new System.Windows.Forms.Label();
     this.vistaButtonGuardar = new VistaButton();
     this.btnok = new System.Windows.Forms.Button();
     this.txtCantidad = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     this.SuspendLayout();
     //
     // lvList
     //
     this.lvList.Activation = System.Windows.Forms.ItemActivation.OneClick;
     this.lvList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     this.Descripcion,
     this.PUnitario,
     this.Cantidad,
     this.Total});
     this.lvList.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lvList.FullRowSelect = true;
     this.lvList.GridLines = true;
     this.lvList.Location = new System.Drawing.Point(68, 63);
     this.lvList.Name = "lvList";
     this.lvList.Size = new System.Drawing.Size(769, 355);
     this.lvList.TabIndex = 2;
     this.lvList.UseCompatibleStateImageBehavior = false;
     this.lvList.View = System.Windows.Forms.View.Details;
     //
     // Descripcion
     //
     this.Descripcion.Text = "Descripcion";
     this.Descripcion.Width = 245;
     //
     // PUnitario
     //
     this.PUnitario.Text = "PUnitario";
     this.PUnitario.Width = 115;
     //
     // Cantidad
     //
     this.Cantidad.Text = "Cantidad";
     //
     // Total
     //
     this.Total.Text = "Total";
     //
     // lbltotal
     //
     this.lbltotal.AutoSize = true;
     this.lbltotal.Font = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lbltotal.ForeColor = System.Drawing.Color.White;
     this.lbltotal.Location = new System.Drawing.Point(843, 379);
     this.lbltotal.Name = "lbltotal";
     this.lbltotal.Size = new System.Drawing.Size(89, 39);
     this.lbltotal.TabIndex = 3;
     this.lbltotal.Text = "Total:";
     //
     // lbltotalprod
     //
     this.lbltotalprod.AutoSize = true;
     this.lbltotalprod.Font = new System.Drawing.Font("Calibri", 24F);
     this.lbltotalprod.ForeColor = System.Drawing.Color.White;
     this.lbltotalprod.Location = new System.Drawing.Point(952, 379);
     this.lbltotalprod.Name = "lbltotalprod";
     this.lbltotalprod.Size = new System.Drawing.Size(89, 39);
     this.lbltotalprod.TabIndex = 4;
     this.lbltotalprod.Text = "00.00";
     //
     // keyboardcontrol1
     //
     this.keyboardcontrol1.KeyboardType = KeyboardClassLibrary.BoW.Standard;
     this.keyboardcontrol1.Location = new System.Drawing.Point(68, 436);
     this.keyboardcontrol1.Name = "keyboardcontrol1";
     this.keyboardcontrol1.Size = new System.Drawing.Size(993, 282);
     this.keyboardcontrol1.TabIndex = 6;
     this.keyboardcontrol1.UserKeyPressed += new KeyboardClassLibrary.KeyboardDelegate(this.keyboardcontrol1_UserKeyPressed);
     this.keyboardcontrol1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.keyboardcontrol1_MouseClick);
     //
     // txtcodigobarras
     //
     this.txtcodigobarras.Font = new System.Drawing.Font("Calibri", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtcodigobarras.Location = new System.Drawing.Point(128, 19);
     this.txtcodigobarras.Name = "txtcodigobarras";
     this.txtcodigobarras.Size = new System.Drawing.Size(354, 37);
     this.txtcodigobarras.TabIndex = 2;
     //
     // lblCodigo
     //
     this.lblCodigo.AutoSize = true;
     this.lblCodigo.Font = new System.Drawing.Font("Calibri", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblCodigo.ForeColor = System.Drawing.Color.White;
     this.lblCodigo.Location = new System.Drawing.Point(34, 22);
     this.lblCodigo.Name = "lblCodigo";
     this.lblCodigo.Size = new System.Drawing.Size(88, 29);
     this.lblCodigo.TabIndex = 8;
     this.lblCodigo.Text = "Codigo:";
     //
     // vistaButtonGuardar
     //
     this.vistaButtonGuardar.BackColor = System.Drawing.Color.Transparent;
     this.vistaButtonGuardar.BaseColor = System.Drawing.Color.Crimson;
     this.vistaButtonGuardar.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     this.vistaButtonGuardar.ButtonText = "LISTO!";
     this.vistaButtonGuardar.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.vistaButtonGuardar.HighlightColor = System.Drawing.Color.FromArgb(((int)(((byte)(193)))), ((int)(((byte)(203)))), ((int)(((byte)(223)))));
     this.vistaButtonGuardar.Location = new System.Drawing.Point(850, 305);
     this.vistaButtonGuardar.Name = "vistaButtonGuardar";
     this.vistaButtonGuardar.Size = new System.Drawing.Size(138, 48);
     this.vistaButtonGuardar.TabIndex = 12;
     this.vistaButtonGuardar.Tag2 = "";
     this.vistaButtonGuardar.Click += new System.EventHandler(this.vistaButtonGuardar_Click);
     //
     // btnok
     //
     this.btnok.AutoEllipsis = true;
     this.btnok.BackColor = System.Drawing.Color.MediumBlue;
     this.btnok.Font = new System.Drawing.Font("Calibri", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnok.ForeColor = System.Drawing.Color.White;
     this.btnok.Location = new System.Drawing.Point(840, 22);
     this.btnok.Name = "btnok";
     this.btnok.Size = new System.Drawing.Size(118, 37);
     this.btnok.TabIndex = 13;
     this.btnok.Text = "OK";
     this.btnok.UseVisualStyleBackColor = false;
     this.btnok.Click += new System.EventHandler(this.btnok_Click);
     //
     // txtCantidad
     //
     this.txtCantidad.Font = new System.Drawing.Font("Calibri", 18F);
     this.txtCantidad.Location = new System.Drawing.Point(642, 19);
     this.txtCantidad.Name = "txtCantidad";
     this.txtCantidad.Size = new System.Drawing.Size(136, 37);
     this.txtCantidad.TabIndex = 3;
     this.txtCantidad.CursorChanged += new System.EventHandler(this.txtCantidad_CursorChanged);
     this.txtCantidad.TextChanged += new System.EventHandler(this.txtCantidad_TextChanged);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Font = new System.Drawing.Font("Calibri", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.White;
     this.label1.Location = new System.Drawing.Point(506, 22);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(102, 29);
     this.label1.TabIndex = 15;
     this.label1.Text = "Cantidad";
     //
     // frmCaja
     //
     this.AcceptButton = this.btnok;
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor = System.Drawing.Color.Black;
     this.ClientSize = new System.Drawing.Size(1171, 750);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.txtCantidad);
     this.Controls.Add(this.btnok);
     this.Controls.Add(this.vistaButtonGuardar);
     this.Controls.Add(this.lblCodigo);
     this.Controls.Add(this.txtcodigobarras);
     this.Controls.Add(this.keyboardcontrol1);
     this.Controls.Add(this.lbltotalprod);
     this.Controls.Add(this.lbltotal);
     this.Controls.Add(this.lvList);
     this.Name = "frmCaja";
     this.Text = "frmCaja";
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Load += new System.EventHandler(this.frmCaja_Load);
     this.ResumeLayout(false);
     this.PerformLayout();
 }