TSharedRef<SDockTab> FCurveAssetEditor::SpawnTab_CurveAsset( const FSpawnTabArgs& Args ) { check( Args.GetTabId().TabType == CurveTabId ); ViewMinInput=0.f; ViewMaxInput=5.f; InputSnap = 0.1f; OutputSnap = 0.05f; TSharedRef<SDockTab> NewDockTab = SNew(SDockTab) .Icon( FEditorStyle::GetBrush("CurveAssetEditor.Tabs.Properties") ) .Label( FText::Format(LOCTEXT("CurveAssetEditorTitle", "{0} Curve Asset"), FText::FromString(GetTabPrefix()))) .TabColorScale( GetTabColorScale() ) [ SNew(SBorder) .BorderImage( FEditorStyle::GetBrush("ToolPanel.GroupBorder") ) .Padding(0.0f) [ SAssignNew(TrackWidget, SCurveEditor) .ViewMinInput(this, &FCurveAssetEditor::GetViewMinInput) .ViewMaxInput(this, &FCurveAssetEditor::GetViewMaxInput) .InputSnap(this, &FCurveAssetEditor::GetInputSnap) .OutputSnap(this, &FCurveAssetEditor::GetOutputSnap) .TimelineLength(this, &FCurveAssetEditor::GetTimelineLength) .OnSetInputViewRange(this, &FCurveAssetEditor::SetInputViewRange) .HideUI(false) .AlwaysDisplayColorCurves(true) .ShowZoomButtons(false) ] ]; UCurveBase* Curve = Cast<UCurveBase>(GetEditingObject()); UCurveFloat* FloatCurve = Cast<UCurveFloat>(Curve); UCurveVector* VectorCurve = Cast<UCurveVector>(Curve); UCurveLinearColor* LinearColorCurve = Cast<UCurveLinearColor>(Curve); FCurveOwnerInterface* CurveOwner = NULL; if(FloatCurve != NULL) { CurveOwner = FloatCurve; } else if(LinearColorCurve != NULL) { CurveOwner = LinearColorCurve; } else { CurveOwner = VectorCurve; } if (CurveOwner != NULL) { check(TrackWidget.IsValid()); // Set this curve as the SCurveEditor's selected curve TrackWidget->SetCurveOwner(CurveOwner); } return NewDockTab; }
TSharedRef<SDockTab> FPropertyEditorToolkit::SpawnTab_PropertyTable( const FSpawnTabArgs& Args ) { check( Args.GetTabId() == GridTabId ); FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>( "PropertyEditor" ); TSharedRef<SDockTab> GridToolkitTab = SNew(SDockTab) .Icon( FEditorStyle::GetBrush("PropertyEditor.Grid.TabIcon") ) .Label( LOCTEXT("GenericGridTitle", "Grid") ) .TabColorScale( GetTabColorScale() ) .Content() [ SNew( SOverlay ) +SOverlay::Slot() [ PropertyEditorModule.CreatePropertyTableWidget( PropertyTable.ToSharedRef() ) ] +SOverlay::Slot() .HAlign( HAlign_Right ) .VAlign( VAlign_Top ) .Padding( FMargin( 0, 3, 0, 0 ) ) [ SNew( SHorizontalBox ) +SHorizontalBox::Slot() .AutoWidth() .HAlign( HAlign_Center ) .VAlign( VAlign_Center ) [ SNew( SImage ) .Image( FEditorStyle::GetBrush( "PropertyEditor.AddColumnOverlay" ) ) .Visibility( this, &FPropertyEditorToolkit::GetAddColumnInstructionsOverlayVisibility ) ] +SHorizontalBox::Slot() .AutoWidth() .HAlign( HAlign_Center ) .VAlign( VAlign_Center ) [ SNew( SImage ) .Image( FEditorStyle::GetBrush( "PropertyEditor.RemoveColumn" ) ) .Visibility( this, &FPropertyEditorToolkit::GetAddColumnInstructionsOverlayVisibility ) ] +SHorizontalBox::Slot() .AutoWidth() .HAlign( HAlign_Center ) .VAlign( VAlign_Center ) .Padding( FMargin( 0, 0, 3, 0 ) ) [ SNew( STextBlock ) .Font( FEditorStyle::GetFontStyle( "PropertyEditor.AddColumnMessage.Font" ) ) .Text( LOCTEXT("GenericPropertiesTitle", "Pin Properties to Add Columns") ) .Visibility( this, &FPropertyEditorToolkit::GetAddColumnInstructionsOverlayVisibility ) .ColorAndOpacity( FEditorStyle::GetColor( "PropertyEditor.AddColumnMessage.ColorAndOpacity" ) ) ] ] ]; return GridToolkitTab; }
TSharedRef<SDockTab> FSequencerAssetEditor::SpawnTab_SequencerMain(const FSpawnTabArgs& Args) { check(Args.GetTabId() == SequencerMainTabId); return SNew(SDockTab) .Icon( FEditorStyle::GetBrush("Sequencer.Tabs.SequencerMain") ) .Label( LOCTEXT("SequencerMainTitle", "Sequencer") ) .TabColorScale( GetTabColorScale() ) [ Sequencer->GetSequencerWidget() ]; }
TSharedRef<SDockTab> FSimpleAssetEditor::SpawnPropertiesTab( const FSpawnTabArgs& Args ) { check( Args.GetTabId() == PropertiesTabId ); return SNew(SDockTab) .Icon( FEditorStyle::GetBrush("GenericEditor.Tabs.Properties") ) .Label( LOCTEXT("GenericDetailsTitle", "Details") ) .TabColorScale( GetTabColorScale() ) [ DetailsView.ToSharedRef() ]; }
TSharedRef<SDockTab> FNiagaraEditor::SpawnTab_NodeGraph( const FSpawnTabArgs& Args ) { check( Args.GetTabId().TabType == NodeGraphTabId ); TSharedRef<SGraphEditor> NodeGraphEditor = CreateGraphEditorWidget(Source->NodeGraph); NodeGraphEditorPtr = NodeGraphEditor; // Keep pointer to editor return SNew(SDockTab) .Label( LOCTEXT("NodeGraph", "Node Graph") ) .TabColorScale( GetTabColorScale() ) [ NodeGraphEditor ]; }
TSharedRef<SDockTab> FNiagaraEffectEditor::SpawnTab(const FSpawnTabArgs& Args) { check(Args.GetTabId().TabType == UpdateTabId); TSharedRef<SNiagaraEffectEditorWidget> Editor = CreateEditorWidget(Effect); UpdateEditorPtr = Editor; // Keep pointer to editor return SNew(SDockTab) .Label(LOCTEXT("NiagaraEffect", "Niagara Effect")) .TabColorScale(GetTabColorScale()) [ Editor ]; }
TSharedRef<SDockTab> FPropertyEditorToolkit::SpawnTab_PropertyTree( const FSpawnTabArgs& Args ) { check( Args.GetTabId() == TreeTabId ); TSharedRef<SDockTab> TreeToolkitTab = SNew(SDockTab) .Icon( FEditorStyle::GetBrush("PropertyEditor.Properties.TabIcon") ) .Label( LOCTEXT("GenericDetailsTitle", "Details") ) .TabColorScale( GetTabColorScale() ) .Content() [ SNew(SBorder) .Padding(4) .BorderImage( FEditorStyle::GetBrush( "ToolPanel.GroupBorder" ) ) .Content() [ PropertyTree.ToSharedRef() ] ]; return TreeToolkitTab; }