[Scummvm-cvs-logs] SF.net SVN: scummvm: [27058] scummvm/trunk/engines/agi/predictive.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sat Jun 2 22:39:06 CEST 2007
Revision: 27058
http://scummvm.svn.sourceforge.net/scummvm/?rev=27058&view=rev
Author: knakos
Date: 2007-06-02 13:39:04 -0700 (Sat, 02 Jun 2007)
Log Message:
-----------
implement most-recently-used scheme for dictionary words
Modified Paths:
--------------
scummvm/trunk/engines/agi/predictive.cpp
Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp 2007-06-02 19:56:18 UTC (rev 27057)
+++ scummvm/trunk/engines/agi/predictive.cpp 2007-06-02 20:39:04 UTC (rev 27058)
@@ -250,8 +250,8 @@
key = doPollKeyboard();
switch (key) {
case KEY_ENTER:
- rc = true;
- goto press;
+ active = 13;
+ goto processkey;
case KEY_ESCAPE:
rc = false;
goto getout;
@@ -266,10 +266,14 @@
needRefresh = true;
lastactive = active;
if (active == 15 && mode != kModeNum) { // Space
+ // bring MRU word at the top of the list when changing words
+ if (mode == kModePre && _activeTreeNode && _activeTreeNode->words.size() > 1 && _wordNumber != 0) {
+ String tmpstr = _activeTreeNode->words.remove_at(_wordNumber);
+ _activeTreeNode->words.insert_at(0, tmpstr);
+ }
+
strncpy(temp, _currentWord.c_str(), _currentCode.size());
-
temp[_currentCode.size()] = 0;
-
prefix += temp;
prefix += " ";
_currentCode.clear();
@@ -331,6 +335,12 @@
} else if (active == 10) { // add
debug(0, "add");
} else if (active == 13) { // Ok
+ // bring MRU word at the top of the list when ok'ed out of the dialog
+ if (mode == kModePre && _activeTreeNode && _activeTreeNode->words.size() > 1 && _wordNumber != 0) {
+ String tmpstr = _activeTreeNode->words.remove_at(_wordNumber);
+ _activeTreeNode->words.insert_at(0, tmpstr);
+ }
+
rc = true;
goto press;
} else if (active == 14) { // Mode
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list