Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

OptionDescriptionDefault
fontFont used for cell labels."medium"
fontSizeFont size used for cell labels.16

Public API

FunctionDescriptionReturns
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