// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "RewindDebuggerTrack.h" #include "SSimpleTimeSlider.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/SCompoundWidget.h" #include "Widgets/Views/STreeView.h" class SRewindDebuggerTimelines : public SSimpleTimeSlider { using FOnSelectionChanged = STreeView>::FOnSelectionChanged; public: SLATE_BEGIN_ARGS(SRewindDebuggerTimelines) {} SLATE_ARGUMENT(TArray< TSharedPtr< RewindDebugger::FRewindDebuggerTrack > >*, Tracks); SLATE_ARGUMENT(TSharedPtr, ExternalScrollbar) SLATE_EVENT(FOnSelectionChanged, OnSelectionChanged) SLATE_EVENT(FOnTableViewScrolled, OnScrolled) SLATE_EVENT(FSimpleDelegate, OnExpansionChanged) /** The scrub position */ SLATE_ATTRIBUTE(double, ScrubPosition); /** View time range */ SLATE_ATTRIBUTE(TRange, ViewRange); /** Clamp time range */ SLATE_ATTRIBUTE(TRange, ClampRange); /** Called when the scrub position changes */ SLATE_EVENT(FOnScrubPositionChanged, OnScrubPositionChanged); /** Called right before the scrubber begins to move */ SLATE_EVENT(FSimpleDelegate, OnBeginScrubberMovement); /** Called right after the scrubber handle is released by the user */ SLATE_EVENT(FSimpleDelegate, OnEndScrubberMovement); /** Called when the view range changes */ SLATE_EVENT(FOnRangeChanged, OnViewRangeChanged); SLATE_END_ARGS() /** * Constructs the application. * * @param InArgs The Slate argument list. */ void Construct(const FArguments& InArgs); void Refresh(); void RestoreExpansion(); void SetSelection(TSharedPtr SelectedItem) const; void ScrollTo(double ScrollOffset) const; virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override; private: TSharedRef TreeViewGenerateRow(TSharedPtr InItem, const TSharedRef& OwnerTable); void TimelineViewExpansionChanged(TSharedPtr InItem, bool bShouldBeExpanded) const; TArray>* Tracks = nullptr; TSharedPtr>> TreeView; FSimpleDelegate OnExpansionChanged; };