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);

            rand = new Random();

            Alt.GUI.Temporary.Gwen.Control.Button button1 = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            button1.SetText("Open a Window");
            button1.Clicked += OpenWindow;
            button1.SizeToContents();

            Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            button2.SetText("Open a MessageBox");
            button2.SizeToContents();
            button2.Clicked += OpenMsgbox;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(button2, button1, 10);

            m_WindowCount = 1;
        }