DreamGUI
类参考

UDreamExpandableArea

A header that toggles, and the content it hides.

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

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamExpandableArea.h.

A header that toggles, and the content it hides.

Three nodes and one behaviour: a column, a clickable header face with an indicator and a label on it, and a content column below. The header is a UUIButton on its own face, exactly as DreamButton builds one -- an expander IS a button whose click means "show the rest" -- so hover, press and navigation come from the library's one selectable rather than from a second interaction story.

HOW A CONSUMER PUTS CONTENT IN IT, and which idiom that is, because there are two in this codebase and only one is reachable from here:

Native.ExpandableArea Details {
    Label = "Advanced"
    Text Body { Text = "..." }

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamExpandableAreaStyleExpandable AreayesGetStyle / 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.
LabelFTextExpandable AreayesGetLabel / SetLabelThe words on the header.
bIsExpandedboolExpandable AreayesGetIsExpanded / SetIsExpandedWhether the content shows. A property so .dui, the designer and bindings can see it and so an author can ship a section already open; every road that CHANGES it goes through SetIsExpanded, which is the only thing that broadcasts.
MaxHeightfloatExpandable AreayesGetMaxHeight / SetMaxHeightA ceiling on the CONTENT's share of the control's height, in local units -- UMG's MaxHeight.
ExpansionDurationfloatExpandable AreayesGetExpansionDuration / SetExpansionDurationHow long the open and close take, in seconds. Zero (the default) is instant.
RootNodeTObjectPtr<UDreamWidget>Expandable Area-read only
HeaderNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe clickable face, and the node whose height IS the style's HeaderHeight. Bound from the part named "HeaderFace" -- the FIELD keeps its name, the part does not; see the class comment for why the two differ.
HeaderRowNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe indicator-and-label row inside the header. See the tree comment for why it is its own node.
ArrowNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe built-in glyph indicator. Asleep whenever the state's brush carries an image instead.
ArrowMarkNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe image indicator, the glyph's stand-in. Exactly one of the two is awake.
LabelNodeTObjectPtr<UDreamWidget>Expandable Area-read only
ContentNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyWhere a consumer's content lives, and the node that is switched off when collapsed.
HeaderBehaviourTObjectPtr<UUIButton>Expandable Area-read only
HeaderSlotNodeTObjectPtr<UDreamWidget>Expandable Area-read onlyThe header's hole, in the stock label's place. Empty is the normal state.

Functions

FunctionKindDescription
UDreamWidget* GetContent()pureThe first widget in the content column, or null while it is empty.
float GetExpansionDuration()pureGet Expansion Duration
bool GetIsExpanded()pureGet Is Expanded
FText GetLabel()pureGet Label
float GetMaxHeight()pureGet Max Height
FDreamExpandableAreaStyle GetStyle()pureGet Style
void SetContent(UDreamWidget* InContent)callablePut InContent in the content column, taking it from wherever it currently hangs.
void SetExpansionDuration(float InExpansionDuration)callableHow long the NEXT open or close takes. Nothing is re-run: a duration describes a move that has not happened yet, and replaying the current one to honour a new speed would animate a section the player already finished opening.
void SetIsExpanded(bool bInIsExpanded)callableSilent when the flag does not move; otherwise pushes the visuals and broadcasts both events.
void SetLabel(FText InLabel)callableThe words on the header, written through to the label the control owns.
void SetMaxHeight(float InMaxHeight)callableRe-measures at once: the ceiling is part of the height this control claims.
void SetStyle(FDreamExpandableAreaStyle InStyle)callableThis instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat.
void ToggleExpansion()callableWhat the header click does, callable without a pointer.

Events

EventSignatureDescription
OnExpansionChangedvoid DreamExpandableAreaExpansionChangedEvent__DelegateSignature(bool bIsExpanded)Fired whenever the expanded flag moves, from a click or from code.
OnValueChangedBPvoid DreamExpandableAreaExpansionChangedEvent__DelegateSignature(bool bIsExpanded)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.

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
UExpandableAreaStyleadoptStyleFDreamExpandableAreaStyle: the header's height, its five state colours, the label, and the content area's background and padding.
UExpandableAreaBorderBrushmapFDreamExpandableAreaStyle::ContentBackgroundA colour rather than an FSlateBrush: the content area is a procedural rect, and what an expander's frame is in this family is that rect's fill. A picture behind the content is a Native.Border around it.
UExpandableAreaBorderColormapFDreamExpandableAreaStyle::ContentBackgroundOne colour where UMG has a brush and a tint over it, for the reason above: there is no brush here for a second colour to multiply.
UExpandableAreabIsExpandedadoptbIsExpandedAuthored open or closed; every road that CHANGES it goes through SetIsExpanded, which is what broadcasts.
UExpandableAreaMaxHeightadoptMaxHeightZero is no ceiling, which is what this control has always done.
UExpandableAreaHeaderPaddingmapFDreamExpandableAreaStyle::HeaderPaddingIn the style, because how a project's section headers are inset is a theme decision.
UExpandableAreaAreaPaddingmapFDreamExpandableAreaStyle::ContentPaddingNamed for what it pads rather than for the widget it sits on.
UExpandableAreaOnExpansionChangedadoptOnExpansionChangedFires from a click and from code alike.
UExpandableAreaGetIsExpandedadoptGetIsExpanded
UExpandableAreaSetIsExpandedadoptSetIsExpanded
UExpandableAreaSetIsExpanded_AnimatedmapExpansionDurationA duration rather than a second function: whether an expander animates is a property of the expander, not of the caller, so every road (a click, a binding, code) gets the same open. Zero is instant, which is what every expander already authored does.
UExpandableAreaSetStyleadoptSetStyleUExpandableArea has no style setter at all (its Style is EditAnywhere only); this is the family's spelling of replacing a look at runtime.

本页目录