本文整理汇总了C++中IDetailChildrenBuilder::AddChildCustomBuilder方法的典型用法代码示例。如果您正苦于以下问题:C++ IDetailChildrenBuilder::AddChildCustomBuilder方法的具体用法?C++ IDetailChildrenBuilder::AddChildCustomBuilder怎么用?C++ IDetailChildrenBuilder::AddChildCustomBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDetailChildrenBuilder
的用法示例。
在下文中一共展示了IDetailChildrenBuilder::AddChildCustomBuilder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
}