public override void OnCancel() { if (btnYes.IsSelected) { btnYes.OnUnselected(); btnNo.OnSelected(); } base.OnCancel(); }
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 AddOption(OdgeButton option) { Options.Add(option); if (Options.Count == 1) { option.Y = 0; option.OnSelected(); } resetBtns(true); }
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(); } }