Fixed Compare button in RamWidget.

Changes highlighting of searched RAM from a framed rectangle to coloring
the cell text.

Removed CheatWidget, since its entire functionality is now handled by
RamWidget buttons.

Next up is the TIA tab (I really hate having to touch that one ...)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@717 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-08-11 21:57:30 +00:00
parent 547575e7a2
commit 51c89930bf
11 changed files with 55 additions and 480 deletions

View File

@ -1,343 +0,0 @@
//============================================================================
//
// 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: CheatWidget.cxx,v 1.4 2005-08-11 19:12:38 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
//============================================================================
#include <sstream>
#include "OSystem.hxx"
#include "FrameBuffer.hxx"
#include "GuiUtils.hxx"
#include "GuiObject.hxx"
#include "RamDebug.hxx"
#include "Widget.hxx"
#include "EditNumWidget.hxx"
#include "AddrValueWidget.hxx"
#include "InputTextDialog.hxx"
#include "CheatWidget.hxx"
enum {
kSearchCmd = 'CSEA',
kCmpCmd = 'CCMP',
kRestartCmd = 'CRST',
kSValEntered = 'CSVE',
kCValEntered = 'CCVE'
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatWidget::CheatWidget(GuiObject* boss, int x, int y, int w, int h)
: Widget(boss, x, y, w, h),
CommandSender(boss),
myInputBox(NULL)
{
const int border = 20;
const int bwidth = 50;
const int charWidth = instance()->consoleFont().getMaxCharWidth();
const int charHeight = instance()->consoleFont().getFontHeight() + 2;
int xpos = x + border;
int ypos = y + border;
// Add the numedit label and box
new StaticTextWidget(boss, xpos, ypos, 70, kLineHeight,
"Enter a value:", kTextAlignLeft);
myEditBox = new EditNumWidget(boss, 90, ypos - 2, charWidth*10, charHeight, "");
myEditBox->setFont(instance()->consoleFont());
// myEditBox->setTarget(this);
addFocusWidget(myEditBox);
ypos += border;
// Add the result text string area
myResult = new StaticTextWidget(boss, border + 5, ypos, 175, kLineHeight,
"", kTextAlignLeft);
myResult->setColor(kTextColorEm);
// Add the three search-related buttons
xpos = x + border;
ypos += border * 2;
mySearchButton = new ButtonWidget(boss, xpos, ypos, bwidth, 16,
"Search", kSearchCmd, 0);
mySearchButton->setTarget(this);
xpos += 8 + bwidth;
myCompareButton = new ButtonWidget(boss, xpos, ypos, bwidth, 16,
"Compare", kCmpCmd, 0);
myCompareButton->setTarget(this);
xpos += 8 + bwidth;
myRestartButton = new ButtonWidget(boss, xpos, ypos, bwidth, 16,
"Restart", kRestartCmd, 0);
myRestartButton->setTarget(this);
// Add the list showing the results of a search/compare
xpos = 200; ypos = border/2;
new StaticTextWidget(boss, xpos + 5, ypos, 75, kLineHeight,
"Address Value", kTextAlignLeft);
ypos += kLineHeight;
myResultsList = new AddrValueWidget(boss, xpos, ypos, 100, 75, 0xff);
myResultsList->setFont(instance()->consoleFont());
myResultsList->setTarget(this);
addFocusWidget(myResultsList);
myInputBox = new InputTextDialog(boss, instance()->consoleFont(), 20, 20);
myInputBox->setTarget(this);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatWidget::~CheatWidget()
{
mySearchArray.clear();
myCompareArray.clear();
delete myInputBox;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheatWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
{
switch(cmd)
{
case kSearchCmd:
myInputBox->setEditString("");
myInputBox->setTitle("");
myInputBox->setEmitSignal(kSValEntered);
parent()->addDialog(myInputBox);
break;
case kCmpCmd:
myInputBox->setEditString("");
myInputBox->setTitle("");
myInputBox->setEmitSignal(kCValEntered);
parent()->addDialog(myInputBox);
break;
case kRestartCmd:
doRestart();
break;
case kSValEntered:
{
const string& result = doSearch(myInputBox->getResult());
if(result != "")
myInputBox->setTitle(result);
else
parent()->removeDialog();
break;
}
case kCValEntered:
{
const string& result = doCompare(myInputBox->getResult());
if(result != "")
myInputBox->setTitle(result);
else
parent()->removeDialog();
break;
}
case kAVItemDataChangedCmd:
int addr = myResultsList->getSelectedAddr() - kRamStart;
int value = myResultsList->getSelectedValue();
instance()->debugger().ramDebug().write(addr, value);
break;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string CheatWidget::doSearch(const string& str)
{
bool comparisonSearch = true;
if(str.length() == 0)
{
// An empty field means return all memory locations
comparisonSearch = false;
}
else if(str.find_first_of("+-", 0) != string::npos)
{
// Don't accept these characters here, only in compare
return "Invalid input +|-";
}
int searchVal = instance()->debugger().stringToValue(str);
// Clear the search array of previous items
mySearchArray.clear();
// Now, search all memory locations for this value, and add it to the
// search array
RamDebug& dbg = instance()->debugger().ramDebug();
AddrValue av;
int searchCount = 0;
for(int addr = 0; addr < kRamSize; ++addr)
{
if(comparisonSearch)
{
av.addr = addr;
av.value = searchVal;
if(dbg.read(av.addr) == av.value)
{
mySearchArray.push_back(av);
++searchCount;
}
}
else // match all memory locations
{
av.addr = addr;
av.value = dbg.read(av.addr);
mySearchArray.push_back(av);
++searchCount;
}
}
// If we have some hits, enable the comparison methods
if(searchCount)
{
mySearchButton->setEnabled(false);
myCompareButton->setEnabled(true);
myRestartButton->setEnabled(true);
}
// Show number of hits
ostringstream buf;
buf << "Search found " << searchCount << " result(s)";
myResult->setLabel(buf.str());
// Finally, show the search results in the list
fillResultsList();
return "";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string CheatWidget::doCompare(const string& str)
{
bool comparitiveSearch = false;
int searchVal = 0;
if(str.length() == 0)
return "Enter an absolute or comparitive value";
// Do some pre-processing on the string
string::size_type pos = str.find_first_of("+-", 0);
if(pos > 0 && pos != string::npos)
{
// Only accept '+' or '-' at the start of the string
return "Input must be [+|-]NUM";
}
if(str[0] == '+' || str[0] == '-')
{
bool negative = false;
if(str[0] == '-')
negative = true;
string tmp = str;
tmp.erase(0, 1); // remove the operator
searchVal = instance()->debugger().stringToValue(tmp);
if(negative)
searchVal = -searchVal;
comparitiveSearch = true;
}
else
searchVal = instance()->debugger().stringToValue(str);
AddrValueList tempList;
// Now, search all memory locations specified in mySearchArray for this value
RamDebug& dbg = instance()->debugger().ramDebug();
AddrValue av;
int searchCount = 0;
// A comparitive search searches memory for locations that have changed by
// the specified amount, vs. for exact values
for(unsigned int i = 0; i < mySearchArray.size(); i++)
{
av.addr = mySearchArray[i].addr;
if(comparitiveSearch)
{
int temp = mySearchArray[i].value + searchVal;
if(temp < 0 || temp > 255) // skip values which are out of range
continue;
av.value = temp;
}
else
av.value = searchVal;
if(dbg.read(av.addr) == av.value)
{
tempList.push_back(av);
++searchCount;
}
}
// Update the searchArray to the new results
mySearchArray = tempList;
// If we have some hits, enable the comparison methods
if(searchCount)
{
myCompareButton->setEnabled(true);
myRestartButton->setEnabled(true);
}
// Show number of hits
ostringstream buf;
buf << "Compare found " << searchCount << " result(s)";
myResult->setLabel(buf.str());
// Finally, show the search results in the list
fillResultsList();
return "";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheatWidget::doRestart()
{
// Erase all search buffers, reset to start mode
mySearchArray.clear();
myCompareArray.clear();
myEditBox->setEditString("");
myResult->setLabel("");
fillResultsList();
mySearchButton->setEnabled(true);
myCompareButton->setEnabled(false);
myRestartButton->setEnabled(false);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheatWidget::fillResultsList()
{
AddrList alist;
ValueList vlist;
for(unsigned int i = 0; i < mySearchArray.size(); i++)
{
alist.push_back(kRamStart + mySearchArray[i].addr);
vlist.push_back(mySearchArray[i].value);
}
myResultsList->setList(alist, vlist);
}

View File

@ -1,76 +0,0 @@
//============================================================================
//
// 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: CheatWidget.hxx,v 1.3 2005-08-10 12:23:42 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
//============================================================================
#ifndef CHEAT_WIDGET_HXX
#define CHEAT_WIDGET_HXX
class GuiObject;
class ButtonWidget;
class StaticTextWidget;
class EditNumWidget;
class AddrValueWidget;
class InputTextDialog;
#include "Array.hxx"
#include "Widget.hxx"
#include "Command.hxx"
class CheatWidget : public Widget, public CommandSender
{
private:
struct AddrValue {
uInt16 addr;
uInt8 value;
};
typedef GUI::Array<AddrValue> AddrValueList;
AddrValueList mySearchArray;
AddrValueList myCompareArray;
public:
CheatWidget(GuiObject *boss, int x, int y, int w, int h);
virtual ~CheatWidget();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
const string doSearch(const string& str);
const string doCompare(const string& str);
void doRestart();
void fillResultsList();
private:
EditNumWidget* myEditBox;
StaticTextWidget* myResult;
ButtonWidget* mySearchButton;
ButtonWidget* myCompareButton;
ButtonWidget* myRestartButton;
AddrValueWidget* myResultsList;
InputTextDialog* myInputBox;
};
#endif

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: RamWidget.cxx,v 1.7 2005-08-11 19:12:38 stephena Exp $
// $Id: RamWidget.cxx,v 1.8 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -47,8 +47,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
: Widget(boss, x, y, 16, 16),
CommandSender(boss),
myUndoAddress(-1),
myUndoValue(-1),
mySearchValue(-1)
myUndoValue(-1)
{
const int fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(),
@ -253,7 +252,7 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RamWidget::loadConfig()
{
cerr << "RamWidget::loadConfig()\n";
//cerr << "RamWidget::loadConfig()\n";
fillGrid(true);
}
@ -304,27 +303,28 @@ const string RamWidget::doSearch(const string& str)
return "Invalid input +|-";
}
mySearchValue = instance()->debugger().stringToValue(str);
int searchVal = instance()->debugger().stringToValue(str);
// Clear the search array of previous items
mySearchResults.clear();
mySearchAddr.clear();
mySearchValue.clear();
// Now, search all memory locations for this value, and add it to the
// search array
RamDebug& dbg = instance()->debugger().ramDebug();
for(int addr = 0; addr < kRamSize; ++addr)
{
if(comparisonSearch)
{
if(dbg.read(addr) == mySearchValue)
mySearchResults.push_back(addr);
}
else // match all memory locations
mySearchResults.push_back(addr);
int value = dbg.read(addr);
if(comparisonSearch && searchVal != value)
continue;
mySearchAddr.push_back(addr);
mySearchValue.push_back(value);
}
// If we have some hits, enable the comparison methods
if(mySearchResults.size() > 0)
if(mySearchAddr.size() > 0)
{
mySearchButton->setEnabled(false);
myCompareButton->setEnabled(true);
@ -332,7 +332,7 @@ const string RamWidget::doSearch(const string& str)
}
// Finally, show the search results in the list
myRamGrid->setHiliteList(mySearchResults);
myRamGrid->setHiliteList(mySearchAddr);
return "";
}
@ -341,7 +341,7 @@ const string RamWidget::doSearch(const string& str)
const string RamWidget::doCompare(const string& str)
{
bool comparitiveSearch = false;
int searchVal = 0;
int searchVal = 0, offset = 0;
if(str.length() == 0)
return "Enter an absolute or comparitive value";
@ -365,44 +365,42 @@ const string RamWidget::doCompare(const string& str)
string tmp = str;
tmp.erase(0, 1); // remove the operator
searchVal = instance()->debugger().stringToValue(tmp);
offset = instance()->debugger().stringToValue(tmp);
if(negative)
searchVal = -searchVal;
offset = -offset;
}
else
searchVal = instance()->debugger().stringToValue(str);
cerr << " ==> searching for " << searchVal << endl;
// Now, search all memory locations specified in mySearchArray for this value
RamDebug& dbg = instance()->debugger().ramDebug();
IntArray tempList;
for(unsigned int i = 0; i < mySearchResults.size(); ++i)
for(unsigned int i = 0; i < mySearchAddr.size(); ++i)
{
if(comparitiveSearch)
{
searchVal += mySearchValue;
if(searchVal >= 0 && searchVal <= 255)
searchVal = mySearchValue[i] + offset;
if(searchVal < 0 || searchVal > 255)
continue;
}
int addr = mySearchResults[i];
int addr = mySearchAddr[i];
if(dbg.read(addr) == searchVal)
tempList.push_back(addr);
}
// Update the searchArray to the new results
mySearchResults = tempList;
mySearchAddr = tempList;
// If we have some hits, enable the comparison methods
if(mySearchResults.size() > 0)
if(mySearchAddr.size() > 0)
{
myCompareButton->setEnabled(true);
myRestartButton->setEnabled(true);
}
// Finally, show the search results in the list
myRamGrid->setHiliteList(mySearchResults);
myRamGrid->setHiliteList(mySearchAddr);
return "";
}
@ -411,9 +409,9 @@ cerr << " ==> searching for " << searchVal << endl;
void RamWidget::doRestart()
{
// Erase all search buffers, reset to start mode
mySearchValue = -1;
mySearchResults.clear();
myRamGrid->setHiliteList(mySearchResults);
mySearchAddr.clear();
mySearchValue.clear();
myRamGrid->setHiliteList(mySearchAddr);
mySearchButton->setEnabled(true);
myCompareButton->setEnabled(false);

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: RamWidget.hxx,v 1.5 2005-08-11 19:12:38 stephena Exp $
// $Id: RamWidget.hxx,v 1.6 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -55,7 +55,6 @@ class RamWidget : public Widget, public CommandSender
private:
int myUndoAddress;
int myUndoValue;
int mySearchValue;
DataGridWidget* myRamGrid;
EditTextWidget* myBinValue;
@ -71,7 +70,8 @@ class RamWidget : public Widget, public CommandSender
InputTextDialog* myInputBox;
IntArray myOldValueList;
IntArray mySearchResults;
IntArray mySearchAddr;
IntArray mySearchValue;
};
#endif

View File

@ -44,7 +44,6 @@ MODULE_OBJS := \
src/debugger/TIADebug.o \
src/debugger/TiaInfoWidget.o \
src/debugger/TiaOutputWidget.o \
src/debugger/CheatWidget.o \
src/debugger/CpuWidget.o \
src/debugger/PromptWidget.o \
src/debugger/RamWidget.o \

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: FrameBuffer.cxx,v 1.59 2005-08-11 19:12:38 stephena Exp $
// $Id: FrameBuffer.cxx,v 1.60 2005-08-11 21:57:30 stephena Exp $
//============================================================================
#include <sstream>
@ -608,7 +608,7 @@ const uInt8 FrameBuffer::ourGUIColors[kNumColors-256][3] = {
{ 104, 104, 104 }, // kColor
{ 0, 0, 0 }, // kBGColor
{ 64, 64, 64 }, // kShadowColor
{ 0, 0, 200 }, // kHiliteColor
{ 200, 200, 255 }, // kHiliteColor
{ 32, 160, 32 }, // kTextColor
{ 0, 255, 0 }, // kTextColorHi
{ 200, 0, 0 } // kTextColorEm

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: AboutDialog.cxx,v 1.5 2005-08-01 22:33:14 stephena Exp $
// $Id: AboutDialog.cxx,v 1.6 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -43,7 +43,7 @@ AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent,
addButton(w - (kButtonWidth + 10), h - 24, "Close", kCloseCmd, 'C');
myPrevButton->clearFlags(WIDGET_ENABLED);
myTitle = new StaticTextWidget(this, 0, 5, w, kFontHeight, "", kTextAlignCenter);
myTitle = new StaticTextWidget(this, 5, 5, w-10, kFontHeight, "", kTextAlignCenter);
myTitle->setColor(kTextColorHi);
for(int i = 0; i < LINES_PER_PAGE; i++)

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: DataGridWidget.cxx,v 1.20 2005-08-11 19:12:39 stephena Exp $
// $Id: DataGridWidget.cxx,v 1.21 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -503,18 +503,22 @@ void DataGridWidget::drawWidget(bool hilite)
buffer = _valueStringList[pos];
deltax = 0;
OverlayColor color = kTextColor;
if(_changedList[pos])
{
fb.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kTextColorEm);
fb.drawString(_font, buffer, x, y, _colWidth, kTextColorHi);
}
else
fb.drawString(_font, buffer, x, y, _colWidth, kTextColor);
}
// Hilite special items by drawing a frame
if (_hiliteList[pos])
fb.frameRect(x - 4, y - 2, _colWidth+1, _rowHeight+1, kHiliteColor);
if(_hiliteList[pos])
color = kHiliteColor;
else
color = kTextColorHi;
}
else if(_hiliteList[pos])
color = kHiliteColor;
fb.drawString(_font, buffer, x, y, _colWidth, color);
}
}
}

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: DebuggerDialog.cxx,v 1.33 2005-08-10 18:44:37 stephena Exp $
// $Id: DebuggerDialog.cxx,v 1.34 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -28,7 +28,6 @@
#include "CpuWidget.hxx"
#include "RamWidget.hxx"
#include "TiaWidget.hxx"
#include "CheatWidget.hxx"
#include "DataGridOpsWidget.hxx"
#include "Rect.hxx"
#include "Debugger.hxx"
@ -119,7 +118,7 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd,
break;
default:
Dialog::handleCommand(sender, cmd, data, 0);
Dialog::handleCommand(sender, cmd, data, id);
}
}
@ -159,13 +158,7 @@ void DebuggerDialog::addTabArea()
addToFocusList(tia->getFocusList(), tabID);
// The input/output tab (part of RIOT)
tabID = myTab->addTab("I/O");
// The Cheat tab
tabID = myTab->addTab("Cheat");
CheatWidget* cheat = new CheatWidget(myTab, 2, 2, widWidth, widHeight);
myTab->setParentWidget(tabID, cheat);
addToFocusList(cheat->getFocusList(), tabID);
// tabID = myTab->addTab("I/O");
myTab->setActiveTab(0);
}

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: GameInfoDialog.cxx,v 1.9 2005-08-01 22:33:15 stephena Exp $
// $Id: GameInfoDialog.cxx,v 1.10 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -43,7 +43,7 @@ GameInfoDialog::GameInfoDialog(OSystem* osystem, DialogContainer* parent,
addButton(w - (kButtonWidth + 10), h - 24, "Close", kCloseCmd, 'C');
myPrevButton->clearFlags(WIDGET_ENABLED);
myTitle = new StaticTextWidget(this, 0, 5, w, kFontHeight, "", kTextAlignCenter);
myTitle = new StaticTextWidget(this, 5, 5, w-10, kFontHeight, "", kTextAlignCenter);
for(uInt8 i = 0; i < LINES_PER_PAGE; i++)
{
myKey[i] = new StaticTextWidget(this, 10, 18 + (10 * i), 80, kFontHeight,

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: HelpDialog.cxx,v 1.11 2005-08-01 22:33:15 stephena Exp $
// $Id: HelpDialog.cxx,v 1.12 2005-08-11 21:57:30 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -41,7 +41,7 @@ HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
addButton(w - (kButtonWidth + 10), h - 24, "Close", kCloseCmd, 'C');
myPrevButton->clearFlags(WIDGET_ENABLED);
myTitle = new StaticTextWidget(this, 0, 5, w, kFontHeight, "", kTextAlignCenter);
myTitle = new StaticTextWidget(this, 5, 5, w-10, kFontHeight, "", kTextAlignCenter);
for(uInt8 i = 0; i < LINES_PER_PAGE; i++)
{
myKey[i] = new StaticTextWidget(this, 10, 18 + (10 * i), 80, kFontHeight,