1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <config.h>
- #include "question.h"
- Question::Question(const char *aText)
- : Label(aText)
- {
- yes_chars.init_from_utf8(_("yY"));
- no_chars.init_from_utf8(_("nN"));
- set_modal();
- positive_answer = false;
- }
- bool Question::handle_event(const Event &evt)
- {
- if (evt.is_literal()) {
- if (yes_chars.has_char(evt.ch)) {
- positive_answer = true;
- end_modal();
- return true;
- }
- if (no_chars.has_char(evt.ch)) {
- positive_answer = false;
- end_modal();
- return true;
- }
- }
- return Label::handle_event(evt);
- }
|