From bd52de99b0da905ecb7f80bc6b721bbb0966331b Mon Sep 17 00:00:00 2001 From: thrust26 Date: Tue, 17 Nov 2020 19:41:23 +0100 Subject: [PATCH] added tooltips to TiaInfoWidget and CpuWidget --- src/debugger/gui/CpuWidget.cxx | 6 +++--- src/debugger/gui/RomListWidget.cxx | 2 +- src/debugger/gui/TiaInfoWidget.cxx | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/debugger/gui/CpuWidget.cxx b/src/debugger/gui/CpuWidget.cxx index ea6fbb96f..a8719f448 100644 --- a/src/debugger/gui/CpuWidget.cxx +++ b/src/debugger/gui/CpuWidget.cxx @@ -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 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 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; } diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index e595fc6aa..72f3a0b03 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -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; diff --git a/src/debugger/gui/TiaInfoWidget.cxx b/src/debugger/gui/TiaInfoWidget.cxx index a02b2365d..2690f8b4f 100644 --- a/src/debugger/gui/TiaInfoWidget.cxx +++ b/src/debugger/gui/TiaInfoWidget.cxx @@ -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