SwitcherPanel
File: Rhapsodist/Core/Widgets/SwitcherPanel.js · Namespace: SwitcherPanel.
Overview
SwitcherPanel shows or hides a panel’s children of a given componentType based on the value of a separate “switcher” component. It’s the standard mechanism behind every tabbed area in Rhapsodist: Settings window pages, the Automation tabs, and Card’s multi-tab cards.
Usage
// pnlSettings has one child panel per settings page (pnlEngineSettings, pnlAudioSettings, ...),
// each with a non-empty `text` used as its tab label; pnlSettingsMenu (the sidebar) drives which one is visible.
const pnlSettings = SwitcherPanel.create("pnlSettings", "pnlSettingsMenu", "ScriptPanel", {});
Options
options is accepted but not currently used.
Public API
| Function | Description | Returns |
|---|---|---|
create(panelId: string, switcherId: string, componentType: string, options: JSON) | Collects every direct child of panelId (excluding switcherId) whose type matches componentType (or all types, if componentType == "all") and whose text property is non-empty, text is used as the tab label. The switcher’s value selects which collected child is visible, by index; -1 shows all of them. | ScriptObject |
Broadcasters
| Broadcaster | Description |
|---|---|
panel.data.broadcasters.switcherWatcher | The switcher component’s value changes. Drives the visibility of the collected child panels directly. Available for an expansion to attach its own listener to the same value change. |