Skip to content

Latest commit

 

History

History
199 lines (165 loc) · 9.46 KB

File metadata and controls

199 lines (165 loc) · 9.46 KB

FROG logo

Button Widget Example Reference

Current Button command and Boolean indicator proof surfaces
FROG - Free Open Graphical Language


Scope

The stabilized Button slices now cover Examples/10_button_press_to_boolean through Examples/15_button_latch_until_released. They prove one frog.widgets.button command control driving one read-only frog.widgets.boolean_indicator without duplicating local SVG skins under Examples. The six slices correspond to the six LabVIEW-like mechanical actions accepted for the Default Button realization.

Example 10:
trigger_button.pressed -> pressed_indicator.value -> public pressed

Examples 11-12:
trigger_button.value -> switched_indicator.value -> public switched

Examples 13-15:
trigger_button.value -> latched_indicator.value -> public latched

Each example is intentionally small: the Button publishes one source-owned boolean value for the selected mechanical action, the diagram copies that value, and the Boolean indicator displays the current result. The accepted Button corridors use the Default Button rectangular SVG asset and the Default Boolean circular indicator.


FROG-Owned Instance Data

The .frog source owns the diagram and the front-panel instance data:

  • Examples/10_button_press_to_boolean/main.frog
  • Examples/11_button_switch_when_pressed/main.frog
  • Examples/12_button_switch_when_released/main.frog
  • Examples/13_button_latch_when_pressed/main.frog
  • Examples/14_button_latch_when_released/main.frog
  • Examples/15_button_latch_until_released/main.frog
  • front panel canvas: source-owned panel pixels in each .frog
  • button control: trigger_button, frog.widgets.button, rectangular variant
  • Boolean indicator: pressed_indicator or switched_indicator, frog.widgets.boolean_indicator, circular variant
  • widget layout, caption placement, initial values, state text, mechanical action, and per-instance visual states live in the .frog widget instances

Current instance-level properties proven by the example include:

  • caption.text, caption anchors, caption font size, and caption visibility
  • state_text.true_text, state_text.false_text, state_text.visible, and state_text.style.*
  • style.face.fill_color.*, style.face.border_color.*, and style.face.border_width
  • style.pressed.inset and hover/pressed visual states for the Button body
  • style.inner.* state colors for the read-only Boolean indicator
  • interaction.enabled for the Button and read-only indicator behavior

Published Parts And Configurable Properties

Surface Current source properties Runtime obligation
Button caption caption.text, caption.anchor.x/y, caption.align.horizontal Place the external label from instance data and keep it visually separated from the Button body.
Button face style.face.*, hover_*, pressed_* Apply normal, hover, and pressed states through the SVG-published face part rather than through a hardcoded HTML shell.
Button state text state_text.true_text, state_text.false_text, state_text.style.* Show ON while pressed and OFF when released according to instance data.
Host input overlay interaction.enabled, behavior.mechanical_action Align the browser input overlay to the SVG-published Button face bounds and drive a momentary pressed value.
Boolean indicator style.inner.*, state_text.* Render the read-only pressed result through the Default Boolean circular realization.

The Default Button SVG template exposes these public parts: caption, face, focus_ring, frame, label, root, state_face, and state_text.


WFROG-Owned Realization Data

The example package is:

Examples/10_button_press_to_boolean/ui/button_panel.wfrog
Examples/11_button_switch_when_pressed/ui/button_panel.wfrog
Examples/12_button_switch_when_released/ui/button_panel.wfrog
Examples/13_button_latch_when_pressed/ui/button_panel.wfrog
Examples/14_button_latch_when_released/ui/button_panel.wfrog
Examples/15_button_latch_until_released/ui/button_panel.wfrog

It owns only the realization references, SVG asset references, and host requirements.

  • Default Button package: Libraries/Realizations/Default/button.default.wfrog
  • Default Boolean package: Libraries/Realizations/Default/boolean.default.wfrog
  • button SVG asset: Libraries/Realizations/Default/assets/button/templates/button_rectangular.svg
  • indicator SVG asset: Libraries/Realizations/Default/assets/boolean/templates/boolean_circular.svg
  • asset ids consumed by runtimes: button_rectangular_svg, boolean_circular_svg

Runtime Expectations

  • Example 10 validates behavior.mechanical_action=switch_until_released.
  • Example 11 validates behavior.mechanical_action=switch_when_pressed.
  • Example 12 validates behavior.mechanical_action=switch_when_released.
  • Example 13 validates behavior.mechanical_action=latch_when_pressed.
  • Example 14 validates behavior.mechanical_action=latch_when_released.
  • Example 15 validates behavior.mechanical_action=latch_until_released.
  • Example 10 must publish a momentary pressed value while the host pointer is down.
  • Example 11 must toggle the stored Button value on the press edge and keep that value after release.
  • Example 12 must toggle the stored Button value on the release edge and keep that value after release.
  • Example 13 must latch ON on press, report TRUE once to the program, and reset the stored value on read.
  • Example 14 must latch ON on release, report TRUE once to the program, and reset the stored value on read.
  • Example 15 must latch ON on press and reset only after release and program read have both occurred.
  • The Boolean indicator is read-only and must reflect the source-owned Button result for the selected mechanical action.
  • Normal, hover, pressed, text, border, and indicator colors are instance-configurable.
  • The visible skins must come from Default Button and Boolean SVG assets, not from a hardcoded HTML card.
  • The runtime must reject fallback markers that replace the Button or Boolean bodies with local HTML/CSS widgets.

Native Kernel Posture

  • native manifest: Implementations/Reference/LLVM/examples/10_button_press_to_boolean/native_kernel_manifest.json
  • native manifest: Implementations/Reference/LLVM/examples/11_button_switch_when_pressed/native_kernel_manifest.json
  • native manifest: Implementations/Reference/LLVM/examples/12_button_switch_when_released/native_kernel_manifest.json
  • native manifest: Implementations/Reference/LLVM/examples/13_button_latch_when_pressed/native_kernel_manifest.json
  • native manifest: Implementations/Reference/LLVM/examples/14_button_latch_when_released/native_kernel_manifest.json
  • native manifest: Implementations/Reference/LLVM/examples/15_button_latch_until_released/native_kernel_manifest.json
  • native ABI entries are example-specific and consumed through manifests by the runtime.
  • Examples 10-15 are accepted at the same C++/Python/Rust reference-runtime source level; local direct Python/Rust execution still depends on those toolchains being available.

Validation Notes

  • The Button press and release path must be tested in the browser-host UI.
  • The visible UI must expose the expected asset routes for the Button and Boolean indicator.
  • Button state text must switch between OFF and ON according to the pressed state.
  • There must be no local duplicated Button SVG under the example directory.
  • The accepted scope is bounded to the examples above and must not be used to claim generalized runtime completeness.