Space Plunder
Loading...
Searching...
No Matches
UCommonCheckbox Class Reference

#include <CommonCheckbox.h>

Inheritance diagram for UCommonCheckbox:
UCommonWidgetBase

Public Member Functions

bool GetIsChecked () const
 
void SetIsChecked (const bool bValue)
 
- Public Member Functions inherited from UCommonWidgetBase
void PlaySlateSound (const FSlateSound &SlateSound) const
 

Public Attributes

bool bShowTitle = true
 
FText Title = FText::FromString("Title Text")
 

Protected Member Functions

virtual bool Initialize () override
 
virtual void NativePreConstruct () override
 
virtual void NativeConstruct () override
 
virtual void Setup () override
 
- Protected Member Functions inherited from UCommonWidgetBase
void LogDebugError (const FString &Message) const
 
void LogDebugError (const FString &Message, const int32 Value) const
 
void LogDebugError (const FString &Message, const float Value) const
 
void LogDebugWarning (const FString &Message) const
 
void LogDebugWarning (const FString &Message, const int32 Value) const
 
void LogDebugWarning (const FString &Message, const float Value) const
 
void LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const int32 Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const float Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const bool bValue, const bool bWarning, const bool bError) const
 
void LogOnScreenMessage (const int32 Key, const FString &Message, FColor Color=FColor::Green) const
 
void SetCategoryName (const FLogCategoryBase &Category)
 

Protected Attributes

UCheckBox * Checkbox = nullptr
 
UTextBlock * TitleTextBlock = nullptr
 
- Protected Attributes inherited from UCommonWidgetBase
bool bDebuggingMode = false
 

Private Member Functions

void OnCheckStateChanged (const bool bValue)
 

Private Attributes

bool bChecked = false
 

Member Function Documentation

◆ GetIsChecked()

bool UCommonCheckbox::GetIsChecked ( ) const
inline
30{return bChecked;};
bool bChecked
Definition CommonCheckbox.h:49

◆ Initialize()

bool UCommonCheckbox::Initialize ( )
overrideprotectedvirtual
15{
16 const bool Success = Super::Initialize();
17 if(!Success) return false;
18 if (!ensure(Checkbox != nullptr)) return false;
19 if (!ensure(TitleTextBlock != nullptr)) return false;
20 Checkbox->OnCheckStateChanged.AddDynamic(this, &UCommonCheckbox::OnCheckStateChanged);
21 return true;
22}
UTextBlock * TitleTextBlock
Definition CommonCheckbox.h:45
void OnCheckStateChanged(const bool bValue)
Definition CommonCheckbox.cpp:45
UCheckBox * Checkbox
Definition CommonCheckbox.h:43

◆ NativeConstruct()

void UCommonCheckbox::NativeConstruct ( )
overrideprotectedvirtual

Reimplemented from UCommonWidgetBase.

30{
31 Super::NativeConstruct();
32 if(Title.IsEmpty())
33 {
34 TitleTextBlock->SetVisibility(ESlateVisibility::Collapsed);
35 }
36}
FText Title
Definition CommonCheckbox.h:28

◆ NativePreConstruct()

void UCommonCheckbox::NativePreConstruct ( )
overrideprotectedvirtual

Reimplemented from UCommonWidgetBase.

25{
26 Super::NativePreConstruct();
27}

◆ OnCheckStateChanged()

void UCommonCheckbox::OnCheckStateChanged ( const bool bValue)
private
46{
47 bChecked = bValue;
48}

◆ SetIsChecked()

void UCommonCheckbox::SetIsChecked ( const bool bValue)
10{
11 Checkbox->SetIsChecked(bValue);
12}

◆ Setup()

void UCommonCheckbox::Setup ( )
overrideprotectedvirtual

Reimplemented from UCommonWidgetBase.

39{
40 Super::Setup();
41 // ToggleWidgetVisibility(TitleTextBlock, bShowTitle);
42 TitleTextBlock->SetText(Title);
43}

Member Data Documentation

◆ bChecked

bool UCommonCheckbox::bChecked = false
private

◆ bShowTitle

bool UCommonCheckbox::bShowTitle = true

◆ Checkbox

UCheckBox* UCommonCheckbox::Checkbox = nullptr
protected

◆ Title

FText UCommonCheckbox::Title = FText::FromString("Title Text")

◆ TitleTextBlock

UTextBlock* UCommonCheckbox::TitleTextBlock = nullptr
protected

The documentation for this class was generated from the following files: