From 18b37a5ed6a1b944c599be7fef1e5e30183577a0 Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 30 Jun 2005 00:08:02 +0000 Subject: [PATCH] Fixed some focus issues in the GUI. Sometimes selecting a widget in one tab would temporarily draw a widget from the previously selected tab. Added 'Alt-f' shortcut for 'Frame+1" in the debugger. Removed that key from toggling filtering, as it only worked for OpenGL mode anyway (and filtering is due for a huge rework in a future version of Stella). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@584 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/emucore/EventHandler.cxx | 6 +----- stella/src/gui/DebuggerDialog.cxx | 4 +++- stella/src/gui/EditNumWidget.cxx | 7 +------ stella/src/gui/EditNumWidget.hxx | 5 +---- stella/src/gui/EditTextWidget.cxx | 7 +------ stella/src/gui/EditTextWidget.hxx | 5 +---- stella/src/gui/EditableWidget.hxx | 5 ++++- stella/src/gui/Widget.cxx | 11 +---------- 8 files changed, 13 insertions(+), 37 deletions(-) diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 5f9c8a9c7..7909230d9 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -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: EventHandler.cxx,v 1.78 2005-06-29 00:31:49 urchlay Exp $ +// $Id: EventHandler.cxx,v 1.79 2005-06-30 00:07:59 stephena Exp $ //============================================================================ #include @@ -270,10 +270,6 @@ void EventHandler::poll(uInt32 time) myOSystem->frameBuffer().toggleFullscreen(); break; #endif - case SDLK_f: - myOSystem->frameBuffer().toggleFilter(); - break; - case SDLK_g: myOSystem->toggleFrameBuffer(); break; diff --git a/stella/src/gui/DebuggerDialog.cxx b/stella/src/gui/DebuggerDialog.cxx index 8da906bd9..07f1256fd 100644 --- a/stella/src/gui/DebuggerDialog.cxx +++ b/stella/src/gui/DebuggerDialog.cxx @@ -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.18 2005-06-24 12:01:26 stephena Exp $ +// $Id: DebuggerDialog.cxx,v 1.19 2005-06-30 00:08:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -113,6 +113,8 @@ void DebuggerDialog::handleKeyDown(int ascii, int keycode, int modifiers) doStep(); else if(ascii == 't') doTrace(); + else if(ascii == 'f') + doAdvance(); } else myTab->handleKeyDown(ascii, keycode, modifiers); diff --git a/stella/src/gui/EditNumWidget.cxx b/stella/src/gui/EditNumWidget.cxx index 3ab1cf92f..7dd395c48 100644 --- a/stella/src/gui/EditNumWidget.cxx +++ b/stella/src/gui/EditNumWidget.cxx @@ -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: EditNumWidget.cxx,v 1.5 2005-06-23 14:33:11 stephena Exp $ +// $Id: EditNumWidget.cxx,v 1.6 2005-06-30 00:08:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -107,11 +107,6 @@ GUI::Rect EditNumWidget::getEditRect() const return r; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EditNumWidget::receivedFocusWidget() -{ -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EditNumWidget::lostFocusWidget() { diff --git a/stella/src/gui/EditNumWidget.hxx b/stella/src/gui/EditNumWidget.hxx index 8c921ee9f..a5a71eb1d 100644 --- a/stella/src/gui/EditNumWidget.hxx +++ b/stella/src/gui/EditNumWidget.hxx @@ -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: EditNumWidget.hxx,v 1.2 2005-06-16 00:55:59 stephena Exp $ +// $Id: EditNumWidget.hxx,v 1.3 2005-06-30 00:08:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -36,11 +36,8 @@ class EditNumWidget : public EditableWidget virtual void handleMouseDown(int x, int y, int button, int clickCount); - virtual bool wantsFocus() { return true; } - protected: void drawWidget(bool hilite); - void receivedFocusWidget(); void lostFocusWidget(); void startEditMode(); diff --git a/stella/src/gui/EditTextWidget.cxx b/stella/src/gui/EditTextWidget.cxx index fb68eee04..5c3a8f64f 100644 --- a/stella/src/gui/EditTextWidget.cxx +++ b/stella/src/gui/EditTextWidget.cxx @@ -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: EditTextWidget.cxx,v 1.5 2005-06-23 14:33:11 stephena Exp $ +// $Id: EditTextWidget.cxx,v 1.6 2005-06-30 00:08:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -97,11 +97,6 @@ GUI::Rect EditTextWidget::getEditRect() const return r; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EditTextWidget::receivedFocusWidget() -{ -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EditTextWidget::lostFocusWidget() { diff --git a/stella/src/gui/EditTextWidget.hxx b/stella/src/gui/EditTextWidget.hxx index a0fb1e4a0..a0d883718 100644 --- a/stella/src/gui/EditTextWidget.hxx +++ b/stella/src/gui/EditTextWidget.hxx @@ -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: EditTextWidget.hxx,v 1.3 2005-06-22 18:30:43 stephena Exp $ +// $Id: EditTextWidget.hxx,v 1.4 2005-06-30 00:08:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -36,11 +36,8 @@ class EditTextWidget : public EditableWidget virtual void handleMouseDown(int x, int y, int button, int clickCount); - virtual bool wantsFocus() { return true; } - protected: void drawWidget(bool hilite); - void receivedFocusWidget(); void lostFocusWidget(); void startEditMode(); diff --git a/stella/src/gui/EditableWidget.hxx b/stella/src/gui/EditableWidget.hxx index f32eb27b3..6ca56704d 100644 --- a/stella/src/gui/EditableWidget.hxx +++ b/stella/src/gui/EditableWidget.hxx @@ -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: EditableWidget.hxx,v 1.4 2005-06-22 18:30:43 stephena Exp $ +// $Id: EditableWidget.hxx,v 1.5 2005-06-30 00:08:01 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -43,6 +43,9 @@ class EditableWidget : public Widget virtual bool handleKeyDown(int ascii, int keycode, int modifiers); + // We only want to focus this widget when we can edit its contents + virtual bool wantsFocus() { return _editable; } + protected: virtual void startEditMode() = 0; virtual void endEditMode() = 0; diff --git a/stella/src/gui/Widget.cxx b/stella/src/gui/Widget.cxx index 2c8c27890..0b035d162 100644 --- a/stella/src/gui/Widget.cxx +++ b/stella/src/gui/Widget.cxx @@ -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: Widget.cxx,v 1.20 2005-06-25 16:35:36 stephena Exp $ +// $Id: Widget.cxx,v 1.21 2005-06-30 00:08:02 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -130,16 +130,7 @@ void Widget::receivedFocus() _boss->handleCommand(NULL, kActiveWidgetCmd, 0); } } -/* FIXME -void Widget::lostFocus() -{ - _hasFocus = false; - lostFocusWidget(); -if(getFlags() & WIDGET_TAB_NAVIGATE) - cerr << "lost focus: " << this << endl; -} -*/ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Widget* Widget::findWidgetInChain(Widget *w, int x, int y) {