DreamGUI
类参考

UDreamRadioButton

A radio button whose hierarchy is code, not an asset.

本页由 DreamGUIReferenceDocs commandlet 从反射生成,正文是头文件注释的原文(英文),所以不翻译——这样它永远和代码一致。概念讲解见核心概念。

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 -> HandleOptionA

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamRadioButtonStyleRadio ButtonyesGetStyle / SetStyleThis 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.
bAutoGroupWithSiblingsboolRadio ButtonyesGetAutoGroupWithSiblings / SetAutoGroupWithSiblingsFind 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.
bIsOnboolRadio ButtonyesGetIsOn / SetIsOnSelected 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.
CheckedStateEDreamCheckStateRadio ButtonyesGetCheckedState / SetCheckedStateThe full state, in UMG's check-box vocabulary -- the same EDreamCheckState UDreamToggle carries, and the same three answers.
AcceptedMouseButtonsint32Radio ButtonyesGetAcceptedMouseButtons / SetAcceptedMouseButtonsWHICH 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.
BoxNodeTObjectPtr<UDreamWidget>Radio Button-read only
DotNodeTObjectPtr<UDreamWidget>Radio Button-read only
ToggleBehaviourTObjectPtr<UUIToggle>Radio Button-read only

Functions

FunctionKindDescription
int32 GetAcceptedMouseButtons()pureGet Accepted Mouse Buttons
bool GetAutoGroupWithSiblings()pureGet Auto Group with Siblings
EDreamCheckState GetCheckedState()pureThe 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()pureGet Is On
FDreamRadioButtonStyle GetStyle()pureGet Style
UUIToggleGroup* GetToggleGroup()pureGet Toggle Group
bool IsChecked()pureUMG's convenience: exactly GetCheckedState() == Checked.
void SetAcceptedMouseButtons(int32 InAcceptedMouseButtons)callableWrites the bitmask and pushes it onto the behaviour at once.
void SetAutoGroupWithSiblings(bool bInAutoGroupWithSiblings)callableTurn the automatic grouping on or off, and act on it now.
void SetCheckedState(EDreamCheckState InCheckedState)callableSet 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)callableSet Is Checked
void SetIsOn(bool bInIsOn)callableThe compatibility spelling of SetCheckedState(Checked/Unchecked), exactly as on the toggle.
void SetStyle(FDreamRadioButtonStyle InStyle)callableThis instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat.
void SetToggleGroup(UUIToggleGroup* InGroup)callableMembership, passed straight through to the behaviour.

Events

EventSignatureDescription
OnToggleChangedvoid DreamRadioButtonChangedEvent__DelegateSignature(bool bIsOn)Fired by the toggle underneath, re-broadcast here so a consumer never reaches into the parts.
OnCheckStateChangedvoid 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.
OnValueChangedBPvoid 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.

本页目录