本文整理汇总了C++中IDetailLayoutBuilder::EditCategory方法的典型用法代码示例。如果您正苦于以下问题:C++ IDetailLayoutBuilder::EditCategory方法的具体用法?C++ IDetailLayoutBuilder::EditCategory怎么用?C++ IDetailLayoutBuilder::EditCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDetailLayoutBuilder
的用法示例。
在下文中一共展示了IDetailLayoutBuilder::EditCategory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAdvancedSubCategory
void FPrimitiveComponentDetails::AddAdvancedSubCategory( IDetailLayoutBuilder& DetailBuilder, FName MainCategoryName, FName SubCategoryName)
{
TArray<TSharedRef<IPropertyHandle> > SubCategoryProperties;
IDetailCategoryBuilder& SubCategory = DetailBuilder.EditCategory(SubCategoryName);
const bool bSimpleProperties = false;
const bool bAdvancedProperties = true;
SubCategory.GetDefaultProperties( SubCategoryProperties, bSimpleProperties, bAdvancedProperties );
if( SubCategoryProperties.Num() > 0 )
{
IDetailCategoryBuilder& MainCategory = DetailBuilder.EditCategory(MainCategoryName);
const bool bForAdvanced = true;
IDetailGroup& Group = MainCategory.AddGroup( SubCategoryName, FText::FromName(SubCategoryName), bForAdvanced );
for( int32 PropertyIndex = 0; PropertyIndex < SubCategoryProperties.Num(); ++PropertyIndex )
{
TSharedRef<IPropertyHandle>& PropertyHandle = SubCategoryProperties[PropertyIndex];
// Ignore customized properties
if( !PropertyHandle->IsCustomized() )
{
Group.AddPropertyRow( SubCategoryProperties[PropertyIndex] );
}
}
}
}
示例2: CustomizeDetails
void FAbcImportSettingsCustomization::CustomizeDetails(IDetailLayoutBuilder& LayoutBuilder)
{
TSharedRef<IPropertyHandle> ImportType = LayoutBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UAbcImportSettings, ImportType));
uint8 EnumValue;
ImportType->GetValue(EnumValue);
IDetailCategoryBuilder& CompressionBuilder = LayoutBuilder.EditCategory("Compression");
CompressionBuilder.SetCategoryVisibility(EnumValue == (uint8)EAlembicImportType::Skeletal);
IDetailCategoryBuilder& StaticMeshBuilder = LayoutBuilder.EditCategory("StaticMesh");
StaticMeshBuilder.SetCategoryVisibility(EnumValue == (uint8)EAlembicImportType::StaticMesh);
FSimpleDelegate OnImportTypeChangedDelegate = FSimpleDelegate::CreateSP(this, &FAbcImportSettingsCustomization::OnImportTypeChanged, &LayoutBuilder);
ImportType->SetOnPropertyValueChanged(OnImportTypeChangedDelegate);
if (UAbcImportSettings::Get()->bReimport)
{
UEnum* ImportTypeEnum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EAlembicImportType"));
static FText RestrictReason = FText::FromString("Unable to change type while reimporting");
TSharedPtr<FPropertyRestriction> EnumRestriction = MakeShareable(new FPropertyRestriction(RestrictReason));
for (uint8 EnumIndex = 0; EnumIndex < (ImportTypeEnum->GetMaxEnumValue() + 1); ++EnumIndex)
{
if (EnumValue != EnumIndex)
{
const FString RestrictValue = ImportTypeEnum->GetDisplayNameTextByValue(EnumIndex).ToString();
EnumRestriction->AddValue(RestrictValue);
}
}
ImportType->AddRestriction(EnumRestriction.ToSharedRef());
}
}
示例3: CustomizeDetails
/** IDetailCustomization interface */
void FSpeedTreeImportDataDetails::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
CachedDetailBuilder = &DetailLayout;
TArray<TWeakObjectPtr<UObject>> EditingObjects;
DetailLayout.GetObjectsBeingCustomized(EditingObjects);
check(EditingObjects.Num() == 1);
SpeedTreeImportData = Cast<USpeedTreeImportData>(EditingObjects[0].Get());
if (SpeedTreeImportData == nullptr)
{
return;
}
//We have to hide FilePath category
DetailLayout.HideCategory(FName(TEXT("File Path")));
//Mesh category Must be the first category (Important)
DetailLayout.EditCategory(FName(TEXT("Mesh")), FText::GetEmpty(), ECategoryPriority::Important);
//Get the Materials category
IDetailCategoryBuilder& MaterialsCategoryBuilder = DetailLayout.EditCategory(FName(TEXT("Materials")));
TArray<TSharedRef<IPropertyHandle>> MaterialCategoryDefaultProperties;
MaterialsCategoryBuilder.GetDefaultProperties(MaterialCategoryDefaultProperties);
//We have to make the logic for vertex processing
TSharedRef<IPropertyHandle> MakeMaterialsCheckProp = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(USpeedTreeImportData, MakeMaterialsCheck));
MakeMaterialsCheckProp->SetOnPropertyValueChanged(FSimpleDelegate::CreateSP(this, &FSpeedTreeImportDataDetails::OnForceRefresh));
TSharedRef<IPropertyHandle> IncludeVertexProcessingCheckProp = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(USpeedTreeImportData, IncludeVertexProcessingCheck));
IncludeVertexProcessingCheckProp->SetOnPropertyValueChanged(FSimpleDelegate::CreateSP(this, &FSpeedTreeImportDataDetails::OnForceRefresh));
//Hide all properties, we will show them in the correct order with the correct grouping
for (TSharedRef<IPropertyHandle> Handle : MaterialCategoryDefaultProperties)
{
DetailLayout.HideProperty(Handle);
}
MaterialsCategoryBuilder.AddProperty(MakeMaterialsCheckProp);
if (SpeedTreeImportData->MakeMaterialsCheck)
{
for (TSharedRef<IPropertyHandle> Handle : MaterialCategoryDefaultProperties)
{
const FString& MetaData = Handle->GetMetaData(TEXT("EditCondition"));
if (MetaData.Compare(TEXT("MakeMaterialsCheck")) == 0 && IncludeVertexProcessingCheckProp->GetProperty() != Handle->GetProperty())
{
MaterialsCategoryBuilder.AddProperty(Handle);
}
}
IDetailGroup& VertexProcessingGroup = MaterialsCategoryBuilder.AddGroup(FName(TEXT("VertexProcessingGroup")), LOCTEXT("VertexProcessingGroup_DisplayName", "Vertex Processing"), false, true);
VertexProcessingGroup.AddPropertyRow(IncludeVertexProcessingCheckProp);
for (TSharedRef<IPropertyHandle> Handle : MaterialCategoryDefaultProperties)
{
const FString& MetaData = Handle->GetMetaData(TEXT("EditCondition"));
if (MetaData.Compare(TEXT("IncludeVertexProcessingCheck")) == 0)
{
VertexProcessingGroup.AddPropertyRow(Handle);
}
}
}
}
示例4: CustomizeDetails
void FSpriteDetailsCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
// Make sure sprite properties are near the top
IDetailCategoryBuilder& SpriteCategory = DetailLayout.EditCategory("Sprite", FText::GetEmpty(), ECategoryPriority::Important);
BuildSpriteSection(SpriteCategory, DetailLayout);
// Build the rendering category
IDetailCategoryBuilder& RenderingCategory = DetailLayout.EditCategory("Rendering");
BuildRenderingSection(RenderingCategory, DetailLayout);
// Build the collision category
IDetailCategoryBuilder& CollisionCategory = DetailLayout.EditCategory("Collision");
BuildCollisionSection(CollisionCategory, DetailLayout);
}
示例5: CustomizeDetails
void FFMODAmbientSoundDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
{
const TArray< TWeakObjectPtr<UObject> >& SelectedObjects = DetailBuilder.GetDetailsView().GetSelectedObjects();
for( int32 ObjectIndex = 0; !AmbientSound.IsValid() && ObjectIndex < SelectedObjects.Num(); ++ObjectIndex )
{
const TWeakObjectPtr<UObject>& CurrentObject = SelectedObjects[ObjectIndex];
if ( CurrentObject.IsValid() )
{
AmbientSound = Cast<AFMODAmbientSound>(CurrentObject.Get());
}
}
DetailBuilder.EditCategory(TEXT("Sound"))
.AddCustomRow(FText::GetEmpty())
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.Padding( 0, 2.0f, 0, 0 )
.FillHeight(1.0f)
.VAlign( VAlign_Center )
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.AutoWidth()
.Padding( 2.0f, 0.0f )
.VAlign(VAlign_Center)
.HAlign(HAlign_Left)
[
SNew(SButton)
.VAlign(VAlign_Center)
.OnClicked( this, &FFMODAmbientSoundDetails::OnEditSoundClicked )
.Text( LOCTEXT("EditAsset", "Edit") )
.ToolTipText( LOCTEXT("EditAssetToolTip", "Edit this sound cue") )
]
+SHorizontalBox::Slot()
.AutoWidth()
.Padding( 2.0f, 0.0f )
.VAlign(VAlign_Center)
.HAlign(HAlign_Left)
[
SNew(SButton)
.VAlign(VAlign_Center)
.OnClicked( this, &FFMODAmbientSoundDetails::OnPlaySoundClicked )
.Text( LOCTEXT("PlaySoundCue", "Play") )
]
+SHorizontalBox::Slot()
.AutoWidth()
.Padding( 2.0f, 0.0f )
.VAlign(VAlign_Center)
.HAlign(HAlign_Left)
[
SNew(SButton)
.VAlign(VAlign_Center)
.OnClicked( this, &FFMODAmbientSoundDetails::OnStopSoundClicked )
.Text( LOCTEXT("StopSoundCue", "Stop") )
]
]
];
}
示例6: CustomizeDetails
void FDerivedCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
// So now we're customizing UDerivedClass object
// First, try to hide an inherited property
{
// 'HideMe' property is defined in UBaseClass
TSharedPtr<IPropertyHandle> PropertyToHide = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UDerivedClass, HideMe));
PropertyToHide->MarkHiddenByCustomization();
}
{
// Now grab any struct property (or property that has customized property value widget)
// Note that this is property defined in UDerivedClass!
TSharedPtr<IPropertyHandle> TestProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UDerivedClass, Vector2dProperty));
// Hide this property
TestProperty->MarkHiddenByCustomization();
// Get a category so we can add a TestProperty back to the panel
IDetailCategoryBuilder& DerivedCategory = DetailLayout.EditCategory("Derived");
DerivedCategory.AddCustomRow(LOCTEXT("DerivedObjectLabel", "Derived"))
.NameContent()
[
TestProperty->CreatePropertyNameWidget()
]
.ValueContent()
[
// This will return NullWidget - thats the problem
TestProperty->CreatePropertyValueWidget()
];
}
}
示例7: CustomizeDetails
void FSpriteComponentDetailsCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
// Create a category so this is displayed early in the properties
IDetailCategoryBuilder& SpriteCategory = DetailBuilder.EditCategory("Sprite", FText::GetEmpty(), ECategoryPriority::Important);
ObjectsBeingCustomized.Empty();
DetailBuilder.GetObjectsBeingCustomized(/*out*/ ObjectsBeingCustomized);
if (ObjectsBeingCustomized.Num() > 1)
{
// Expose merge buttons
FDetailWidgetRow& MergeRow = SpriteCategory.AddCustomRow(LOCTEXT("MergeSearchText", "Merge"))
.WholeRowContent()
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(2.0f, 0.0f)
.VAlign(VAlign_Center)
.HAlign(HAlign_Left)
[
SNew(SButton)
.Text(LOCTEXT("MergeSprites", "Merge Sprites"))
.ToolTipText(LOCTEXT("MergeSprites_Tooltip", "Merges all selected sprite components into entries on a single grouped sprite component"))
.OnClicked(this, &FSpriteComponentDetailsCustomization::MergeSprites)
]
];
}
}
示例8: AddCodeViewCategory
void AddCodeViewCategory(IDetailLayoutBuilder& DetailBuilder, const FGetSelectedActors& GetSelectedActors)
{
FString SolutionPath;
if(FDesktopPlatformModule::Get()->GetSolutionPath(SolutionPath))
{
TSharedRef< CodeView::SCodeView > CodeViewWidget =
SNew( CodeView::SCodeView )
.GetSelectedActors( GetSelectedActors );
// Only start out expanded if we're already in "ready to populate" mode. This is because we don't want
// to immediately start digesting symbols as soon as the widget is visible. Instead, when the user
// expands the section, we'll start loading symbols. However, this state is remembered even after
// the widget is destroyed.
const bool bShouldInitiallyExpand = CodeViewWidget->IsReadyToPopulate();
DetailBuilder.EditCategory( "CodeView", NSLOCTEXT("ActorDetails", "CodeViewSection", "Code View"), ECategoryPriority::Uncommon )
.InitiallyCollapsed( !bShouldInitiallyExpand )
// The expansion state should not be restored
.RestoreExpansionState( false )
.OnExpansionChanged( FOnBooleanValueChanged::CreateSP( CodeViewWidget, &CodeView::SCodeView::OnDetailSectionExpansionChanged ) )
.AddCustomRow( NSLOCTEXT("ActorDetails", "CodeViewSection", "Code View") )
[
// @todo editcode1: Width of item is too big for detail view?!
CodeViewWidget
];
}
}
示例9: Create
void FComponentMaterialCategory::Create( IDetailLayoutBuilder& DetailBuilder )
{
NotifyHook = DetailBuilder.GetPropertyUtilities()->GetNotifyHook();
FMaterialListDelegates MaterialListDelegates;
MaterialListDelegates.OnGetMaterials.BindSP( this, &FComponentMaterialCategory::OnGetMaterialsForView );
MaterialListDelegates.OnMaterialChanged.BindSP( this, &FComponentMaterialCategory::OnMaterialChanged );
TSharedRef<FMaterialList> MaterialList = MakeShareable( new FMaterialList( DetailBuilder, MaterialListDelegates ) );
bool bAnyMaterialsToDisplay = false;
for( FMaterialIterator It( SelectedComponents ); It; ++It )
{
UActorComponent* CurrentComponent = It.GetComponent();
if( !bAnyMaterialsToDisplay )
{
bAnyMaterialsToDisplay = true;
break;
}
}
// only show the category if there are materials to display
if( bAnyMaterialsToDisplay )
{
// Make a category for the materials.
IDetailCategoryBuilder& MaterialCategory = DetailBuilder.EditCategory("Materials", FText::GetEmpty(), ECategoryPriority::TypeSpecific );
MaterialCategory.AddCustomBuilder( MaterialList );
}
}
示例10: CustomizeDetails
void FFormatTextDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
const TArray<TWeakObjectPtr<UObject>> Objects = DetailLayout.GetDetailsView().GetSelectedObjects();
check(Objects.Num() > 0);
if (Objects.Num() == 1)
{
TargetNode = CastChecked<UK2Node_FormatText>(Objects[0].Get());
TSharedRef<IPropertyHandle> PropertyHandle = DetailLayout.GetProperty(FName("PinNames"), UK2Node_FormatText::StaticClass());
IDetailCategoryBuilder& InputsCategory = DetailLayout.EditCategory("Arguments", LOCTEXT("FormatTextDetailsArguments", "Arguments"));
InputsCategory.AddCustomRow( LOCTEXT("FunctionNewInputArg", "New") )
[
SNew(SBox)
.HAlign(HAlign_Right)
[
SNew(SButton)
.Text(LOCTEXT("FunctionNewInputArg", "New"))
.OnClicked(this, &FFormatTextDetails::OnAddNewArgument)
.IsEnabled(this, &FFormatTextDetails::CanEditArguments)
]
];
Layout = MakeShareable( new FFormatTextLayout(TargetNode) );
InputsCategory.AddCustomBuilder( Layout.ToSharedRef() );
}
UPackage::PackageDirtyStateChangedEvent.AddSP(this, &FFormatTextDetails::OnEditorPackageModified);
}
示例11: CustomizeDetails
void FAnimMontageSegmentDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
{
IDetailCategoryBuilder& SegmentCategory = DetailBuilder.EditCategory("Animation Segment", LOCTEXT("AnimationSegmentCategoryTitle", "Animation Segment") );
SegmentCategory.AddProperty("AnimSegment.AnimReference").DisplayName( LOCTEXT("AnimationReferenceLabel", "Animation Reference") );
SegmentCategory.AddProperty("AnimSegment.AnimStartTime").DisplayName( LOCTEXT("StartTimeLabel", "Start Time") );
SegmentCategory.AddProperty("AnimSegment.AnimEndTime").DisplayName( LOCTEXT("EndTimeLabel", "End Time") );
SegmentCategory.AddProperty("AnimSegment.AnimPlayRate").DisplayName( LOCTEXT("PlayRateLabel", "Play Rate") );
SegmentCategory.AddProperty("AnimSegment.LoopingCount").DisplayName( LOCTEXT("LoopCountLabel", "Loop Count") );
TSharedPtr<IPropertyHandle> InPropertyHandle = DetailBuilder.GetProperty("AnimSegment.AnimReference");
UObject *Object = NULL;
InPropertyHandle->GetValue(Object);
UAnimSequenceBase *AnimRef = Cast<UAnimSequenceBase>(Object);
USkeleton *Skeleton = NULL;
if(AnimRef != NULL)
{
Skeleton = AnimRef->GetSkeleton();
}
SegmentCategory.AddCustomRow(FText::GetEmpty(), false)
[
SNew(SAnimationSegmentViewport)
.Skeleton(Skeleton)
.AnimRef(AnimRef)
.AnimRefPropertyHandle(DetailBuilder.GetProperty("AnimSegment.AnimReference"))
.StartTimePropertyHandle(DetailBuilder.GetProperty("AnimSegment.AnimStartTime"))
.EndTimePropertyHandle(DetailBuilder.GetProperty("AnimSegment.AnimEndTime"))
];
}
示例12: CustomizeDetails
void FEditorTutorialDetailsCustomization::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
struct Local
{
static FReply OnLaunchClicked(UEditorTutorial* Tutorial)
{
FLevelEditorModule& LevelEditorModule = FModuleManager::Get().GetModuleChecked<FLevelEditorModule>("LevelEditor");
IIntroTutorials& IntroTutorials = FModuleManager::Get().GetModuleChecked<IIntroTutorials>("IntroTutorials");
IntroTutorials.LaunchTutorial(Tutorial, true, LevelEditorModule.GetLevelEditorTab()->GetParentWindow());
return FReply::Handled();
}
};
TArray<TWeakObjectPtr<UObject>> Objects;
DetailLayout.GetObjectsBeingCustomized(Objects);
check(Objects.Num() > 0);
UEditorTutorial* Tutorial = CastChecked<UEditorTutorial>(Objects[0].Get());
IDetailCategoryBuilder& CategoryBuilder = DetailLayout.EditCategory(TEXT("Testing"), LOCTEXT("TestingSection", "Testing"), ECategoryPriority::Important);
CategoryBuilder.AddCustomRow(LOCTEXT("LaunchButtonLabel", "Launch"))
.WholeRowContent()
.VAlign(VAlign_Center)
.HAlign(HAlign_Left)
[
SNew(SButton)
.OnClicked(FOnClicked::CreateStatic(&Local::OnLaunchClicked, Tutorial))
.Text(LOCTEXT("LaunchButtonLabel", "Launch"))
.ToolTipText(LOCTEXT("LaunchButtonTooltip", "Test this tutorial."))
];
}
示例13: CustomizeDetails
void FMatineeActorDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
const TArray< TWeakObjectPtr<UObject> >& SelectedObjects = DetailLayout.GetDetailsView().GetSelectedObjects();
for( int32 ObjectIndex = 0; ObjectIndex < SelectedObjects.Num(); ++ObjectIndex )
{
const TWeakObjectPtr<UObject>& CurrentObject = SelectedObjects[ObjectIndex];
if ( CurrentObject.IsValid() )
{
AMatineeActor* CurrentMatineeActor = Cast<AMatineeActor>(CurrentObject.Get());
if (CurrentMatineeActor != NULL)
{
MatineeActor = CurrentMatineeActor;
break;
}
}
}
DetailLayout.EditCategory( "MatineeActor", NSLOCTEXT("MatineeActorDetails", "MatineeActor", "Matinee Actor"), ECategoryPriority::Important )
.AddCustomRow( NSLOCTEXT("MatineeActorDetails", "OpenMatinee", "Open Matinee") )
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.FillWidth(1.f)
.Padding(0, 5, 10, 5)
[
SNew(SButton)
.ContentPadding(3)
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
.OnClicked( this, &FMatineeActorDetails::OnOpenMatineeForActor )
.Text( NSLOCTEXT("MatineeActorDetails", "OpenMatinee", "Open Matinee") )
]
];
}
示例14: CustomizeDetails
void FRuntimeMeshComponentDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
{
IDetailCategoryBuilder& RuntimeMeshCategory = DetailBuilder.EditCategory("RuntimeMesh");
const FText ConvertToStaticMeshText = LOCTEXT("ConvertToStaticMesh", "Create StaticMesh");
// Cache set of selected things
SelectedObjectsList = DetailBuilder.GetDetailsView().GetSelectedObjects();
RuntimeMeshCategory.AddCustomRow(ConvertToStaticMeshText, false)
.NameContent()
[
SNullWidget::NullWidget
]
.ValueContent()
.VAlign(VAlign_Center)
.MaxDesiredWidth(250)
[
SNew(SButton)
.VAlign(VAlign_Center)
.ToolTipText(LOCTEXT("ConvertToStaticMeshTooltip", "Create a new StaticMesh asset using current geometry from this RuntimeMeshComponent. Does not modify instance."))
.OnClicked(this, &FRuntimeMeshComponentDetails::ClickedOnConvertToStaticMesh)
.IsEnabled(this, &FRuntimeMeshComponentDetails::ConvertToStaticMeshEnabled)
.Content()
[
SNew(STextBlock)
.Text(ConvertToStaticMeshText)
]
];
}
示例15: AddStructToDetails
void AddStructToDetails(FName CategoryName, FName PropertyName, IDetailLayoutBuilder& DetailBuilder, bool bInline = true, bool bAdvanced = false)
{
IDetailCategoryBuilder& Category = DetailBuilder.EditCategory(CategoryName, TEXT(""), ECategoryPriority::Important);
TSharedPtr<IPropertyHandle> Params = DetailBuilder.GetProperty(PropertyName);
if (Params.IsValid())
{
EPropertyLocation::Type PropertyLocation = bAdvanced ? EPropertyLocation::Advanced : EPropertyLocation::Default;
if (bInline)
{
uint32 NumChildren = 0;
Params->GetNumChildren(NumChildren);
// add all collision properties
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
{
TSharedPtr<IPropertyHandle> ChildProperty = Params->GetChildHandle(ChildIndex);
Category.AddProperty(ChildProperty, PropertyLocation);
}
}
else
{
Category.AddProperty(Params, PropertyLocation);
}
}
}