Make Add Button caption react to Shift key.

svn-id: r25373
This commit is contained in:
Eugene Sandulenko 2007-02-04 02:36:23 +00:00
parent 18a9cb46d6
commit 0d01bdd799
2 changed files with 13 additions and 1 deletions

View File

@ -494,7 +494,8 @@ LauncherDialog::LauncherDialog()
new ButtonWidget(this, "launcher_start_button", "Start", kStartCmd, 'S');
// Above the lowest button rows: two more buttons (directly below the list box)
new ButtonWidget(this, "launcher_addGame_button", "Add Game...", kAddGameCmd, 'A');
_addButton =
new ButtonWidget(this, "launcher_addGame_button", "Add Game...", kAddGameCmd, 'A');
_editButton =
new ButtonWidget(this, "launcher_editGame_button", "Edit Game...", kEditGameCmd, 'E');
_removeButton =
@ -806,11 +807,21 @@ void LauncherDialog::editGame(int item) {
void LauncherDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
_modifiers = modifiers;
Dialog::handleKeyDown(ascii, keycode, modifiers);
if ((modifiers & OSystem::KBD_SHIFT) != 0) {
_addButton->setLabel("Mass Add...");
_addButton->draw();
}
}
void LauncherDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
_modifiers = modifiers;
Dialog::handleKeyUp(ascii, keycode, modifiers);
if ((modifiers & OSystem::KBD_SHIFT) == 0) {
_addButton->setLabel("Add Game...");
_addButton->draw();
}
}
void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {

View File

@ -45,6 +45,7 @@ public:
protected:
ListWidget *_list;
ButtonWidget *_addButton;
Widget *_startButton;
Widget *_editButton;
Widget *_removeButton;