示例#1
0
        protected virtual void InitButtons()
        {
            // panel
            ButtonContainer buttonContainer = this.Controls.AddChild(new ButtonContainer("buttoncontainer"));

            buttonContainer.BackColor = Theme.Colors.Base2;

            Button btnOK = buttonContainer.AddChild(new Button("okbutton", "OK"));

            btnOK.Click  += (sender, eOK) => OnOK();
            btnOK.HAlign  = Alignment.Far;
            btnOK.MinSize = new System.Drawing.SizeF(96, btnOK.MinSize.Height);
        }
示例#2
0
        protected virtual void InitButtons(MessageBoxButtons buttons, ColorContexts colorContext)
        {
            DefaultButton btn = null;

            if (buttons.HasFlag(MessageBoxButtons.Continue))
            {
                btn        = new DefaultButton("continuebutton", "&Continue", colorContext, (char)0, true);
                btn.Click += (sender, eContinue) => OnContinue();
                ButtonContainer.AddChild(btn);
                btn.Focus();
            }

            if (buttons.HasFlag(MessageBoxButtons.Repeat))
            {
                btn        = new DefaultButton("repeatbutton", "&Repeat", colorContext, (char)0, true);
                btn.Click += (sender, eRepeat) => OnRepeat();
                ButtonContainer.AddChild(btn);
            }

            if (buttons.HasFlag(MessageBoxButtons.Yes))
            {
                btn        = new DefaultButton("yesbutton", "&Yes", colorContext, (char)0, true);
                btn.Click += (sender, eYes) => OnYes();
                ButtonContainer.AddChild(btn);
                btn.Focus();
            }

            if (buttons.HasFlag(MessageBoxButtons.No))
            {
                btn        = new DefaultButton("nobutton", "&No", colorContext, (char)0, true);
                btn.Click += (sender, eNo) => OnNo();
                ButtonContainer.AddChild(btn);
            }

            if (buttons.HasFlag(MessageBoxButtons.OK))
            {
                btn        = new DefaultButton("okbutton", "&OK", colorContext, (char)0, true);
                btn.Click += (sender, eOK) => OnOK();
                ButtonContainer.AddChild(btn);
                btn.Focus();
            }

            if (buttons.HasFlag(MessageBoxButtons.Cancel))
            {
                btn        = new DefaultButton("cancelbutton", "&Cancel", colorContext, (char)0, true);
                btn.Click += (sender, eCancel) => OnCancel();
                ButtonContainer.AddChild(btn);
            }
        }
        protected virtual void InitButtons(MessageBoxButtons buttons)
        {
            // panel
            DefaultButton btn = null;

            if (buttons.HasFlag(MessageBoxButtons.Continue))
            {
                btn        = ButtonContainer.AddChild(new DefaultButton("continuebutton", "&Continue"));
                btn.Click += (sender, eContinue) => OnContinue();
            }

            if (buttons.HasFlag(MessageBoxButtons.Repeat))
            {
                btn        = ButtonContainer.AddChild(new DefaultButton("repeatbutton", "&Repeat"));
                btn.Click += (sender, eRepeat) => OnRepeat();
            }

            if (buttons.HasFlag(MessageBoxButtons.Yes))
            {
                btn        = ButtonContainer.AddChild(new DefaultButton("yesbutton", "&Yes"));
                btn.Click += (sender, eYes) => OnYes();
            }

            if (buttons.HasFlag(MessageBoxButtons.No))
            {
                btn        = ButtonContainer.AddChild(new DefaultButton("nobutton", "&No"));;
                btn.Click += (sender, eNo) => OnNo();
            }

            if (buttons.HasFlag(MessageBoxButtons.OK))
            {
                btn        = ButtonContainer.AddChild(new DefaultButton("okbutton", "&OK"));
                btn.Click += (sender, eOK) => OnOK();
            }

            if (buttons.HasFlag(MessageBoxButtons.Cancel))
            {
                btn        = ButtonContainer.AddChild(new DefaultButton("cancelbutton", "&Cancel"));
                btn.Click += (sender, eCancel) => OnCancel();
            }

            ButtonContainer.Children.First.Focus();
        }