ButtonGridPanel
File: Rhapsodist/Widgets/ButtonGridPanel.js · Namespace: ButtonGridPanel.
Overview
A minimal, generic radio-button grid. Given an existing panel and a labels array, it paints a numCols × numRows grid of selectable cells and sets the panel’s value to the clicked cell’s flat index.
Usage
Note
Signature may change as it’s refined.
const pnlModeGrid = ButtonGridPanel.create("pnlModeGrid", 3, 1, ["Vibrato", "Flutter", "Growl"], {});
Options
Every key in options is copied onto the panel’s data object; the paint routine reads font and fontSize back from there.
| Option | Description | Default |
|---|---|---|
font | Font used for cell labels. | "medium" |
fontSize | Font size used for cell labels. | 16 |
Public API
| Function | Description | Returns |
|---|---|---|
create(panelId: string, numCols: int, numRows: int, labels: Array, options: JSON) | Returns the panel, configured to paint the grid and handle clicks. Clicks past labels.length, and right-clicks, are ignored. | ScriptObject |