3 #include "mwindowgui.h"
11 QuestionWindow::QuestionWindow(MWindow *mwindow)
12 : BC_Window(PROGRAM_NAME ": Question",
13 mwindow->gui->get_abs_cursor_x(1) - WIDTH / 2,
14 mwindow->gui->get_abs_cursor_y(1) - HEIGHT / 2,
18 this->mwindow = mwindow;
21 QuestionWindow::~QuestionWindow()
25 int QuestionWindow::create_objects(char *string, int use_cancel)
28 add_subwindow(new BC_Title(10, 10, string));
30 add_subwindow(new QuestionYesButton(mwindow, this, x, y));
32 add_subwindow(new QuestionNoButton(mwindow, this, x, y));
34 if(use_cancel) add_subwindow(new BC_CancelButton(x, y));
38 QuestionYesButton::QuestionYesButton(MWindow *mwindow, QuestionWindow *window, int x, int y)
39 : BC_GenericButton(x, y, _("Yes"))
41 this->window = window;
45 int QuestionYesButton::handle_event()
50 int QuestionYesButton::keypress_event()
52 if(get_keypress() == 'y') { handle_event(); return 1; }
56 QuestionNoButton::QuestionNoButton(MWindow *mwindow, QuestionWindow *window, int x, int y)
57 : BC_GenericButton(x, y, _("No"))
59 this->window = window;
63 int QuestionNoButton::handle_event()
68 int QuestionNoButton::keypress_event()
70 if(get_keypress() == 'n') { handle_event(); return 1; }