79 lines
1.9 KiB
C++
79 lines
1.9 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Styling/SlateColor.h"
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
#include "Widgets/SWidget.h"
|
|
#include "Widgets/Views/STableViewBase.h"
|
|
#include "Widgets/Views/STableRow.h"
|
|
#include "Widgets/Views/SListView.h"
|
|
#include "Models/WidgetReflectorNode.h"
|
|
|
|
/**
|
|
* Widget that visualizes the contents of a FReflectorNode.
|
|
*/
|
|
class SReflectorTreeWidgetItem
|
|
: public SMultiColumnTableRow<TSharedRef<FWidgetReflectorNodeBase>>
|
|
{
|
|
public:
|
|
|
|
static FName NAME_WidgetName;
|
|
static FName NAME_WidgetInfo;
|
|
static FName NAME_Visibility;
|
|
static FName NAME_Focusable;
|
|
static FName NAME_Enabled;
|
|
static FName NAME_Volatile;
|
|
static FName NAME_HasActiveTimer;
|
|
static FName NAME_Clipping;
|
|
static FName NAME_LayerId;
|
|
static FName NAME_ForegroundColor;
|
|
static FName NAME_Address;
|
|
static FName NAME_ActualSize;
|
|
|
|
SLATE_BEGIN_ARGS(SReflectorTreeWidgetItem)
|
|
: _WidgetInfoToVisualize()
|
|
, _SourceCodeAccessor()
|
|
, _AssetAccessor()
|
|
{ }
|
|
|
|
SLATE_ARGUMENT(TSharedPtr<FWidgetReflectorNodeBase>, WidgetInfoToVisualize)
|
|
SLATE_ARGUMENT(FAccessSourceCode, SourceCodeAccessor)
|
|
SLATE_ARGUMENT(FAccessAsset, AssetAccessor)
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
public:
|
|
|
|
/**
|
|
* Construct child widgets that comprise this widget.
|
|
*
|
|
* @param InArgs Declaration from which to construct this widget.
|
|
*/
|
|
void Construct(const FArguments& InArgs, const TSharedRef<STableViewBase>& InOwnerTableView);
|
|
|
|
public:
|
|
|
|
// SMultiColumnTableRow overrides
|
|
virtual TSharedRef<SWidget> GenerateWidgetForColumn( const FName& ColumnName ) override;
|
|
|
|
protected:
|
|
|
|
/** @return The tint of the reflector node */
|
|
FSlateColor GetTint() const
|
|
{
|
|
return WidgetInfo->GetTint();
|
|
}
|
|
|
|
void HandleHyperlinkNavigate();
|
|
|
|
private:
|
|
|
|
/** The info about the widget that we are visualizing. */
|
|
TSharedPtr<FWidgetReflectorNodeBase> WidgetInfo;
|
|
|
|
FAccessSourceCode OnAccessSourceCode;
|
|
FAccessAsset OnAccessAsset;
|
|
};
|