Пример #1
0
        //Init
        public RegisterWindow(Canvas parent, MainMenu mainMenu, ImagePanel parentPanel)
        {
            //Assign References
            mMainMenu = mainMenu;

            //Main Menu Window
            mRegistrationPanel = new ImagePanel(parent, "RegistrationWindow");

            //Menu Header
            mRegistrationHeader = new Label(mRegistrationPanel, "RegistrationLabel");
            mRegistrationHeader.SetText(Strings.Registration.title);

            //Register Username Background
            mUsernameBackground = new ImagePanel(mRegistrationPanel, "UsernamePanel");

            //Register Username Label
            mUsernameLabel = new Label(mUsernameBackground, "UsernameLabel");
            mUsernameLabel.SetText(Strings.Registration.username);

            //Register Username Textbox
            mUsernameTextbox = new TextBox(mUsernameBackground, "UsernameField");
            mUsernameTextbox.SubmitPressed += UsernameTextbox_SubmitPressed;

            //Register Email Background
            mEmailBackground = new ImagePanel(mRegistrationPanel, "EmailPanel");

            //Register Email Label
            mEmailLabel = new Label(mEmailBackground, "EmailLabel");
            mEmailLabel.SetText(Strings.Registration.email);

            //Register Email Textbox
            mEmailTextbox = new TextBox(mEmailBackground, "EmailField");
            mEmailTextbox.SubmitPressed += EmailTextbox_SubmitPressed;

            //Register Password Background
            mPasswordBackground = new ImagePanel(mRegistrationPanel, "Password1Panel");

            //Register Password Label
            mPasswordLabel = new Label(mPasswordBackground, "Password1Label");
            mPasswordLabel.SetText(Strings.Registration.password);

            //Register Password Textbox
            mPasswordTextbox = new TextBoxPassword(mPasswordBackground, "Password1Field");
            mPasswordTextbox.SubmitPressed += PasswordTextbox_SubmitPressed;

            //Register Password Background
            mPasswordBackground2 = new ImagePanel(mRegistrationPanel, "Password2Panel");

            //Register Password Label2
            mPasswordLabel2 = new Label(mPasswordBackground2, "Password2Label");
            mPasswordLabel2.SetText(Strings.Registration.confirmpass);

            //Register Password Textbox2
            mPasswordTextbox2 = new TextBoxPassword(mPasswordBackground2, "Password2Field");
            mPasswordTextbox2.SubmitPressed += PasswordTextbox2_SubmitPressed;

            //Register - Send Registration Button
            mRegisterBtn = new Button(mRegistrationPanel, "RegisterButton");
            mRegisterBtn.SetText(Strings.Registration.register);
            mRegisterBtn.Clicked += RegisterBtn_Clicked;

            //Register - Back Button
            mBackBtn = new Button(mRegistrationPanel, "BackButton");
            mBackBtn.SetText(Strings.Registration.back);
            mBackBtn.Clicked += BackBtn_Clicked;

            mRegistrationPanel.LoadJsonUi(GameContentManager.UI.Menu, Graphics.Renderer.GetResolutionString());
        }