Files
UnrealEngineUWP/Engine/Source/Editor/MovieSceneTools/Public/FrameNumberDetailsCustomization.h
aurel cordonnier 1ee4eed9aa Merge from Release-Engine-Test @ 17666640 to UE5/Main
This represents UE4/Main @17638339 and Dev-PerfTest @17636504

[CL 17668579 by aurel cordonnier in ue5-main branch]
2021-09-29 17:45:16 -04:00

47 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "IPropertyTypeCustomization.h"
#include "Widgets/Input/NumericTypeInterface.h"
class IDetailLayoutBuilder;
/**
* Customize the FFrameNumber to support conversion from seconds/frames/timecode formats.
*/
class MOVIESCENETOOLS_API FFrameNumberDetailsCustomization : public IPropertyTypeCustomization
{
public:
static TSharedRef<IPropertyTypeCustomization> MakeInstance(TSharedPtr<INumericTypeInterface<double>> InNumericTypeInterface)
{
return MakeShared<FFrameNumberDetailsCustomization>(InNumericTypeInterface);
}
FFrameNumberDetailsCustomization(TSharedPtr<INumericTypeInterface<double>> InNumericTypeInterface)
{
NumericTypeInterface = InNumericTypeInterface;
}
/** IPropertyTypeCustomization interface */
virtual void CustomizeHeader(TSharedRef<IPropertyHandle> PropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& CustomizationUtils) override {}
virtual void CustomizeChildren(TSharedRef<IPropertyHandle> PropertyHandle, IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils) override;
private:
FText OnGetTimeText() const;
FText OnGetTimeToolTipText() const;
void OnTimeTextCommitted(const FText& InText, ETextCommit::Type CommitInfo);
/** The Numeric Type interface used to convert between display formats and internal tick resolution. */
TSharedPtr<INumericTypeInterface<double>> NumericTypeInterface;
/** Store the property handle to the FrameNumber field so we can get/set the value on the object via text box callbacks. */
TSharedPtr<IPropertyHandle> FrameNumberProperty;
/** If they've used the UIMin metadata on the FFrameNumber property, we store that for use via text box callbacks. */
int32 UIClampMin;
/** If they've used the UIMax metadata on the FFrameNumber property, we store that for use via text box callbacks. */
int32 UIClampMax;
};