private void InitializeComponent(int type) { this.Size = new Vector2(280, 120); this.Position = new Vector2(SharedInformation.Config.ScreenWidth / 2 - 140, SharedInformation.Config.ScreenHeight / 2 - 60); this.Text = "message"; lblText = new Label(); lblText.Position = new Vector2(13, 29); if (type >= 1) { btnOkYes = new Button(); btnOkYes.Size = new Vector2(42, 20); btnOkYes.Position = new Vector2(189, 96); btnOkYes.Clicked += new Action<Nuclex.Input.MouseButtons, float, float>(btnOkYes_Clicked); btnOkYes.Text = "OK"; this.Controls.Add(btnOkYes); } if (type >= 2) { btnNo = new Button(); btnNo.Size = new Vector2(42, 20); btnNo.Position = new Vector2(234, 96); btnNo.Text = "cancel"; btnNo.Clicked += new Action<Nuclex.Input.MouseButtons, float, float>(btnNo_Clicked); this.Controls.Add(btnNo); } this.Controls.Add(lblText); }
private void InitializeComponent() { this.Size = new Vector2(280, 120); this.Position = new Vector2(SharedInformation.Config.ScreenWidth / 2 - 140, SharedInformation.Config.ScreenHeight - 140 - 120); this.Text = "Login"; btnOK = new Button(); btnOK.Text = "enter"; btnOK.Position = new Vector2(189, 96); btnOK.Size = new Vector2(42, 20); btnOK.Clicked += new Action<MouseButtons, float, float>(btnOK_Clicked); btnCancel = new Button(); btnCancel.Clicked += new Action<Nuclex.Input.MouseButtons, float, float>(btnCancel_Clicked); btnCancel.Text = "cancel"; btnCancel.Position = new Vector2(234, 96); btnCancel.Size = new Vector2(42, 20); txtLogin = new TextBox(); txtLogin.Position = new Vector2(91, 29); txtLogin.Size = new Vector2(127, 18); txtLogin.BackColor = Color.FromNonPremultiplied(242, 242, 242, 255); txtPassword = new TextBox(); txtPassword.Position = new Vector2(91, 61); txtPassword.Size = new Vector2(127, 18); txtPassword.TextMask = "*"; txtPassword.BackColor = Color.FromNonPremultiplied(242, 242, 242, 255); txtPassword.OnEnter += new Action(txtPassword_OnEnter); lblLogin = new Label(); lblLogin.Text = "Username"; lblLogin.Position = new Vector2(23, 33); lblLogin.ForeColor = Color.FromNonPremultiplied(90, 111, 153, 255); lblLogin.Font = Control.Gulim8B; lblPassword = new Label(); lblPassword.Text = "Password"; lblPassword.Position = new Vector2(23, 64); lblPassword.ForeColor = Color.FromNonPremultiplied(90, 111, 153, 255); lblPassword.Font = Control.Gulim8B; ckSave = new CheckBox(); ckSave.Position = new Vector2(232, 33); ckSave.Text = "Save"; this.Controls.Add(lblPassword); this.Controls.Add(lblLogin); this.Controls.Add(txtLogin); this.Controls.Add(txtPassword); this.Controls.Add(btnOK); this.Controls.Add(btnCancel); this.Controls.Add(ckSave); }