SCheckBox

Check box Slate control

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Input/SCheckBox.h

Include

#include "Widgets/Input/SCheckBox.h"

Syntax

class SCheckBox : public SCompoundWidget

Remarks

Check box Slate control

Variables

Name Description

Protected variable

bool

 

bCheckBoxContentUsesAutoWidth

Whether or not the checkbox content is arranged using auto-width when in checkbox mode.

Protected variable

bool

 

bIsFocusable

When true, this checkbox will be keyboard focusable. Defaults to true.

Protected variable

bool

 

bIsPressed

True if this check box is currently in a pressed state

Protected variable

TAttribute < FSl ...

 

BorderBackgroundColorOverride

Overrides border background color in the widget style, if set

Protected variable

TOptional < ESla ...

 

CheckBoxTypeOverride

Overrides checkbox type in the widget style, if set

Protected variable

const FSlateBru ...

 

CheckedHoveredImage

Image to use when the checkbox is checked and hovered

Protected variable

const FSlateBru ...

 

CheckedImage

Image to use when the checkbox is checked

Protected variable

const FSlateBru ...

 

CheckedPressedImage

Image to use when the checkbox is checked and pressed

Protected variable

FSlateSound

 

CheckedSound

The Sound to play when the check box is checked

Protected variable

EButtonClickMet ...

 

ClickMethod

Sets whether a click should be triggered on mouse down, mouse up, or that both a mouse down and up are required.

Protected variable

TSharedPtr < SBo ...

 

ContentContainer

When in toggle button mode, this will hold the pointer to the toggle button's border

Protected variable

TAttribute < FSl ...

 

ForegroundColorOverride

Overrides foreground color in the widget style, if set

Protected variable

EHorizontalAlig ...

 

HorizontalAlignment

Horiz align setting if in togglebox mode

Protected variable

FSlateSound

 

HoveredSound

The Sound to play when the check box is hovered

Protected variable

TAttribute < ECh ...

 

IsCheckboxChecked

Are we checked

Protected variable

FOnCheckStateCh ...

 

OnCheckStateChanged

Delegate called when the check box changes state

Protected variable

FOnGetContent

 

OnGetMenuContent

Delegate to execute to get the menu content of this button

Protected variable

TAttribute < FMa ...

 

PaddingOverride

Overrides padding in the widget style, if set

Protected variable

TEnumAsByte < EB ...

 

PressMethod

How should the button be clicked with keyboard/controller button events?

Protected variable

const FCheckBox ...

 

Style

Protected variable

TEnumAsByte < EB ...

 

TouchMethod

How should the button be clicked with touch events?

Protected variable

const FSlateBru ...

 

UncheckedHoveredImage

Image to use when the checkbox is unchecked and hovered

Protected variable

const FSlateBru ...

 

UncheckedImage

Image to use when the checkbox is unchecked

Protected variable

const FSlateBru ...

 

UncheckedPressedImage

Image to use when the checkbox is unchecked and pressed

Protected variable

FSlateSound

 

UncheckedSound

The Sound to play when the check box is unchecked

Protected variable

const FSlateBru ...

 

UndeterminedHoveredImage

Image to use when the checkbox is in an ambiguous state and hovered

Protected variable

const FSlateBru ...

 

UndeterminedImage

Image to use when the checkbox is in an ambiguous state

Protected variable

const FSlateBru ...

 

UndeterminedPressedImage

Image to use when the checkbox is in an ambiguous state and pressed

Constructors

Name Description

Public function

SCheckBox()

Functions

Name Description

Protected function

void

 

BuildCheckBox

(
    TSharedRef < SWidget > InContent
)

Rebuilds the checkbox based on the current ESlateCheckBoxType

Public function

void

 

Construct

(
    const FArguments & InArgs
)

Construct this widget

Protected function Const

const FSlate ...

 

GetCheckedHoveredImage()

Protected function Const

const FSlate ...

 

GetCheckedImage()

Protected function Const

const FSlate ...

 

GetCheckedPressedImage()

Public function Const

ECheckBoxSta ...

 

GetCheckedState()

Protected function Const

TEnumAsByte <...

 

GetClickMethodFromInputType

(
    const FPointerEvent & MouseEvent
)

Utility function to translate other input click methods to regular ones.

Protected function Const

const FSlate ...

 

GetUncheckedHoveredImage()

Protected function Const

const FSlate ...

 

GetUncheckedImage()

Protected function Const

const FSlate ...

 

GetUncheckedPressedImage()

Protected function Const

const FSlate ...

 

GetUndeterminedHoveredImage()

Protected function Const

const FSlate ...

 

GetUndeterminedImage()

Protected function Const

const FSlate ...

 

GetUndeterminedPressedImage()

Public function Const

bool

 

IsChecked()

Returns true if the checkbox is currently checked

Protected function Const

bool

 

IsPreciseTapOrClick

(
    const FPointerEvent & MouseEvent
)

Utility function to determine if the incoming mouse event is for a precise tap or click

Public function Const

bool

 

IsPressed()

Returns true if this button is currently pressed

Protected function Const

FSlateColor

 

OnGetBorderBackgroundColor()

Attribute getter for the border background color

Protected function Const

ESlateCheckB ...

 

OnGetCheckBoxType()

Attribute getter for the checkbox type

Protected function Const

const FSlate ...

 

OnGetCheckImage()

Gets the check image to display for the current state of the check box

Protected function Const

FSlateColor

 

OnGetForegroundColor()

Attribute getter for the foreground color

Protected function Const

FMargin

 

OnGetPadding()

Attribute getter for the padding

Protected function Const

void

 

PlayCheckedSound()

Play the checked sound

Protected function Const

void

 

PlayHoverSound()

Play the hovered sound

Protected function Const

void

 

PlayUncheckedSound()

Play the unchecked sound

Public function

void

 

SetCheckedHoveredImage

(
    const FSlateBrush * Brush
)

See the CheckedHoveredImage attribute

Public function

void

 

SetCheckedImage

(
    const FSlateBrush * Brush
)

See the CheckedImage attribute

Public function

void

 

SetCheckedPressedImage

(
    const FSlateBrush * Brush
)

See the CheckedPressedImage attribute

Public function

void

 

SetClickMethod

(
    EButtonClickMethod::Type InClickMet...
)

Public function

void

 

SetContent

(
    const TSharedRef < SWidget >& InCon...
)

See the Content slot

Public function

void

 

SetIsChecked

(
    TAttribute < ECheckBoxState > InIsCh...
)

See the IsChecked attribute

Public function

void

 

SetPressMethod

(
    EButtonPressMethod::Type InPressMet...
)

Public function

void

 

SetStyle

(
    const FCheckBoxStyle * InStyle
)

See the Style attribute

Public function

void

 

SetTouchMethod

(
    EButtonTouchMethod::Type InTouchMet...
)

Public function

void

 

SetUncheckedHoveredImage

(
    const FSlateBrush * Brush
)

See the UncheckedHoveredImage attribute

Public function

void

 

SetUncheckedImage

(
    const FSlateBrush * Brush
)

See the UncheckedImage attribute

Public function

void

 

SetUncheckedPressedImage

(
    const FSlateBrush * Brush
)

See the UncheckedPressedImage attribute

Public function

void

 

SetUndeterminedHoveredImage

(
    const FSlateBrush * Brush
)

See the UndeterminedHoveredImage attribute

Public function

void

 

SetUndeterminedImage

(
    const FSlateBrush * Brush
)

See the UndeterminedImage attribute

Public function

void

 

SetUndeterminedPressedImage

(
    const FSlateBrush * Brush
)

See the UndeterminedPressedImage attribute

Public function

void

 

ToggleCheckedState()

Toggles the checked state for this check box, fire events as needed

Overridden from SWidget

Name Description

Public function Virtual

TSharedRef < ...

 

CreateAccessibleWidget()

Public function Virtual Const

bool

 

IsInteractable()

Public function Virtual

FReply

 

OnKeyDown

(
    const FGeometry & MyGeometry,
    const FKeyEvent & InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Public function Virtual

FReply

 

OnKeyUp

(
    const FGeometry & MyGeometry,
    const FKeyEvent & InKeyEvent
)

Called after a key is released when this widget has focus

Public function Virtual

FReply

 

OnMouseButtonDoubleClick

(
    const FGeometry & InMyGeometry,
    const FPointerEvent & InMouseEvent
)

See SWidget::OnMouseButtonDoubleClick .

Public function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry & MyGeometry,
    const FPointerEvent & MouseEvent
)

See SWidget::OnMouseButtonDown .

Public function Virtual

FReply

 

OnMouseButtonUp

(
    const FGeometry & MyGeometry,
    const FPointerEvent & MouseEvent
)

See SWidget::OnMouseButtonUp .

Public function Virtual

void

 

OnMouseEnter

(
    const FGeometry & MyGeometry,
    const FPointerEvent & MouseEvent
)

The system will use this event to notify a widget that the cursor has entered it.

Public function Virtual

void

 

OnMouseLeave

(
    const FPointerEvent & MouseEvent
)

The system will use this event to notify a widget that the cursor has left it.

Public function Virtual Const

bool

 

SupportsKeyboardFocus()

See SWidget::SupportsKeyboardFocus() .

Classes

Name

Description

Public struct

FArguments

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback