예제 #1
0
 public override void OnCancel()
 {
     if (btnYes.IsSelected)
     {
         btnYes.OnUnselected();
         btnNo.OnSelected();
     }
     base.OnCancel();
 }
예제 #2
0
        public QuestionBox(StyleSheet style, Rectangle area, string message, OdgeButton yesBtn, OdgeButton noBtn)
            : base(style)
        {
            Answer     = AnswerType.Unanswered;
            _btnInText = true;
            _btnOnTop  = false;
            dialog     = new DialogBox(Style, new Rectangle(Point.Zero, area.Size), message);
            dialog.ShowMultiPageFooter = false;

            // Options need style first.
            btnYes = yesBtn;
            if (btnYes.Style == null)
            {
                btnYes.Style = style;
            }

            btnNo = noBtn;
            if (btnNo.Style == null)
            {
                btnNo.Style = style;
            }

            // Init Dimensions on these options.
            btnYes.Dimensions = new Rectangle(0, 0, 1, 1);
            btnNo.Dimensions  = new Rectangle(0, 0, 1, 1);
            Dimensions        = area;
            calcBtnPoints();

            // At first optionNo should be selected.
            btnNo.OnSelected();
        }
예제 #3
0
 public void AddOption(OdgeButton option)
 {
     Options.Add(option);
     if (Options.Count == 1)
     {
         option.Y = 0;
         option.OnSelected();
     }
     resetBtns(true);
 }
예제 #4
0
        public override void Update()
        {
            if (CheckSubmit)
            {
                OnSubmit();
            }

            else if (!btnYes.IsSelected && OdgeUIInput.LEFT)
            {
                btnNo.OnUnselected();
                btnYes.OnSelected();
            }

            else if (btnYes.IsSelected && OdgeUIInput.RIGHT)
            {
                btnYes.OnUnselected();
                btnNo.OnSelected();
            }

            else if (CheckCancel)
            {
                OnCancel();
            }
        }