26template<
typename OptionType >
105 return _Tooltip.
Get();
182 , CurrentValues(*this)
187 check(InArgs._Style);
189 Style = InArgs._Style;
190 TextStyle = InArgs._TextStyle;
192 SupportsMultiSelection = InArgs._SupportsMultiSelection;
193 SupportsEmptySelection = InArgs._SupportsEmptySelection;
194 CurrentValuesIsBound =
false;
196 if(InArgs._Value.IsBound() || InArgs._Value.IsSet())
200 else if(InArgs._Values.IsBound() || InArgs._Values.IsSet())
205 OnValueChanged = InArgs._OnValueChanged;
206 OnValuesChanged = InArgs._OnValuesChanged;
207 OnValueChecked = InArgs._OnValueChecked;
209 UniformPadding = InArgs._UniformPadding;
211 MaxSegmentsPerLine = InArgs._MaxSegmentsPerLine;
220 SlotPadding.
Right = 0.0f;
225 for (
int32 SlotIndex = 0; SlotIndex <
NumSlots; ++SlotIndex )
266 .TextStyle(TextStyle)
281 const int32 ColumnIndex = MaxSegmentsPerLine > 0 ? SlotIndex % MaxSegmentsPerLine : SlotIndex;
282 const int32 RowIndex = MaxSegmentsPerLine > 0 ? SlotIndex / MaxSegmentsPerLine : 0;
293 .Style(CheckBoxStyle)
294 .IsChecked(GetCheckBoxStateAttribute(
ChildValue))
295 .OnCheckStateChanged(
this, &SSegmentedControl::CommitValue,
ChildValue)
296 .Padding(UniformPadding)
313 UpdateCheckboxValuesIfNeeded();
339 return Children.
Num();
354 return CurrentValues.Get();
389 CurrentValuesIsBound =
InValues.IsBound();
391 if(CurrentValuesIsBound)
393 CurrentValues.Assign(*
this,
InValues);
397 CurrentValues.Set(*
this,
InValues.Get());
401 CurrentValues.Unbind(*
this);
406 UpdateCheckboxValuesIfNeeded();
423 .OnValuesChanged(OnValuesChanged);
435 Widget->RebuildChildren();
444 auto Lambda = [
this,
InValue]()
450 if (CurrentValuesIsBound)
458 void UpdateCheckboxValuesIfNeeded()
460 if (!CurrentValuesIsBound)
483 if(!SupportsEmptySelection)
485 UpdateCheckboxValuesIfNeeded();
491 if(SupportsMultiSelection)
519 if (!CurrentValuesIsBound)
521 CurrentValues.Set(*
this, Values);
523 UpdateCheckboxValuesIfNeeded();
526 if(OnValueChecked.IsBound())
544 OnValueChanged.ExecuteIfBound(
InValue);
547 OnValuesChanged.ExecuteIfBound(Values);
565 int32 MaxSegmentsPerLine = 0;
567 bool CurrentValuesIsBound =
false;
568 bool SupportsMultiSelection =
false;
569 bool SupportsEmptySelection =
false;
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
decltype(auto) MakeAttributeLambda(LambdaType &&InCallable, PayloadTypes &&... InputPayload)
Definition Attribute.h:545
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SLATE_STYLE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:280
#define SAssignNew(ExposeAs, WidgetType,...)
Definition DeclarativeSyntaxSupport.h:41
#define SLATE_SLOT_ARGUMENT(SlotType, SlotName)
Definition DeclarativeSyntaxSupport.h:348
#define SNew(WidgetType,...)
Definition DeclarativeSyntaxSupport.h:37
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_SLOT_END_ARGS()
Definition DeclarativeSyntaxSupport.h:386
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
UE::Math::TVector2< double > FVector2D
Definition MathFwd.h:48
ECheckBoxState
Definition SlateTypes.h:65
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition ChildrenBase.h:27
bool IsControlDown() const
Definition GenericApplication.h:158
bool IsShiftDown() const
Definition GenericApplication.h:128
static FSlateApplication & Get()
Definition SlateApplication.h:319
SLATE_API FModifierKeysState GetModifierKeys() const
Definition SlateApplication.cpp:3166
Definition SCheckBox.h:30
Definition SBoxPanel.h:171
static FSlot::FSlotArguments Slot()
Definition SBoxPanel.h:272
Definition SSegmentedControl.h:28
DECLARE_DELEGATE_OneParam(FOnValueChanged, OptionType)
void RebuildChildren()
Definition SSegmentedControl.h:216
SLATE_BEGIN_ARGS(SSegmentedControl< OptionType >)
Definition SSegmentedControl.h:129
DECLARE_DELEGATE_OneParam(FOnValuesChanged, TArray< OptionType >)
typename TPanelChildren< FSlot >::FScopedWidgetSlotArguments FScopedWidgetSlotArguments
Definition SSegmentedControl.h:317
OptionType GetValue() const
Definition SSegmentedControl.h:342
void Construct(const FArguments &InArgs)
Definition SSegmentedControl.h:185
void SetValues(TAttribute< TArray< OptionType > > InValues, bool bUpdateChildren=true)
Definition SSegmentedControl.h:387
FScopedWidgetSlotArguments AddSlot(const OptionType &InValue, bool bRebuildChildren=true)
Definition SSegmentedControl.h:318
static TSharedPtr< SSegmentedControl< OptionType > > Create(const TArray< OptionType > &InKeys, const TArray< FText > &InLabels, const TArray< FText > &InTooltips, const TAttribute< TArray< OptionType > > &InValues, bool bSupportsMultiSelection=true, FOnValuesChanged OnValuesChanged=FOnValuesChanged())
Definition SSegmentedControl.h:410
TArray< OptionType > GetValues() const
Definition SSegmentedControl.h:352
static FSlot::FSlotArguments Slot(const OptionType &InValue)
Definition SSegmentedControl.h:120
DECLARE_DELEGATE_TwoParams(FOnValueChecked, OptionType, ECheckBoxState)
int32 NumSlots() const
Definition SSegmentedControl.h:337
void SetValue(TAttribute< OptionType > InValue, bool bUpdateChildren=true)
Definition SSegmentedControl.h:364
bool HasValue(OptionType InValue)
Definition SSegmentedControl.h:357
Definition STextBlock.h:45
SizeType Remove(const ElementType &Item)
Definition Array.h:3091
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
bool Contains(const ComparisonType &Item) const
Definition Array.h:1518
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_FORCEINLINE_HINT SizeType AddUnique(ElementType &&Item)
Definition Array.h:2993
Definition Attribute.h:17
const ObjectType & Get() const
Definition Attribute.h:241
Definition Children.h:461
void AddSlots(TArray< typename SlotType::FSlotArguments > SlotArguments)
Definition Children.h:515
virtual int32 Num() const override
Definition Children.h:485
TWeakPtr< SWidget, Mode > AsWeak()
Definition SharedPointer.h:1718
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis(OtherType *ThisPtr)
Definition SharedPointer.h:1780
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SlotBase.h:122
void Construct(const FChildren &SlotOwner, FSlotArguments &&InArgs)
Definition SlotBase.h:212
Definition SharedPointer.h:1295
UE_FORCEINLINE_HINT TSharedPtr< ObjectType, Mode > Pin() const &
Definition SharedPointer.h:1512
int32 CheckBox
Definition BoundingVolumeHierarchy.cpp:270
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition SlateTypes.h:105
float Right
Definition Margin.h:30
Definition SegmentedControlStyle.h:16
FCheckBoxStyle FirstControlStyle
Definition SegmentedControlStyle.h:41
FCheckBoxStyle ControlStyle
Definition SegmentedControlStyle.h:34
FCheckBoxStyle LastControlStyle
Definition SegmentedControlStyle.h:48
FSlateBrush BackgroundBrush
Definition SegmentedControlStyle.h:53
FMargin UniformPadding
Definition SegmentedControlStyle.h:60
Definition SlateBrush.h:239
static FSlateColor UseForeground()
Definition SlateColor.h:198
Definition SlateTypes.h:326
Definition SSegmentedControl.h:34
const FSlateBrush * GetIcon() const
Definition SSegmentedControl.h:93
void SetIcon(TAttribute< const FSlateBrush * > InBrush)
Definition SSegmentedControl.h:88
FText GetToolTip() const
Definition SSegmentedControl.h:103
FText GetText() const
Definition SSegmentedControl.h:83
SLATE_SLOT_BEGIN_ARGS_OneMixin(FSlot, TSlotBase< FSlot >, TAlignmentWidgetSlotMixin< FSlot >) void Construct(const FChildren &SlotOwner
void SetText(TAttribute< FText > InText)
Definition SSegmentedControl.h:78
FSlotArguments && InArgs
Definition SSegmentedControl.h:53
FSlot(const OptionType &InValue)
Definition SSegmentedControl.h:35
void SetToolTip(TAttribute< FText > InTooltip)
Definition SSegmentedControl.h:98
Definition Optional.h:131
static CORE_API const TVector2< double > ZeroVector
Definition Vector2D.h:63
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79