// Copyright 2023 MrRobin. All Rights Reserved. #pragma once #include "IPropertyTypeCustomization.h" #include "Internationalization/Text.h" #include "Styling/SlateColor.h" #include "Templates/SharedPointer.h" #include "Types/SlateEnums.h" class IPropertyHandle; class SEditableTextBox; /** * Implements a details view customization for the FDateTime structure. */ class FMyDateTimeDetailCustomization : public IPropertyTypeCustomization { public: public: /** * Creates an instance of this class. * * @return The new instance. */ static TSharedRef MakeInstance() { return MakeShareable(new FMyDateTimeDetailCustomization()); } public: // IPropertyTypeCustomization interface void CustomizeChildren(TSharedRef StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; void CustomizeHeader(TSharedRef StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override; private: TOptional OnGetValue(int32 Index) const; void OnValueCommitted(double NewValue, ETextCommit::Type CommitType, int32 Index); void OnValueChanged(double NewValue, int32 Index); void OnBeginSliderMovement(); void OnEndSliderMovement(double NewValue); private: /** Holds a handle to the property being edited. */ TSharedPtr PropertyHandle; /** True if a value is being changed by dragging a slider */ bool bIsUsingSlider; TSharedPtr YearEntryBox; TSharedPtr MonthEntryBox; TSharedPtr DayEntryBox; TSharedPtr HourEntryBox; TSharedPtr MinuteEntryBox; TSharedPtr SecondEntryBox; };