Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            buttonA      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonA.Text = "Event tester";
            buttonA.SetBounds(200, 30, 300, 200);
            buttonA.Pressed  += onButtonAp;
            buttonA.Clicked  += onButtonAc;
            buttonA.Released += onButtonAr;

            buttonB      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonB.Text = "\u0417\u0430\u043C\u0435\u0436\u043D\u0430\u044F \u043C\u043E\u0432\u0430";
            buttonB.SetPosition(0, 20);

            buttonC      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonC.Text = "Image button";
            buttonC.SetImage("AltData/Gwen/test16.png");
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonC, buttonB, 10);

            buttonD = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonD.SetImage("AltData/Gwen/test16.png");
            buttonD.SetSize(20, 20);
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonD, buttonC, 10);

            buttonE             = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonE.Text        = "Toggle me";
            buttonE.IsToggle    = true;
            buttonE.Toggled    += onToggle;
            buttonE.ToggledOn  += onToggleOn;
            buttonE.ToggledOff += onToggleOff;
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonE, buttonD, 10);

            buttonF            = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonF.Text       = "Disabled :D";
            buttonF.IsDisabled = true;
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonF, buttonE, 10);

            buttonG      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonG.Text = "With Tooltip";
            buttonG.SetToolTipText("This is tooltip");
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonG, buttonF, 10);

            buttonH      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonH.Text = "I'm autosized";
            buttonH.SizeToContents();
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonH, buttonG, 10);
        }
Ejemplo n.º 2
0
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);


                Cursor = GUI.Cursors.Hand;

                //  GUI
                {
                    m_PanelTop                 = new Base(this);
                    m_PanelTop.Dock            = Pos.Top;
                    m_PanelTop.ClientBackColor = Color.FromArgb(96, Color.Black);
                    m_PanelTop.Height          = 38;

                    Base controlsMain = new Base(m_PanelTop);
                    controlsMain.Dock = Pos.Fill;

                    Alt.GUI.Temporary.Gwen.Control.Button backButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    backButton.Dock   = Pos.Left;
                    backButton.Click += new EventHandler(BackButton_Click);
                    backButton.SetToolTipText("Prev");
                    backButton.SetImage("AltData/Back.png", true);
                    backButton.Width  = 36;
                    backButton.Margin = new Margin(1, 1, 0, 1);

                    Alt.GUI.Temporary.Gwen.Control.Button forwardButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    forwardButton.Dock   = Pos.Left;
                    forwardButton.Click += new EventHandler(ForwardButton_Click);
                    forwardButton.SetToolTipText("Next");
                    forwardButton.SetImage("AltData/Forward.png", true);
                    forwardButton.Width  = 36;
                    forwardButton.Margin = new Margin(1, 1, 0, 1);


                    m_ExampleNumberLabel      = new Alt.GUI.Temporary.Gwen.Control.Label(controlsMain);
                    m_ExampleNumberLabel.Dock = Pos.Left;
                    m_ExampleNumberLabel.AutoSizeToContents = true;
                    m_ExampleNumberLabel.TextColor          = Color.White;
                    m_ExampleNumberLabel.Text   = "";
                    m_ExampleNumberLabel.Margin = new Margin(5, (m_PanelTop.Height - m_ExampleNumberLabel.Height) / 2 - 3, 5, 1);


                    Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(controlsMain);
                    label.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;
                    label.AutoSizeToContents = true;
                    label.Text      = "Use mouse device to operate with dynamic objects\nand scene zoom / offset";
                    label.TextColor = Color.Cyan;
                    label.Margin    = new Alt.GUI.Temporary.Gwen.Margin(5, //(m_PanelTop.Height - label.Height) / 2 -
                                                                        3, 5, 0);


                    Alt.GUI.Temporary.Gwen.Control.Button refreshButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    refreshButton.Dock   = Pos.Right;
                    refreshButton.Click += new EventHandler(RestartButton_Click);
                    refreshButton.SetToolTipText("Restart");
                    refreshButton.SetImage("AltData/Refresh.png", true);
                    refreshButton.Width  = 36;
                    refreshButton.Margin = new Margin(0, 1, 0, 1);
                }


                settings = new FarseerPhysicsGameSettings();

                testCount = 0;
                while (FarseerPhysicsTestEntries.TestList[testCount].CreateTest != null)
                {
                    testCount++;
                }

                testIndex     = -1;
                testSelection = Alt.Box2D.MathUtils.Clamp(testIndex, 0, testCount - 1);


                m_InfoFont = new Font("Arial", 10.01, FontStyle.Bold);


                Focus();
            }