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(); }
public void RemoveOption(OdgeButton option) { if (SelectedOption == option) { SelectedIndex--; } Options.Remove(option); repositionOptions(); }
public void RemoveOption(OdgeButton option) { if (SelectedIndex == Options.Count - 1) { SelectedIndex--; } Options.Remove(option); resetBtns(true); }
public void AddOption(OdgeButton option) { Options.Add(option); if (Options.Count == 1) { option.Y = 0; option.OnSelected(); } resetBtns(true); }
public void AddOption(OdgeButton option) { Options.Add(option); Dimensions = new Rectangle(X, Y, Width, Height); repositionOptions(); }