Example #1
0
 public override void PostLoad()
 {
     Gwen.Control.TextBox tbx = new Gwen.Control.TextBox (canvas);
     tbx.Height = 50;
     tbx.Dock = Gwen.Pos.Top;
     tbx.SetText ("TEXTBOX");
     tbx.TextChanged += (s, e) =>
     {
         Console.WriteLine ("TextChanged {0}", tbx.Text);
     };
     tbx.SubmitPressed += (s, e) =>
     {
         Console.WriteLine ("SubmitPressed {0}", tbx.Text);
     };
 }
Example #2
0
        Base ConstructFindGame()
        {
            Base FindGame = new Base(MainCanvas.GetCanvas());
            FindGame.SetSize(300, 300);

            Label EnterIP = new Label(FindGame);
            EnterIP.AutoSizeToContents = true;
            EnterIP.SetText("Enter an IP:");
            EnterIP.SetPosition(10, 10);

            TextBox IPAddress = new TextBox(FindGame);
            IPAddress.SetText("127.0.0.1");
            IPAddress.SetPosition(10, 40);
            IPAddress.SetSize(260, 20);

            TextBox Port = new TextBox(FindGame);
            Port.SetText("54987");
            Port.SetPosition(10, 70);
            Port.SetSize(260, 20);

            Button Connect = new Button(FindGame);
            Connect.SetText("Connect");
            Connect.SetPosition(10, 200);
            Connect.SetSize(200, 20);
            Connect.Clicked += delegate(Base sender, ClickedEventArgs args) {
                Program.Connect(IPAddress.Text, Int32.Parse(Port.Text));
                MainMenu.Hide();
                FindGame.Hide();

                Connecting.Show();
            };

            Button Back = new Button(FindGame);
            Back.SetText("Back");
            Back.SetPosition(10, 225);
            Back.SetSize(200, 20);
            Back.Clicked += delegate(Base sender, ClickedEventArgs args) {
                Mode = MenuMode.MainMenu;
                MainMenu.Show();
                FindGame.Hide();
            };

            return FindGame;
        }