From 3e0a2db948fa9935dbb3594954dacde843b38d9c Mon Sep 17 00:00:00 2001 From: stephena Date: Tue, 5 Jul 2005 00:07:58 +0000 Subject: [PATCH] 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 --- stella/src/gui/DataGridWidget.cxx | 26 +++++++++++++++++++++++++- stella/src/win32/FSNodeWin32.cxx | 4 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/stella/src/gui/DataGridWidget.cxx b/stella/src/gui/DataGridWidget.cxx index 2592cadcd..62aa97556 100644 --- a/stella/src/gui/DataGridWidget.cxx +++ b/stella/src/gui/DataGridWidget.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: 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 // Copyright (C) 2002-2004 The ScummVM project @@ -208,6 +208,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers) _currentRow--; dirty = true; } + else if(_currentCol > 0) + { + _currentRow = _rows - 1; + _currentCol--; + dirty = true; + } break; case 256+18: // down arrow @@ -216,6 +222,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers) _currentRow++; dirty = true; } + else if(_currentCol < (int) _cols - 1) + { + _currentRow = 0; + _currentCol++; + dirty = true; + } break; case 256+20: // left arrow @@ -224,6 +236,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers) _currentCol--; dirty = true; } + else if(_currentRow > 0) + { + _currentCol = _cols - 1; + _currentRow--; + dirty = true; + } break; case 256+19: // right arrow @@ -232,6 +250,12 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers) _currentCol++; dirty = true; } + else if(_currentRow < (int) _rows - 1) + { + _currentCol = 0; + _currentRow++; + dirty = true; + } break; case 256+24: // pageup diff --git a/stella/src/win32/FSNodeWin32.cxx b/stella/src/win32/FSNodeWin32.cxx index b6552cb93..5d9b82625 100644 --- a/stella/src/win32/FSNodeWin32.cxx +++ b/stella/src/win32/FSNodeWin32.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: 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 // Copyright (C) 2002-2004 The ScummVM project @@ -246,7 +246,7 @@ AbstractFilesystemNode* WindowsFilesystemNode::parent() const return p; } - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool AbstractFilesystemNode::fileExists(const string& path) {