Skip to content

LVGL: extend Textarea and ButtonMatrix properties and actions - #1068

Open
AwangYes wants to merge 13 commits into
eez-open:masterfrom
AwangYes:lvgl-textarea-buttonmatrix
Open

AwangYes wants to merge 13 commits into
eez-open:masterfrom
AwangYes:lvgl-textarea-buttonmatrix

Conversation

@AwangYes

@AwangYes AwangYes commented Sep 15, 2026 •

Copy link
Copy Markdown

Summary

  • Textarea Placeholder uses the existing Literal - String / Translated Literal / Expression selector, including old-project migration and empty-value updates. Add Password Bullet using the existing string property editor.
  • Add six Textarea actions: Get Text, Set Text, Set One Line, Set Password Mode, Set Password Bullet and Set Placeholder Text.
  • ButtonMatrix Text uses the existing expression mechanism for LVGL.LV_SYMBOL_*, preserving old literal text.
  • Add ButtonMatrix Get Selected Button, Get Button Text and Set Map. Set Map reuses the complete existing Buttons editor: New line, Text, Width and all existing controls. No raw-C/symbol mode, string-array selector, new resource page or new UI styling is introduced.
  • Keep nested expression indexes, save/reopen, command undo/redo and clipboard cloning on the existing mechanisms.
  • Bundle matching amalgamation and all five rebuilt engines. Existing action IDs 0–64 are frozen; the new IDs are appended as 65–73.

Dependencies / merge order

  1. LVGL: add Textarea actions and owned ButtonMatrix maps eez-framework#30
  2. LVGL: rebuild Textarea and ButtonMatrix engines with regression coverage studio-wasm-libs#1
  3. This Studio PR, consuming those exact artifacts.

The missing shared dispatcher/string-lifetime work affected all new actions, not only Set Map. That work and Set Map are now implemented, so this is one complete feature delivery with coordinated repository dependencies. The current coordinated pins are framework 0a1acdfe16799302a781add3a254ff06b6f78fec and studio-wasm-libs ceed856175282dd67de2917a394a2f98ddb8af33; regenerate downstream artifacts if upstream squash-merges change either SHA.

Validation

  • Real Studio editor preview and saved-project Run on LVGL 8.4.0 / 9.2.2 / 9.3.0 / 9.4.0 / 9.5.0.
  • All nine actions run from Studio-compiled bytecode; actual Textarea VALUE_CHANGED assignments update live Placeholder and ButtonMatrix bindings, including non-empty → empty → non-empty values.
  • Regression coverage includes default symbol-to-literal replacement across repeated ticks, other matrices retaining live bindings, failed replacement preserving bindings, and binding reset on widget recreation.
  • Legacy defaults, all three Placeholder types, nested Buttons persistence, undo/redo, grouped edits, clipboard cloning and validation.
  • Generated Flow/no-Flow C is compiled as C and run with ASan/UBSan; no-Flow uses native variable getters and the shared C-compatible helper. Tests cover translation-hook output, getter ownership, repeated binding updates and teardown.
  • Full Studio build, metadata/ABI gate, Linux directory packaging and the packaged application's normal --build-project command for both Flow/no-Flow resources.
  • Latest Studio validation workflow (Linux/Windows/macOS) is recorded here: https://github.com/AwangYes/eez-studio/actions/runs/35080615456. The companion runtime matrix is green: https://github.com/AwangYes/studio-wasm-libs/actions/runs/35080585574.

tests/README.md documents the commands and source pins. Test code is excluded from release WASM. No npm dependencies or lockfile entries are changed.

Runtime behavior

Without Flow, Expression keeps the existing Variable selector. Translated Literal uses the existing _() generated-code hook; the canvas shows source text. Getter results own their text. Selected-button NONE is 65535. Successful ButtonMatrix Set Map replaces the complete map and detaches its original Buttons text bindings. For example, a default LVGL.LV_SYMBOL_BACKSPACE expression can be replaced with plain text without the next tick restoring the symbol. Set Map expressions produce snapshots at action execution; subsequent Set Map actions can replace them again. Failed replacement preserves the previous map and bindings; recreating the widget restores its configured bindings. Other matrices and Textarea bindings continue updating normally. Project-specific fonts and hardware/input integration remain downstream firmware checks.

Demo project

The demo covers Textarea placeholder modes, password bullet, all Textarea actions, ButtonMatrix symbol expressions, Set Map, Get Selected Button and Get Button Text. It is included in this PR branch for direct import into Studio.

@AwangYes
AwangYes marked this pull request as draft September 16, 2026 08:33
@AwangYes

Copy link
Copy Markdown
Author

@mvladic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant