// private Texture2D ShowPasswordTexture;

        public override void OnInitialize()
        {
            // ShowPasswordTexture = TextureManager.Load("Images/UI/InfoIcon_5");

            float height = 0;

            Password = new UILabeledTextInput(Language.GetText(ValueIDPrefix + "PasswordLabel"));
            Password.Input.Sensitive = true;
            Password.Width.Set(0, 1);

            focusGroup.Add(Password.Input);
            height += UILabeledTextInput.DEFAULT_HEIGHT + PADDING;

            RememberPassword = new UILabeledCheckbox(Language.GetText(ValueIDPrefix + "RememberPasswordLabel"), true);
            RememberPassword.Top.Set(height, 0);

            focusGroup.Add(RememberPassword.Checkbox);
            height += UILabeledCheckbox.DEFAULT_HEIGHT + PADDING * 2;             // Add the top padding here as well

            UIPanel Panel = new UIPanel();

            Panel.Width.Set(0, 1);
            Panel.Height.Set(height, 0);
            Panel.SetPadding(PADDING);
            Panel.BackgroundColor = new Color(33, 43, 79) * 0.8f;

            Panel.Append(Password);
            Panel.Append(RememberPassword);

            UILargeButton CancelButton = new UILargeButton(Language.GetText("UI.Cancel"), CancelClick);

            CancelButton.Width.Set(-10, 0.5f);
            CancelButton.VAlign = 1;
            CancelButton.Top.Set(-0, 0);

            UILargeButton SubmitButton = new UILargeButton(Language.GetText("UI.Submit"), SubmitClick);

            SubmitButton.CopyStyle(CancelButton);
            SubmitButton.HAlign = 1;

            UIElement Element = new UIElement();

            Element.Width.Set(0, 0.8f);
            Element.MaxWidth.Set(420, 0);
            Element.Top.Set(220, 0);
            Element.Height.Set(height + 65, 0);
            Element.HAlign = 0.5f;

            Element.Append(Panel);
            Element.Append(CancelButton);
            Element.Append(SubmitButton);

            Append(Element);
        }
        public override void OnInitialize()
        {
            float height = 0;

            Name = new UILabeledTextInput(Language.GetText(ValueIDPrefix + "NameLabel"));
            focusGroup.Add(Name.Input);
            Name.Width.Set(0, 1);
            height += UILabeledTextInput.DEFAULT_HEIGHT + PADDING;

            Address = new UILabeledTextInput(Language.GetText(ValueIDPrefix + "AddressLabel"));
            Address.Top.Set(height, 0);
            Address.Width.Set(0 - PORT_WIDTH - PADDING, 1);
            focusGroup.Add(Address.Input);

            Port = new UILabeledTextInput(Language.GetText(ValueIDPrefix + "PortLabel"));
            Port.Top.Set(height, 0);
            Port.Width.Set(PORT_WIDTH, 0);
            Port.HAlign       = 1;
            Port.Input.Filter = (value) => {
                string cleaned = Regex.Replace(value, "[^0-9]", "");

                try {
                    return(Math.Max(0, Math.Min(65535, int.Parse(cleaned))).ToString());
                } catch { }

                return("");
            };

            focusGroup.Add(Port.Input);
            height += UILabeledTextInput.DEFAULT_HEIGHT + PADDING;

            HideAddress = new UILabeledCheckbox(Language.GetText(ValueIDPrefix + "HideAddressLabel"), true);
            HideAddress.Top.Set(height, 0);
            focusGroup.Add(HideAddress.Checkbox);
            height += UILabeledCheckbox.DEFAULT_HEIGHT + PADDING * 2;             // Add the top padding here as well

            UIPanel Panel = new UIPanel();

            Panel.Width.Set(0, 1);
            Panel.Height.Set(height, 0);
            Panel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
            Panel.SetPadding(PADDING);
            Panel.Append(Name);
            Panel.Append(Port);
            Panel.Append(Address);
            Panel.Append(HideAddress);

            UIElement Element = new UIElement();

            Element.Width.Set(0, 0.8f);
            Element.MaxWidth.Set(420, 0);
            Element.Top.Set(220, 0);
            Element.Height.Set(height + 65 * 2, 0);             // 65 * 2 = 2 Buttons high
            Element.HAlign = 0.5f;
            Element.Append(Panel);

            UILargeButton BackButton = new UILargeButton(Language.GetText("UI.Back"), GoBackClick);

            BackButton.Top.Set(-0, 0);
            BackButton.Width.Set(-10, 0.5f);
            BackButton.VAlign = 1;
            Element.Append(BackButton);

            UILargeButton SaveButton = new UILargeButton(Language.GetText(ValueIDPrefix + "Save"), SaveServerClick);

            SaveButton.CopyStyle(BackButton);
            SaveButton.HAlign = 1;
            Element.Append(SaveButton);

            UILargeButton SaveAndConnectButton = new UILargeButton(Language.GetText(ValueIDPrefix + "SaveAndConnect"), SaveAndConnectClick);

            SaveAndConnectButton.Top.Set(-65, 0);
            SaveAndConnectButton.VAlign = 1;
            Element.Append(SaveAndConnectButton);

            Append(Element);

            // BackButton.SetSnapPoint("Back", 0);
            // SaveButton.SetSnapPoint("Save", 0);
            // SaveAndConnectButton.SetSnapPoint("Save&Connect", 0);
        }