From f42399092d4221ea34ca4d936ac03254fc910654 Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 16 Jun 2005 00:20:12 +0000 Subject: [PATCH] Added border around active widget. Currently it's drawn in an ugly red color; this will have to change. This makes it much easier to navigate with the keyboard, since it's now easy to see which widget you've tabbed to. Added some copyright stuff to the debugger classes. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@506 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/debugger/Debugger.hxx | 8 +++---- stella/src/debugger/Equate.hxx | 17 +++++++++++++++ stella/src/debugger/EquateList.cxx | 17 +++++++++++++++ stella/src/debugger/EquateList.hxx | 17 +++++++++++++++ stella/src/gui/AddrValueWidget.cxx | 34 ++++++------------------------ stella/src/gui/PromptWidget.cxx | 5 ++--- stella/src/gui/Widget.cxx | 7 +++++- 7 files changed, 70 insertions(+), 35 deletions(-) diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index b14e29ecd..33e67eb1b 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.hxx @@ -8,12 +8,12 @@ // SS SS tt ee ll ll aa aa // SSSS ttt eeeee llll llll aaaaa // -// Copyright (c) 1995-2005 by Bradford W. Mott +// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team // // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.hxx,v 1.5 2005-06-15 23:45:04 urchlay Exp $ +// $Id: Debugger.hxx,v 1.6 2005-06-16 00:20:11 stephena Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -47,7 +47,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.5 2005-06-15 23:45:04 urchlay Exp $ + @version $Id: Debugger.hxx,v 1.6 2005-06-16 00:20:11 stephena Exp $ */ class Debugger : public DialogContainer { @@ -144,7 +144,7 @@ class Debugger : public DialogContainer DebuggerParser* myParser; D6502* myDebugger; - EquateList *equateList; + EquateList *equateList; }; #endif diff --git a/stella/src/debugger/Equate.hxx b/stella/src/debugger/Equate.hxx index 5afc02241..429413152 100644 --- a/stella/src/debugger/Equate.hxx +++ b/stella/src/debugger/Equate.hxx @@ -1,3 +1,20 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team +// +// See the file "license" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: Equate.hxx,v 1.2 2005-06-16 00:20:11 stephena Exp $ +//============================================================================ #ifndef EQUATE_HXX #define EQUATE_HXX diff --git a/stella/src/debugger/EquateList.cxx b/stella/src/debugger/EquateList.cxx index 51cf0be21..df5685945 100644 --- a/stella/src/debugger/EquateList.cxx +++ b/stella/src/debugger/EquateList.cxx @@ -1,3 +1,20 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team +// +// See the file "license" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: EquateList.cxx,v 1.6 2005-06-16 00:20:11 stephena Exp $ +//============================================================================ #include #include diff --git a/stella/src/debugger/EquateList.hxx b/stella/src/debugger/EquateList.hxx index c3d5233a9..49084d9a6 100644 --- a/stella/src/debugger/EquateList.hxx +++ b/stella/src/debugger/EquateList.hxx @@ -1,3 +1,20 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team +// +// See the file "license" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: EquateList.hxx,v 1.5 2005-06-16 00:20:11 stephena Exp $ +//============================================================================ #ifndef EQUATELIST_HXX #define EQUATELIST_HXX diff --git a/stella/src/gui/AddrValueWidget.cxx b/stella/src/gui/AddrValueWidget.cxx index a700d1e45..683b211b0 100644 --- a/stella/src/gui/AddrValueWidget.cxx +++ b/stella/src/gui/AddrValueWidget.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: AddrValueWidget.cxx,v 1.2 2005-06-15 21:18:47 stephena Exp $ +// $Id: AddrValueWidget.cxx,v 1.3 2005-06-16 00:20:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -63,27 +63,6 @@ AddrValueWidget::~AddrValueWidget() { } -/* -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void AddrValueWidget::setSelected(int item) -{ - assert(item >= -1 && item < (int)_list.size()); - - if (isEnabled() && _selectedItem != item) - { - if (_editMode) - abortEditMode(); - - _selectedItem = item; - sendCommand(kAVSelectionChangedCmd, _selectedItem); - - _currentPos = _selectedItem - _entriesPerPage / 2; - scrollToCurrent(); - draw(); - instance()->frameBuffer().refresh(); - } -} -*/ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void AddrValueWidget::setList(const AddrList& alist, const ValueList& vlist) { @@ -327,9 +306,10 @@ void AddrValueWidget::drawWidget(bool hilite) int deltax; // Draw a thin frame around the list. - fb.hLine(_x, _y, _x + _w - 1, kColor); + OverlayColor surroundColor = hilite ? kTextColorEm : kColor; + fb.hLine(_x, _y, _x + _w - 1, surroundColor); fb.hLine(_x, _y + _h - 1, _x + _w - 1, kShadowColor); - fb.vLine(_x, _y, _y + _h - 1, kColor); + fb.vLine(_x, _y, _y + _h - 1, surroundColor); // kColor // Draw the list items for (i = 0, pos = _currentPos; i < _entriesPerPage && pos < len; i++, pos++) @@ -344,7 +324,7 @@ void AddrValueWidget::drawWidget(bool hilite) if (_hasFocus && !_editMode) fb.fillRect(_x + 1, _y + 1 + kLineHeight * i, _w - 1, kLineHeight, kTextColorHi); else - fb.frameRect(_x + 1, _y + 1 + kLineHeight * i, _w - 1, kLineHeight, kTextColorHi); + fb.frameRect(_x + 1, _y + 1 + kLineHeight * i, _w - 2, kLineHeight, kTextColorHi); } // Print the address @@ -377,7 +357,7 @@ void AddrValueWidget::drawWidget(bool hilite) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GUI::Rect AddrValueWidget::getEditRect() const { - GUI::Rect r(2, 1, _w - 2 , kLineHeight); + GUI::Rect r(2, 1, _w - 3 , kLineHeight); const int offset = (_selectedItem - _currentPos) * kLineHeight; r.top += offset; r.bottom += offset; @@ -416,7 +396,7 @@ void AddrValueWidget::startEditMode() if (_editable && !_editMode && _selectedItem >= 0) { _editMode = true; - setEditString(_valueStringList[_selectedItem]); + setEditString(""); // Erase current entry when starting editing draw(); } } diff --git a/stella/src/gui/PromptWidget.cxx b/stella/src/gui/PromptWidget.cxx index c970089f5..119a98c11 100644 --- a/stella/src/gui/PromptWidget.cxx +++ b/stella/src/gui/PromptWidget.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: PromptWidget.cxx,v 1.4 2005-06-15 21:18:47 stephena Exp $ +// $Id: PromptWidget.cxx,v 1.5 2005-06-16 00:20:12 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -43,8 +43,7 @@ PromptWidget::PromptWidget(GuiObject* boss, int x, int y, int w, int h) : Widget(boss, x, y, w - kScrollBarWidth, h), CommandSender(boss) { - _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | - WIDGET_TAB_NAVIGATE; + _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS; _type = kPromptWidget; _kConsoleCharWidth = instance()->consoleFont().getMaxCharWidth(); diff --git a/stella/src/gui/Widget.cxx b/stella/src/gui/Widget.cxx index 835f375e7..020348915 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.14 2005-06-14 01:11:48 stephena Exp $ +// $Id: Widget.cxx,v 1.15 2005-06-16 00:20:12 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -88,6 +88,11 @@ void Widget::draw() // Now perform the actual widget draw drawWidget((_flags & WIDGET_HILITED) ? true : false); + // Indicate if this is the currently active widget + // by drawing a box around it. + if((_activeWidget == this) && (_flags & WIDGET_TAB_NAVIGATE)) + fb.frameRect(_x, _y, _w, _h, kTextColorEm); // FIXME - maybe chose a better color + // Restore x/y if (_flags & WIDGET_BORDER) { _x -= 4;