added tooltips to TiaInfoWidget and CpuWidget

This commit is contained in:
thrust26 2020-11-17 19:41:23 +01:00
parent b81706b215
commit bd52de99b0
3 changed files with 15 additions and 4 deletions

View File

@ -85,18 +85,19 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
_w = lwidth + myPCGrid->getWidth() + myPCLabel->getWidth() + 20;
// Create labels showing the source of data for SP/A/X/Y registers
const std::array<string, 4> labels = { "SP", "A", "X", "Y" };
xpos += myCpuGridBinValue->getWidth() + 20;
int src_y = ypos, src_w = (max_w - xpos + x) - 10;
for(int i = 0; i < 4; ++i)
{
myCpuDataSrc[i] = new EditTextWidget(boss, nfont, xpos, src_y, src_w, fontHeight + 1);
myCpuDataSrc[i]->setToolTip("Source label of last load into " + labels[i] + ".");
myCpuDataSrc[i]->setEditable(false, true);
src_y += fontHeight + 2;
}
// Add labels for other CPU registers
xpos = x;
const std::array<string, 4> labels = { "SP ", "A ", "X ", "Y " };
for(int row = 0; row < 4; ++row)
{
new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2,
@ -139,10 +140,9 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
xpos = myCpuDataSrc[0]->getLeft();
new StaticTextWidget(boss, lfont, xpos - fontWidth * 4.5, ypos + 2, "Dest");
myCpuDataDest = new EditTextWidget(boss, nfont, xpos, ypos, src_w, fontHeight + 1);
myCpuDataDest->setToolTip("Destination label of last store.");
myCpuDataDest->setEditable(false, true);
_h = ypos + myPSRegister->getHeight() - y;
}

View File

@ -476,7 +476,7 @@ string RomListWidget::getToolTip(Common::Point pos) const
}
else
{
// hex 1..3 values
// 1..3 hex values
if(idx.x % 3 == 2)
// Skip gaps between hex values
return EmptyString;

View File

@ -60,30 +60,35 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
xpos = x;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Frame Cycls" : "F. Cycls");
myFrameCycles = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myFrameCycles->setToolTip("CPU cycles executed this frame.");
myFrameCycles->setEditable(false, true);
// Left: WSync Cycles
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "WSync Cycls" : "WSync C.");
myWSyncCylces = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myWSyncCylces->setToolTip("CPU cycles used for WSYNC this frame.");
myWSyncCylces->setEditable(false, true);
// Left: Timer Cycles
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Timer Cycls" : "Timer C.");
myTimerCylces = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myTimerCylces->setToolTip("CPU cycles roughly used for INTIM reads this frame.");
myTimerCylces->setEditable(false, true);
// Left: Total Cycles
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, "Total");
myTotalCycles = new EditTextWidget(boss, nfont, xpos + lwidth8, ypos - 1, twidth, lineHeight);
myTotalCycles->setToolTip("Total CPU cycles executed for this session (E notation).");
myTotalCycles->setEditable(false, true);
// Left: Delta Cycles
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, "Delta");
myDeltaCycles = new EditTextWidget(boss, nfont, xpos + lwidth8, ypos - 1, twidth, lineHeight);
myDeltaCycles->setToolTip("CPU cycles executed since last debug break.");
myDeltaCycles->setEditable(false, true);
// Right column
@ -93,6 +98,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
// Right: Frame Count
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Frame Cnt." : "Frame");
myFrameCount = new EditTextWidget(boss, nfont, xpos + lwidthR, ypos - 1, fwidth, lineHeight);
myFrameCount->setToolTip("Total number of frames executed this session.");
myFrameCount->setEditable(false, true);
lwidth = lfont.getStringWidth(longstr ? "Color Clock " : "Pixel Pos ") + LGAP;
@ -102,28 +108,33 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Scanline" : "Scn Ln");
myScanlineCountLast = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myScanlineCountLast->setToolTip("Number of scanlines of last frame.");
myScanlineCountLast->setEditable(false, true);
myScanlineCount = new EditTextWidget(boss, nfont,
xpos + lwidth - myScanlineCountLast->getWidth() - 2, ypos - 1,
fwidth, lineHeight);
myScanlineCount->setToolTip("Current scanline of this frame.");
myScanlineCount->setEditable(false, true);
// Right: Scan Cycle
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Scan Cycle" : "Scn Cycle");
myScanlineCycles = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myScanlineCycles->setToolTip("CPU cycles in current scanline.");
myScanlineCycles->setEditable(false, true);
// Right: Pixel Pos
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, "Pixel Pos");
myPixelPosition = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myPixelPosition->setToolTip("Pixel position in current scanline.");
myPixelPosition->setEditable(false, true);
// Right: Color Clock
ypos += lineHeight + VGAP;
new StaticTextWidget(boss, lfont, xpos, ypos + 1, longstr ? "Color Clock" : "Color Clk");
myColorClocks = new EditTextWidget(boss, nfont, xpos + lwidth, ypos - 1, fwidth, lineHeight);
myColorClocks->setToolTip("Color clocks in current scanline.");
myColorClocks->setEditable(false, true);
// Calculate actual dimensions