From 4133668d75f6eaf9d193bd3fd04a0860d7f7d8cf Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 19 Mar 2009 15:03:51 +0000 Subject: [PATCH] Removed KidVid from the list of controllers for now. I won't have it ready for the next minor point release, so there's no need for users to see it. When using 'quick-select' mode in list widgets (notably the ROM launcher), treat space as a valid character, instead of stopping when space is pressed. Make quickselect be an option for ListWidgets, and disable it for CheckBoxWidgets (cheat listing, rom dissassembly listing, etc). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1683 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/gui/CheckListWidget.cxx | 4 ++-- stella/src/gui/GameInfoDialog.cxx | 4 ++-- stella/src/gui/ListWidget.cxx | 8 +++++--- stella/src/gui/ListWidget.hxx | 5 +++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/stella/src/gui/CheckListWidget.cxx b/stella/src/gui/CheckListWidget.cxx index d92a0e579..b37a25ab8 100644 --- a/stella/src/gui/CheckListWidget.cxx +++ b/stella/src/gui/CheckListWidget.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: CheckListWidget.cxx,v 1.18 2009-01-01 18:13:38 stephena Exp $ +// $Id: CheckListWidget.cxx,v 1.19 2009-03-19 15:03:50 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -25,7 +25,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) - : ListWidget(boss, font, x, y, w, h) + : ListWidget(boss, font, x, y, w, h, false) // disable quick select { int ypos = _y + 2; diff --git a/stella/src/gui/GameInfoDialog.cxx b/stella/src/gui/GameInfoDialog.cxx index f3a70c638..e3b1625a7 100644 --- a/stella/src/gui/GameInfoDialog.cxx +++ b/stella/src/gui/GameInfoDialog.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: GameInfoDialog.cxx,v 1.67 2009-03-16 00:23:42 stephena Exp $ +// $Id: GameInfoDialog.cxx,v 1.68 2009-03-19 15:03:50 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -224,7 +224,7 @@ GameInfoDialog::GameInfoDialog( ctrls.push_back("AmigaMouse", "AMIGAMOUSE" ); ctrls.push_back("AtariVox", "ATARIVOX" ); ctrls.push_back("SaveKey", "SAVEKEY" ); - ctrls.push_back("KidVid", "KIDVID" ); +//FIXME ctrls.push_back("KidVid", "KIDVID" ); myP0Controller = new PopUpWidget(myTab, font, xpos+lwidth, ypos, pwidth, lineHeight, ctrls, "", 0, 0); wid.push_back(myP0Controller); diff --git a/stella/src/gui/ListWidget.cxx b/stella/src/gui/ListWidget.cxx index f5c6d999a..3ee3ab144 100644 --- a/stella/src/gui/ListWidget.cxx +++ b/stella/src/gui/ListWidget.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: ListWidget.cxx,v 1.55 2009-01-24 17:32:29 stephena Exp $ +// $Id: ListWidget.cxx,v 1.56 2009-03-19 15:03:50 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -32,7 +32,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font, - int x, int y, int w, int h) + int x, int y, int w, int h, bool quickSelect) : EditableWidget(boss, font, x, y, 16, 16), _rows(0), _cols(0), @@ -42,6 +42,7 @@ ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font, _currentKeyDown(0), _editMode(false), _caretInverse(true), + _quickSelect(quickSelect), _quickSelectTime(0) { _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS; @@ -218,7 +219,8 @@ bool ListWidget::handleKeyDown(int ascii, int keycode, int modifiers) bool handled = true; int oldSelectedItem = _selectedItem; - if (!_editMode && isalnum((char)ascii)) + if (!_editMode && _quickSelect && + ((isalnum((char)ascii)) || isspace((char)ascii))) { // Quick selection mode: Go to first list item starting with this key // (or a substring accumulated from the last couple key presses). diff --git a/stella/src/gui/ListWidget.hxx b/stella/src/gui/ListWidget.hxx index da45559d7..47dbec4f4 100644 --- a/stella/src/gui/ListWidget.hxx +++ b/stella/src/gui/ListWidget.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: ListWidget.hxx,v 1.25 2009-01-05 22:05:35 stephena Exp $ +// $Id: ListWidget.hxx,v 1.26 2009-03-19 15:03:51 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -46,7 +46,7 @@ class ListWidget : public EditableWidget { public: ListWidget(GuiObject* boss, const GUI::Font& font, - int x, int y, int w, int h); + int x, int y, int w, int h, bool quickSelect = true); virtual ~ListWidget(); int rows() const { return _rows; } @@ -111,6 +111,7 @@ class ListWidget : public EditableWidget StringList _list; string _backupString; + bool _quickSelect; string _quickSelectStr; int _quickSelectTime;