Ejemplo n.º 1
0
 public void MessageBoxYesNo(string text, ThreadStart yes, ThreadStart no)
 {
     widgets.Clear();
     menu.AddBackground(widgets);
     MessageboxYesWidget = (new Widget()
     {
         BackgroundImage = menu.button4,
         BackgroundImageSelected = menu.button4sel,
         Rect = new RectangleF(400, 600, 400, 128),
         Text = "OK",
         Click = yes,
     });
     MessageboxNoWidget = (new Widget()
     {
         BackgroundImage = menu.button4,
         BackgroundImageSelected = menu.button4sel,
         Rect = new RectangleF(800, 600, 400, 128),
         Text = "Cancel",
         Click = no,
     });/*
         * MessageboxBackgroundWidget = (new Widget()
         * {
         * BackgroundImage = menu.button4,
         * BackgroundImageSelected = menu.button4sel,
         * Rect = new RectangleF(400, 200, 800, 500),
         * });*/
     MessageboxLabelWidget = (new Widget()
     {
         BackgroundImage = null,
         BackgroundImageSelected = null,
         Rect = new RectangleF(400, 400, 400, 128),
         Text = text,
     });
     //widgets.Add(MessageboxBackgroundWidget);
     widgets.Add(MessageboxLabelWidget);
     widgets.Add(MessageboxYesWidget);
     widgets.Add(MessageboxNoWidget);
 }
Ejemplo n.º 2
0
        public void Initialize()
        {
            widgets.Clear();
            menu.AddBackground(this.widgets);
            menu.AddCaption(this, "Connect to IP");

            widgets.Add(new Widget()
            {
                BackgroundImage         = null,
                BackgroundImageSelected = null,
                Rect     = new RectangleF(200, 300, 400, 90),
                Text     = "Hash/Url: ",
                Click    = delegate { },
                FontSize = 20,
            });
            hashTextboxWidget = new Widget()
            {
                BackgroundImage         = menu.button4,
                BackgroundImageSelected = menu.button4sel,
                Rect      = new RectangleF(500, 300, 650, 90),
                Text      = gethashurl(),
                Click     = delegate { },
                FontSize  = 20,
                IsTextbox = true,
            };

            widgets.Add(hashTextboxWidget);

            /*
             * widgets.Add(new Widget()
             * {
             *  BackgroundImage = null,
             *  BackgroundImageSelected = null,
             *  Rect = new RectangleF(200, 450, 400, 90),
             *  Text = "Or",
             *  Click = delegate { },
             *  FontSize = 20,
             * });
             */
            widgets.Add(new Widget()
            {
                BackgroundImage         = null,
                BackgroundImageSelected = null,
                Rect     = new RectangleF(200, 600, 400, 90),
                Text     = "IP: ",
                Click    = delegate { },
                FontSize = 20,
            });
            ipTextboxWidget = new Widget()
            {
                BackgroundImage         = menu.button4,
                BackgroundImageSelected = menu.button4sel,
                Rect      = new RectangleF(500, 600, 600, 90),
                Text      = getip(),
                Click     = delegate { },
                FontSize  = 20,
                IsTextbox = true,
            };
            widgets.Add(ipTextboxWidget);
            widgets.Add(new Widget()
            {
                BackgroundImage         = null,
                BackgroundImageSelected = null,
                Rect     = new RectangleF(200, 700, 400, 90),
                Text     = "Port: ",
                Click    = delegate { },
                FontSize = 20,
            });
            portTextboxWidget = new Widget()
            {
                BackgroundImage         = menu.button4,
                BackgroundImageSelected = menu.button4sel,
                Rect      = new RectangleF(500, 700, 600, 90),
                Text      = getport(),
                Click     = delegate { },
                FontSize  = 20,
                IsTextbox = true,
                IsNumeric = true,
            };
            widgets.Add(portTextboxWidget);
            invalidHashWidget = new Widget()
            {
                BackgroundImage         = null,
                BackgroundImageSelected = null,
                Rect      = new RectangleF(1200, 300, 400, 90),
                Text      = "Invalid address.",
                Click     = delegate { },
                FontSize  = 20,
                TextColor = Color.Red,
            };
            widgets.Add(invalidHashWidget);
            invalidHostWidget = new Widget()
            {
                BackgroundImage         = null,
                BackgroundImageSelected = null,
                Rect      = new RectangleF(1200, 600, 400, 90),
                Text      = "Invalid address.",
                Click     = delegate { },
                FontSize  = 20,
                TextColor = Color.Red,
            };
            widgets.Add(invalidHostWidget);

            menu.AddOkCancel(this, delegate { Connect(); }, delegate { menu.currentForm = menu.d_FormJoinMultiplayer; });
        }