SPanel

A Panel arranges its child widgets on the screen.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Widgets/SPanel.h

Include

#include "Widgets/SPanel.h"

Syntax

class SPanel : public SWidget

Remarks

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.

Constructors

Name Description

Protected function

SPanel()

Hidden default constructor.

Functions

Name Description

Public function

void

 

Construct()

Most panels do not create widgets as part of their implementation, so they do not need to implement a Construct()

Protected function Const

int32

 

PaintArrangedChildren

(
    const FPaintArgs& Args,
    const FArrangedChildren& ArrangedC...,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

Just like OnPaint, but takes already arranged children. Can be handy for writing custom SPanels.

Overridden from SWidget

Name Description

Public function Const

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.

Public function

FChildren &#...

 

GetChildren()

All widgets must provide a way to access their children in a layout-agnostic way.

Public function Const

void

 

OnArrangeChildren

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildre...
)

Panels arrange their children in a space described by the AllottedGeometry parameter.

Public function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children.

Public function Virtual

void

 

SetVisibility

(
    TAttribute< EVisibility > InVisibil...
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss