mirror of https://github.com/stella-emu/stella.git
More fixes for the Dialog focus issues.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@920 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
b1439714dc
commit
34284d0af9
|
@ -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: DebuggerDialog.cxx,v 1.9 2005-10-14 13:50:00 stephena Exp $
|
||||
// $Id: DebuggerDialog.cxx,v 1.10 2005-12-20 19:05:15 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -87,14 +87,21 @@ void DebuggerDialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
|||
// Doing this means we disallow 'Alt xxx' events to any widget in the tabset
|
||||
if(instance()->eventHandler().kbdAlt(modifiers))
|
||||
{
|
||||
if(ascii == 's')
|
||||
switch(ascii)
|
||||
{
|
||||
case 's':
|
||||
doStep();
|
||||
else if(ascii == 't')
|
||||
break;
|
||||
case 't':
|
||||
doTrace();
|
||||
else if(ascii == 'f')
|
||||
break;
|
||||
case 'f':
|
||||
doAdvance();
|
||||
else if(ascii == 'l')
|
||||
break;
|
||||
case 'l':
|
||||
doScanlineAdvance();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
Dialog::handleKeyDown(ascii, keycode, modifiers);
|
||||
|
|
|
@ -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: Dialog.cxx,v 1.35 2005-12-19 02:19:49 stephena Exp $
|
||||
// $Id: Dialog.cxx,v 1.36 2005-12-20 19:05:16 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -121,6 +121,8 @@ void Dialog::addToFocusList(WidgetArray& list, int id)
|
|||
}
|
||||
|
||||
_ourFocusList[id].focusList.push_back(list);
|
||||
if(id == 0)
|
||||
_focusList = _ourFocusList[id].focusList;
|
||||
|
||||
if(list.size() > 0 && !(list[0]->getFlags() & WIDGET_NODRAW_FOCUS))
|
||||
_ourFocusList[id].focusedWidget = list[0];
|
||||
|
@ -263,6 +265,8 @@ void Dialog::handleMouseUp(int x, int y, int button, int clickCount)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Dialog::handleMouseWheel(int x, int y, int direction)
|
||||
{
|
||||
cerr << "_focusedWidget = " << _focusedWidget << endl;
|
||||
|
||||
Widget* w;
|
||||
|
||||
// This may look a bit backwards, but I think it makes more sense for
|
||||
|
|
|
@ -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: EventMappingWidget.cxx,v 1.2 2005-12-07 20:46:49 stephena Exp $
|
||||
// $Id: EventMappingWidget.cxx,v 1.3 2005-12-20 19:05:16 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -46,7 +46,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, int x, int y, int w, int
|
|||
myActionsList->setTarget(this);
|
||||
myActionsList->setNumberingMode(kListNumberingOff);
|
||||
myActionsList->setEditable(false);
|
||||
// myActionsList->setFlags(WIDGET_NODRAW_FOCUS);
|
||||
myActionsList->setFlags(WIDGET_NODRAW_FOCUS);
|
||||
addFocusWidget(myActionsList);
|
||||
|
||||
// Add remap, erase, cancel and default buttons
|
||||
|
@ -81,6 +81,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, int x, int y, int w, int
|
|||
l.push_back(EventHandler::ourActionList[i].action);
|
||||
|
||||
myActionsList->setList(l);
|
||||
myActionSelected = myActionsList->getSelected();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -151,6 +152,7 @@ void EventMappingWidget::stopRemapping()
|
|||
myCancelMapButton->setEnabled(false);
|
||||
|
||||
// Make sure the list widget is in a known state
|
||||
cerr << "myActionSelected = " << myActionSelected << endl;
|
||||
if(myActionSelected >= 0)
|
||||
{
|
||||
drawKeyMapping();
|
||||
|
|
|
@ -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: EventMappingWidget.hxx,v 1.2 2005-12-07 20:46:49 stephena Exp $
|
||||
// $Id: EventMappingWidget.hxx,v 1.3 2005-12-20 19:05:16 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -29,6 +29,7 @@ class StaticTextWidget;
|
|||
class StringListWidget;
|
||||
class PopUpWidget;
|
||||
class GuiObject;
|
||||
class InputDialog;
|
||||
|
||||
#include "Widget.hxx"
|
||||
#include "Command.hxx"
|
||||
|
@ -37,6 +38,8 @@ class GuiObject;
|
|||
|
||||
class EventMappingWidget : public Widget, public CommandSender
|
||||
{
|
||||
friend class InputDialog;
|
||||
|
||||
public:
|
||||
EventMappingWidget(GuiObject* boss, int x, int y, int w, int h);
|
||||
~EventMappingWidget();
|
||||
|
|
|
@ -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: InputDialog.cxx,v 1.6 2005-12-16 14:41:15 stephena Exp $
|
||||
// $Id: InputDialog.cxx,v 1.7 2005-12-20 19:05:16 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include "OSystem.hxx"
|
||||
|
@ -56,6 +56,9 @@ InputDialog::InputDialog(
|
|||
myTab->setParentWidget(tabID, myEventMapper);
|
||||
addToFocusList(myEventMapper->getFocusList(), tabID);
|
||||
|
||||
cerr << "size = " << myEventMapper->getFocusList().size()
|
||||
<< ", tabid = " << tabID << endl;
|
||||
|
||||
// 2) Virtual device support
|
||||
addVDeviceTab();
|
||||
|
||||
|
@ -179,6 +182,8 @@ void InputDialog::addVDeviceTab()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void InputDialog::loadConfig()
|
||||
{
|
||||
myEventMapper->loadConfig();
|
||||
|
||||
// Left & right ports
|
||||
const string& sa1 = instance()->settings().getString("sa1");
|
||||
int lport = sa1 == "right" ? 2 : 1;
|
||||
|
|
|
@ -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: InputTextDialog.cxx,v 1.9 2005-12-20 00:56:31 stephena Exp $
|
||||
// $Id: InputTextDialog.cxx,v 1.10 2005-12-20 19:05:16 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -129,13 +129,8 @@ void InputTextDialog::setEditString(const string& str, int idx)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void InputTextDialog::setFocus(int idx)
|
||||
{
|
||||
cerr << "size = " << getFocusList().size() << endl;
|
||||
/* FIXME - a related problem in InputDialog EventMappingWidget list
|
||||
is occurring, whereby the focuslist isn't being filled
|
||||
right away
|
||||
if((unsigned int)idx < myInput.size())
|
||||
Dialog::setFocus(getFocusList()[idx]);
|
||||
*/
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in New Issue