2 #include "mwindowgui.h"
8 #define _(String) gettext(String)
9 #define gettext_noop(String) String
10 #define N_(String) gettext_noop (String)
15 QuestionWindow::QuestionWindow(MWindow *mwindow)
16 : BC_Window(PROGRAM_NAME ": Question",
17 mwindow->gui->get_abs_cursor_x() - WIDTH / 2,
18 mwindow->gui->get_abs_cursor_y() - HEIGHT / 2,
22 this->mwindow = mwindow;
25 QuestionWindow::~QuestionWindow()
29 int QuestionWindow::create_objects(char *string, int use_cancel)
32 add_subwindow(new BC_Title(10, 10, string));
34 add_subwindow(new QuestionYesButton(mwindow, this, x, y));
36 add_subwindow(new QuestionNoButton(mwindow, this, x, y));
38 if(use_cancel) add_subwindow(new BC_CancelButton(x, y));
42 QuestionYesButton::QuestionYesButton(MWindow *mwindow, QuestionWindow *window, int x, int y)
43 : BC_GenericButton(x, y, _("Yes"))
45 this->window = window;
49 int QuestionYesButton::handle_event()
54 int QuestionYesButton::keypress_event()
56 if(get_keypress() == 'y') { handle_event(); return 1; }
60 QuestionNoButton::QuestionNoButton(MWindow *mwindow, QuestionWindow *window, int x, int y)
61 : BC_GenericButton(x, y, _("No"))
63 this->window = window;
67 int QuestionNoButton::handle_event()
72 int QuestionNoButton::keypress_event()
74 if(get_keypress() == 'n') { handle_event(); return 1; }