本文整理汇总了C++中IDetailChildrenBuilder类的典型用法代码示例。如果您正苦于以下问题:C++ IDetailChildrenBuilder类的具体用法?C++ IDetailChildrenBuilder怎么用?C++ IDetailChildrenBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IDetailChildrenBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GeneratePropertyContent
void FReplaceVectorWithLinearColorBuilder::GeneratePropertyContent(const TSharedRef<IPropertyHandle>& Handle, IDetailChildrenBuilder& ChildrenBuilder)
{
// Add to the current builder, depending on the property type.
uint32 NumChildren = 0;
ensure(Handle->GetNumChildren(NumChildren) == FPropertyAccess::Success);
bool bHasChildren = (NumChildren > 0);
bool bIsArray = Handle->AsArray().IsValid();
if (bIsArray)
{
// Arrays need special handling and will create an array builder
TSharedRef<FDetailArrayBuilder> ArrayBuilder = MakeShareable(new FDetailArrayBuilder(Handle));
ArrayBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FReplaceVectorWithLinearColorBuilder::OnGenerateArrayElementWidget));
ChildrenBuilder.AddChildCustomBuilder(ArrayBuilder);
}
else if (bHasChildren)
{
// If there are children, we invoke a new instance of our custom builder for recursive handling
// Note, if this is an FVector, it will be handled specially by the implementation of the IDetailCustomNodeBuilder interface.
TSharedRef<FReplaceVectorWithLinearColorBuilder> StructBuilder = MakeShareable(new FReplaceVectorWithLinearColorBuilder(Handle));
ChildrenBuilder.AddChildCustomBuilder(StructBuilder);
}
else
{
// No children - just add the property.
ChildrenBuilder.AddChildProperty(Handle);
}
}
示例2: 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());
}
}
}
示例3: CustomizeChildren
void FLandscapeEditorStructCustomization_FGizmoImportLayer::CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& 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);
}
示例4: AddColorChildProperty
void FReplaceVectorWithLinearColorBuilder::AddColorChildProperty(const TSharedPtr<IPropertyHandle>& StructHandle, const FText& Text, int32 ElementIndex, IDetailChildrenBuilder& ChildrenBuilder)
{
ChildrenBuilder.AddChildContent(LOCTEXT("Color", "Color"))
.NameContent()
[
SNew(STextBlock)
.Text(Text)
.Font(IPropertyTypeCustomizationUtils::GetRegularFont())
]
.ValueContent()
.MinDesiredWidth(100.0f)
.MaxDesiredWidth(100.0f)
[
SNew(SNumericEntryBox<float>)
.Font(IPropertyTypeCustomizationUtils::GetRegularFont())
.Value(this, &FReplaceVectorWithLinearColorBuilder::OnGetColorElementValue, StructHandle, ElementIndex)
.OnValueCommitted(this, &FReplaceVectorWithLinearColorBuilder::OnColorElementValueCommitted, StructHandle, ElementIndex)
.OnValueChanged(this, &FReplaceVectorWithLinearColorBuilder::OnColorElementValueChanged, StructHandle, ElementIndex)
.OnBeginSliderMovement(this, &FReplaceVectorWithLinearColorBuilder::OnBeginSliderMovement)
.OnEndSliderMovement(this, &FReplaceVectorWithLinearColorBuilder::OnEndSliderMovement)
.AllowSpin(true)
.MinSliderValue(0.0f)
.MaxSliderValue(1.0f)
];
}
示例5: GenerateChildContent
void FActionMappingsNodeBuilder::GenerateChildContent( IDetailChildrenBuilder& ChildrenBuilder )
{
RebuildGroupedMappings();
for (int32 Index = 0; Index < GroupedMappings.Num(); ++Index)
{
FMappingSet& MappingSet = GroupedMappings[Index];
FString GroupNameString(TEXT("ActionMappings."));
MappingSet.SharedName.AppendString(GroupNameString);
FName GroupName(*GroupNameString);
IDetailGroup& ActionMappingGroup = ChildrenBuilder.AddChildGroup(GroupName, FText::FromName(MappingSet.SharedName));
MappingSet.DetailGroup = &ActionMappingGroup;
TSharedRef<SWidget> AddButton = PropertyCustomizationHelpers::MakeAddButton(FSimpleDelegate::CreateSP(this, &FActionMappingsNodeBuilder::AddActionMappingToGroupButton_OnClick, MappingSet),
LOCTEXT("AddActionMappingToGroupToolTip", "Adds Action Mapping to Group"));
TSharedRef<SWidget> RemoveButton = PropertyCustomizationHelpers::MakeDeleteButton(FSimpleDelegate::CreateSP(this, &FActionMappingsNodeBuilder::RemoveActionMappingGroupButton_OnClick, MappingSet),
LOCTEXT("RemoveActionMappingGroupToolTip", "Removes Action Mapping Group"));
ActionMappingGroup.HeaderRow()
[
SNew( SHorizontalBox )
+ SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SBox)
.WidthOverride( InputConstants::TextBoxWidth )
[
SNew(SEditableTextBox)
.Padding(2.0f)
.Text(FText::FromName(MappingSet.SharedName))
.OnTextCommitted(FOnTextCommitted::CreateSP(this, &FActionMappingsNodeBuilder::OnActionMappingNameCommitted, MappingSet))
.Font(IDetailLayoutBuilder::GetDetailFont())
]
]
+SHorizontalBox::Slot()
.Padding(InputConstants::PropertyPadding)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
.AutoWidth()
[
AddButton
]
+SHorizontalBox::Slot()
.Padding(InputConstants::PropertyPadding)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
.AutoWidth()
[
RemoveButton
]
];
for (int32 MappingIndex = 0; MappingIndex < MappingSet.Mappings.Num(); ++MappingIndex)
{
ActionMappingGroup.AddPropertyRow(MappingSet.Mappings[MappingIndex]).ShowPropertyButtons(false);
}
}
}
示例6: GenerateAdditionalTextureWidget
void FSpriteDetailsCustomization::GenerateAdditionalTextureWidget(TSharedRef<IPropertyHandle> PropertyHandle, int32 ArrayIndex, IDetailChildrenBuilder& ChildrenBuilder)
{
IDetailPropertyRow& TextureRow = ChildrenBuilder.AddChildProperty(PropertyHandle);
FText ExtraText;
if (FText* pExtraText = AdditionalTextureLabels.Find(ArrayIndex))
{
ExtraText = *pExtraText;
}
FNumberFormattingOptions NoCommas;
NoCommas.UseGrouping = false;
const FText SlotDesc = FText::Format(LOCTEXT("AdditionalTextureSlotIndex", "Slot #{0}"), FText::AsNumber(ArrayIndex, &NoCommas));
TextureRow.DisplayName(SlotDesc);
TextureRow.ShowPropertyButtons(false);
TextureRow.CustomWidget(false)
.NameContent()
[
CreateTextureNameWidget(PropertyHandle, ExtraText)
]
.ValueContent()
.MaxDesiredWidth(TOptional<float>())
[
PropertyHandle->CreatePropertyValueWidget()
];
}
示例7: GenerateArrayElementWidget
void FMoviePlayerSettingsDetails::GenerateArrayElementWidget(TSharedRef<IPropertyHandle> PropertyHandle, int32 ArrayIndex, IDetailChildrenBuilder& ChildrenBuilder)
{
IDetailPropertyRow& FilePathRow = ChildrenBuilder.AddChildProperty( PropertyHandle );
{
FilePathRow.CustomWidget(false)
.NameContent()
[
PropertyHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MaxDesiredWidth(0.0f)
.MinDesiredWidth(125.0f)
[
SNew(SFilePathPicker)
.BrowseButtonImage(FEditorStyle::GetBrush("PropertyWindow.Button_Ellipsis"))
.BrowseButtonStyle(FEditorStyle::Get(), "HoverHintOnly")
.BrowseButtonToolTip(LOCTEXT("FileButtonToolTipText", "Choose a file from this computer"))
.BrowseDirectory(FEditorDirectories::Get().GetLastDirectory(ELastDirectory::GENERIC_OPEN))
.BrowseTitle(LOCTEXT("PropertyEditorTitle", "File picker..."))
.FilePath(this, &FMoviePlayerSettingsDetails::HandleFilePathPickerFilePath, PropertyHandle)
.FileTypeFilter(TEXT("MPEG-4 Movie (*.mp4)|*.mp4"))
.OnPathPicked(this, &FMoviePlayerSettingsDetails::HandleFilePathPickerPathPicked, PropertyHandle)
];
}
};
示例8: GenerateChildContent
void FDialogueContextMappingNodeBuilder::GenerateChildContent( IDetailChildrenBuilder& ChildrenBuilder )
{
if( ContextMappingPropertyHandle->IsValidHandle() )
{
const TSharedPtr<IPropertyHandle> SoundwavePropertyHandle = ContextMappingPropertyHandle->GetChildHandle("Soundwave");
ChildrenBuilder.AddChildProperty(SoundwavePropertyHandle.ToSharedRef());
}
}
示例9: GenerateChildContent
void FFormatTextLayout::GenerateChildContent( IDetailChildrenBuilder& ChildrenBuilder )
{
Children.Empty();
for (int32 ArgIdx = 0; ArgIdx < TargetNode->GetArgumentCount(); ++ArgIdx)
{
TSharedRef<class FFormatTextArgumentLayout> ArgumentIndexLayout = MakeShareable(new FFormatTextArgumentLayout(TargetNode, ArgIdx) );
ChildrenBuilder.AddChildCustomBuilder(ArgumentIndexLayout);
Children.Add(ArgumentIndexLayout);
}
}
示例10: 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
示例11: GenerateChildContent
void FLightmapCustomNodeBuilder::GenerateChildContent(IDetailChildrenBuilder& ChildrenBuilder)
{
RefreshLightmapItems();
for(TSharedPtr<FLightmapItem>& Item : LightmapItems)
{
ChildrenBuilder.AddChildContent(LOCTEXT("LightMapsFilter", "Lightmaps"))
.ValueContent()
.HAlign(HAlign_Fill)
[
MakeLightMapList(Item)
];
}
}
示例12: GenerateChildContent
void FLightmapCustomNodeBuilder::GenerateChildContent(IDetailChildrenBuilder& ChildrenBuilder)
{
RefreshLightmapItems();
ChildrenBuilder.AddChildContent(LOCTEXT("LightMapsFilter", "Lightmaps"))
.ValueContent()
.HAlign(HAlign_Fill)
[
SAssignNew(LightmapListView, SListView<TSharedPtr<FLightmapItem>>)
.ListItemsSource(&LightmapItems)
.OnGenerateRow(this, &FLightmapCustomNodeBuilder::MakeLightMapListViewWidget)
.OnContextMenuOpening(this, &FLightmapCustomNodeBuilder::OnGetLightMapContextMenuContent)
.OnMouseButtonDoubleClick(this, &FLightmapCustomNodeBuilder::OnLightMapListMouseButtonDoubleClick)
];
}
示例13: CustomizeChildren
void FAbcCompressionSettingsCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
{
Settings = UAbcImportSettings::Get();
uint32 NumChildren;
StructPropertyHandle->GetNumChildren(NumChildren);
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
{
TSharedRef<IPropertyHandle> ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex).ToSharedRef();
IDetailPropertyRow& Property = StructBuilder.AddChildProperty(ChildHandle);
static const FName EditConditionName = "EnumCondition";
int32 EnumCondition = ChildHandle->GetINTMetaData(EditConditionName);
Property.Visibility(TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FAbcCompressionSettingsCustomization::ArePropertiesVisible, EnumCondition)));
}
}
示例14: MakeNavRow
void FWidgetNavigationCustomization::MakeNavRow(TWeakPtr<IPropertyHandle> PropertyHandle, IDetailChildrenBuilder& ChildBuilder, EUINavigation Nav, FText NavName)
{
ChildBuilder.AddChildContent(NavName)
.NameContent()
[
SNew(STextBlock)
.Font(IDetailLayoutBuilder::GetDetailFont())
.Text(NavName)
]
.ValueContent()
.MaxDesiredWidth(300)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SComboButton)
.HAlign(HAlign_Center)
.ButtonContent()
[
SNew(STextBlock)
.Text(this, &FWidgetNavigationCustomization::GetNavigationText, PropertyHandle, Nav)
]
.ContentPadding(FMargin(2.0f, 1.0f))
.MenuContent()
[
MakeNavMenu(PropertyHandle, Nav)
]
]
// Explicit Navigation Widget
+ SHorizontalBox::Slot()
.FillWidth(1.0f)
[
SNew(SEditableTextBox)
.HintText(LOCTEXT("WidgetName", "Widget Name?"))
.Text(this, &FWidgetNavigationCustomization::GetExplictWidget, PropertyHandle, Nav)
.OnTextCommitted(this, &FWidgetNavigationCustomization::OnCommitExplictWidgetText, PropertyHandle, Nav)
.Font(IDetailLayoutBuilder::GetDetailFont())
.Visibility(this, &FWidgetNavigationCustomization::GetExplictWidgetFieldVisibility, PropertyHandle, Nav)
]
];
}
示例15: OnGenerateEventReceiverEntry
void FNiagaraEmitterPropertiesDetails::OnGenerateEventReceiverEntry(TSharedRef<IPropertyHandle> ElementProperty, int32 ElementIndex, IDetailChildrenBuilder& ChildrenBuilder)
{
TSharedPtr<IPropertyHandle> NameProperty = ElementProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNiagaraEventReceiverProperties, Name));
FName DisplayName;
NameProperty->GetValue(DisplayName);
// ChildrenBuilder.AddChildProperty(ElementProperty).DisplayName(FText::FromName(DisplayName));
IDetailGroup& Group = ChildrenBuilder.AddChildGroup(DisplayName, FText::FromName(DisplayName));
uint32 NumChildren = 0;
if (ElementProperty->GetNumChildren(NumChildren) == FPropertyAccess::Success)
{
for (uint32 i = 0; i < NumChildren; ++i)
{
TSharedPtr<IPropertyHandle> Child = ElementProperty->GetChildHandle(i);
//Dont add the ID. We just grab it's name for the name region of this property.
if (Child.IsValid() && Child->GetProperty()->GetName() != GET_MEMBER_NAME_CHECKED(FNiagaraEventReceiverProperties, Name).ToString())
{
TSharedPtr<SWidget> NameWidget;
TSharedPtr<SWidget> ValueWidget;
FDetailWidgetRow DefaultDetailRow;
IDetailPropertyRow& Row = Group.AddPropertyRow(Child.ToSharedRef());
Row.GetDefaultWidgets(NameWidget, ValueWidget, DefaultDetailRow);
Row.CustomWidget(true)
.NameContent()
[
NameWidget.ToSharedRef()
]
.ValueContent()
[
ValueWidget.ToSharedRef()
];
}
}
}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:37,代码来源:NiagaraEmitterPropertiesDetailsCustomization.cpp