Navigation
API > API/Runtime > API/Runtime/SlateCore
A Panel arranges its child widgets on the screen.
Each child widget should be stored in a Slot. The Slot describes how the individual child should be arranged with respect to its parent (i.e. the Panel) and its peers Widgets (i.e. the Panel's other children.) For a simple example see StackPanel.
| Name | SPanel |
| Type | class |
| Header File | /Engine/Source/Runtime/SlateCore/Public/Widgets/SPanel.h |
| Include Path | #include "Widgets/SPanel.h" |
Syntax
class SPanel : public SWidget
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SPanel
- FSlateControlledConstruction → SWidget → SPanel
Derived Classes
SPanel derived class hierarchy
- SBox
- SBoxPanel
- SCanvas
- SCompoundTrackLaneView
- SConstraintCanvas
- SDPIScaler
- SGridPanel
- SMenuAnchor
- SOverlay
- SRadialBox
- SResponsiveGridPanel
- SScissorRectBox
- SScrollBarTrack
- SScrollPanel
- SSplitter
- SSplitter2x2
- SThemeColorBlocksBar
- STooltipPresenter
- STrackAreaView
- STrackLane
- SUniformGridPanel
- SUniformWrapPanel
- SWidgetSwitcher
- SWindowTitleBarArea
- SWrapBox
- SNodePanel::SNode
- SDepthBar
- SNodePanel
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SPanel() |
Hidden default constructor. | Widgets/SPanel.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~SPanel() |
Widgets/SPanel.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Construct() |
Most panels do not create widgets as part of their implementation, so they do not need to implement a Construct() | Widgets/SPanel.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FVector2D ComputeDesiredSize
(
float |
A Panel's desired size in the space required to arrange of its children on the screen while respecting all of the children's desired sizes and any layout-related options specified by the user. | Widgets/SPanel.h | |
FChildren * GetChildren () |
All widgets must provide a way to access their children in a layout-agnostic way. | Widgets/SPanel.h | |
void OnArrangeChildren
(
const FGeometry& AllottedGeometry, |
Panels arrange their children in a space described by the AllottedGeometry parameter. | Widgets/SPanel.h | |
virtual int32 OnPaint
(
const FPaintArgs& Args, |
The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children. | Widgets/SPanel.h | |
virtual void SetVisibility
(
TAttribute< EVisibility > InVisibility |
Widgets/SPanel.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 PaintArrangedChildren
(
const FPaintArgs& Args, |
Just like OnPaint, but takes already arranged children. Can be handy for writing custom SPanels. | Widgets/SPanel.h |