enhanced tooltips (per cell and/or whole widget) for DataGridWidget

updated debugger doc
This commit is contained in:
Thomas Jentzsch 2021-09-06 10:31:48 +02:00
parent c79dedae98
commit d5dad489bf
5 changed files with 23 additions and 8 deletions

View File

@ -1098,11 +1098,11 @@ in another part of the debugger).</p>
<p><img src="graphics/debugger_iotab.png"></p> <p><img src="graphics/debugger_iotab.png"></p>
<p>As with the TIA tab, most of the values here will be self-explanatory to a 2600 <p>As with the TIA tab, most of the values here will be self-explanatory to a 2600
developer, and almost all can be modified. However, the SWCHx registers need developer, and many can be modified. However, the SWCHx registers need
further explanation:<p> further explanation:<p>
<p>SWCHx(W) can be modified; here, the (W) stands for write. Similarly, <p>SWCHx(W/R) can be modified; here (W) stands for write, (R) for read.
SWACNT/SWBCNT can be directly modified. However, the results of reading back from Similarly, SWxCNT can be directly modified. However, the results of reading
the SWCHx register are influenced by SWACNT/SWBCNT, and SWCHx(R) is a read-only display back from the SWCHx register are influenced by SWxCNT, and SWCHx(R) is
reflecting this result.</p> reflecting this result.</p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -55,7 +55,8 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font,
{ {
_addrList.push_back(0); _addrList.push_back(0);
_valueList.push_back(0); _valueList.push_back(0);
_valueStringList.push_back(""); _valueStringList.push_back(EmptyString);
_toolTipList.push_back(EmptyString);
_changedList.push_back(0); _changedList.push_back(0);
_hiliteList.push_back(false); _hiliteList.push_back(false);
} }
@ -584,6 +585,13 @@ void DataGridWidget::handleCommand(CommandSender* sender, int cmd,
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DataGridWidget::setGridToolTip(int column, int row, const string& text)
{
if(row >= 0 && row < _rows && column >= 0 && column < _cols)
_toolTipList[row * _cols + column] = text;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int DataGridWidget::getToolTipIndex(const Common::Point& pos) const int DataGridWidget::getToolTipIndex(const Common::Point& pos) const
{ {
@ -607,9 +615,12 @@ string DataGridWidget::getToolTip(const Common::Point& pos) const
const Int32 val = _valueList[idx]; const Int32 val = _valueList[idx];
ostringstream buf; ostringstream buf;
buf << _toolTipText if(_toolTipList[idx] != EmptyString)
<< "$" << Common::Base::toString(val, Common::Base::Fmt::_16) buf << _toolTipList[idx];
<< " = #" << val; else
buf << _toolTipText;
buf << "$" << Common::Base::toString(val, Common::Base::Fmt::_16)
<< " = #" << val;
if(val < 0x100) if(val < 0x100)
{ {
if(val >= 0x80) if(val >= 0x80)

View File

@ -84,6 +84,7 @@ class DataGridWidget : public EditableWidget
void setCrossed(bool enable); void setCrossed(bool enable);
void setGridToolTip(int column, int row, const string& text);
string getToolTip(const Common::Point& pos) const override; string getToolTip(const Common::Point& pos) const override;
bool changedToolTip(const Common::Point& oldPos, const Common::Point& newPos) const override; bool changedToolTip(const Common::Point& oldPos, const Common::Point& newPos) const override;
@ -129,6 +130,7 @@ class DataGridWidget : public EditableWidget
IntArray _addrList; IntArray _addrList;
IntArray _valueList; IntArray _valueList;
StringList _valueStringList; StringList _valueStringList;
StringList _toolTipList;
BoolArray _changedList; BoolArray _changedList;
BoolArray _hiliteList; BoolArray _hiliteList;

View File

@ -157,6 +157,8 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
} }
xpos += t->getWidth() + _fontWidth / 2; xpos += t->getWidth() + _fontWidth / 2;
myTimRead = new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 4, 30, Common::Base::Fmt::_16); myTimRead = new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 4, 30, Common::Base::Fmt::_16);
myTimRead->setGridToolTip(0, 1, "Timer interrupt flag in bit 7.\n");
myTimRead->setGridToolTip(0, 2, "Number of CPU cycles since last TIMxxT write.\n");
myTimRead->setTarget(this); myTimRead->setTarget(this);
myTimRead->setEditable(false); myTimRead->setEditable(false);