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
This commit is contained in:
stephena 2005-06-16 00:20:12 +00:00
parent bbd77f6a51
commit f42399092d
7 changed files with 70 additions and 35 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <string>
#include <iostream>

View File

@ -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

View File

@ -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();
}
}

View File

@ -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();

View File

@ -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;