Normative baseline for the standardized button control widget class
FROG — Free Open Graphical Language
- Widgets index
- Expression widget instances
- Expression widget interaction
- Expression widget realization
- Widget package publication
- Executable UI primitives
- 1. Overview
- 2. Class Defined Here
- 3. Button Class versus Realization
- 4. Label, Caption, and State Text Posture
- 5. Mechanical Action Model
- 6. Public Visual Part Model
- 7. Standard Property Surface
- 8.
frog.widgets.button - 9. Default SVG Realization Posture
- 10. State Resource Override Posture
- 11. Diagram Interaction Posture
- 12. Validation Expectations
- 13. Summary
This document defines the intrinsic standardized baseline for the button widget in FROG. The button is a command-oriented control with a boolean state, explicit mechanical-action behavior, event observation, and realization-driven visual state support.
The intrinsic button baseline is not merely a decorative clickable rectangle and is not equivalent to a generic boolean control. It owns button-specific timing and interaction semantics while remaining compatible with the shared widget model.
frog.widgets.button
The button class owns state meaning, mechanical action, properties, methods, events, parts, and legal access through frog.ui.*.
The realization owns shape, skin, SVG resources, state-specific visual resources, part bindings, anchors, transitions, and host-specific rendering.
A state-specific SVG override does not create a new button class. A new class is justified only when the public contract changes.
label.*
- structural / logical widget name surface
caption.*
- front-panel presentation caption shown near the button
state_text.*
- optional text displayed inside the button face
and optionally varied by button state
label.textnames the object for tooling, references, diagram readability, accessibility, and debugging.caption.textis the external front-panel caption shown near the button.state_text.false_textandstate_text.true_textare the internal button-face strings.
The button exposes the following canonical property:
behavior.mechanical_actionThe standard values are:
switch_when_pressedswitch_when_releasedswitch_until_releasedlatch_when_pressedlatch_when_releasedlatch_until_released
| Mechanical action | Value event | Button value after user release | Latch reset rule |
|---|---|---|---|
switch_when_pressed |
Toggle the stored boolean value on the press edge. | The toggled value remains stored. | Not applicable. |
switch_when_released |
Toggle the stored boolean value on the release edge. | The toggled value remains stored. | Not applicable. |
switch_until_released |
Publish true while pressed and false on release. |
false. |
Not applicable. |
latch_when_pressed |
Publish true on the press edge. |
Latched until natural value consumption resets it. | Reset after the executable diagram consumes the natural value path. |
latch_when_released |
Publish true on the release edge. |
Latched until natural value consumption resets it. | Reset after the executable diagram consumes the natural value path. |
latch_until_released |
Show the pressed state while held, then publish true on release. |
Latched until natural value consumption resets it. | Reset after the executable diagram consumes the natural value path. |
For latch modes, the reset condition MUST be explicit.
The portable baseline defines the reset trigger as consumption through the natural button value path when that path is present in the executable diagram.
A mere object-style property read of value SHOULD NOT by itself reset the latch unless a later profile or runtime-family contract explicitly publishes that behavior.
Runtimes MUST NOT accept a mechanical action unless the corresponding event timing, stored value behavior, UI snapshot behavior, and reset behavior are implemented and validated for that runtime family.
rootlabelcaptionframefacestate_facestate_textfocus_ring
Default SVG realizations SHOULD publish stable anchors for external text placement, internal state text placement, and host input overlays.
The rectangular default realization publishes label.anchor, caption.anchor, state_text.center, and face.bounds.
Host overlays for input handling MAY align to face.bounds, but they MUST NOT replace the SVG-owned visible button skin.
value : bool
label.visible : boollabel.text : stringlabel.style.*caption.visible : boolcaption.text : stringcaption.placement : enumcaption.padding : lengthcaption.style.*
state_text.visible : boolstate_text.lock_in_center : boolstate_text.multiple_strings : boolstate_text.false_text : stringstate_text.true_text : stringstate_text.hover_false_text : stringwhen exposedstate_text.hover_true_text : stringwhen exposedstate_text.style.*
interaction.visible : boolinteraction.enabled : boolinteraction.focusable : boolinteraction.focused : boolinteraction.hovered : boolinteraction.pressed : boolbehavior.mechanical_action : enumbehavior.latch_reset_policy : enum
style.frame.*style.face.*style.state_face.*style.focus_ring.*style.disabled.opacity : numberrealization.family : stringrealization.variant : stringrealization.skin_id : string
- class_id:
frog.widgets.button - family:
button_widget - compatible role:
control
- primary value: present
- value type:
bool - natural value participation: optional and mechanical-action-dependent
- mirrored property:
value
focus()press()release()activate()click()set_true()set_false()toggle()reset_to_default()
pressedreleasedclickedvalue_changedhover_enteredhover_leftfocus_gainedfocus_lost
The default realization SHOULD support a parameterized rectangular SVG template, state-dependent color application, caption and internal state-text rendering, a single visible rectangular face with configurable border, optional frame / state-face surfaces for advanced realizations, and focus ring display.
The Default Button SVG template is the reusable visual grammar for examples and runtimes. Example sources may provide instance-level values, labels, layout, bindings, and style overrides, but they should reference the Default realization package and its published SVG assets instead of duplicating local button skins.
widget property
-> realization parameter
-> SVG part/style application
The default button realization may be driven by one parameterized template SVG and may also publish optional state-specific SVG overrides.
The initial state-specific override names are:
falsetruehover_falsehover_truetransition_false_to_truetransition_true_to_false
Additional visual states such as pressed_false, pressed_true, disabled_false, disabled_true, focused_false, and focused_true may be represented by parameter binding or later explicit override assets.
The button supports object-style property access through frog.ui.property_read and frog.ui.property_write, method invocation through frog.ui.method_invoke, event observation through frog.ui.event_observe, and widget reference targeting through widget_reference.
When the button participates through a natural value path, that value path is mechanical-action-aware and may be relevant to latch reset.
Object-style reads of value remain distinct from natural value consumption.
Validators SHOULD diagnose unknown mechanical actions, illegal value access for the selected button posture, unsupported state-resource overrides, attempts to use realization-only SVG layers as public class members, and attempts to make a skin or state asset redefine class semantics.
The standardized button defines the intrinsic command-oriented action widget of the FROG baseline:
frog.widgets.button
The button is a stateful command control with explicit mechanical-action behavior, event posture, internal state text, shared label / caption convention, and default SVG realization support with optional state-specific overrides.