2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "IDetailsViewPrivate.h"
|
|
|
|
|
#include "AssetSelection.h"
|
|
|
|
|
#include "IPropertyUtilities.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FDetailCategoryImpl;
|
|
|
|
|
class FDetailLayoutBuilderImpl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct FPropertyNodeMap
|
|
|
|
|
{
|
|
|
|
|
FPropertyNodeMap()
|
2014-06-17 09:41:33 -04:00
|
|
|
: ParentProperty(NULL)
|
2014-05-29 17:43:55 -04:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
/** Object property node which contains the properties in the node map */
|
2014-06-17 09:41:33 -04:00
|
|
|
FPropertyNode* ParentProperty;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/** Property name to property node map */
|
|
|
|
|
TMap<FName, TSharedPtr<FPropertyNode> > PropertyNameToNode;
|
|
|
|
|
|
|
|
|
|
bool Contains(FName PropertyName) const
|
|
|
|
|
{
|
|
|
|
|
return PropertyNameToNode.Contains(PropertyName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Add(FName PropertyName, TSharedPtr<FPropertyNode>& PropertyNode)
|
|
|
|
|
{
|
|
|
|
|
PropertyNameToNode.Add(PropertyName, PropertyNode);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef TArray< TSharedRef<class IDetailTreeNode> > FDetailNodeList;
|
|
|
|
|
|
|
|
|
|
/** Mapping of categories to all top level item property nodes in that category */
|
|
|
|
|
typedef TMap<FName, TSharedPtr<FDetailCategoryImpl> > FCategoryMap;
|
|
|
|
|
|
|
|
|
|
/** Class to properties in that class */
|
|
|
|
|
typedef TMap<FName, FPropertyNodeMap> FClassInstanceToPropertyMap;
|
|
|
|
|
|
|
|
|
|
/** Class to properties in that class */
|
|
|
|
|
typedef TMap<FName, FClassInstanceToPropertyMap> FClassToPropertyMap;
|
|
|
|
|
|
|
|
|
|
typedef STreeView< TSharedRef<class IDetailTreeNode> > SDetailTree;
|
|
|
|
|
|
|
|
|
|
/** Represents a filter which controls the visibility of items in the details view */
|
|
|
|
|
struct FDetailFilter
|
|
|
|
|
{
|
|
|
|
|
FDetailFilter()
|
|
|
|
|
: bShowOnlyModifiedProperties(false)
|
|
|
|
|
, bShowAllAdvanced(false)
|
2014-08-12 16:54:27 -04:00
|
|
|
, bShowOnlyDiffering(false)
|
2014-11-19 06:38:05 -05:00
|
|
|
, bShowAllChildrenIfCategoryMatches(true)
|
2014-05-29 17:43:55 -04:00
|
|
|
{}
|
|
|
|
|
|
2014-11-19 06:38:05 -05:00
|
|
|
bool IsEmptyFilter() const { return FilterStrings.Num() == 0 && bShowOnlyModifiedProperties == false && bShowAllAdvanced == false && bShowOnlyDiffering == false && bShowAllChildrenIfCategoryMatches == false; }
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/** Any user search terms that items must match */
|
|
|
|
|
TArray<FString> FilterStrings;
|
|
|
|
|
/** If we should only show modified properties */
|
|
|
|
|
bool bShowOnlyModifiedProperties;
|
|
|
|
|
/** If we should show all advanced properties */
|
|
|
|
|
bool bShowAllAdvanced;
|
2014-08-12 16:54:27 -04:00
|
|
|
/** If we should only show differing properties */
|
|
|
|
|
bool bShowOnlyDiffering;
|
2014-11-19 06:38:05 -05:00
|
|
|
/** If we should show all the children if their category name matches the search */
|
|
|
|
|
bool bShowAllChildrenIfCategoryMatches;
|
2014-10-23 13:16:13 -04:00
|
|
|
TSet<FPropertyPath> WhitelistedProperties;
|
2014-05-29 17:43:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct FDetailColumnSizeData
|
|
|
|
|
{
|
|
|
|
|
TAttribute<float> LeftColumnWidth;
|
|
|
|
|
TAttribute<float> RightColumnWidth;
|
|
|
|
|
SSplitter::FOnSlotResized OnWidthChanged;
|
|
|
|
|
|
|
|
|
|
void SetColumnWidth(float InWidth) { OnWidthChanged.ExecuteIfBound(InWidth); }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SDetailsViewBase : public IDetailsViewPrivate
|
|
|
|
|
{
|
|
|
|
|
public:
|
2014-10-23 13:16:13 -04:00
|
|
|
SDetailsViewBase()
|
|
|
|
|
: ColumnWidth(.65f)
|
|
|
|
|
, bHasActiveFilter(false)
|
|
|
|
|
, bIsLocked(false)
|
|
|
|
|
, bHasOpenColorPicker(false)
|
|
|
|
|
, bDisableCustomDetailLayouts( false )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* @return true of the details view can be updated from editor selection
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool IsUpdatable() const override
|
2014-05-29 17:43:55 -04:00
|
|
|
{
|
|
|
|
|
return DetailsViewArgs.bUpdatesFromSelection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** @return The identifier for this details view, or NAME_None is this view is anonymous */
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FName GetIdentifier() const override
|
2014-05-29 17:43:55 -04:00
|
|
|
{
|
|
|
|
|
return DetailsViewArgs.ViewIdentifier;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the visible state of the filter box/property grid area
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void HideFilterArea(bool bHide) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
2014-08-12 16:54:27 -04:00
|
|
|
/**
|
2014-10-23 13:16:13 -04:00
|
|
|
* Implementation of IDetailsView:
|
2014-08-12 16:54:27 -04:00
|
|
|
*/
|
2014-10-23 13:16:13 -04:00
|
|
|
virtual TArray< FPropertyPath > GetPropertiesInOrderDisplayed() const override;
|
|
|
|
|
virtual void HighlightProperty(const FPropertyPath& Property) override;
|
|
|
|
|
virtual void ShowAllAdvancedProperties() override;
|
|
|
|
|
virtual void SetOnDisplayedPropertiesChanged(FOnDisplayedPropertiesChanged InOnDisplayedPropertiesChangedDelegate) override;
|
|
|
|
|
virtual void SetDisableCustomDetailLayouts( bool bInDisableCustomDetailLayouts ) override { bDisableCustomDetailLayouts = bInDisableCustomDetailLayouts; }
|
2014-08-12 16:54:27 -04:00
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FOnFinishedChangingProperties& OnFinishedChangingProperties() override
|
2014-05-29 17:43:55 -04:00
|
|
|
{
|
|
|
|
|
return OnFinishedChangingPropertiesDelegate;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-17 09:41:33 -04:00
|
|
|
virtual bool IsConnected() const = 0;
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* Called when the open color picker window associated with this details view is closed
|
|
|
|
|
*/
|
|
|
|
|
void OnColorPickerWindowClosed(const TSharedRef<SWindow>& Window);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the details view is locked and cant have its observed objects changed
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool IsLocked() const override
|
2014-05-29 17:43:55 -04:00
|
|
|
{
|
|
|
|
|
return bIsLocked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets a delegate which is called to determine whether a specific property should be visible
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void SetIsPropertyVisibleDelegate(FIsPropertyVisible InIsPropertyVisible) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
2015-03-13 12:41:11 -04:00
|
|
|
/**
|
|
|
|
|
* Sets a delegate to call to determine if a specific property should be read-only in this instance of the details view
|
|
|
|
|
*/
|
|
|
|
|
virtual void SetIsPropertyReadOnlyDelegate( FIsPropertyReadOnly InIsPropertyReadOnly ) override;
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* Sets a delegate to call to determine if the properties editing is enabled
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void SetIsPropertyEditingEnabledDelegate(FIsPropertyEditingEnabled IsPropertyEditingEnabled) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return true if property editing is enabled (based on the FIsPropertyEditingEnabled delegate)
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool IsPropertyEditingEnabled() const override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
2014-07-24 23:52:28 -04:00
|
|
|
virtual void SetKeyframeHandler( TSharedPtr<class IDetailKeyframeHandler> InKeyframeHandler ) override;
|
|
|
|
|
virtual TSharedPtr<IDetailKeyframeHandler> GetKeyframeHandler() override;
|
|
|
|
|
|
2015-04-01 07:20:55 -04:00
|
|
|
virtual void SetExtensionHandler(TSharedPtr<class IDetailPropertyExtensionHandler> InExtensionHandler) override;
|
|
|
|
|
virtual TSharedPtr<IDetailPropertyExtensionHandler> GetExtensionHandler() override;
|
2014-10-14 13:37:45 -04:00
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* Requests that an item in the tree be expanded or collapsed
|
|
|
|
|
*
|
|
|
|
|
* @param TreeNode The tree node to expand
|
|
|
|
|
* @param bExpand true if the item should be expanded, false otherwise
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
void RequestItemExpanded(TSharedRef<IDetailTreeNode> TreeNode, bool bExpand) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the expansion state for a node and optionally all of its children
|
|
|
|
|
*
|
|
|
|
|
* @param InTreeNode The node to change expansion state on
|
|
|
|
|
* @param bIsItemExpanded The new expansion state
|
|
|
|
|
* @param bRecursive Whether or not to apply the expansion change to any children
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
void SetNodeExpansionState(TSharedRef<IDetailTreeNode> InTreeNode, bool bIsItemExpanded, bool bRecursive) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the expansion state all root nodes and optionally all of their children
|
|
|
|
|
*
|
|
|
|
|
* @param bExpand The new expansion state
|
|
|
|
|
* @param bRecurse Whether or not to apply the expansion change to any children
|
|
|
|
|
*/
|
|
|
|
|
void SetRootExpansionStates(const bool bExpand, const bool bRecurse);
|
|
|
|
|
|
2014-06-17 09:41:33 -04:00
|
|
|
/**
|
|
|
|
|
* Queries a layout for a specific class
|
|
|
|
|
*/
|
|
|
|
|
void QueryLayoutForClass(FDetailLayoutBuilderImpl& CustomDetailLayout, UStruct* Class);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Calls a delegate for each registered class that has properties visible to get any custom detail layouts
|
|
|
|
|
*/
|
|
|
|
|
void QueryCustomDetailLayout(class FDetailLayoutBuilderImpl& CustomDetailLayout);
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* Refreshes the detail's treeview
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
void RefreshTree() override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Saves the expansion state of a tree node
|
|
|
|
|
*
|
|
|
|
|
* @param NodePath The path to the detail node to save
|
|
|
|
|
* @param bIsExpanded true if the node is expanded, false otherwise
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
void SaveCustomExpansionState(const FString& NodePath, bool bIsExpanded) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the saved expansion state of a tree node in this category
|
|
|
|
|
*
|
|
|
|
|
* @param NodePath The path to the detail node to get
|
|
|
|
|
* @return true if the node should be expanded, false otherwise
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
bool GetCustomSavedExpansionState(const FString& NodePath) const override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when properties have finished changing (after PostEditChange is called)
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void NotifyFinishedChangingProperties(const FPropertyChangedEvent& PropertyChangedEvent) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/** Column width accessibility */
|
|
|
|
|
float OnGetLeftColumnWidth() const { return 1.0f - ColumnWidth; }
|
|
|
|
|
float OnGetRightColumnWidth() const { return ColumnWidth; }
|
|
|
|
|
void OnSetColumnWidth(float InWidth) { ColumnWidth = InWidth; }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return True if the property is visible
|
|
|
|
|
*/
|
2014-07-24 23:52:28 -04:00
|
|
|
virtual bool IsPropertyVisible( const struct FPropertyAndParent& PropertyAndParent ) const override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
2015-03-13 12:41:11 -04:00
|
|
|
/**
|
|
|
|
|
* @return True if the property is visible
|
|
|
|
|
*/
|
|
|
|
|
virtual bool IsPropertyReadOnly( const struct FPropertyAndParent& PropertyAndParent ) const override;
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* Sets a delegate which is regardless of the objects being viewed to lay out generic details not specific to any object
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void SetGenericLayoutDetailsDelegate(FOnGetDetailCustomizationInstance OnGetGenericDetails) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds an action to execute next tick
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void EnqueueDeferredAction(FSimpleDelegate& DeferredAction) override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return The thumbnail pool that should be used for thumbnails being rendered in this view
|
|
|
|
|
*/
|
2015-04-01 07:20:55 -04:00
|
|
|
TSharedPtr<class FAssetThumbnailPool> GetThumbnailPool() const override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the property utilities for this view
|
|
|
|
|
*/
|
2014-06-13 06:14:46 -04:00
|
|
|
TSharedPtr<IPropertyUtilities> GetPropertyUtilities() override;
|
2014-05-29 17:43:55 -04:00
|
|
|
|
2014-05-29 17:45:44 -04:00
|
|
|
/** Returns the notify hook to use when properties change */
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FNotifyHook* GetNotifyHook() const override
|
2014-05-29 17:45:44 -04:00
|
|
|
{
|
|
|
|
|
return DetailsViewArgs.NotifyHook;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
virtual ~SDetailsViewBase();
|
|
|
|
|
|
2014-06-17 09:41:33 -04:00
|
|
|
// SWidget interface
|
|
|
|
|
virtual bool SupportsKeyboardFocus() const override;
|
2014-10-30 12:29:36 -04:00
|
|
|
virtual FReply OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent) override;
|
---- Merging with SlateDev branch ----
Introduces the concept of "Active Ticking" to allow Slate to go to sleep when there is no need to update the UI.
While asleep, Slate will skip the Tick & Paint pass for that frame entirely.
- There are TWO ways to "wake" Slate and cause a Tick/Paint pass:
1. Provide some sort of input (mouse movement, clicks, and key presses). Slate will always tick when the user is active.
- Therefore, if the logic in a given widget's Tick is only relevant in response to user action, there is no need to register an active tick.
2. Register an Active Tick. Currently this is an all-or-nothing situation, so if a single active tick needs to execute, all of Slate will be ticked.
- The purpose of an Active Tick is to allow a widget to "drive" Slate and guarantee a Tick/Paint pass in the absence of any user action.
- Examples include animation, async operations that update periodically, progress updates, loading bars, etc.
- An empty active tick is registered for viewports when they are real-time, so game project widgets are unaffected by this change and should continue to work as before.
- An Active Tick is registered by creating an FWidgetActiveTickDelegate and passing it to SWidget::RegisterActiveTick()
- There are THREE ways to unregister an active tick:
1. Return EActiveTickReturnType::StopTicking from the active tick function
2. Pass the FActiveTickHandle returned by RegisterActiveTick() to SWidget::UnregisterActiveTick()
3. Destroy the widget responsible for the active tick
- Sleeping is currently disabled, can be enabled with Slate.AllowSlateToSleep cvar
- There is currently a little buffer time during which Slate continues to tick following any input. Long-term, this is planned to be removed.
- The duration of the buffer can be adjusted using Slate.SleepBufferPostInput cvar (defaults to 1.0f)
- The FCurveSequence API has been updated to work with the active tick system
- Playing a curve sequence now requires that you pass the widget being animated by the sequence
- The active tick will automatically be registered on behalf of the widget and unregister when the sequence is complete
- GetLerpLooping() has been removed. Instead, pass true as the second param to Play() to indicate that the animation will loop. This causes the active tick to be registered indefinitely until paused or jumped to the start/end.
[CL 2391669 by Dan Hertzka in Main branch]
2014-12-17 16:07:57 -05:00
|
|
|
virtual void Tick( const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime ) override;
|
2014-06-17 09:41:33 -04:00
|
|
|
// End of SWidget interface
|
|
|
|
|
|
|
|
|
|
/** Saves the expansion state of property nodes for the selected object set */
|
|
|
|
|
void SaveExpandedItems();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Restores the expansion state of property nodes for the selected object set
|
|
|
|
|
*
|
|
|
|
|
* @param InitialStartNode The starting node if any. If one is not supplied the expansion state is restored from the root node
|
|
|
|
|
*/
|
|
|
|
|
void RestoreExpandedItems(TSharedPtr<FPropertyNode> InitialStartNode = NULL);
|
|
|
|
|
|
|
|
|
|
virtual TSharedPtr<FComplexPropertyNode> GetRootNode() = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates the color picker window for this property view.
|
|
|
|
|
*
|
|
|
|
|
* @param PropertyEditor The slate property node to edit.
|
|
|
|
|
* @param bUseAlpha Whether or not alpha is supported
|
|
|
|
|
*/
|
|
|
|
|
void CreateColorPickerWindow(const TSharedRef< class FPropertyEditor >& PropertyEditor, bool bUseAlpha) override;
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
protected:
|
2014-06-17 09:41:33 -04:00
|
|
|
/**
|
|
|
|
|
* Called when a color property is changed from a color picker
|
|
|
|
|
*/
|
|
|
|
|
void SetColorPropertyFromColorPicker(FLinearColor NewColor);
|
|
|
|
|
|
|
|
|
|
/** Updates the property map for access when customizing the details view. Generates default layout for properties */
|
|
|
|
|
void UpdatePropertyMap();
|
2014-06-18 04:45:09 -04:00
|
|
|
virtual void CustomUpdatePropertyMap() {}
|
2014-06-17 09:41:33 -04:00
|
|
|
/**
|
|
|
|
|
* Recursively updates children of property nodes. Generates default layout for properties
|
|
|
|
|
*
|
|
|
|
|
* @param InNode The parent node to get children from
|
|
|
|
|
* @param The detail layout builder that will be used for customization of this property map
|
|
|
|
|
* @param CurCategory The current category name
|
|
|
|
|
*/
|
|
|
|
|
void UpdatePropertyMapRecursive( FPropertyNode& InNode, FDetailLayoutBuilderImpl& DetailLayout, FName CurCategory, FComplexPropertyNode* CurObjectNode );
|
|
|
|
|
|
|
|
|
|
|
2014-05-29 17:43:55 -04:00
|
|
|
/** Called to get the visibility of the tree view */
|
|
|
|
|
EVisibility GetTreeVisibility() const;
|
|
|
|
|
|
|
|
|
|
/** Returns the name of the image used for the icon on the filter button */
|
|
|
|
|
const FSlateBrush* OnGetFilterButtonImageResource() const;
|
|
|
|
|
|
|
|
|
|
/** Called when the locked button is clicked */
|
|
|
|
|
FReply OnLockButtonClicked();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called to recursively expand/collapse the children of the given item
|
|
|
|
|
*
|
|
|
|
|
* @param InTreeNode The node that was expanded or collapsed
|
|
|
|
|
* @param bIsItemExpanded True if the item is expanded, false if it is collapsed
|
|
|
|
|
*/
|
|
|
|
|
void SetNodeExpansionStateRecursive( TSharedRef<IDetailTreeNode> InTreeNode, bool bIsItemExpanded );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when an item is expanded or collapsed in the detail tree
|
|
|
|
|
*
|
|
|
|
|
* @param InTreeNode The node that was expanded or collapsed
|
|
|
|
|
* @param bIsItemExpanded True if the item is expanded, false if it is collapsed
|
|
|
|
|
*/
|
|
|
|
|
void OnItemExpansionChanged( TSharedRef<IDetailTreeNode> InTreeNode, bool bIsItemExpanded );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function called through a delegate on the TreeView to request children of a tree node
|
|
|
|
|
*
|
|
|
|
|
* @param InTreeNode The tree node to get children from
|
|
|
|
|
* @param OutChildren The list of children of InTreeNode that should be visible
|
|
|
|
|
*/
|
|
|
|
|
void OnGetChildrenForDetailTree( TSharedRef<IDetailTreeNode> InTreeNode, TArray< TSharedRef<IDetailTreeNode> >& OutChildren );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns an SWidget used as the visual representation of a node in the treeview.
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<ITableRow> OnGenerateRowForDetailTree( TSharedRef<IDetailTreeNode> InTreeNode, const TSharedRef<STableViewBase>& OwnerTable );
|
|
|
|
|
|
2014-05-29 17:45:44 -04:00
|
|
|
/** @return true if show only modified is checked */
|
|
|
|
|
bool IsShowOnlyModifiedChecked() const { return CurrentFilter.bShowOnlyModifiedProperties; }
|
|
|
|
|
|
|
|
|
|
/** @return true if show all advanced is checked */
|
|
|
|
|
bool IsShowAllAdvancedChecked() const { return CurrentFilter.bShowAllAdvanced; }
|
|
|
|
|
|
2014-08-12 16:54:27 -04:00
|
|
|
/** @return true if show only differing is checked */
|
|
|
|
|
bool IsShowOnlyDifferingChecked() const { return CurrentFilter.bShowOnlyDiffering; }
|
|
|
|
|
|
2014-11-19 06:38:05 -05:00
|
|
|
/** @return true if show all advanced is checked */
|
|
|
|
|
bool IsShowAllChildrenIfCategoryMatchesChecked() const { return CurrentFilter.bShowAllChildrenIfCategoryMatches; }
|
|
|
|
|
|
2014-05-29 17:45:44 -04:00
|
|
|
/** Called when show only modified is clicked */
|
|
|
|
|
void OnShowOnlyModifiedClicked();
|
|
|
|
|
|
2014-11-19 06:38:05 -05:00
|
|
|
/** Called when show all advanced is clicked */
|
|
|
|
|
void OnShowAllAdvancedClicked();
|
|
|
|
|
|
2014-08-12 16:54:27 -04:00
|
|
|
/** Called when show only differing is clicked */
|
|
|
|
|
void OnShowOnlyDifferingClicked();
|
|
|
|
|
|
2014-11-19 06:38:05 -05:00
|
|
|
/** Called when show all children if category matches is clicked */
|
|
|
|
|
void OnShowAllChildrenIfCategoryMatchesClicked();
|
2014-05-29 17:45:44 -04:00
|
|
|
|
2014-06-17 09:41:33 -04:00
|
|
|
/**
|
|
|
|
|
* Updates the details with the passed in filter
|
|
|
|
|
*/
|
|
|
|
|
void UpdateFilteredDetails();
|
2014-05-29 17:45:44 -04:00
|
|
|
|
|
|
|
|
/** Called when the filter text changes. This filters specific property nodes out of view */
|
|
|
|
|
void OnFilterTextChanged(const FText& InFilterText);
|
|
|
|
|
|
2014-08-25 19:23:04 -04:00
|
|
|
/** Called when the list of currently differing properties changes */
|
2014-10-23 13:16:13 -04:00
|
|
|
virtual void UpdatePropertiesWhitelist(const TSet<FPropertyPath> InWhitelistedProperties) override { CurrentFilter.WhitelistedProperties = InWhitelistedProperties; }
|
2014-08-12 16:54:27 -04:00
|
|
|
|
2015-01-15 16:59:07 -05:00
|
|
|
virtual TSharedPtr<SWidget> GetNameAreaWidget() override;
|
|
|
|
|
virtual TSharedPtr<SWidget> GetFilterAreaWidget() override;
|
2015-04-10 02:12:33 -04:00
|
|
|
virtual TSharedPtr<class FUICommandList> GetHostCommandList() const override;
|
2015-01-15 16:59:07 -05:00
|
|
|
|
2014-05-29 17:45:44 -04:00
|
|
|
/**
|
|
|
|
|
* Hides or shows properties based on the passed in filter text
|
|
|
|
|
*
|
|
|
|
|
* @param InFilterText The filter text
|
|
|
|
|
*/
|
|
|
|
|
void FilterView( const FString& InFilterText );
|
|
|
|
|
|
2014-06-17 09:41:33 -04:00
|
|
|
/** Called to get the visibility of the filter box */
|
|
|
|
|
EVisibility GetFilterBoxVisibility() const;
|
2014-05-29 17:43:55 -04:00
|
|
|
protected:
|
|
|
|
|
/** The user defined args for the details view */
|
|
|
|
|
FDetailsViewArgs DetailsViewArgs;
|
|
|
|
|
/** A mapping of class (or struct) to properties in that struct (only top level, non-deeply nested properties appear in this map) */
|
|
|
|
|
FClassToPropertyMap ClassToPropertyMap;
|
|
|
|
|
/** A mapping unique classes being viewed to their variable names (for multiple of the same type being viewed)*/
|
|
|
|
|
TSet< TWeakObjectPtr<UStruct> > ClassesWithProperties;
|
|
|
|
|
/** A mapping of classes to detail layout delegates, called when querying for custom detail layouts in this instance of the details view only*/
|
|
|
|
|
FCustomDetailLayoutMap InstancedClassToDetailLayoutMap;
|
|
|
|
|
/** The current detail layout based on selection */
|
|
|
|
|
TSharedPtr<class FDetailLayoutBuilderImpl> DetailLayout;
|
2015-01-15 16:59:07 -05:00
|
|
|
/** Row for searching and view options */
|
|
|
|
|
TSharedPtr<SHorizontalBox> FilterRow;
|
2014-05-29 17:43:55 -04:00
|
|
|
/** Search box */
|
|
|
|
|
TSharedPtr<SWidget> SearchBox;
|
|
|
|
|
/** Customization class instances currently active in this view */
|
|
|
|
|
TArray< TSharedPtr<IDetailCustomization> > CustomizationClassInstances;
|
|
|
|
|
/** Customization instances that need to be destroyed when safe to do so */
|
|
|
|
|
TArray< TSharedPtr<IDetailCustomization> > CustomizationClassInstancesPendingDelete;
|
|
|
|
|
/** Map of nodes that are requesting an automatic expansion/collapse due to being filtered */
|
|
|
|
|
TMap< TSharedRef<IDetailTreeNode>, bool > FilteredNodesRequestingExpansionState;
|
|
|
|
|
/** Current set of expanded detail nodes (by path) that should be saved when the details panel closes */
|
|
|
|
|
TSet<FString> ExpandedDetailNodes;
|
|
|
|
|
/** Tree view */
|
|
|
|
|
TSharedPtr<SDetailTree> DetailTree;
|
|
|
|
|
/** Root tree nodes visible in the tree */
|
|
|
|
|
TArray< TSharedRef<IDetailTreeNode> > RootTreeNodes;
|
|
|
|
|
/** Delegate executed to determine if a property should be visible */
|
|
|
|
|
FIsPropertyVisible IsPropertyVisibleDelegate;
|
2015-03-13 12:41:11 -04:00
|
|
|
/** Delegate executed to determine if a property should be read-only */
|
|
|
|
|
FIsPropertyReadOnly IsPropertyReadOnlyDelegate;
|
2014-05-29 17:43:55 -04:00
|
|
|
/** Delegate called to see if a property editing is enabled */
|
|
|
|
|
FIsPropertyEditingEnabled IsPropertyEditingEnabledDelegate;
|
|
|
|
|
/** Delegate called when the details panel finishes editing a property (after post edit change is called) */
|
|
|
|
|
FOnFinishedChangingProperties OnFinishedChangingPropertiesDelegate;
|
|
|
|
|
/** Container for passing around column size data to rows in the tree (each row has a splitter which can affect the column size)*/
|
|
|
|
|
FDetailColumnSizeData ColumnSizeData;
|
|
|
|
|
/** The actual width of the right column. The left column is 1-ColumnWidth */
|
|
|
|
|
float ColumnWidth;
|
|
|
|
|
/** True if there is an active filter (text in the filter box) */
|
|
|
|
|
bool bHasActiveFilter;
|
|
|
|
|
/** True if this property view is currently locked (I.E The objects being observed are not changed automatically due to user selection)*/
|
|
|
|
|
bool bIsLocked;
|
|
|
|
|
/** The property node that the color picker is currently editing. */
|
|
|
|
|
TWeakPtr< FPropertyNode > ColorPropertyNode;
|
|
|
|
|
/** Whether or not this instance of the details view opened a color picker and it is not closed yet */
|
|
|
|
|
bool bHasOpenColorPicker;
|
|
|
|
|
/** Settings for this view */
|
|
|
|
|
TSharedPtr<class IPropertyUtilities> PropertyUtilities;
|
|
|
|
|
/** The name area which is not recreated when selection changes */
|
|
|
|
|
TSharedPtr<class SDetailNameArea> NameArea;
|
|
|
|
|
/** Asset pool for rendering and managing asset thumbnails visible in this view*/
|
|
|
|
|
mutable TSharedPtr<class FAssetThumbnailPool> ThumbnailPool;
|
|
|
|
|
/** The current filter */
|
|
|
|
|
FDetailFilter CurrentFilter;
|
|
|
|
|
/** Delegate called to get generic details not specific to an object being viewed */
|
|
|
|
|
FOnGetDetailCustomizationInstance GenericLayoutDelegate;
|
|
|
|
|
/** Actions that should be executed next tick */
|
|
|
|
|
TArray<FSimpleDelegate> DeferredActions;
|
2014-06-17 09:41:33 -04:00
|
|
|
|
|
|
|
|
/** Root tree node that needs to be destroyed when safe */
|
|
|
|
|
TSharedPtr<FComplexPropertyNode> RootNodePendingKill;
|
|
|
|
|
|
2014-10-14 13:37:45 -04:00
|
|
|
/** The handler for the keyframe UI, determines if the key framing UI should be displayed. */
|
2014-07-24 23:52:28 -04:00
|
|
|
TSharedPtr<IDetailKeyframeHandler> KeyframeHandler;
|
|
|
|
|
|
2014-10-14 13:37:45 -04:00
|
|
|
/** Property extension handler returns additional UI to apply after the customization is applied to the property. */
|
|
|
|
|
TSharedPtr<IDetailPropertyExtensionHandler> ExtensionHandler;
|
|
|
|
|
|
2014-06-17 09:41:33 -04:00
|
|
|
/** External property nodes which need to validated each tick */
|
2014-12-10 10:57:36 -05:00
|
|
|
TArray< TWeakPtr<FPropertyNode> > ExternalRootPropertyNodes;
|
2014-08-12 16:54:27 -04:00
|
|
|
|
2014-10-23 13:16:13 -04:00
|
|
|
/** The tree node that is currently highlighted, may be none: */
|
|
|
|
|
TWeakPtr< IDetailTreeNode > CurrentlyHighlightedNode;
|
|
|
|
|
|
|
|
|
|
/** Executed when the tree is refreshed */
|
|
|
|
|
FOnDisplayedPropertiesChanged OnDisplayedPropertiesChangedDelegate;
|
|
|
|
|
|
|
|
|
|
/** True if we want to skip generation of custom layouts for displayed object */
|
|
|
|
|
bool bDisableCustomDetailLayouts;
|
2015-04-01 07:20:55 -04:00
|
|
|
};
|