/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "confirmquit.h"
#include "mwindowgui.h"
#include "theme.h"
-
+#include <ctype.h>
ConfirmQuitWindow::ConfirmQuitWindow(MWindow *mwindow)
- : BC_Window(_(PROGRAM_NAME ": Confirm Quit"),
- mwindow->gui->get_abs_cursor_x(1),
- mwindow->gui->get_abs_cursor_y(1),
- 375,
+ : BC_Window(_(PROGRAM_NAME ": Confirm Quit"),
+ mwindow->gui->get_abs_cursor_x(1),
+ mwindow->gui->get_abs_cursor_y(1),
+ 375,
160)
{
this->mwindow = mwindow;
unlock_window();
}
-ConfirmQuitYesButton::ConfirmQuitYesButton(MWindow *mwindow,
+ConfirmQuitYesButton::ConfirmQuitYesButton(MWindow *mwindow,
ConfirmQuitWindow *gui)
- : BC_GenericButton(10,
- gui->get_h() - BC_GenericButton::calculate_h() - 10,
+ : BC_GenericButton(10,
+ gui->get_h() - BC_GenericButton::calculate_h() - 10,
_("Yes"))
{
set_underline(0);
}
int ConfirmQuitYesButton::keypress_event()
-{;
- if(get_keypress() == 'y') return handle_event();
+{
+ if( toupper(get_keypress()) == *get_text() )
+ return handle_event();
return 0;
}
-ConfirmQuitNoButton::ConfirmQuitNoButton(MWindow *mwindow,
+ConfirmQuitNoButton::ConfirmQuitNoButton(MWindow *mwindow,
ConfirmQuitWindow *gui)
- : BC_GenericButton(gui->get_w() / 2 - BC_GenericButton::calculate_w(gui, _("No")) / 2,
- gui->get_h() - BC_GenericButton::calculate_h() - 10,
+ : BC_GenericButton(gui->get_w() / 2 - BC_GenericButton::calculate_w(gui, _("No")) / 2,
+ gui->get_h() - BC_GenericButton::calculate_h() - 10,
_("No"))
{
set_underline(0);
int ConfirmQuitNoButton::keypress_event()
{
- if(get_keypress() == 'n') return handle_event();
+ if( toupper(get_keypress()) == *get_text() )
+ return handle_event();
return 0;
}
-ConfirmQuitCancelButton::ConfirmQuitCancelButton(MWindow *mwindow,
+ConfirmQuitCancelButton::ConfirmQuitCancelButton(MWindow *mwindow,
ConfirmQuitWindow *gui)
- : BC_GenericButton(gui->get_w() - BC_GenericButton::calculate_w(gui, _("Cancel")) - 10,
- gui->get_h() - BC_GenericButton::calculate_h() - 10,
+ : BC_GenericButton(gui->get_w() - BC_GenericButton::calculate_w(gui, _("Cancel")) - 10,
+ gui->get_h() - BC_GenericButton::calculate_h() - 10,
_("Cancel"))
{
}