diff --git a/docs/index.html b/docs/index.html
index 17688c12d..576df1c5a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1780,12 +1780,12 @@
- Switch mouse to previous controller emulation mode(see Controller Properties) |
+ Switch mouse to previous controller emulation mode(see Controller Properties) |
Shift-Control + 0 |
Shift-Control + 0 |
- Switch mouse to next controller emulation modes(see Controller Properties) |
+ Switch mouse to next controller emulation modes(see Controller Properties) |
Control + 0 |
Control + 0 |
@@ -2584,7 +2584,7 @@
- For details how to configure high scores definintions for a game see
+
For details how to configure high scores definitions for a game see
High Scores Properties.
@@ -3353,7 +3353,7 @@
-bs <type> |
- Set "Cart.Type" property. See the Emulation Properties section
+ | Set "Cart.Type" property. See the Emulation Properties section
for valid types. |
@@ -3394,7 +3394,7 @@
-lc <type> |
- Set "Controller.Left" property. See the Controller Properties
+ | Set "Controller.Left" property. See the Controller Properties
section for valid types. |
@@ -3412,7 +3412,7 @@
-rc <type> |
- Set "Controller.Right" property. See the Controller Properties
+ | Set "Controller.Right" property. See the Controller Properties
section for valid types. |
@@ -3432,7 +3432,7 @@
-bc <type> |
Set both "Controller.Left" and "Controller.Right" properties.
- See the Controller Properties section for valid types. |
+ See the Controller Properties section for valid types.
@@ -3459,12 +3459,12 @@
-ma <Auto|XY> |
Set "Controller.MouseAxis" property.
- See the Controller Properties section for valid types. |
+ See the Controller Properties section for valid types.
-format <format> |
- Set "Display.Format" property. See the Emulation Properties section
+ | Set "Display.Format" property. See the Emulation Properties section
for valid formats. |
@@ -3619,7 +3619,7 @@
Options Menu dialog:
-
Video & Audio Settings dialog (Display):
+ Video & Audio Settings dialog (Display):
 |
@@ -3645,7 +3645,7 @@
- Video & Audio Settings dialog (Palettes):
+ Video & Audio Settings dialog (Palettes):
 |
@@ -3670,7 +3670,7 @@
- Video & Audio Settings dialog (TV Effects):
+ Video & Audio Settings dialog (TV Effects):
 |
@@ -3696,7 +3696,7 @@
- Video & Audio Settings dialog (Audio):
+ Video & Audio Settings dialog (Audio):
 |
@@ -3942,7 +3942,7 @@
- Device and port settings can be configured under the 'Devices & Ports' tab, shown below:
+ Device and port settings can be configured under the 'Devices & Ports' tab, shown below:
 |
@@ -3969,7 +3969,7 @@
- Mouse settings can be configured under the 'Mouse' tab, shown below:
+ Mouse settings can be configured under the 'Mouse' tab, shown below:
 |
@@ -4233,7 +4233,7 @@
Two sets ('Player settings', 'Developer settings') allow easy adjustment of all settings
for different use cases (playing or developing games) at once.
- Developer Settings dialog (Emulator)
+ Developer Settings dialog (Emulator)
 |
@@ -4270,7 +4270,7 @@
- Developer Settings dialog (TIA):
+ Developer Settings dialog (TIA):
 |
@@ -4300,7 +4300,7 @@
- Developer Settings dialog (Video):
+ Developer Settings dialog (Video):
 |
@@ -4327,7 +4327,7 @@
- Developer Settings dialog (Time Machine)
+ Developer Settings dialog (Time Machine)
 |
@@ -4382,7 +4382,7 @@
- Developer Settings dialog (Debugger)
+ Developer Settings dialog (Debugger)
 |
@@ -4677,7 +4677,7 @@ Ms Pac-Man (Stella extended codes):
Stella supports the properties described below:
-
+
@@ -4804,7 +4804,7 @@ Ms Pac-Man (Stella extended codes):
Note: Items marked as '*' are deprecated, and will probably be
removed in a future release.
-->
-
+
@@ -4830,7 +4830,7 @@ Ms Pac-Man (Stella extended codes):
-
+
@@ -4950,7 +4950,7 @@ Ms Pac-Man (Stella extended codes):
-
+
@@ -5026,7 +5026,7 @@ Ms Pac-Man (Stella extended codes):
Note | Allows defining some free text which explains the high scores properties. |
To find the required definition values, you can use Stella's built-in debugger.
- Please share your results, so that we can extend the list of supported games.
+ Please share your results, so that we can extend the list of supported games.
Note: To verify the definitions, the current values of the addresses and the resulting score are displayed.
diff --git a/src/debugger/gui/AudioWidget.cxx b/src/debugger/gui/AudioWidget.cxx
index b0d44ffbf..f548f8082 100644
--- a/src/debugger/gui/AudioWidget.cxx
+++ b/src/debugger/gui/AudioWidget.cxx
@@ -82,6 +82,8 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
myAudEffV = new StaticTextWidget(boss, lfont, myAudV->getRight() + fontWidth, myAudV->getTop() + 2,
"100% (eff. volume)");
+
+ setHelpAnchor("AudioTab", true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/CpuWidget.cxx b/src/debugger/gui/CpuWidget.cxx
index 11f7a9787..e8dc1eddc 100644
--- a/src/debugger/gui/CpuWidget.cxx
+++ b/src/debugger/gui/CpuWidget.cxx
@@ -47,7 +47,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
new StaticTextWidget(boss, lfont, xpos, ypos + 2, lwidth-2, fontHeight,
"PC ", TextAlign::Left);
myPCGrid =
- new DataGridWidget(boss, nfont, xpos + lwidth, ypos, 1, 1, 4, 16, Common::Base::Fmt::_16);
+ new DataGridWidget(this, nfont, xpos + lwidth, ypos, 1, 1, 4, 16, Common::Base::Fmt::_16);
myPCGrid->setTarget(this);
myPCGrid->setID(kPCRegID);
addFocusWidget(myPCGrid);
@@ -62,6 +62,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
xpos = x + lwidth; ypos = myPCGrid->getBottom() + VGAP;
myCpuGrid =
new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 2, 8, Common::Base::Fmt::_16);
+ myCpuGrid->setHelpAnchor("CPURegisters", true);
myCpuGrid->setTarget(this);
myCpuGrid->setID(kCpuRegID);
addFocusWidget(myCpuGrid);
@@ -70,6 +71,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
xpos = myPCGrid->getRight() + 10;
myCpuGridDecValue =
new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 3, 8, Common::Base::Fmt::_10);
+ myCpuGridDecValue->setHelpAnchor("CPURegisters", true);
myCpuGridDecValue->setTarget(this);
myCpuGridDecValue->setID(kCpuRegDecID);
addFocusWidget(myCpuGridDecValue);
@@ -143,6 +145,8 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
myCpuDataDest->setToolTip("Destination label of last write.");
myCpuDataDest->setEditable(false, true);
+ setHelpAnchor("DataOpButtons", true);
+
_h = ypos + myPSRegister->getHeight() - y;
}
diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx
index 27dfa40d6..7a442e5b7 100644
--- a/src/debugger/gui/DebuggerDialog.cxx
+++ b/src/debugger/gui/DebuggerDialog.cxx
@@ -600,6 +600,7 @@ void DebuggerDialog::addRomArea()
xpos = r.x() + 10; ypos += myCpu->getHeight() + 10;
myRam = new RiotRamWidget(this, *myLFont, *myNFont, xpos, ypos, r.w() - 10);
+ //myRam->setHelpAnchor("M6532", true); // TODO: doesn't work
addToFocusList(myRam->getFocusList());
// Add the DataGridOpsWidget to any widgets which contain a
@@ -626,6 +627,7 @@ void DebuggerDialog::addRomArea()
tabID = myRomTab->addTab(" Disassembly ", TabWidget::AUTO_WIDTH);
myRom = new RomWidget(myRomTab, *myLFont, *myNFont, 2, 2, tabWidth - 1,
tabHeight - myRomTab->getTabHeight() - 2);
+ myRom->setHelpAnchor("Disassembly", true);
myRomTab->setParentWidget(tabID, myRom);
addToFocusList(myRom->getFocusList(), myRomTab, tabID);
@@ -637,6 +639,7 @@ void DebuggerDialog::addRomArea()
tabHeight - myRomTab->getTabHeight() - 2);
if(myCartInfo != nullptr)
{
+ //myCartInfo->setHelpAnchor("BankswitchInformation", true); // TODO: doesn't work
myRomTab->setParentWidget(tabID, myCartInfo);
addToFocusList(myCartInfo->getFocusList(), myRomTab, tabID);
tabID = myRomTab->addTab(" States ", TabWidget::AUTO_WIDTH);
@@ -648,6 +651,7 @@ void DebuggerDialog::addRomArea()
tabHeight - myRomTab->getTabHeight() - 2);
if(myCartDebug) // TODO - make this always non-null
{
+ //myRomTab->setHelpAnchor("BankswitchInformation", true); // TODO: doesn't work
myRomTab->setParentWidget(tabID, myCartDebug);
addToFocusList(myCartDebug->getFocusList(), myRomTab, tabID);
@@ -660,6 +664,7 @@ void DebuggerDialog::addRomArea()
tabHeight - myRomTab->getTabHeight() - 2, *myCartDebug);
if(myCartRam) // TODO - make this always non-null
{
+ myCartRam->setHelpAnchor("CartridgeRAMInformation", true);
myRomTab->setParentWidget(tabID, myCartRam);
addToFocusList(myCartRam->getFocusList(), myRomTab, tabID);
myCartRam->setOpsWidget(ops);
diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx
index 2771bcc79..83dff3198 100644
--- a/src/debugger/gui/PromptWidget.cxx
+++ b/src/debugger/gui/PromptWidget.cxx
@@ -74,6 +74,7 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
clearScreen();
addFocusWidget(this);
+ setHelpAnchor("PromptTab", true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx
index 77449ddd3..9c2798e8b 100644
--- a/src/debugger/gui/RiotWidget.cxx
+++ b/src/debugger/gui/RiotWidget.cxx
@@ -265,6 +265,8 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
myPause->setID(kPauseID);
myPause->setTarget(this);
addFocusWidget(myPause);
+
+ setHelpAnchor("IOTab", true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/TiaInfoWidget.cxx b/src/debugger/gui/TiaInfoWidget.cxx
index b24938c11..e865a79f9 100644
--- a/src/debugger/gui/TiaInfoWidget.cxx
+++ b/src/debugger/gui/TiaInfoWidget.cxx
@@ -138,6 +138,8 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
// Calculate actual dimensions
_w = myColorClocks->getRight() - x;
_h = myColorClocks->getBottom();
+
+ //setHelpAnchor("TIAInfo", true); // TODO: does not work due to missing focus
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx
index 727faf5e4..c858598c1 100644
--- a/src/debugger/gui/TiaOutputWidget.cxx
+++ b/src/debugger/gui/TiaOutputWidget.cxx
@@ -51,6 +51,8 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
VarList::push_back(l, "Save snapshot", "snap");
#endif
myMenu = make_unique(this, font, l);
+
+ //setHelpAnchor("TIADisplay", true); // TODO: does not work due to missing focus
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/TiaWidget.cxx b/src/debugger/gui/TiaWidget.cxx
index 35ba3f0e9..1874ffea0 100644
--- a/src/debugger/gui/TiaWidget.cxx
+++ b/src/debugger/gui/TiaWidget.cxx
@@ -667,6 +667,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
"HMCLR", kHmclrCmd);
b->setTarget(this);
addFocusWidget(b);
+
+ setHelpAnchor("TIATab", true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/TiaZoomWidget.cxx b/src/debugger/gui/TiaZoomWidget.cxx
index b3ba37d2c..d0c174748 100644
--- a/src/debugger/gui/TiaZoomWidget.cxx
+++ b/src/debugger/gui/TiaZoomWidget.cxx
@@ -65,6 +65,8 @@ TiaZoomWidget::TiaZoomWidget(GuiObject* boss, const GUI::Font& font,
VarList::push_back(l, "4x zoom", "4");
VarList::push_back(l, "8x zoom", "8");
myMenu = make_unique(this, font, l);
+
+ setHelpAnchor("TIAZoom", true);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx
index 5c80c5eca..ec18bab0b 100644
--- a/src/gui/DeveloperDialog.cxx
+++ b/src/gui/DeveloperDialog.cxx
@@ -209,6 +209,8 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
// Add items for tab 0
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("DeveloperEmulator");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -313,6 +315,8 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
// Add items for tab 2
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("DeveloperTIA");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -418,6 +422,8 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
// Add items for tab 2
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("DeveloperVideo");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -552,6 +558,8 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
"(*) Any size change clears the buffer");
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("DeveloperTimeMachine");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -646,6 +654,8 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
#endif
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("DeveloperDebugger");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx
index c2e4b71f9..f2892e743 100644
--- a/src/gui/Dialog.cxx
+++ b/src/gui/Dialog.cxx
@@ -189,8 +189,29 @@ void Dialog::setHelpURL(const string& helpURL)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-const string Dialog::getHelpURL()
+const string Dialog::getHelpURL() const
{
+ // 1. check individual widget
+ if(_focusedWidget && _focusedWidget->hasHelp())
+ return _focusedWidget->getHelpURL();
+
+ if(_tabID < int(_myTabList.size()))
+ {
+ TabWidget* activeTabGroup = _myTabList[_tabID].widget;
+
+ // 2. check active tab
+ int activeTab = activeTabGroup->getActiveTab();
+ const Widget* parentTab = activeTabGroup->parentWidget(activeTab);
+
+ if(parentTab->hasHelp())
+ return parentTab->getHelpURL();
+
+ // 3. check active tab group
+ if(activeTabGroup && activeTabGroup->hasHelp())
+ return activeTabGroup->getHelpURL();
+ }
+
+ // 4. check dialog
if(!_helpURL.empty())
return _helpURL;
@@ -201,6 +222,7 @@ const string Dialog::getHelpURL()
else
return "https://stella-emu.github.io/docs/index.html#" + _helpAnchor;
}
+ // no help found
return EmptyString;
}
diff --git a/src/gui/Dialog.hxx b/src/gui/Dialog.hxx
index 112712792..582956d40 100644
--- a/src/gui/Dialog.hxx
+++ b/src/gui/Dialog.hxx
@@ -97,6 +97,7 @@ class Dialog : public GuiObject
void setTitle(const string& title);
bool hasTitle() { return !_title.empty(); }
+ void initHelp();
void setHelpAnchor(const string& helpAnchor, bool debugger = false);
void setHelpURL(const string& helpURL);
@@ -210,9 +211,8 @@ class Dialog : public GuiObject
bool handleNavEvent(Event::Type e, bool repeated = false);
void getTabIdForWidget(Widget* w);
bool cycleTab(int direction);
- void initHelp();
- const string getHelpURL();
- bool hasHelp() { return !getHelpURL().empty(); }
+ const string getHelpURL() const override;
+ bool hasHelp() const override { return !getHelpURL().empty(); }
void openHelp();
protected:
diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx
index 0f7684aaa..640c40545 100644
--- a/src/gui/GameInfoDialog.cxx
+++ b/src/gui/GameInfoDialog.cxx
@@ -194,6 +194,7 @@ void GameInfoDialog::addEmulationTab()
// Add items for tab 0
addToFocusList(wid, myTab, tabID);
+ myTab->parentWidget(tabID)->setHelpAnchor("EmulationProps");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -246,6 +247,8 @@ void GameInfoDialog::addConsoleTab()
// Add items for tab 1
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("ConsoleProps");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -396,6 +399,8 @@ void GameInfoDialog::addControllersTab()
// Add items for tab 2
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("ControllerProps");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -455,6 +460,8 @@ void GameInfoDialog::addCartridgeTab()
// Add items for tab 3
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("CartridgeProps");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -650,6 +657,8 @@ void GameInfoDialog::addHighScoresTab()
// Add items for tab 4
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("HighScoreProps");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/gui/GuiObject.hxx b/src/gui/GuiObject.hxx
index 0ea0d269d..bede18150 100644
--- a/src/gui/GuiObject.hxx
+++ b/src/gui/GuiObject.hxx
@@ -147,6 +147,9 @@ class GuiObject : public CommandReceiver
virtual void draw() = 0;
virtual void drawChain() = 0;
+ virtual const string getHelpURL() const = 0;
+ virtual bool hasHelp() const = 0;
+
private:
OSystem& myOSystem;
DialogContainer& myParent;
diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx
index 2319214bb..d6784472d 100644
--- a/src/gui/InputDialog.cxx
+++ b/src/gui/InputDialog.cxx
@@ -72,6 +72,7 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
EventMode::kEmulationMode);
myTab->setParentWidget(tabID, myEmulEventMapper);
addToFocusList(myEmulEventMapper->getFocusList(), myTab, tabID);
+ myTab->parentWidget(tabID)->setHelpAnchor("Remapping");
// 2) Event mapper for UI actions
tabID = myTab->addTab(" UI Events ", TabWidget::AUTO_WIDTH);
@@ -81,6 +82,7 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
EventMode::kMenuMode);
myTab->setParentWidget(tabID, myMenuEventMapper);
addToFocusList(myMenuEventMapper->getFocusList(), myTab, tabID);
+ myTab->parentWidget(tabID)->setHelpAnchor("Remapping");
// 3) Devices & ports
addDevicePortTab();
@@ -235,6 +237,8 @@ void InputDialog::addDevicePortTab()
// Add items for virtual device ports
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("DevicesPorts");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -323,6 +327,8 @@ void InputDialog::addMouseTab()
// Add items for mouse
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("Mouse");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/gui/TabWidget.cxx b/src/gui/TabWidget.cxx
index 4c99fe73b..f5d657cac 100644
--- a/src/gui/TabWidget.cxx
+++ b/src/gui/TabWidget.cxx
@@ -186,6 +186,21 @@ void TabWidget::setParentWidget(int tabID, Widget* parent)
_tabs[tabID].parentWidget = parent;
}
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Widget* TabWidget::parentWidget(int tabID)
+{
+ assert(0 <= tabID && tabID < int(_tabs.size()));
+
+ if(!_tabs[tabID].parentWidget)
+ {
+ // create dummy widget if not existing
+ Widget* w = new Widget(_boss, _font, 0, 0, 0, 0);
+
+ setParentWidget(tabID, w);
+ }
+ return _tabs[tabID].parentWidget;
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
{
diff --git a/src/gui/TabWidget.hxx b/src/gui/TabWidget.hxx
index 5c399f748..352bed6c4 100644
--- a/src/gui/TabWidget.hxx
+++ b/src/gui/TabWidget.hxx
@@ -54,6 +54,7 @@ class TabWidget : public Widget, public CommandSender
// setActiveTab changes the value of _firstWidget. This means Widgets added afterwards
// will be added to the active tab.
void setParentWidget(int tabID, Widget* parent);
+ Widget* parentWidget(int tabID);
int getTabWidth() { return _tabWidth; }
int getTabHeight() { return _tabHeight; }
diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx
index d8b6d5082..f45187f1a 100644
--- a/src/gui/UIDialog.cxx
+++ b/src/gui/UIDialog.cxx
@@ -196,6 +196,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
// Add items for tab 0
addToFocusList(wid, myTab, tabID);
+ myTab->parentWidget(tabID)->setHelpAnchor("UserInterface");
+
//////////////////////////////////////////////////////////
// 2) Launcher options
wid.clear();
@@ -296,6 +298,9 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
// Add items for tab 1
addToFocusList(wid, myTab, tabID);
+ myTab->parentWidget(tabID)->setHelpAnchor("ROMInfo");
+
+ //////////////////////////////////////////////////////////
// All ROM settings are disabled while in game mode
if(!myIsGlobal)
{
@@ -313,6 +318,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
setHelpAnchor("UserInterface");
+
#ifndef WINDOWED_SUPPORT
myCenter->clearFlags(Widget::FLAG_ENABLED);
#endif
diff --git a/src/gui/VideoAudioDialog.cxx b/src/gui/VideoAudioDialog.cxx
index 5fdf1ac72..a30f114e9 100644
--- a/src/gui/VideoAudioDialog.cxx
+++ b/src/gui/VideoAudioDialog.cxx
@@ -195,6 +195,8 @@ void VideoAudioDialog::addDisplayTab()
// Add items for tab 0
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("VideoAudioDisplay");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -326,6 +328,8 @@ void VideoAudioDialog::addPaletteTab()
// Add items for tab 2
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("VideoAudioPalettes");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -412,6 +416,8 @@ void VideoAudioDialog::addTVEffectsTab()
// Add items for tab 3
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("VideoAudioEffects");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -541,6 +547,8 @@ void VideoAudioDialog::addAudioTab()
// Add items for tab 4
addToFocusList(wid, myTab, tabID);
+
+ myTab->parentWidget(tabID)->setHelpAnchor("VideoAudioAudio");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx
index 9722c4816..16db4c89a 100644
--- a/src/gui/Widget.cxx
+++ b/src/gui/Widget.cxx
@@ -284,6 +284,40 @@ void Widget::setToolTip(const string& text)
_toolTipText = text;
}
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void Widget::setHelpAnchor(const string& helpAnchor, bool debugger)
+{
+ _helpAnchor = helpAnchor;
+ _debuggerHelp = debugger;
+
+ dialog().initHelp();
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void Widget::setHelpURL(const string& helpURL)
+{
+ _helpURL = helpURL;
+
+ dialog().initHelp();
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+const string Widget::getHelpURL() const
+{
+ if(!_helpURL.empty())
+ return _helpURL;
+
+ if(!_helpAnchor.empty())
+ {
+ if(_debuggerHelp)
+ return "https://stella-emu.github.io/docs/debugger.html#" + _helpAnchor;
+ else
+ return "https://stella-emu.github.io/docs/index.html#" + _helpAnchor;
+ }
+ return EmptyString;
+}
+
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Widget* Widget::findWidgetInChain(Widget* w, int x, int y)
{
diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx
index bccd17ef0..169c41876 100644
--- a/src/gui/Widget.hxx
+++ b/src/gui/Widget.hxx
@@ -118,6 +118,9 @@ class Widget : public GuiObject
virtual bool changedToolTip(const Common::Point& oldPos,
const Common::Point& newPos) const { return false; }
+ void setHelpAnchor(const string& helpAnchor, bool debugger = false);
+ void setHelpURL(const string& helpURL);
+
virtual void loadConfig() { }
protected:
@@ -137,6 +140,9 @@ class Widget : public GuiObject
void handleCommand(CommandSender* sender, int cmd, int data, int id) override
{ assert(_boss); _boss->handleCommand(sender, cmd, data, id); }
+ const string getHelpURL() const override;
+ bool hasHelp() const override { return !getHelpURL().empty(); }
+
protected:
GuiObject* _boss{nullptr};
const GUI::Font& _font;
@@ -153,6 +159,9 @@ class Widget : public GuiObject
ColorId _textcolorlo{kBGColorLo};
ColorId _shadowcolor{kShadowColor};
string _toolTipText;
+ string _helpAnchor;
+ string _helpURL;
+ bool _debuggerHelp{false};
public:
static Widget* findWidgetInChain(Widget* start, int x, int y);