public UILoginDialog(LoginScreen loginScreen) : base(UIDialogStyle.Standard, true)
        {
            this.m_LoginScreen = loginScreen;
            this.Caption       = GameFacade.Strings.GetString("UIText", "209", "1");

            SetSize(350, 225);


            m_TxtAccName          = UITextEdit.CreateTextBox();
            m_TxtAccName.X        = 20;
            m_TxtAccName.Y        = 72;
            m_TxtAccName.MaxChars = 16;
            m_TxtAccName.SetSize(310, 27);
            m_TxtAccName.CurrentText = "username";
            this.Add(m_TxtAccName);


            m_TxtPass             = UITextEdit.CreateTextBox();
            m_TxtPass.X           = 20;
            m_TxtPass.Y           = 128;
            m_TxtPass.MaxChars    = 16;
            m_TxtPass.CurrentText = "password";
            m_TxtPass.SetSize(310, 27);
            this.Add(m_TxtPass);


            /** Login button **/
            var loginBtn = new UIButton {
                X       = 116,
                Y       = 170,
                Width   = 100,
                ID      = "LoginButton",
                Caption = GameFacade.Strings.GetString("UIText", "209", "2")
            };

            this.Add(loginBtn);
            loginBtn.OnButtonClick += new ButtonClickDelegate(loginBtn_OnButtonClick);

            var exitBtn = new UIButton
            {
                X       = 226,
                Y       = 170,
                Width   = 100,
                ID      = "ExitButton",
                Caption = GameFacade.Strings.GetString("UIText", "209", "3")
            };

            this.Add(exitBtn);
            exitBtn.OnButtonClick += new ButtonClickDelegate(exitBtn_OnButtonClick);


            this.Add(new UILabel
            {
                Caption = GameFacade.Strings.GetString("UIText", "209", "4"),
                X       = 24,
                Y       = 50
            });

            this.Add(new UILabel
            {
                Caption = GameFacade.Strings.GetString("UIText", "209", "5"),
                X       = 24,
                Y       = 106
            });
        }
Esempio n. 2
0
        public UILoginDialog(Action login)
            : base(UIDialogStyle.Standard, true)
        {
            this.Login   = login;
            this.Caption = GameFacade.Strings.GetString("UIText", "209", "1");

            SetSize(350, 225);

            m_TxtAccName          = UITextEdit.CreateTextBox();
            m_TxtAccName.X        = 20;
            m_TxtAccName.Y        = 72;
            m_TxtAccName.MaxChars = 32;
            m_TxtAccName.SetSize(310, 27);
            m_TxtAccName.CurrentText   = GlobalSettings.Default.LastUser;
            m_TxtAccName.OnChange     += M_TxtAccName_OnChange;
            m_TxtAccName.OnTabPress   += new KeyPressDelegate(m_TxtAccName_OnTabPress);
            m_TxtAccName.OnEnterPress += new KeyPressDelegate(loginBtn_OnButtonClick);

            this.Add(m_TxtAccName);

            m_TxtPass          = UITextEdit.CreateTextBox();
            m_TxtPass.X        = 20;
            m_TxtPass.Y        = 128;
            m_TxtPass.MaxChars = 64;
            m_TxtPass.SetSize(310, 27);
            m_TxtPass.Password  = true;
            m_TxtPass.OnChange += M_TxtAccName_OnChange;
            //m_TxtPass.OnTabPress += new KeyPressDelegate(m_TxtPass_OnTabPress);
            m_TxtPass.OnEnterPress    += new KeyPressDelegate(loginBtn_OnButtonClick);
            m_TxtPass.OnShiftTabPress += new KeyPressDelegate(m_TxtPass_OnShiftTabPress);
            this.Add(m_TxtPass);

            /** Login button **/
            var loginBtn = new UIButton
            {
                X       = 116,
                Y       = 170,
                Width   = 100,
                ID      = "LoginButton",
                Caption = GameFacade.Strings.GetString("UIText", "209", "2")
            };

            this.Add(loginBtn);
            loginBtn.OnButtonClick += new ButtonClickDelegate(loginBtn_OnButtonClick);

            var exitBtn = new UIButton
            {
                X       = 226,
                Y       = 170,
                Width   = 100,
                ID      = "ExitButton",
                Caption = GameFacade.Strings.GetString("UIText", "209", "3")
            };

            this.Add(exitBtn);
            exitBtn.OnButtonClick += new ButtonClickDelegate(exitBtn_OnButtonClick);

            this.Add(new UILabel
            {
                Caption = GameFacade.Strings.GetString("UIText", "209", "4"),
                X       = 24,
                Y       = 50
            });

            this.Add(new UILabel
            {
                Caption = GameFacade.Strings.GetString("UIText", "209", "5"),
                X       = 24,
                Y       = 106
            });

            GameFacade.Screens.inputManager.SetFocus(m_TxtAccName);
            RefreshBlink();
        }