SettingsPanel
File: Rhapsodist/Core/Widgets/SettingsPanel.js · Namespace: SettingsPanel.
Overview
SettingsPanel lays out a Settings page’s child components into label + control rows, one per visible child. It builds the layout of pnlEngineSettings and pnlInstrumentSettings in the Settings window (see UserSettings).
Usage
To add a new setting to a Settings page, place a labelled control (a button, combo box, or a panel wrapping a single ScriptSlider, upgraded automatically into a ValueEdit control) as a direct child of the relevant settings page panel. It’s picked up automatically on the next compile.
Options
Every key in options is copied onto the panel’s data object:
| Option | Description | Default |
|---|---|---|
useNoise | Forwarded as an option to ValueEdit for any child panel setupChildren() upgrades into a ValueEdit control. | — |
Public API
| Function | Description | Returns |
|---|---|---|
create(panelId: string, rowHeight: number, options: JSON) | Lays out the panel’s children into rows rowHeight pixels tall, painting each label from the child’s text property. Buttons, combo boxes, and panels wrapping a single ScriptSlider (upgraded automatically into a ValueEdit control) get type-appropriate defaults. | ScriptObject |
Internal Reference
| Function | Description | Returns |
|---|---|---|
setupChildren(parent: ScriptObject) | Positions each visible child on its row, applying type-specific defaults (a toggle-switch Look and Feel for buttons, a combo-box Look and Feel for combo boxes, ValueEdit for a panel wrapping a single ScriptSlider), and resizes the parent panel to fit. | — |
isValueEdit(component: ScriptObject) | Returns whether a ScriptPanel child wraps a single ScriptSlider (as 1/0), the condition setupChildren uses to upgrade it into a ValueEdit control. | number |