Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
        public void RemoveOption(OdgeButton option)
        {
            if (SelectedOption == option)
            {
                SelectedIndex--;
            }

            Options.Remove(option);
            repositionOptions();
        }
Exemplo n.º 3
0
        public void RemoveOption(OdgeButton option)
        {
            if (SelectedIndex == Options.Count - 1)
            {
                SelectedIndex--;
            }

            Options.Remove(option);
            resetBtns(true);
        }
Exemplo n.º 4
0
 public void AddOption(OdgeButton option)
 {
     Options.Add(option);
     if (Options.Count == 1)
     {
         option.Y = 0;
         option.OnSelected();
     }
     resetBtns(true);
 }
Exemplo n.º 5
0
 public void AddOption(OdgeButton option)
 {
     Options.Add(option);
     Dimensions = new Rectangle(X, Y, Width, Height);
     repositionOptions();
 }