Made the arrow keys in DataGridWidget 'wrap around', so that when the end

a row/column is reached, it goes to the next row/column.  The reason for
this will become apparent over the next day or so.

Still TODO is revamp the base widget to accept and return an identifier
for which widget it is, since every widget/dialog in the debugger
currently assumes that there's only one type of each widget (so if there
are two DataGridWidgets, the returned signal doesn't know which one
to use).  Sorry if that sounds confusing ;)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@607 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-07-05 00:07:58 +00:00
parent fe8c605d8d
commit 3e0a2db948
2 changed files with 27 additions and 3 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: DataGridWidget.cxx,v 1.9 2005-07-04 15:59:38 stephena Exp $ // $Id: DataGridWidget.cxx,v 1.10 2005-07-05 00:07:57 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -208,6 +208,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers)
_currentRow--; _currentRow--;
dirty = true; dirty = true;
} }
else if(_currentCol > 0)
{
_currentRow = _rows - 1;
_currentCol--;
dirty = true;
}
break; break;
case 256+18: // down arrow case 256+18: // down arrow
@ -216,6 +222,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers)
_currentRow++; _currentRow++;
dirty = true; dirty = true;
} }
else if(_currentCol < (int) _cols - 1)
{
_currentRow = 0;
_currentCol++;
dirty = true;
}
break; break;
case 256+20: // left arrow case 256+20: // left arrow
@ -224,6 +236,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers)
_currentCol--; _currentCol--;
dirty = true; dirty = true;
} }
else if(_currentRow > 0)
{
_currentCol = _cols - 1;
_currentRow--;
dirty = true;
}
break; break;
case 256+19: // right arrow case 256+19: // right arrow
@ -232,6 +250,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers)
_currentCol++; _currentCol++;
dirty = true; dirty = true;
} }
else if(_currentRow < (int) _rows - 1)
{
_currentCol = 0;
_currentRow++;
dirty = true;
}
break; break;
case 256+24: // pageup case 256+24: // pageup

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FSNodeWin32.cxx,v 1.5 2005-06-16 00:56:00 stephena Exp $ // $Id: FSNodeWin32.cxx,v 1.6 2005-07-05 00:07:58 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -246,7 +246,7 @@ AbstractFilesystemNode* WindowsFilesystemNode::parent() const
return p; return p;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool AbstractFilesystemNode::fileExists(const string& path) bool AbstractFilesystemNode::fileExists(const string& path)
{ {