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
| Name | Type | Category | In the details panel | From Blueprint | Description |
|---|---|---|---|---|---|
Style | FDreamExpandableAreaStyle | Expandable Area | 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. |
Label | FText | Expandable Area | yes | GetLabel / SetLabel | The words on the header. |
bIsExpanded | bool | Expandable Area | yes | GetIsExpanded / SetIsExpanded | Whether 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. |
MaxHeight | float | Expandable Area | yes | GetMaxHeight / SetMaxHeight | A ceiling on the CONTENT's share of the control's height, in local units -- UMG's MaxHeight. |
ExpansionDuration | float | Expandable Area | yes | GetExpansionDuration / SetExpansionDuration | How long the open and close take, in seconds. Zero (the default) is instant. |
RootNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | |
HeaderNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | The 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. |
HeaderRowNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | The indicator-and-label row inside the header. See the tree comment for why it is its own node. |
ArrowNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | The built-in glyph indicator. Asleep whenever the state's brush carries an image instead. |
ArrowMarkNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | The image indicator, the glyph's stand-in. Exactly one of the two is awake. |
LabelNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | |
ContentNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | Where a consumer's content lives, and the node that is switched off when collapsed. |
HeaderBehaviour | TObjectPtr<UUIButton> | Expandable Area | - | read only | |
HeaderSlotNode | TObjectPtr<UDreamWidget> | Expandable Area | - | read only | The header's hole, in the stock label's place. Empty is the normal state. |
Functions
| Function | Kind | Description |
|---|---|---|
UDreamWidget* GetContent() | pure | The first widget in the content column, or null while it is empty. |
float GetExpansionDuration() | pure | Get Expansion Duration |
bool GetIsExpanded() | pure | Get Is Expanded |
FText GetLabel() | pure | Get Label |
float GetMaxHeight() | pure | Get Max Height |
FDreamExpandableAreaStyle GetStyle() | pure | Get Style |
void SetContent(UDreamWidget* InContent) | callable | Put InContent in the content column, taking it from wherever it currently hangs. |
void SetExpansionDuration(float InExpansionDuration) | callable | How 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) | callable | Silent when the flag does not move; otherwise pushes the visuals and broadcasts both events. |
void SetLabel(FText InLabel) | callable | The words on the header, written through to the label the control owns. |
void SetMaxHeight(float InMaxHeight) | callable | Re-measures at once: the ceiling is part of the height this control claims. |
void SetStyle(FDreamExpandableAreaStyle InStyle) | callable | This instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat. |
void ToggleExpansion() | callable | What the header click does, callable without a pointer. |
Events
| Event | Signature | Description |
|---|---|---|
OnExpansionChanged | void DreamExpandableAreaExpansionChangedEvent__DelegateSignature(bool bIsExpanded) | Fired whenever the expanded flag moves, from a click or from code. |
OnValueChangedBP | void 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.
| UMG | Member | Status | Here | Note |
|---|---|---|---|---|
UExpandableArea | Style | adopt | Style | FDreamExpandableAreaStyle: the header's height, its five state colours, the label, and the content area's background and padding. |
UExpandableArea | BorderBrush | map | FDreamExpandableAreaStyle::ContentBackground | A 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. |
UExpandableArea | BorderColor | map | FDreamExpandableAreaStyle::ContentBackground | One 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. |
UExpandableArea | bIsExpanded | adopt | bIsExpanded | Authored open or closed; every road that CHANGES it goes through SetIsExpanded, which is what broadcasts. |
UExpandableArea | MaxHeight | adopt | MaxHeight | Zero is no ceiling, which is what this control has always done. |
UExpandableArea | HeaderPadding | map | FDreamExpandableAreaStyle::HeaderPadding | In the style, because how a project's section headers are inset is a theme decision. |
UExpandableArea | AreaPadding | map | FDreamExpandableAreaStyle::ContentPadding | Named for what it pads rather than for the widget it sits on. |
UExpandableArea | OnExpansionChanged | adopt | OnExpansionChanged | Fires from a click and from code alike. |
UExpandableArea | GetIsExpanded | adopt | GetIsExpanded | |
UExpandableArea | SetIsExpanded | adopt | SetIsExpanded | |
UExpandableArea | SetIsExpanded_Animated | map | ExpansionDuration | A 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. |
UExpandableArea | SetStyle | adopt | SetStyle | UExpandableArea has no style setter at all (its Style is EditAnywhere only); this is the family's spelling of replacing a look at runtime. |