DreamGUI
Reference

UDreamToggle

A toggle whose hierarchy is code, not an asset.

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamToggle.h.

A toggle whose hierarchy is code, not an asset.

The same four nodes BP_Toggle has -- a box, a tick inside it, a label beside it -- built in NativeOnInitialized instead of instanced from a template. What that buys is that the control cannot be half-built: BP_Button shipped for months with no UIButton on it and nothing said so, and a class that always adds its own behaviour cannot have that happen to it.

What it costs is the tree nobody can open. Everything an author would otherwise have reached into the hierarchy to change has to be a property here, which is what FDreamToggleStyle is, and the moment a project wants all its toggles to agree that stops being enough.

It composes into .dui with no language change at all, because a class path is already a node tag:

Native.Toggle Mute {
    Style.TickChecked = #FF3355
    OnToggleChanged -> HandleMute

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamToggleStyleToggleyesGetStyle / 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.
ClickMethodEDreamUIClickMethodToggleyesGetClickMethod / SetClickMethodWHEN the tick flips, per input kind -- UMG's three enums, surfaced at the control exactly as UDreamButton surfaces them and for the same reason: they live on the selectable underneath, and a control that never stated them left every check box on the desktop's DownAndUp.
TouchMethodEDreamUITouchMethodToggleyesGetTouchMethod / SetTouchMethod
PressMethodEDreamUIPressMethodToggleyesGetPressMethod / SetPressMethod
AcceptedMouseButtonsint32ToggleyesGetAcceptedMouseButtons / SetAcceptedMouseButtonsWHICH mouse buttons press and flip this check box -- a bitmask over EDreamUIMouseButtonType, the left button alone by default, which is UMG's rule: SCheckBox toggles on the left button and nothing else, so a right click neither presses nor flips it and goes on to whatever is behind.
CheckedStateEDreamCheckStateToggleyesGetCheckedState / SetCheckedStateThe authored state, in UMG's spelling and with UMG's third value. A click moves it the way UMG's check box does: Unchecked to Checked, and Checked or Undetermined to Unchecked -- a mixed state is cleared by a click, never ticked. 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 -- so a knob that exists only as two UFUNCTIONs is a knob nothing outside C++ can turn.
bIsOnboolToggleyesGetIsOn / SetIsOnThe compatibility spelling: CheckedState as a bool. Checked mirrors true; Unchecked and Undetermined mirror false. Kept as a property because existing .dui two-way-binds it (bIsOn <-> ...) and a binding resolves a property; kept coherent with CheckedState through every path (authored push, user click, programmatic set). New code speaks CheckedState.
BoxNodeTObjectPtr<UDreamWidget>Toggle-read onlyThe parts, in the shape the rest of the framework expects to find them.
TickNodeTObjectPtr<UDreamWidget>Toggle-read only
MarkNodeTObjectPtr<UDreamWidget>Toggle-read onlyThe image mark -- active only while the current state's brush holds an image.
ToggleBehaviourTObjectPtr<UUIToggle>Toggle-read only

Functions

FunctionKindDescription
int32 GetAcceptedMouseButtons()pureGet Accepted Mouse Buttons
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.
EDreamUIClickMethod GetClickMethod()pureGet Click Method
bool GetIsOn()pureThe compatibility spelling of IsChecked(): the behaviour's bool once it exists, bIsOn before.
EDreamUIPressMethod GetPressMethod()pureGet Press Method
FDreamToggleStyle GetStyle()pureGet Style
EDreamUITouchMethod GetTouchMethod()pureGet Touch Method
bool IsChecked()pureUMG's convenience: exactly GetCheckedState() == Checked.
bool IsPressed()pureWhether a pointer is holding the box down -- UMG's IsPressed, which a check box has for the same reason a button does. Asked of the behaviour rather than remembered here: a second copy of "is it down" goes stale the first time a press ends somewhere this control does not hear.
void SetAcceptedMouseButtons(int32 InAcceptedMouseButtons)callableWrites the bitmask and pushes it onto the behaviour at once, as the three method setters do.
void SetCheckedState(EDreamCheckState InCheckedState)callableSet any of the three states. Checked/Unchecked go through the behaviour with notify, the path a click takes; Undetermined parks the behaviour at unchecked without notify and lives on the control (see the class comment).
void SetClickMethod(EDreamUIClickMethod InMethod)callableEach of the four setters below writes the field and re-pushes it onto the behaviour.
void SetIsChecked(bool bInIsChecked)callableUMG's convenience spelling of SetIsOn.
void SetIsOn(bool bInIsOn)callableThe compatibility spelling of SetCheckedState(Checked/Unchecked).
void SetPressMethod(EDreamUIPressMethod InMethod)callableSet Press Method
void SetStyle(FDreamToggleStyle InStyle)callableThis instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat.
void SetTouchMethod(EDreamUITouchMethod InMethod)callableSet Touch Method

Events

EventSignatureDescription
OnToggleChangedvoid DreamToggleChangedEvent__DelegateSignature(bool bIsOn)Fired by the toggle underneath, re-broadcast here so a consumer never has to reach into the parts. The compatibility spelling of OnCheckStateChanged: fires whenever the BOOL projection of the state changes (so Unchecked <-> Undetermined moves are silent here).
OnCheckStateChangedvoid DreamCheckStateChangedEvent__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 DreamToggleChangedEvent__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.
OnPressedvoid DreamToggleSimpleEvent__DelegateSignature()The four pointer moments, re-broadcast from the behaviour exactly as the value change is.
OnReleasedvoid DreamToggleSimpleEvent__DelegateSignature()
OnHoveredvoid DreamToggleSimpleEvent__DelegateSignature()
OnUnhoveredvoid DreamToggleSimpleEvent__DelegateSignature()

Compared with UMG

Every Blueprint-facing member of the UMG class, and where it went. adopt: same name, same meaning. map: here under another name or on another type. reject: deliberately absent, with the reason.

UMGMemberStatusHereNote
UCheckBoxCheckedStateadoptCheckedStateEDreamCheckState, the same three values. bIsOn is the two-state compatibility spelling and mirrors it.
UCheckBoxWidgetStylemapStyleFDreamToggleStyle. Its CheckedBrush / UncheckedBrush / UndeterminedBrush are UMG's three mark images; StateFaces is the box's per-pointer-state drawing.
UCheckBoxHorizontalAlignmentrejectThis control is a box and its mark, with no content slot at all -- the text beside a check box is the consumer's own layout here. There is nothing for an alignment to align.
UCheckBoxClickMethodadoptClickMethodEDreamUIClickMethod; pushed onto the selectable underneath.
UCheckBoxTouchMethodadoptTouchMethod
UCheckBoxPressMethodadoptPressMethod
UCheckBoxIsFocusablemapUDreamWidget::bIsFocusableEvery widget here carries it; a control-level copy would shadow the base member.
UCheckBoxOnCheckStateChangedadoptOnCheckStateChangedCarries the full state. OnToggleChanged is the bool projection and fires alongside it. Only the mouse buttons in AcceptedMouseButtons press and flip the box -- the left one alone by default, which is SCheckBox's rule; AcceptedMouseButtons is this control's own knob, as on UDreamButton. A double click flips the box twice, as SCheckBox's does: the second press arrives as a double click and the toggle takes it as its press (SCheckBox::OnMouseButtonDoubleClick is OnMouseButtonDown).
UCheckBoxIsPressedadoptIsPressedAsked of the behaviour's selection state rather than remembered on the control.
UCheckBoxIsCheckedadoptIsChecked
UCheckBoxGetCheckedStateadoptGetCheckedState
UCheckBoxSetIsCheckedadoptSetIsChecked
UCheckBoxSetCheckedStateadoptSetCheckedStateUndetermined parks the two-state behaviour at unchecked and lives on the control; a click leaves it by becoming UNCHECKED, as UMG's does (SCheckBox::ToggleCheckedState: Checked or Undetermined becomes Unchecked, Unchecked becomes Checked).
UCheckBoxSetClickMethodadoptSetClickMethod
UCheckBoxSetTouchMethodadoptSetTouchMethod
UCheckBoxSetPressMethodadoptSetPressMethod
UCheckBoxSetStyleadoptSetStyleNot a UFUNCTION on UCheckBox (its Setter meta names it); added here because a style nothing can replace at runtime is a look only the designer can change.

On this page