本文整理汇总了C++中TSharedRef::GetChildHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedRef::GetChildHandle方法的具体用法?C++ TSharedRef::GetChildHandle怎么用?C++ TSharedRef::GetChildHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedRef
的用法示例。
在下文中一共展示了TSharedRef::GetChildHandle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CustomizeStructChildren
void FLandscapeEditorStructCustomization_FGizmoImportLayer::CustomizeStructChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IStructCustomizationUtils& StructCustomizationUtils)
{
TSharedRef<IPropertyHandle> PropertyHandle_LayerFilename = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FGizmoImportLayer, LayerFilename)).ToSharedRef();
ChildBuilder.AddChildProperty(PropertyHandle_LayerFilename)
.CustomWidget()
.NameContent()
[
PropertyHandle_LayerFilename->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(250.0f)
.MaxDesiredWidth(0)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
[
PropertyHandle_LayerFilename->CreatePropertyValueWidget()
]
+ SHorizontalBox::Slot()
.AutoWidth()
//.Padding(0,0,12,0) // Line up with the other properties due to having no reset to default button
[
SNew(SButton)
.ContentPadding(FMargin(4, 0))
.Text(NSLOCTEXT("UnrealEd", "GenericOpenDialog", "..."))
.OnClicked_Static(&FLandscapeEditorStructCustomization_FGizmoImportLayer::OnGizmoImportLayerFilenameButtonClicked, PropertyHandle_LayerFilename)
]
];
TSharedRef<IPropertyHandle> PropertyHandle_LayerName = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FGizmoImportLayer, LayerName)).ToSharedRef();
ChildBuilder.AddChildProperty(PropertyHandle_LayerName);
}
示例2: CustomizeChildren
void FCinematicOptionsCustomization::CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
{
bPlayMatinee = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBTDialogueCinematicOptions, bPlayMatinee));
bLoop = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBTDialogueCinematicOptions, bLoop));
Matinee = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBTDialogueCinematicOptions, Matinee));
ChildBuilder.AddChildProperty(StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBTDialogueCinematicOptions, bPlayMatinee)).ToSharedRef());
ChildBuilder.AddChildProperty(StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBTDialogueCinematicOptions, bLoop)).ToSharedRef());
ChildBuilder.AddChildContent(LOCTEXT("Matinee", "Matinee"))
.NameContent()
[
Matinee->CreatePropertyNameWidget()
]
.ValueContent()
.HAlign(HAlign_Fill)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.MaxWidth(109.0f)
[
SNew(SComboButton)
.OnGetMenuContent(this, &FCinematicOptionsCustomization::OnGetMatineeList)
.ContentPadding(FMargin(2.0f, 2.0f))
.ButtonContent()
[
SNew(STextBlock)
.Text(this, &FCinematicOptionsCustomization::GetCurrentMatineeName)
.Font(IDetailLayoutBuilder::GetDetailFont())
]
]
];
}
示例3: CustomizeChildren
void FStreamingLevelDetailsCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle,
class IDetailChildrenBuilder& ChildBuilder,
IPropertyTypeCustomizationUtils& StructCustomizationUtils )
{
TSharedPtr<IPropertyHandle> StreamingModeProperty = StructPropertyHandle->GetChildHandle(TEXT("StreamingMode"));
TSharedPtr<IPropertyHandle> PackageNameProperty = StructPropertyHandle->GetChildHandle(TEXT("PackageName"));
ChildBuilder.AddChildProperty(StreamingModeProperty.ToSharedRef());
ChildBuilder.AddChildProperty(PackageNameProperty.ToSharedRef())
.CustomWidget()
.NameContent()
[
PackageNameProperty->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(LevelPackageWidgetMinDesiredWidth)
[
SNew(SPropertyEditorLevelPackage, PackageNameProperty)
.RootPath(GetWorldRoot(WorldModel))
.SortAlphabetically(true)
.OnShouldFilterPackage(this, &FStreamingLevelDetailsCustomization::OnShouldFilterStreamingPackage)
];
}
示例4: OnGenerateScalarConstantEntry
void FNiagaraEmitterPropertiesDetails::OnGenerateScalarConstantEntry(TSharedRef<IPropertyHandle> ElementProperty, int32 ElementIndex, IDetailChildrenBuilder& ChildrenBuilder)
{
TSharedPtr<IPropertyHandle> ValueProperty = ElementProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraConstants_Float, Value));
TSharedPtr<IPropertyHandle> NameProperty = ElementProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraConstants_Float, Name));
FName DisplayName;
NameProperty->GetValue(DisplayName);
//Don't display system constants
if (UNiagaraComponent::GetSystemConstants().Find(FNiagaraVariableInfo(DisplayName, ENiagaraDataType::Scalar)) == INDEX_NONE)
{
ChildrenBuilder.AddChildProperty(ValueProperty.ToSharedRef()).DisplayName(FText::FromName(DisplayName));
}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:13,代码来源:NiagaraEmitterPropertiesDetailsCustomization.cpp
示例5: CustomizeChildren
void FInputAxisMappingCustomization::CustomizeChildren( TSharedRef<class IPropertyHandle> InStructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils )
{
TSharedPtr<IPropertyHandle> KeyHandle = InStructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FInputAxisKeyMapping, Key));
TSharedPtr<IPropertyHandle> ScaleHandle = InStructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FInputAxisKeyMapping, Scale));
TSharedRef<SWidget> RemoveButton = PropertyCustomizationHelpers::MakeDeleteButton( FSimpleDelegate::CreateSP( this, &FInputAxisMappingCustomization::RemoveAxisMappingButton_OnClick),
LOCTEXT("RemoveAxisMappingToolTip", "Removes Axis Mapping") );
StructBuilder.AddChildContent( LOCTEXT("KeySearchStr", "Key").ToString() )
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.Padding(InputConstants::PropertyPadding)
.AutoWidth()
[
SNew( SBox )
.WidthOverride( InputConstants::TextBoxWidth )
[
StructBuilder.GenerateStructValueWidget( KeyHandle.ToSharedRef() )
]
]
+SHorizontalBox::Slot()
.Padding(InputConstants::PropertyPadding)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
.AutoWidth()
[
ScaleHandle->CreatePropertyNameWidget()
]
+SHorizontalBox::Slot()
.Padding(InputConstants::PropertyPadding)
.HAlign(HAlign_Left)
.VAlign(VAlign_Center)
.AutoWidth()
[
SNew(SBox)
.WidthOverride(InputConstants::ScaleBoxWidth)
[
ScaleHandle->CreatePropertyValueWidget()
]
]
+SHorizontalBox::Slot()
.Padding(InputConstants::PropertyPadding)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
.AutoWidth()
[
RemoveButton
]
];
}
示例6: BuildScriptProperties
void FNiagaraEmitterPropertiesDetails::BuildScriptProperties(TSharedRef<IPropertyHandle> ScriptPropsHandle, FName Name, FText DisplayName)
{
DetailLayout->HideProperty(ScriptPropsHandle);
IDetailCategoryBuilder& ScriptCategory = DetailLayout->EditCategory(Name, DisplayName);
//Script
TSharedPtr<IPropertyHandle> ScriptHandle = ScriptPropsHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraEmitterScriptProperties, Script));
ScriptCategory.AddProperty(ScriptHandle);
//Constants
bool bGenerateHeader = false;
bool bDisplayResetToDefault = false;
TSharedPtr<IPropertyHandle> Constants = ScriptPropsHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraEmitterScriptProperties, ExternalConstants));
DetailLayout->HideProperty(Constants);
//Scalar Constants.
TSharedPtr<IPropertyHandle> ScalarConstants = Constants->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraConstants, ScalarConstants));
TSharedRef<FDetailArrayBuilder> ScalarConstantsBuilder = MakeShareable(new FDetailArrayBuilder(ScalarConstants.ToSharedRef(), bGenerateHeader, bDisplayResetToDefault));
ScalarConstantsBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FNiagaraEmitterPropertiesDetails::OnGenerateScalarConstantEntry));
ScriptCategory.AddCustomBuilder(ScalarConstantsBuilder);
//Vector Constants.
TSharedPtr<IPropertyHandle> VectorConstants = Constants->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraConstants, VectorConstants));
TSharedRef<FDetailArrayBuilder> VectorConstantsBuilder = MakeShareable(new FDetailArrayBuilder(VectorConstants.ToSharedRef(), bGenerateHeader, bDisplayResetToDefault));
VectorConstantsBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FNiagaraEmitterPropertiesDetails::OnGenerateVectorConstantEntry));
ScriptCategory.AddCustomBuilder(VectorConstantsBuilder);
//Matrix Constants.
TSharedPtr<IPropertyHandle> MatrixConstants = Constants->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraConstants, MatrixConstants));
TSharedRef<FDetailArrayBuilder> MatrixConstantsBuilder = MakeShareable(new FDetailArrayBuilder(MatrixConstants.ToSharedRef(), bGenerateHeader, bDisplayResetToDefault));
MatrixConstantsBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FNiagaraEmitterPropertiesDetails::OnGenerateMatrixConstantEntry));
ScriptCategory.AddCustomBuilder(MatrixConstantsBuilder);
//DataObject Constants.
TSharedPtr<IPropertyHandle> DataObjectConstants = Constants->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraConstants, DataObjectConstants));
TSharedRef<FDetailArrayBuilder> DataObjectConstantsBuilder = MakeShareable(new FDetailArrayBuilder(DataObjectConstants.ToSharedRef(), bGenerateHeader, bDisplayResetToDefault));
DataObjectConstantsBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FNiagaraEmitterPropertiesDetails::OnGenerateDataObjectConstantEntry));
ScriptCategory.AddCustomBuilder(DataObjectConstantsBuilder);
//Events
bGenerateHeader = true;
//Generators
TSharedPtr<IPropertyHandle> EventGenerators = ScriptPropsHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraEmitterScriptProperties, EventGenerators));
TSharedRef<FDetailArrayBuilder> EventGeneratorsBuilder = MakeShareable(new FDetailArrayBuilder(EventGenerators.ToSharedRef(), bGenerateHeader, bDisplayResetToDefault));
EventGeneratorsBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FNiagaraEmitterPropertiesDetails::OnGenerateEventGeneratorEntry));
ScriptCategory.AddCustomBuilder(EventGeneratorsBuilder);
//Receivers
TSharedPtr<IPropertyHandle> EventReceivers = ScriptPropsHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraEmitterScriptProperties, EventReceivers));
TSharedRef<FDetailArrayBuilder> EventReceiversBuilder = MakeShareable(new FDetailArrayBuilder(EventReceivers.ToSharedRef(), bGenerateHeader, bDisplayResetToDefault));
EventReceiversBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FNiagaraEmitterPropertiesDetails::OnGenerateEventReceiverEntry));
ScriptCategory.AddCustomBuilder(EventReceiversBuilder);
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:50,代码来源:NiagaraEmitterPropertiesDetailsCustomization.cpp
示例7: AddRangePropertyRow
void UAnimGraphNode_BoneDrivenController::AddRangePropertyRow(const FText& Name, const FText& Tooltip, IDetailCategoryBuilder& Category, TSharedRef<IPropertyHandle> PropertyHandle, const FName MinPropertyName, const FName MaxPropertyName, TAttribute<EVisibility> VisibilityAttribute)
{
const float MiddlePadding = 4.0f;
TSharedPtr<IPropertyHandle> MinProperty = PropertyHandle->GetChildHandle(MinPropertyName);
Category.GetParentLayout().HideProperty(MinProperty);
TSharedPtr<IPropertyHandle> MaxProperty = PropertyHandle->GetChildHandle(MaxPropertyName);
Category.GetParentLayout().HideProperty(MaxProperty);
Category.AddCustomRow(Name)
.Visibility(VisibilityAttribute)
.NameContent()
[
SNew(STextBlock)
.Text(Name)
.ToolTipText(Tooltip)
.Font(IDetailLayoutBuilder::GetDetailFont())
]
.ValueContent()
.MinDesiredWidth(100.0f * 2.0f)
.MaxDesiredWidth(100.0f * 2.0f)
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.FillWidth(1)
.Padding(0.0f, 0.0f, MiddlePadding, 0.0f)
.VAlign(VAlign_Center)
[
MinProperty->CreatePropertyValueWidget()
]
+SHorizontalBox::Slot()
.AutoWidth()
[
SNew(STextBlock)
.Text(LOCTEXT("MinMaxSpacer", ".."))
.Font(IDetailLayoutBuilder::GetDetailFont())
]
+SHorizontalBox::Slot()
.FillWidth(1)
.Padding(MiddlePadding, 0.0f, 0.0f, 0.0f)
.VAlign(VAlign_Center)
[
MaxProperty->CreatePropertyValueWidget()
]
];
}
示例8: CustomizeChildren
void FCameraLensSettingsCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
{
// Retrieve structure's child properties
uint32 NumChildren;
StructPropertyHandle->GetNumChildren(NumChildren);
TMap<FName, TSharedPtr< IPropertyHandle > > PropertyHandles;
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
{
TSharedRef<IPropertyHandle> ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex).ToSharedRef();
const FName PropertyName = ChildHandle->GetProperty()->GetFName();
PropertyHandles.Add(PropertyName, ChildHandle);
}
// Retrieve special case properties
MinFocalLengthHandle = PropertyHandles.FindChecked(GET_MEMBER_NAME_CHECKED(FCameraLensSettings, MinFocalLength));
MaxFocalLengthHandle = PropertyHandles.FindChecked(GET_MEMBER_NAME_CHECKED(FCameraLensSettings, MaxFocalLength));
MinFStopHandle = PropertyHandles.FindChecked(GET_MEMBER_NAME_CHECKED(FCameraLensSettings, MinFStop));
MaxFStopHandle = PropertyHandles.FindChecked(GET_MEMBER_NAME_CHECKED(FCameraLensSettings, MaxFStop));
MinFocusDistanceHandle = PropertyHandles.FindChecked(GET_MEMBER_NAME_CHECKED(FCameraLensSettings, MinimumFocusDistance));
for (auto Iter(PropertyHandles.CreateConstIterator()); Iter; ++Iter)
{
if (Iter.Value() == MinFocusDistanceHandle)
{
// skip showing these in the panel for now, as we don't really use them
continue;
}
IDetailPropertyRow& SettingsRow = ChildBuilder.AddChildProperty(Iter.Value().ToSharedRef());
}
}
示例9: CustomizeChildren
void FRawDistributionVectorStructCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
{
// Determine from the metadata whether we should treat vectors as FLinearColors or not
bool bTreatAsColor = StructPropertyHandle->HasMetaData("TreatAsColor");
uint32 NumChildren;
ensure(StructPropertyHandle->GetNumChildren(NumChildren) == FPropertyAccess::Success);
// Now recurse through all children, creating a custom builder for each which will either add the default property row, or
// a property row exposing a FLinearColor type customization which maps directly to the elements of the original FVector.
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ChildIndex++)
{
TSharedPtr<IPropertyHandle> ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex);
check(ChildHandle.IsValid());
if (bTreatAsColor)
{
TSharedRef<FReplaceVectorWithLinearColorBuilder> CustomBuilder = MakeShareable(new FReplaceVectorWithLinearColorBuilder(ChildHandle.ToSharedRef()));
StructBuilder.AddChildCustomBuilder(CustomBuilder);
}
else
{
StructBuilder.AddChildProperty(ChildHandle.ToSharedRef());
}
}
}
示例10: RebuildGroupedMappings
void FAxisMappingsNodeBuilder::RebuildGroupedMappings()
{
GroupedMappings.Empty();
TSharedPtr<IPropertyHandleArray> AxisMappingsArrayHandle = AxisMappingsPropertyHandle->AsArray();
uint32 NumMappings;
AxisMappingsArrayHandle->GetNumElements(NumMappings);
for (uint32 Index = 0; Index < NumMappings; ++Index)
{
TSharedRef<IPropertyHandle> AxisMapping = AxisMappingsArrayHandle->GetElement(Index);
FName AxisName;
FPropertyAccess::Result Result = AxisMapping->GetChildHandle(GET_MEMBER_NAME_CHECKED(FInputAxisKeyMapping, AxisName))->GetValue(AxisName);
if (Result == FPropertyAccess::Success)
{
int32 FoundIndex = INDEX_NONE;
for (int32 GroupIndex = 0; GroupIndex < GroupedMappings.Num(); ++GroupIndex)
{
if (GroupedMappings[GroupIndex].SharedName == AxisName)
{
FoundIndex = GroupIndex;
break;
}
}
if (FoundIndex == INDEX_NONE)
{
FoundIndex = GroupedMappings.Num();
GroupedMappings.AddZeroed();
GroupedMappings[FoundIndex].SharedName = AxisName;
}
GroupedMappings[FoundIndex].Mappings.Add(AxisMapping);
}
}
}
示例11: CustomizeHeader
void FMarginStructCustomization::CustomizeHeader( TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils )
{
this->StructPropertyHandle = StructPropertyHandle;
const FString UVSpaceString( StructPropertyHandle->GetProperty()->GetMetaData( TEXT( "UVSpace" ) ) );
bIsMarginUsingUVSpace = UVSpaceString.Len() > 0 && UVSpaceString == TEXT( "true" );
uint32 NumChildren;
StructPropertyHandle->GetNumChildren( NumChildren );
for( uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex )
{
ChildPropertyHandles.Add( StructPropertyHandle->GetChildHandle( ChildIndex ).ToSharedRef() );
}
TSharedPtr<SHorizontalBox> HorizontalBox;
HeaderRow.NameContent()
[
StructPropertyHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth( 250.0f )
.MaxDesiredWidth( 250.0f )
[
SAssignNew( HorizontalBox, SHorizontalBox )
];
HorizontalBox->AddSlot()
[
MakePropertyWidget()
];
}
示例12: GetSortedChildren
void FRotatorStructCustomization::GetSortedChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, TArray< TSharedRef<IPropertyHandle> >& OutChildren)
{
static const FName Roll("Roll");
static const FName Pitch("Pitch");
static const FName Yaw("Yaw");
TSharedPtr< IPropertyHandle > RotatorChildren[3];
uint32 NumChildren;
StructPropertyHandle->GetNumChildren(NumChildren);
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
{
TSharedRef<IPropertyHandle> ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex).ToSharedRef();
const FName PropertyName = ChildHandle->GetProperty()->GetFName();
if (PropertyName == Roll)
{
RotatorChildren[0] = ChildHandle;
}
else if (PropertyName == Pitch)
{
RotatorChildren[1] = ChildHandle;
}
else
{
check(PropertyName == Yaw);
RotatorChildren[2] = ChildHandle;
}
}
OutChildren.Add(RotatorChildren[0].ToSharedRef());
OutChildren.Add(RotatorChildren[1].ToSharedRef());
OutChildren.Add(RotatorChildren[2].ToSharedRef());
}
示例13: CustomizeStructHeader
void FSlateSoundStructCustomization::CustomizeStructHeader(TSharedRef<IPropertyHandle> StructPropertyHandle, FDetailWidgetRow& HeaderRow, IStructCustomizationUtils& StructCustomizationUtils)
{
TSharedPtr<IPropertyHandle> ResourceObjectProperty = StructPropertyHandle->GetChildHandle(TEXT("ResourceObject"));
check(ResourceObjectProperty.IsValid());
TArray<void*> StructPtrs;
StructPropertyHandle->AccessRawData(StructPtrs);
for(auto It = StructPtrs.CreateConstIterator(); It; ++It)
{
FSlateSound* const SlateSound = reinterpret_cast<FSlateSound*>(*It);
SlateSoundStructs.Add(SlateSound);
}
HeaderRow
.NameContent()
[
StructPropertyHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(250.0f)
[
SNew(SObjectPropertyEntryBox)
.PropertyHandle(ResourceObjectProperty)
.AllowedClass(USoundBase::StaticClass())
.OnObjectChanged(this, &FSlateSoundStructCustomization::OnObjectChanged)
];
}
示例14: CustomizeHeader
void FFoliageTypeObjectCustomization::CustomizeHeader(TSharedRef<IPropertyHandle> PropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& CustomizationUtils)
{
TSharedPtr<IPropertyHandle> FoliageTypeHandle = PropertyHandle->GetChildHandle("FoliageTypeObject");
// Only allow foliage type assets to be created (i.e. don't show all the factories for blueprints)
TArray<const UClass*> SupportedClasses;
SupportedClasses.Add(UFoliageType_InstancedStaticMesh::StaticClass());
HeaderRow
.NameContent()
[
FoliageTypeHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(250.f)
.MaxDesiredWidth(0.f)
[
SNew(SObjectPropertyEntryBox)
.PropertyHandle(FoliageTypeHandle)
.ThumbnailPool(CustomizationUtils.GetThumbnailPool())
.NewAssetFactories(PropertyCustomizationHelpers::GetNewAssetFactoriesForClasses(SupportedClasses))
.OnShouldFilterAsset(this, &FFoliageTypeObjectCustomization::OnShouldFilterAsset)
];
//PropertyCustomizationHelpers::MakeInsertDeleteDuplicateButton <-- not sure how to get that to show up properly, since the struct doesn't know it's an array
}
示例15: CustomizeChildren
void FEnvDirectionCustomization::CustomizeChildren( TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils )
{
StructBuilder.AddChildProperty(ModeProp.ToSharedRef());
TSharedPtr<IPropertyHandle> PropFrom = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FEnvDirection,LineFrom));
StructBuilder.AddChildProperty(PropFrom.ToSharedRef())
.Visibility(TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FEnvDirectionCustomization::GetTwoPointsVisibility)));
TSharedPtr<IPropertyHandle> PropTo = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FEnvDirection,LineTo));
StructBuilder.AddChildProperty(PropTo.ToSharedRef())
.Visibility(TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FEnvDirectionCustomization::GetTwoPointsVisibility)));
TSharedPtr<IPropertyHandle> PropRot = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FEnvDirection,Rotation));
StructBuilder.AddChildProperty(PropRot.ToSharedRef())
.Visibility(TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FEnvDirectionCustomization::GetRotationVisibility)));
}