Ejemplo n.º 1
0
        private void InicializeComponent()
        {
            grid = new Panel();
            container = new Panel();
            btnProp = new Button();
            btnControl = new Button();


            grid.Location = new Vector2(619, 26);
            grid.Name = "grid";
            grid.Size = new Vector2(258, 475);

            container.Location = new Vector2(1, 1);
            container.Name = "container";
            container.Size = new Vector2(616, 500);

            btnProp.Location = new Vector2(619, 1);
            btnProp.Name = "btnProp";
            btnProp.Size = new Vector2(59, 25);
            btnProp.Text = "Props";
            btnProp.AutoSize = true;

            btnControl.Location = new Vector2(678, 1);
            btnControl.Name = "btnControl";
            btnControl.Size = new Vector2(59, 25);
            btnControl.Text = "Controls";
            btnControl.AutoSize = true;

            Name = "Game1";
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Конструктор по умолчанию
 /// </summary>
 public ComboBox() : base(new ProcentLayout())
 {
     //if (textBrush == null) throw new ArgumentNullException($"ComboBox::{nameof(TextBrush)} is Null");
     _arrow = new Button { Text = string.Empty };
     _contaier = new ListBox() { AutoSize = true };
     Controls.Add(_arrow);
     Controls.Add(_contaier);
     _contaier.Visibled = false;
     _contaier.Enabled = false;
     ResizeControl += ComboBox_ResizeControl;
     _arrow.Click += _arrow_Click;
     BackgroundChanged += ComboBox_BackgroundChanged;
     BorderChanged += ComboBox_BorderChanged;
     Paint += ComboBox_Paint;
     Container.ControlsAdded += Container_ControlsAdded;
     _contaier.Tag = "comboContainer";
 }
Ejemplo n.º 3
0
        protected override void LoadContent()
        {
            // Load Content
            _baseFont = Content.Load<SpriteFont>("Arial");

            // Form Inicialize & Generate GUI
            // and Other Inicializator...
            // xna method: Inicialize
            _fps = new FpsControl(_baseFont);

            _p = new Panel
            {
                Location = new Vector2(200, 100),
                Size = new Vector2(400, 300),
                Background = new SolidColorBrush(Color.White),
                Border = new DefaultBorderBrush(1, Color.Blue)
            };
            DefaultTextBrush defaultBrush = new DefaultTextBrush(_baseFont, Color.Black);
            _b = new Button()
            {
                TextBrush = defaultBrush,
                Location = new Vector2(10, 10),
                Size = new Vector2(150, 40),
                Text = "TMP Button",
                ColorText = Color.Black,
                Background = new SolidColorBrush(Color.White),
                Border = new DefaultBorderBrush(1, Color.Black),
                Name = "Super Button"
            };
            _p.Controls.Add(_b);

            _b.Click += b_MouseClick;
            _p.Click += p_MouseClick;

            _textBox = new TextBox()
            {
                TextBrush = new DefaultTextBrush(_baseFont, Color.Purple),
                AutoSize = false,
                Border = new DefaultBorderBrush(1, Color.Lime),
                Background = new SolidColorBrush(Color.Silver),
                Location = new Vector2(250, 250),
                Size = new Vector2(100, 30),
                Text = "Sample Text",
                MaxLenght = 13
            };

            // Loadding Screen (Only Game-State)
            LoadingScreen l = new LoadingScreen(this, _baseFont)
            {
                BackGroundThread = new GameThread(delegate
                {
                    System.Threading.Thread.Sleep(3000);// Sleep 3 seconds. :D

                    _isDrawing = true;// Example variable.

                    return true;
                }),
                NextState = "main"// Name to Next State
            };

            // Create Game State
            GameState state = new GameState(this) { Name = "main" };
            state.Controls.Add(_p);// Add Controls for Game State
            state.Controls.Add(_textBox);

            Controls.Add(l);// Add to Form Controls
            Controls.Add(state);

            l.Show();// Show Game State
            //(GameState Object).Change("stateName"); - Change State
            base.LoadContent();
        }