Don't highlight the mapping buttons if no item has been selected.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@392 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-04-06 19:50:12 +00:00
parent c2aba6aa6f
commit 04261c129d
2 changed files with 19 additions and 5 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventMappingDialog.cxx,v 1.2 2005-04-05 00:40:55 stephena Exp $
// $Id: EventMappingDialog.cxx,v 1.3 2005-04-06 19:50:12 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -71,6 +71,14 @@ EventMappingDialog::~EventMappingDialog()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventMappingDialog::loadConfig()
{
// Make sure remapping is turned off, just in case the user didn't properly
// exit from the dialog last time
stopRemapping();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventMappingDialog::startRemapping()
{
@ -113,8 +121,8 @@ void EventMappingDialog::stopRemapping()
// And re-enable all the widgets
myActionsList->setEnabled(true);
myMapButton->setEnabled(true);
myEraseButton->setEnabled(true);
myMapButton->setEnabled(false);
myEraseButton->setEnabled(false);
myDefaultsButton->setEnabled(true);
myOKButton->setEnabled(true);
myCancelMapButton->setEnabled(false);
@ -126,6 +134,9 @@ void EventMappingDialog::stopRemapping()
buf << "Key(s) : "
<< EventHandler::ourActionList[ myActionSelected ].key;
myKeyMapping->setLabel(buf.str());
myMapButton->setEnabled(true);
myEraseButton->setEnabled(true);
}
}
@ -149,6 +160,9 @@ void EventMappingDialog::handleCommand(CommandSender* sender, uInt32 cmd, uInt32
<< EventHandler::ourActionList[ myActionSelected ].key;
myKeyMapping->setLabel(buf.str());
myMapButton->setEnabled(true);
myEraseButton->setEnabled(true);
myCancelMapButton->setEnabled(false);
}
break;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventMappingDialog.hxx,v 1.2 2005-04-05 00:40:55 stephena Exp $
// $Id: EventMappingDialog.hxx,v 1.3 2005-04-06 19:50:12 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -59,7 +59,7 @@ class EventMappingDialog : public Dialog
void startRemapping();
void eraseRemapping();
void stopRemapping();
// void loadConfig() { }
void loadConfig();
private:
// Indicates the event that is currently selected