Tooltips
File: Rhapsodist/Core/Includes/Tooltips.js · Namespace: Tooltips
Overview
Tooltips implements the hover-tooltip popup (pnlTooltip) for any ScriptButton, ScriptSlider, ScriptTable, ScriptComboBox, or ScriptPanel that has a non-empty tooltip property. There’s no public API.
Tooltip listeners are only active while the shell’s btnTooltips toggle is on, so tooltips can be switched off entirely from Settings (“Show Tooltips”), the same toggle UserSettings persists via setProperty.
Usage
Tooltips wires itself up once Core.js is included, watching every ScriptButton, ScriptSlider, ScriptTable, ScriptComboBox, or ScriptPanel in the interface. Give a component a non-empty tooltip property to opt it in, there’s nothing else to call.
Internal Reference
| Function | Description | Returns |
|---|---|---|
getComponents() | Collects every enabled ScriptButton, ScriptSlider, ScriptTable, ScriptComboBox, or ScriptPanel with a non-empty tooltip property. Runs once at load to build the set bcTooltipPanel attaches to. | Array |
addRemoveListeners(state: number) | Adds or removes bcTooltipPanel’s two listeners (position/show and the delayed show). Called by bcTooltipButton whenever btnTooltips is toggled. | — |
Broadcasters
| Broadcaster | Description |
|---|---|
bcTooltipPanel | Fires on mouse events for every tooltip-enabled component. Positions pnlTooltip over the hovered component and shows it after a short delay, or hides it when the hover ends. Its listeners are only active while addRemoveListeners() has turned them on. |
bcTooltipButton | Fires when btnTooltips changes value. Calls addRemoveListeners() to turn bcTooltipPanel’s listeners on or off, this is how the Settings “Show Tooltips” toggle enables or disables tooltips entirely. |