1 #include "confirmquit.h"
4 #include "mwindowgui.h"
9 #define _(String) gettext(String)
10 #define gettext_noop(String) String
11 #define N_(String) gettext_noop (String)
14 ConfirmQuitWindow::ConfirmQuitWindow(MWindow *mwindow)
15 : BC_Window(PROGRAM_NAME ": Question",
16 mwindow->gui->get_abs_cursor_x(),
17 mwindow->gui->get_abs_cursor_y(),
21 this->mwindow = mwindow;
24 ConfirmQuitWindow::~ConfirmQuitWindow()
28 int ConfirmQuitWindow::create_objects(char *string)
33 //printf("ConfirmQuitWindow::create_objects 1\n");
34 add_subwindow(title = new BC_Title(x, y, string));
36 //printf("ConfirmQuitWindow::create_objects 1\n");
37 add_subwindow(title = new BC_Title(x, y, _("( Answering ""No"" will destroy changes )")));
39 //printf("ConfirmQuitWindow::create_objects 1\n");
40 add_subwindow(new ConfirmQuitYesButton(mwindow, x, y));
42 //printf("ConfirmQuitWindow::create_objects 1\n");
43 add_subwindow(new ConfirmQuitNoButton(mwindow, x, y));
45 //printf("ConfirmQuitWindow::create_objects 1\n");
46 add_subwindow(new ConfirmQuitCancelButton(mwindow, x, y));
47 //printf("ConfirmQuitWindow::create_objects 1\n");
51 ConfirmQuitYesButton::ConfirmQuitYesButton(MWindow *mwindow, int x, int y)
52 : BC_GenericButton(x, y, _("Yes"))
57 int ConfirmQuitYesButton::handle_event()
63 int ConfirmQuitYesButton::keypress_event()
65 if(get_keypress() == 'y') return handle_event();
69 ConfirmQuitNoButton::ConfirmQuitNoButton(MWindow *mwindow, int x, int y)
70 : BC_GenericButton(x, y, _("No"))
75 int ConfirmQuitNoButton::handle_event()
81 int ConfirmQuitNoButton::keypress_event()
83 if(get_keypress() == 'n') return handle_event();
87 ConfirmQuitCancelButton::ConfirmQuitCancelButton(MWindow *mwindow, int x, int y)
88 : BC_CancelButton(x, y)
92 int ConfirmQuitCancelButton::handle_event()
98 int ConfirmQuitCancelButton::keypress_event()
100 if(get_keypress() == ESC) return handle_event();