Beispiel #1
0
        private void AddOKCancelButtons()
        {
            XNAButton btnOK = new XNAClientButton(WindowManager);

            btnOK.FontIndex       = 1;
            btnOK.ClientRectangle = new Rectangle(0, 0, 92, 23);
            btnOK.Name            = "btnOK";
            btnOK.Text            = "OK";
            btnOK.LeftClick      += BtnYes_LeftClick;
            btnOK.HotKey          = Keys.Enter;

            AddChild(btnOK);

            btnOK.ClientRectangle = new Rectangle((Width - ((btnOK.Width + 5) * 2)) / 2,
                                                  Height - 28, btnOK.Width, btnOK.Height);

            XNAButton btnCancel = new XNAClientButton(WindowManager);

            btnCancel.FontIndex       = 1;
            btnCancel.ClientRectangle = new Rectangle(0, 0, 92, 23);
            btnCancel.Name            = "btnCancel";
            btnCancel.Text            = "Cancel";
            btnCancel.LeftClick      += BtnCancel_LeftClick;
            btnCancel.HotKey          = Keys.C;

            AddChild(btnCancel);

            btnCancel.ClientRectangle = new Rectangle(btnOK.X + btnOK.Width + 10,
                                                      Height - 28, btnCancel.Width, btnCancel.Height);
        }
Beispiel #2
0
        private void AddYesNoButtons()
        {
            XNAButton btnYes = new XNAClientButton(WindowManager);

            btnYes.FontIndex       = 1;
            btnYes.ClientRectangle = new Rectangle(0, 0, 92, 23);
            btnYes.Name            = "btnYes";
            btnYes.Text            = "Yes";
            btnYes.LeftClick      += BtnYes_LeftClick;
            btnYes.HotKey          = Keys.Y;
            this.btnYes            = btnYes;

            AddChild(btnYes);

            btnYes.ClientRectangle = new Rectangle((Width - ((btnYes.Width + 5) * 2)) / 2,
                                                   Height - 28, btnYes.Width, btnYes.Height);

            XNAButton btnNo = new XNAClientButton(WindowManager);

            btnNo.FontIndex       = 1;
            btnNo.ClientRectangle = new Rectangle(0, 0, 92, 23);
            btnNo.Name            = "btnNo";
            btnNo.Text            = "No";
            btnNo.LeftClick      += BtnNo_LeftClick;
            btnNo.HotKey          = Keys.N;
            this.btnNo            = btnNo;

            AddChild(btnNo);

            btnNo.ClientRectangle = new Rectangle(btnYes.X + btnYes.Width + 10,
                                                  Height - 28, btnNo.Width, btnNo.Height);
        }