Files
gridcraft/crates/engine/src/catalog.rs
T
prxnvt 7042306478 UI: Insert › Controls, form controls on the sheet, Assign Action and Format Control
The Insert tab gains Button, Slider and Spin Button beside Cell
Controls › Checkbox, which is unchanged. Each arms placement: a drag on
the grid draws the control at that size (a tall drag makes a vertical
slider), a click places it at its default size, and Escape disarms. Key
tips (N B U, N S L, N S B) place one at the active cell. A new button
opens Assign Action, as Excel opens Assign Macro.

form_controls.rs draws the controls in the sheet tokens, so they look
the same in both themes: buttons with hover and pressed states, sliders
with a track, a filled part and a thumb (and the value beside the thumb
while it is dragged), spin buttons with two arrows, stacked or side by
side. A plain click works a control: dragging the thumb, clicking the
track (a page), clicking or holding an arrow (it repeats after 0.4 s),
pressing a button (it runs on release over it). A drag or a hold is one
undo step. The control last worked takes the arrows, Page Up and Page
Down, Home and End, and Space or Enter for a button. Ctrl or Cmd+click
or a right-click selects a control to move or resize it; a right-click
opens the object menu, which for a control adds Edit Text and Assign
Action (buttons) and Format Control before Delete.
Double-clicking a selected control opens its editor. On a right-to-left
sheet a control moves as a whole and works where it is drawn.

Assign Action runs a macro (from the list or typed, on the selection or
a fixed range, with an optional output cell) or a command (searched
among those a macro may run, with JSON parameters). Format Control edits
the value, limits, incremental and page change, cell link, orientation,
name and the locked and print flags, checking the same rules as the
engine. A button whose action needs approval, or whose macro would write
over data, asks in a prompt whose buttons press it again with the
answer.

New theme tokens (thumb, hover, pressed, fill, focus ring) are in the
contrast test; Button, Slider and Spin icons are drawn in code; the new
labels are translated in every interface language. The catalog gains
Developer › Controls (280 / 296).
2026-10-31 16:11:54 -04:00

343 lines
20 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! Excel's ribbon and menu tree (feature names only), used as the parity metric: a catalog
//! entry counts as done when a command with its id is registered. `cargo xtask parity` writes
//! `docs/parity-checklist.md` from this list.
/// (id, tab, group, label)
pub const CATALOG: &[(&str, &str, &str, &str)] = &[
// File
("file.new", "File", "File", "New"),
("file.open", "File", "File", "Open"),
("file.save", "File", "File", "Save"),
("file.saveAs", "File", "File", "Save As"),
("file.close", "File", "File", "Close"),
("file.print", "File", "File", "Print"),
("file.exportPdf", "File", "Export", "Export to PDF"),
("file.exportCsv", "File", "Export", "CSV"),
("file.exportHtml", "File", "Export", "Web Page"),
("file.properties", "File", "Info", "Properties"),
("file.options", "File", "Options", "Options"),
// Home
("edit.paste", "Home", "Clipboard", "Paste"),
("edit.pasteSpecial", "Home", "Clipboard", "Paste Special"),
("edit.cut", "Home", "Clipboard", "Cut"),
("edit.copy", "Home", "Clipboard", "Copy"),
("edit.formatPainter", "Home", "Clipboard", "Format Painter"),
("home.fontName", "Home", "Font", "Font"),
("home.fontSize", "Home", "Font", "Font Size"),
("home.increaseFontSize", "Home", "Font", "Increase Font Size"),
("home.decreaseFontSize", "Home", "Font", "Decrease Font Size"),
("home.bold", "Home", "Font", "Bold"),
("home.italic", "Home", "Font", "Italic"),
("home.underline", "Home", "Font", "Underline"),
("home.doubleUnderline", "Home", "Font", "Double Underline"),
("home.strikethrough", "Home", "Font", "Strikethrough"),
("home.superscript", "Home", "Font", "Superscript"),
("home.subscript", "Home", "Font", "Subscript"),
("home.borders", "Home", "Font", "Borders"),
("home.drawBorder", "Home", "Font", "Draw Border"),
("home.fillColor", "Home", "Font", "Fill Color"),
("home.fontColor", "Home", "Font", "Font Color"),
("home.alignTop", "Home", "Alignment", "Top Align"),
("home.alignMiddle", "Home", "Alignment", "Middle Align"),
("home.alignBottom", "Home", "Alignment", "Bottom Align"),
("home.orientation", "Home", "Alignment", "Orientation"),
("home.alignLeft", "Home", "Alignment", "Align Left"),
("home.alignCenter", "Home", "Alignment", "Center"),
("home.alignRight", "Home", "Alignment", "Align Right"),
("home.decreaseIndent", "Home", "Alignment", "Decrease Indent"),
("home.increaseIndent", "Home", "Alignment", "Increase Indent"),
("home.wrapText", "Home", "Alignment", "Wrap Text"),
("home.mergeCenter", "Home", "Alignment", "Merge & Center"),
("home.mergeAcross", "Home", "Alignment", "Merge Across"),
("home.mergeCells", "Home", "Alignment", "Merge Cells"),
("home.unmergeCells", "Home", "Alignment", "Unmerge Cells"),
("home.numberFormat", "Home", "Number", "Number Format"),
("home.accounting", "Home", "Number", "Accounting Number Format"),
("home.percent", "Home", "Number", "Percent Style"),
("home.comma", "Home", "Number", "Comma Style"),
("home.increaseDecimal", "Home", "Number", "Increase Decimal"),
("home.decreaseDecimal", "Home", "Number", "Decrease Decimal"),
("home.conditionalFormat", "Home", "Styles", "Conditional Formatting"),
("home.clearRules", "Home", "Styles", "Clear Rules"),
("home.manageRules", "Home", "Styles", "Manage Rules"),
("home.formatAsTable", "Home", "Styles", "Format as Table"),
("home.cellStyle", "Home", "Styles", "Cell Styles"),
("home.newCellStyle", "Home", "Styles", "New Cell Style"),
("home.insertCells", "Home", "Cells", "Insert Cells"),
("home.insertRows", "Home", "Cells", "Insert Sheet Rows"),
("home.insertColumns", "Home", "Cells", "Insert Sheet Columns"),
("home.insertSheet", "Home", "Cells", "Insert Sheet"),
("home.deleteCells", "Home", "Cells", "Delete Cells"),
("home.deleteRows", "Home", "Cells", "Delete Sheet Rows"),
("home.deleteColumns", "Home", "Cells", "Delete Sheet Columns"),
("home.deleteSheet", "Home", "Cells", "Delete Sheet"),
("home.rowHeight", "Home", "Cells", "Row Height"),
("home.autofitRowHeight", "Home", "Cells", "AutoFit Row Height"),
("home.columnWidth", "Home", "Cells", "Column Width"),
("home.autofitColumnWidth", "Home", "Cells", "AutoFit Column Width"),
("home.defaultWidth", "Home", "Cells", "Default Width"),
("home.hideRows", "Home", "Cells", "Hide Rows"),
("home.hideColumns", "Home", "Cells", "Hide Columns"),
("home.unhideRows", "Home", "Cells", "Unhide Rows"),
("home.unhideColumns", "Home", "Cells", "Unhide Columns"),
("sheet.hide", "Home", "Cells", "Hide Sheet"),
("sheet.unhide", "Home", "Cells", "Unhide Sheet"),
("sheet.rename", "Home", "Cells", "Rename Sheet"),
("sheet.move", "Home", "Cells", "Move or Copy Sheet"),
("sheet.tabColor", "Home", "Cells", "Tab Color"),
("review.protectSheet", "Home", "Cells", "Protect Sheet"),
("home.lockCell", "Home", "Cells", "Lock Cell"),
("home.formatCells", "Home", "Cells", "Format Cells"),
("formulas.autoSum", "Home", "Editing", "AutoSum"),
("edit.fillDown", "Home", "Editing", "Fill Down"),
("edit.fillRight", "Home", "Editing", "Fill Right"),
("edit.fillUp", "Home", "Editing", "Fill Up"),
("edit.fillLeft", "Home", "Editing", "Fill Left"),
("edit.fillSeries", "Home", "Editing", "Series"),
("edit.flashFill", "Home", "Editing", "Flash Fill"),
("edit.clearAll", "Home", "Editing", "Clear All"),
("edit.clearFormats", "Home", "Editing", "Clear Formats"),
("edit.clearContents", "Home", "Editing", "Clear Contents"),
("edit.clearComments", "Home", "Editing", "Clear Comments"),
("edit.clearHyperlinks", "Home", "Editing", "Clear Hyperlinks"),
("data.sortAscending", "Home", "Editing", "Sort A to Z"),
("data.sortDescending", "Home", "Editing", "Sort Z to A"),
("data.sort", "Home", "Editing", "Custom Sort"),
("data.filter", "Home", "Editing", "Filter"),
("data.clearFilter", "Home", "Editing", "Clear Filter"),
("data.reapply", "Home", "Editing", "Reapply"),
("edit.find", "Home", "Editing", "Find"),
("edit.replace", "Home", "Editing", "Replace"),
("edit.goTo", "Home", "Editing", "Go To"),
("edit.goToSpecial", "Home", "Editing", "Go To Special"),
("home.addIns", "Home", "Add-ins", "Add-ins"),
// Insert
("insert.pivotTable", "Insert", "Tables", "PivotTable"),
("insert.recommendedPivotTables", "Insert", "Tables", "Recommended PivotTables"),
("insert.table", "Insert", "Tables", "Table"),
("insert.picture", "Insert", "Illustrations", "Pictures"),
("insert.shape", "Insert", "Illustrations", "Shapes"),
("insert.icons", "Insert", "Illustrations", "Icons"),
("insert.smartArt", "Insert", "Illustrations", "SmartArt"),
("insert.screenshot", "Insert", "Illustrations", "Screenshot"),
("insert.recommendedCharts", "Insert", "Charts", "Recommended Charts"),
("insert.chart", "Insert", "Charts", "Charts"),
("insert.pivotChart", "Insert", "Charts", "PivotChart"),
("insert.map", "Insert", "Charts", "Maps"),
("insert.sparkline", "Insert", "Sparklines", "Sparklines"),
("insert.slicer", "Insert", "Filters", "Slicer"),
("insert.timeline", "Insert", "Filters", "Timeline"),
("insert.link", "Insert", "Links", "Link"),
("review.newComment", "Insert", "Comments", "Comment"),
("insert.textBox", "Insert", "Text", "Text Box"),
("pageLayout.headerFooter", "Insert", "Text", "Header & Footer"),
("insert.wordArt", "Insert", "Text", "WordArt"),
("insert.signatureLine", "Insert", "Text", "Signature Line"),
("insert.object", "Insert", "Text", "Object"),
("insert.equation", "Insert", "Symbols", "Equation"),
("insert.symbol", "Insert", "Symbols", "Symbol"),
("insert.checkbox", "Insert", "Cell Controls", "Checkbox"),
// Draw
("draw.pen", "Draw", "Tools", "Pen"),
("draw.eraser", "Draw", "Tools", "Eraser"),
("draw.lasso", "Draw", "Tools", "Lasso Select"),
("draw.inkToShape", "Draw", "Convert", "Ink to Shape"),
// Page Layout
("pageLayout.theme", "Page Layout", "Themes", "Themes"),
("pageLayout.themeColors", "Page Layout", "Themes", "Colors"),
("pageLayout.themeFonts", "Page Layout", "Themes", "Fonts"),
("pageLayout.themeEffects", "Page Layout", "Themes", "Effects"),
("pageLayout.margins", "Page Layout", "Page Setup", "Margins"),
("pageLayout.orientation", "Page Layout", "Page Setup", "Orientation"),
("pageLayout.size", "Page Layout", "Page Setup", "Size"),
("pageLayout.printArea", "Page Layout", "Page Setup", "Print Area"),
("pageLayout.breaks", "Page Layout", "Page Setup", "Breaks"),
("pageLayout.background", "Page Layout", "Page Setup", "Background"),
("pageLayout.printTitles", "Page Layout", "Page Setup", "Print Titles"),
("pageLayout.pageSetup", "Page Layout", "Page Setup", "Page Setup"),
("pageLayout.scaleToFit", "Page Layout", "Scale to Fit", "Scale to Fit"),
("view.gridlines", "Page Layout", "Sheet Options", "View Gridlines"),
("pageLayout.printGridlines", "Page Layout", "Sheet Options", "Print Gridlines"),
("view.headings", "Page Layout", "Sheet Options", "View Headings"),
("pageLayout.printHeadings", "Page Layout", "Sheet Options", "Print Headings"),
("arrange.bringForward", "Page Layout", "Arrange", "Bring Forward"),
("arrange.sendBackward", "Page Layout", "Arrange", "Send Backward"),
("arrange.selectionPane", "Page Layout", "Arrange", "Selection Pane"),
("arrange.align", "Page Layout", "Arrange", "Align"),
("arrange.group", "Page Layout", "Arrange", "Group"),
("arrange.rotate", "Page Layout", "Arrange", "Rotate"),
// Formulas
("formulas.insertFunction", "Formulas", "Function Library", "Insert Function"),
("formulas.recentlyUsed", "Formulas", "Function Library", "Recently Used"),
("formulas.financial", "Formulas", "Function Library", "Financial"),
("formulas.logical", "Formulas", "Function Library", "Logical"),
("formulas.text", "Formulas", "Function Library", "Text"),
("formulas.dateTime", "Formulas", "Function Library", "Date & Time"),
("formulas.lookupReference", "Formulas", "Function Library", "Lookup & Reference"),
("formulas.mathTrig", "Formulas", "Function Library", "Math & Trig"),
("formulas.moreFunctions", "Formulas", "Function Library", "More Functions"),
("formulas.nameManager", "Formulas", "Defined Names", "Name Manager"),
("formulas.defineName", "Formulas", "Defined Names", "Define Name"),
("formulas.useInFormula", "Formulas", "Defined Names", "Use in Formula"),
("formulas.createFromSelection", "Formulas", "Defined Names", "Create from Selection"),
("formulas.tracePrecedents", "Formulas", "Formula Auditing", "Trace Precedents"),
("formulas.traceDependents", "Formulas", "Formula Auditing", "Trace Dependents"),
("formulas.removeArrows", "Formulas", "Formula Auditing", "Remove Arrows"),
("formulas.showFormulas", "Formulas", "Formula Auditing", "Show Formulas"),
("formulas.errorChecking", "Formulas", "Formula Auditing", "Error Checking"),
("formulas.evaluateFormula", "Formulas", "Formula Auditing", "Evaluate Formula"),
("formulas.watchWindow", "Formulas", "Formula Auditing", "Watch Window"),
("formulas.calculationOptions", "Formulas", "Calculation", "Calculation Options"),
("formulas.calculateNow", "Formulas", "Calculation", "Calculate Now"),
("formulas.calculateSheet", "Formulas", "Calculation", "Calculate Sheet"),
// Data
("data.getData", "Data", "Get & Transform Data", "Get Data"),
("data.fromTextCsv", "Data", "Get & Transform Data", "From Text/CSV"),
("data.fromWeb", "Data", "Get & Transform Data", "From Web"),
("data.fromTableRange", "Data", "Get & Transform Data", "From Table/Range"),
("data.refreshAll", "Data", "Queries & Connections", "Refresh All"),
("data.queriesConnections", "Data", "Queries & Connections", "Queries & Connections"),
("data.stocks", "Data", "Data Types", "Stocks"),
("data.geography", "Data", "Data Types", "Geography"),
("data.sortAscending", "Data", "Sort & Filter", "Sort A to Z"),
("data.sortDescending", "Data", "Sort & Filter", "Sort Z to A"),
("data.sort", "Data", "Sort & Filter", "Sort"),
("data.filter", "Data", "Sort & Filter", "Filter"),
("data.clearFilter", "Data", "Sort & Filter", "Clear"),
("data.reapply", "Data", "Sort & Filter", "Reapply"),
("data.advancedFilter", "Data", "Sort & Filter", "Advanced"),
("data.textToColumns", "Data", "Data Tools", "Text to Columns"),
("data.flashFill", "Data", "Data Tools", "Flash Fill"),
("data.removeDuplicates", "Data", "Data Tools", "Remove Duplicates"),
("data.validation", "Data", "Data Tools", "Data Validation"),
("data.circleInvalid", "Data", "Data Tools", "Circle Invalid Data"),
("data.consolidate", "Data", "Data Tools", "Consolidate"),
("data.relationships", "Data", "Data Tools", "Relationships"),
("data.scenarioManager", "Data", "Forecast", "Scenario Manager"),
("data.goalSeek", "Data", "Forecast", "Goal Seek"),
("data.dataTable", "Data", "Forecast", "Data Table"),
("data.forecastSheet", "Data", "Forecast", "Forecast Sheet"),
("data.group", "Data", "Outline", "Group"),
("data.ungroup", "Data", "Outline", "Ungroup"),
("data.subtotal", "Data", "Outline", "Subtotal"),
("data.showDetail", "Data", "Outline", "Show Detail"),
("data.hideDetail", "Data", "Outline", "Hide Detail"),
("data.analyzeData", "Data", "Analysis", "Analyze Data"),
("data.solver", "Data", "Analysis", "Solver"),
("data.analysisToolPak", "Data", "Analysis", "Data Analysis"),
// Review
("review.spelling", "Review", "Proofing", "Spelling"),
("review.thesaurus", "Review", "Proofing", "Thesaurus"),
("review.workbookStatistics", "Review", "Proofing", "Workbook Statistics"),
("review.checkAccessibility", "Review", "Accessibility", "Check Accessibility"),
("review.smartLookup", "Review", "Insights", "Smart Lookup"),
("review.translate", "Review", "Language", "Translate"),
("review.newComment", "Review", "Comments", "New Comment"),
("review.deleteComment", "Review", "Comments", "Delete Comment"),
("review.previousComment", "Review", "Comments", "Previous Comment"),
("review.nextComment", "Review", "Comments", "Next Comment"),
("review.showComments", "Review", "Comments", "Show Comments"),
("review.newNote", "Review", "Notes", "New Note"),
("review.showNote", "Review", "Notes", "Show/Hide Note"),
("review.showAllNotes", "Review", "Notes", "Show All Notes"),
("review.convertToComments", "Review", "Notes", "Convert to Comments"),
("review.protectSheet", "Review", "Protect", "Protect Sheet"),
("review.unprotectSheet", "Review", "Protect", "Unprotect Sheet"),
("review.protectWorkbook", "Review", "Protect", "Protect Workbook"),
("review.allowEditRanges", "Review", "Protect", "Allow Edit Ranges"),
("review.showChanges", "Review", "Changes", "Show Changes"),
// View
("view.normal", "View", "Workbook Views", "Normal"),
("view.pageBreakPreview", "View", "Workbook Views", "Page Break Preview"),
("view.pageLayout", "View", "Workbook Views", "Page Layout"),
("view.customViews", "View", "Workbook Views", "Custom Views"),
("view.ruler", "View", "Show", "Ruler"),
("view.formulaBar", "View", "Show", "Formula Bar"),
("view.gridlines", "View", "Show", "Gridlines"),
("view.headings", "View", "Show", "Headings"),
("view.zoom", "View", "Zoom", "Zoom"),
("view.zoom100", "View", "Zoom", "100%"),
("view.zoomToSelection", "View", "Zoom", "Zoom to Selection"),
("view.newWindow", "View", "Window", "New Window"),
("view.arrangeAll", "View", "Window", "Arrange All"),
("view.freezePanes", "View", "Window", "Freeze Panes"),
("view.freezeTopRow", "View", "Window", "Freeze Top Row"),
("view.freezeFirstColumn", "View", "Window", "Freeze First Column"),
("view.unfreezePanes", "View", "Window", "Unfreeze Panes"),
("view.split", "View", "Window", "Split"),
("view.hideWindow", "View", "Window", "Hide"),
("view.unhideWindow", "View", "Window", "Unhide"),
("view.switchWindows", "View", "Window", "Switch Windows"),
("view.macros", "View", "Macros", "Macros"),
("macro.record", "View", "Macros", "Record Macro"),
// Automate
("automate.newScript", "Automate", "Scripting Tools", "New Script"),
("automate.allScripts", "Automate", "Scripting Tools", "All Scripts"),
("automate.recordActions", "Automate", "Scripting Tools", "Record Actions"),
("automate.trustScripts", "Automate", "Scripting Tools", "Trust Scripts"),
// Developer (Insert › Controls in GridCraft)
("insert.button", "Developer", "Controls", "Button (Form Control)"),
("insert.spinButton", "Developer", "Controls", "Spin Button (Form Control)"),
("insert.slider", "Developer", "Controls", "Scroll Bar (Form Control)"),
("control.format", "Developer", "Controls", "Properties"),
// Table Design
("table.rename", "Table Design", "Properties", "Table Name"),
("table.resize", "Table Design", "Properties", "Resize Table"),
("table.summarizePivot", "Table Design", "Tools", "Summarize with PivotTable"),
("table.removeDuplicates", "Table Design", "Tools", "Remove Duplicates"),
("table.convertToRange", "Table Design", "Tools", "Convert to Range"),
("table.insertSlicer", "Table Design", "Tools", "Insert Slicer"),
("table.headerRow", "Table Design", "Table Style Options", "Header Row"),
("table.totalRow", "Table Design", "Table Style Options", "Total Row"),
("table.bandedRows", "Table Design", "Table Style Options", "Banded Rows"),
("table.firstColumn", "Table Design", "Table Style Options", "First Column"),
("table.lastColumn", "Table Design", "Table Style Options", "Last Column"),
("table.bandedColumns", "Table Design", "Table Style Options", "Banded Columns"),
("table.style", "Table Design", "Table Styles", "Table Styles"),
// Chart Design / Format
("chart.addElement", "Chart Design", "Chart Layouts", "Add Chart Element"),
("chart.quickLayout", "Chart Design", "Chart Layouts", "Quick Layout"),
("chart.changeColors", "Chart Design", "Chart Styles", "Change Colors"),
("chart.set", "Chart Design", "Chart Styles", "Chart Styles"),
("chart.switchRowColumn", "Chart Design", "Data", "Switch Row/Column"),
("chart.selectData", "Chart Design", "Data", "Select Data"),
("chart.changeType", "Chart Design", "Type", "Change Chart Type"),
("chart.move", "Chart Design", "Location", "Move Chart"),
("chart.formatSelection", "Format", "Current Selection", "Format Selection"),
("chart.shapeFill", "Format", "Shape Styles", "Shape Fill"),
("chart.shapeOutline", "Format", "Shape Styles", "Shape Outline"),
// PivotTable Analyze / Design
("pivot.fieldList", "PivotTable Analyze", "Show", "Field List"),
("pivot.refresh", "PivotTable Analyze", "Data", "Refresh"),
("pivot.changeSource", "PivotTable Analyze", "Data", "Change Data Source"),
("pivot.calculatedField", "PivotTable Analyze", "Calculations", "Fields, Items & Sets"),
("pivot.grandTotals", "PivotTable Design", "Layout", "Grand Totals"),
("pivot.subtotals", "PivotTable Design", "Layout", "Subtotals"),
("pivot.reportLayout", "PivotTable Design", "Layout", "Report Layout"),
("pivot.style", "PivotTable Design", "PivotTable Styles", "PivotTable Styles"),
("pivot.addField", "PivotTable Analyze", "Fields", "Add Field"),
("pivot.removeField", "PivotTable Analyze", "Fields", "Remove Field"),
("pivot.moveField", "PivotTable Analyze", "Fields", "Move Field"),
("pivot.valueSettings", "PivotTable Analyze", "Active Field", "Value Field Settings"),
("pivot.filter", "PivotTable Analyze", "Filter", "Filter"),
("pivot.sort", "PivotTable Analyze", "Sort", "Sort"),
("pivot.group", "PivotTable Analyze", "Group", "Group Field"),
("pivot.collapse", "PivotTable Analyze", "Active Field", "Collapse Field"),
("pivot.delete", "PivotTable Analyze", "Actions", "Clear All"),
];
/// Distinct catalog ids.
pub fn ids() -> Vec<&'static str> {
let mut v: Vec<&str> = CATALOG.iter().map(|e| e.0).collect();
v.sort_unstable();
v.dedup();
v
}
/// (implemented, total) over distinct ids.
pub fn parity() -> (usize, usize) {
let ids = ids();
let done = ids.iter().filter(|id| crate::find_command(id).is_some()).count();
(done, ids.len())
}