UDreamRadioButton
A radio button whose hierarchy is code, not an asset.
Inherits from UDreamUIControl.
Declared in Public/Controls/DreamRadioButton.h.
A radio button whose hierarchy is code, not an asset.
The toggle's anatomy with the toggle's own behaviour underneath -- a box, a mark centred in it, a label beside it in a row -- differing in exactly two places, which is why it is a class and not a style: the mark is an image dot sized by the style rather than a glyph, and the box's corner radius defaults to half its size, which is the whole of what makes it read as a radio.
What makes a radio a radio at runtime is the GROUP, and the group is not this control's: it is a UUIToggleGroup behaviour living on a shared ancestor, and membership is handed over through SetToggleGroup. Ungrouped, this control is honest about being a round toggle -- clicking it again turns it off; a group with bAllowNoneSelected=false is what forbids that.
/Script/DreamGUIControls.DreamRadioButton OptionA {
bIsOn = true
OnToggleChanged -> HandleOptionAProperties
| Name | Type | Category | In the details panel | From Blueprint | Description |
|---|---|---|---|---|---|
Style | FDreamRadioButtonStyle | Radio Button | yes | GetStyle / SetStyle | This instance's own look. The project sheet wins while StyleSource says so AND a sheet actually exists; with no sheet in the project this IS the look in effect -- which is why it stays editable instead of being gated on the enum: the old edit condition greyed the exact values that were driving the control. |
bAutoGroupWithSiblings | bool | Radio Button | yes | GetAutoGroupWithSiblings / SetAutoGroupWithSiblings | Find a UUIToggleGroup on an ancestor at Awake and join it -- with a group behaviour on the shared parent, sibling radios exclude each other with nothing wired. Default on, because a radio that does not exclude is a round toggle; off, grouping goes through SetToggleGroup. |
bIsOn | bool | Radio Button | yes | GetIsOn / SetIsOn | Selected or not. A property rather than the getter/setter pair alone, because the pair alone is invisible: .dui writes properties, the designer lists properties, and a binding resolves a property. Authored value in, mirror of the behaviour's out -- HandleValueChanged keeps it honest when the user (or the group switching this one off) is the writer. |
CheckedState | EDreamCheckState | Radio Button | yes | GetCheckedState / SetCheckedState | The full state, in UMG's check-box vocabulary -- the same EDreamCheckState UDreamToggle carries, and the same three answers. |
AcceptedMouseButtons | int32 | Radio Button | yes | GetAcceptedMouseButtons / SetAcceptedMouseButtons | WHICH mouse buttons press and choose this radio -- a bitmask over EDreamUIMouseButtonType, the left button alone by default: a radio is a check box to UMG, and SCheckBox answers the left button and nothing else, so a right click neither presses nor chooses it. |
BoxNode | TObjectPtr<UDreamWidget> | Radio Button | - | read only | |
DotNode | TObjectPtr<UDreamWidget> | Radio Button | - | read only | |
ToggleBehaviour | TObjectPtr<UUIToggle> | Radio Button | - | read only |
Functions
| Function | Kind | Description |
|---|---|---|
int32 GetAcceptedMouseButtons() | pure | Get Accepted Mouse Buttons |
bool GetAutoGroupWithSiblings() | pure | Get Auto Group with Siblings |
EDreamCheckState GetCheckedState() | pure | The full state. The behaviour is the truth for the two states it can hold; Undetermined is the control's own and reads from here. |
bool GetIsOn() | pure | Get Is On |
FDreamRadioButtonStyle GetStyle() | pure | Get Style |
UUIToggleGroup* GetToggleGroup() | pure | Get Toggle Group |
bool IsChecked() | pure | UMG's convenience: exactly GetCheckedState() == Checked. |
void SetAcceptedMouseButtons(int32 InAcceptedMouseButtons) | callable | Writes the bitmask and pushes it onto the behaviour at once. |
void SetAutoGroupWithSiblings(bool bInAutoGroupWithSiblings) | callable | Turn the automatic grouping on or off, and act on it now. |
void SetCheckedState(EDreamCheckState InCheckedState) | callable | Set any of the three. Checked/Unchecked go through the behaviour WITH notify -- the path a click takes, and the path the group hears -- while Undetermined parks the behaviour at unchecked without notify and lives on the control. |
void SetIsChecked(bool bInIsChecked) | callable | Set Is Checked |
void SetIsOn(bool bInIsOn) | callable | The compatibility spelling of SetCheckedState(Checked/Unchecked), exactly as on the toggle. |
void SetStyle(FDreamRadioButtonStyle InStyle) | callable | This instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat. |
void SetToggleGroup(UUIToggleGroup* InGroup) | callable | Membership, passed straight through to the behaviour. |
Events
| Event | Signature | Description |
|---|---|---|
OnToggleChanged | void DreamRadioButtonChangedEvent__DelegateSignature(bool bIsOn) | Fired by the toggle underneath, re-broadcast here so a consumer never reaches into the parts. |
OnCheckStateChanged | void DreamRadioCheckStateChangedEvent__DelegateSignature(EDreamCheckState CheckedState) | UMG's spelling of the same moment, carrying the full state. Fires whenever CheckedState changes -- alongside OnToggleChanged when the bool projection moved too. |
OnValueChangedBP | void DreamRadioButtonChangedEvent__DelegateSignature(bool bIsOn) | The <-> convention: two-way bindings synthesize their reverse route against this exact name, so a value control carries it alongside its spoken events. Fires with them. |