ButtonGroup
Shared selection resource for toggle buttons.
Assign one ButtonGroup instance to related buttons with ToggleMode = true. Different instances do not form one group. By default the resource is local to a level instance; it tracks membership without owning Control lifetimes.
AllowUnpress defaults to false and prevents repeated activation from deselecting the current button. It does not guarantee that one item is always selected: groups start empty, SetPressed(false) can clear selection, SetPressedNoSignal bypasses reconciliation, and group assignment does not normalize existing states. Set the initial selection explicitly.
GetPressedButton returns a selected button or null. If code created multiple selected items, the result depends on unordered traversal; restore consistent state first. GetButtons returns shared references without tree-order guarantees. Editing this array does not change membership; set the button’s ButtonGroup = null to detach it.
Pressed supplies the button processed by group activation or ordinary SetPressed(true) selection. With AllowUnpress = true, activation may already have switched the supplied button off. Read ButtonPressed/GetPressedButton when you need final selection rather than the action source.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
ButtonGroupConstructor
public ButtonGroup();Creates an empty group with AllowUnpress = false and ResourceLocalToScene = true. Set initial selection explicitly.
Properties1
AllowUnpressProperty
public bool AllowUnpress { get; set; }Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.
Methods4
GetButtonsReckfell.Collections.Array<BaseButton>
public Reckfell.Collections.Array<BaseButton> GetButtons();Returns shared member references without tree-order guarantees. Editing the array does not change membership and does not transfer ownership of buttons. Detach by assigning null to the button’s ButtonGroup.
Reckfell.Collections.Array<BaseButton>Array of shared BaseButton references without stable ordering.
GetPressedButtonBaseButton
public BaseButton GetPressedButton();Returns a selected member or null. Multiple selections created by inconsistent programmatic writes produce an unordered-traversal-dependent result.
BaseButtonSelected BaseButton, or null.
IsAllowUnpressbool
public bool IsAllowUnpress();Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.
booltrue when repeated activation may clear selection.
SetAllowUnpressvoid
public void SetAllowUnpress(bool enabled);Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledPermit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.
Signals and events1
PressedEvent
public event ButtonGroup.PressedEventHandler Pressed;Supplies a member on activation or ordinary SetPressed(true) selection. With AllowUnpress, that member may already be off. Not a universal final-selection signal; SetPressedNoSignal does not emit it.
| Name | Type | Default |
|---|---|---|
button | BaseButton | — |
buttonMember causing notification; inspect its ButtonPressed for final state.