本文整理汇总了C++中SAssignNew函数的典型用法代码示例。如果您正苦于以下问题:C++ SAssignNew函数的具体用法?C++ SAssignNew怎么用?C++ SAssignNew使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SAssignNew函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FLinearColor
void SAnimMontageSectionsPanel::Update()
{
int32 ColorIdx=0;
FLinearColor Colors[] = { FLinearColor(0.9f, 0.9f, 0.9f, 0.9f), FLinearColor(0.5f, 0.5f, 0.5f) };
FLinearColor NodeColor = FLinearColor(0.f, 0.5f, 0.0f, 0.5f);
FLinearColor SelectedColor = FLinearColor(1.0f,0.65,0.0f);
FLinearColor LoopColor = FLinearColor(0.0f, 0.25f, 0.25f, 0.5f);
if ( Montage != NULL )
{
TSharedPtr<STrack> Track;
TSharedPtr<SVerticalBox> MontageSlots;
PanelArea->SetContent(
SAssignNew( MontageSlots, SVerticalBox )
);
SectionMap.Empty();
TopSelectionSet.Empty();
SelectionSet.Empty();
MontageSlots->ClearChildren();
SMontageEditor * Editor = MontageEditor.Pin().Get();
TArray<bool> Used;
Used.AddZeroed(Montage->CompositeSections.Num());
int RowIdx=0;
/** Create Buttons for reseting/creating default section ordering */
MontageSlots->AddSlot()
.AutoHeight()
.VAlign(VAlign_Center)
.Padding( FMargin(0.5f, 0.5f) )
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
.VAlign(VAlign_Center)
[
SNew(SButton)
.Visibility( EVisibility::Visible )
.Text( LOCTEXT("CreateDefault", "Create Default") )
.ToolTipText( LOCTEXT("CreateDefaultToolTip", "Reconstructs section ordering based on start time") )
.OnClicked(this, &SAnimMontageSectionsPanel::MakeDefaultSequence)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
]
+ SHorizontalBox::Slot()
.AutoWidth()
.VAlign(VAlign_Center)
[
SNew(SButton)
.Visibility( EVisibility::Visible )
.Text( LOCTEXT("Clear", "Clear") )
.ToolTipText( LOCTEXT("ClearToolTip", "Resets section orderings") )
.OnClicked(this, &SAnimMontageSectionsPanel::ClearSequence)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
]
];
/** Create top track of section nodes */
MontageSlots->AddSlot()
.AutoHeight()
.VAlign(VAlign_Center)
.Padding( FMargin(0.5f, 20.0f) )
[
SAssignNew(Track, STrack)
.ViewInputMin(0)
.ViewInputMax(100)
.TrackColor( FLinearColor(0.0f, 0.0f, 0.0f, 0.0f))
.TrackMaxValue(100)
];
for(int32 SectionIdx=0; SectionIdx < Montage->CompositeSections.Num(); SectionIdx++)
{
const float NodeLength = 100.f / static_cast<float>(Montage->CompositeSections.Num()+1);
const float NodeSpacing = 100.f / static_cast<float>(Montage->CompositeSections.Num());
Track->AddTrackNode(
SNew(STrackNode)
.ViewInputMax(100)
.ViewInputMin(0)
.NodeColor(NodeColor)
.SelectedNodeColor(SelectedColor)
.DataLength(NodeLength)
.DataStartPos(NodeSpacing * SectionIdx)
.NodeName(Montage->CompositeSections[SectionIdx].SectionName.ToString())
.NodeSelectionSet(&TopSelectionSet)
.OnTrackNodeClicked( this, &SAnimMontageSectionsPanel::TopSectionClicked, SectionIdx)
.AllowDrag(false)
);
}
MontageSlots->AddSlot()
.AutoHeight()
//.........这里部分代码省略.........
示例2: Construct
/** Constructs this widget with InArgs */
void Construct(const FArguments& InArgs)
{
bOkClicked = false;
ParentClass = UGameplayAbility::StaticClass();
ChildSlot
[
SNew(SBorder)
.Visibility(EVisibility::Visible)
.BorderImage(FEditorStyle::GetBrush("Menu.Background"))
[
SNew(SBox)
.Visibility(EVisibility::Visible)
.WidthOverride(500.0f)
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.FillHeight(1)
[
SNew(SBorder)
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
.Content()
[
SAssignNew(ParentClassContainer, SVerticalBox)
]
]
// Ok/Cancel buttons
+ SVerticalBox::Slot()
.AutoHeight()
.HAlign(HAlign_Right)
.VAlign(VAlign_Bottom)
.Padding(8)
[
SNew(SUniformGridPanel)
.SlotPadding(FEditorStyle::GetMargin("StandardDialog.SlotPadding"))
.MinDesiredSlotWidth(FEditorStyle::GetFloat("StandardDialog.MinDesiredSlotWidth"))
.MinDesiredSlotHeight(FEditorStyle::GetFloat("StandardDialog.MinDesiredSlotHeight"))
+ SUniformGridPanel::Slot(0, 0)
[
SNew(SButton)
.HAlign(HAlign_Center)
.ContentPadding(FEditorStyle::GetMargin("StandardDialog.ContentPadding"))
.OnClicked(this, &SGameplayAbilityBlueprintCreateDialog::OkClicked)
.Text(LOCTEXT("CreateGameplayAbilityBlueprintOk", "OK"))
]
+ SUniformGridPanel::Slot(1, 0)
[
SNew(SButton)
.HAlign(HAlign_Center)
.ContentPadding(FEditorStyle::GetMargin("StandardDialog.ContentPadding"))
.OnClicked(this, &SGameplayAbilityBlueprintCreateDialog::CancelClicked)
.Text(LOCTEXT("CreateGameplayAbilityBlueprintCancel", "Cancel"))
]
]
]
]
];
MakeParentClassPicker();
}
示例3: ModeSwitchButtons
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SLandscapeEditor::Construct(const FArguments& InArgs, TSharedRef<FLandscapeToolKit> InParentToolkit)
{
TSharedRef<FUICommandList> CommandList = InParentToolkit->GetToolkitCommands();
// Modes:
FToolBarBuilder ModeSwitchButtons(CommandList, FMultiBoxCustomization::None);
{
ModeSwitchButtons.AddToolBarButton(FLandscapeEditorCommands::Get().ManageMode, NAME_None, LOCTEXT("Mode.Manage", "Manage"), LOCTEXT("Mode.Manage.Tooltip", "Contains tools to add a new landscape, import/export landscape, add/remove components and manage streaming"));
ModeSwitchButtons.AddToolBarButton(FLandscapeEditorCommands::Get().SculptMode, NAME_None, LOCTEXT("Mode.Sculpt", "Sculpt"), LOCTEXT("Mode.Sculpt.Tooltip", "Contains tools that modify the shape of a landscape"));
ModeSwitchButtons.AddToolBarButton(FLandscapeEditorCommands::Get().PaintMode, NAME_None, LOCTEXT("Mode.Paint", "Paint"), LOCTEXT("Mode.Paint.Tooltip", "Contains tools that paint materials on to a landscape"));
}
FPropertyEditorModule& PropertyEditorModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
FDetailsViewArgs DetailsViewArgs(false, false, false,FDetailsViewArgs::HideNameArea);
DetailsPanel = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
DetailsPanel->SetIsPropertyVisibleDelegate(FIsPropertyVisible::CreateSP(this, &SLandscapeEditor::GetIsPropertyVisible));
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
if (LandscapeEdMode)
{
DetailsPanel->SetObject(LandscapeEdMode->UISettings);
}
IIntroTutorials& IntroTutorials = FModuleManager::LoadModuleChecked<IIntroTutorials>(TEXT("IntroTutorials"));
ChildSlot
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0, 0, 0, 5)
[
SAssignNew(Error, SErrorText)
]
+ SVerticalBox::Slot()
.Padding(0)
[
SNew(SVerticalBox)
.IsEnabled(this, &SLandscapeEditor::GetLandscapeEditorIsEnabled)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(4, 0, 4, 5)
[
SNew(SOverlay)
+ SOverlay::Slot()
[
SNew(SBorder)
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
.HAlign(HAlign_Center)
[
ModeSwitchButtons.MakeWidget()
]
]
// Tutorial link
+ SOverlay::Slot()
.HAlign(HAlign_Right)
.VAlign(VAlign_Bottom)
.Padding(4)
[
IntroTutorials.CreateTutorialsWidget(TEXT("LandscapeMode"))
]
]
+ SVerticalBox::Slot()
.Padding(0)
[
DetailsPanel.ToSharedRef()
]
]
];
}
示例4: check
/**
* Invoked when the drag and drop operation has ended.
*
* @param bDropWasHandled true when the drop was handled by some widget; false otherwise
*/
void FDockingDragOperation::OnDrop( bool bDropWasHandled, const FPointerEvent& MouseEvent )
{
check(CursorDecoratorWindow.IsValid());
const FVector2D WindowSize = CursorDecoratorWindow->GetSizeInScreen();
// Destroy the CursorDecoratorWindow by calling the base class implementation because we are relocating the content into a more permanent home.
FDragDropOperation::OnDrop(bDropWasHandled, MouseEvent);
TabBeingDragged->SetDraggedOverDockArea( NULL );
if (!bDropWasHandled)
{
// If we dropped the tab into an existing DockNode then it would have handled the DropEvent.
// We are here because that didn't happen, so make a new window with a new DockNode and drop the tab into that.
const FVector2D PositionToDrop = MouseEvent.GetScreenSpacePosition() - GetDecoratorOffsetFromCursor();
TSharedRef<FTabManager> MyTabManager = TabBeingDragged->GetTabManager();
TSharedPtr<SWindow> NewWindowParent = MyTabManager->GetPrivateApi().GetParentWindow();
TSharedRef<SWindow> NewWindow = SNew(SWindow)
.Title( FGlobalTabmanager::Get()->GetApplicationTitle() )
.AutoCenter(EAutoCenter::None)
.ScreenPosition( PositionToDrop )
// Make room for the title bar; otherwise windows will get progressive smaller whenver you float them.
.ClientSize( SWindow::ComputeWindowSizeForContent( WindowSize ) )
.CreateTitleBar(false);
TSharedPtr<SDockingTabStack> NewDockNode;
if ( TabBeingDragged->GetTabRole() == ETabRole::NomadTab )
{
TabBeingDragged->SetTabManager(FGlobalTabmanager::Get());
}
// Create a new dockarea
TSharedRef<SDockingArea> NewDockArea =
SNew(SDockingArea, TabBeingDragged->GetTabManager(), FTabManager::NewPrimaryArea())
. ParentWindow( NewWindow )
. InitialContent
(
SAssignNew(NewDockNode, SDockingTabStack, FTabManager::NewStack())
);
if (TabBeingDragged->GetTabRole() == ETabRole::MajorTab || TabBeingDragged->GetTabRole() == ETabRole::NomadTab)
{
TSharedPtr<SWindow> RootWindow = FGlobalTabmanager::Get()->GetRootWindow();
if ( RootWindow.IsValid() )
{
// We have a root window, so all MajorTabs are nested under it.
FSlateApplication::Get().AddWindowAsNativeChild( NewWindow, RootWindow.ToSharedRef() )->SetContent(NewDockArea);
}
else
{
// App tabs get put in top-level windows. They show up on the taskbar.
FSlateApplication::Get().AddWindow( NewWindow )->SetContent(NewDockArea);
}
}
else
{
// Other tab types are placed in child windows. Their life is controlled by the top-level windows.
// They do not show up on the taskbar.
if ( NewWindowParent.IsValid() )
{
FSlateApplication::Get().AddWindowAsNativeChild( NewWindow, NewWindowParent.ToSharedRef() )->SetContent(NewDockArea);
}
else
{
FSlateApplication::Get().AddWindow( NewWindow )->SetContent(NewDockArea);
}
}
// Do this after the window parenting so that the window title is set correctly
NewDockNode->OpenTab(TabBeingDragged.ToSharedRef());
// Let every widget under this tab manager know that this tab has found a new home.
TabOwnerAreaOfOrigin->GetTabManager()->GetPrivateApi().OnTabRelocated( TabBeingDragged.ToSharedRef(), NewWindow );
}
else
{
// The event was handled, so we HAVE to have some window that we dropped onto.
TSharedRef<SWindow> WindowDroppedInto = MouseEvent.GetWindow();
// Let every widget under this tab manager know that this tab has found a new home.
TSharedPtr<SWindow> NewWindow = ( TabOwnerAreaOfOrigin->GetParentWindow() == WindowDroppedInto )
// Tab dropped into same window as before, meaning there is no NewWindow.
? TSharedPtr<SWindow>()
// Tab was dropped into a different window, so the tab manager needs to know in order to re-parent child windows.
: WindowDroppedInto;
TabOwnerAreaOfOrigin->GetTabManager()->GetPrivateApi().OnTabRelocated( TabBeingDragged.ToSharedRef(), WindowDroppedInto );
}
//.........这里部分代码省略.........
示例5: ViewComboContent
void SBlueprintProfilerView::UpdateActiveProfilerWidget()
{
FMenuBuilder ViewComboContent(true, NULL);
ViewComboContent.AddMenuEntry( LOCTEXT("OverviewViewType", "Profiler Overview"),
LOCTEXT("OverviewViewTypeDesc", "Displays High Level Profiling Information"),
FSlateIcon(),
FExecuteAction::CreateSP(this, &SBlueprintProfilerView::OnViewSelectionChanged, EBlueprintPerfViewType::Overview),
NAME_None,
EUserInterfaceActionType::Button);
ViewComboContent.AddMenuEntry( LOCTEXT("ExecutionGraphViewType", "Execution Graph"),
LOCTEXT("ExecutionGraphViewTypeDesc", "Displays the Execution Graph with Statistics"),
FSlateIcon(),
FExecuteAction::CreateSP(this, &SBlueprintProfilerView::OnViewSelectionChanged, EBlueprintPerfViewType::ExecutionGraph),
NAME_None,
EUserInterfaceActionType::Button);
ViewComboContent.AddMenuEntry( LOCTEXT("LeastPerformantViewType", "Least Performant List"),
LOCTEXT("LeastPerformantViewTypeDesc", "Displays a list of Least Performant Areas of the Blueprint"),
FSlateIcon(),
FExecuteAction::CreateSP(this, &SBlueprintProfilerView::OnViewSelectionChanged, EBlueprintPerfViewType::LeastPerformant),
NAME_None,
EUserInterfaceActionType::Button);
ChildSlot
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.AutoHeight()
.Padding(0)
[
SNew(SBorder)
.BorderImage(FEditorStyle::GetBrush("BlueprintProfiler.ViewToolBar"))
.Padding(0)
.VAlign(VAlign_Top)
.HAlign(HAlign_Right)
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(FMargin(5,0))
[
SAssignNew(ViewComboButton, SComboButton)
.ForegroundColor(this, &SBlueprintProfilerView::GetViewButtonForegroundColor)
.ToolTipText(LOCTEXT("BlueprintProfilerViewType", "View Type"))
.ButtonStyle(FEditorStyle::Get(), "ToggleButton")
.ContentPadding(2)
.MenuContent()
[
ViewComboContent.MakeWidget()
]
.ButtonContent()
[
CreateViewButton()
]
]
]
]
+SVerticalBox::Slot()
[
SNew(SBorder)
.Padding(FMargin(0,2,0,0))
.BorderImage(FEditorStyle::GetBrush("NoBorder"))
[
CreateActiveStatisticWidget()
]
]
];
}
示例6: Construct
/**
* Constructs this widget
*
* @param InArgs Declaration from which to construct the widget
*/
void Construct(const FArguments& InArgs, const TSharedPtr<FString> &_Name, SLiveEditorConfigWindow *_Owner)
{
Name = _Name;
Owner = _Owner;
bIsActive = (Name.Get())? FLiveEditorManager::Get().CheckActive( *Name.Get() ) : false;
Blueprint = LoadObject<UBlueprint>( NULL, *(*Name.Get()), NULL, 0, NULL );
check( Blueprint != NULL
&& Blueprint->GeneratedClass != NULL
&& Blueprint->GeneratedClass->IsChildOf( ULiveEditorBlueprint::StaticClass() ) );
ChildSlot
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(2.0f)
[
SNew( SButton )
.Text( this, &SLiveEditorBlueprint::GetBindButtonText )
.ToolTipText( FString(TEXT("Bind your MIDI hardware to this Blueprint")) )
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
.OnClicked( this, &SLiveEditorBlueprint::BindBlueprint )
]
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(2.0f)
[
SNew( SButton )
.Text( FString(TEXT("Activate")) )
.ToolTipText( FString(TEXT("Make this Blueprint active in the LiveEditor context")) )
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
.Visibility( this, &SLiveEditorBlueprint::CanActivate )
.OnClicked( this, &SLiveEditorBlueprint::ActivateBlueprint )
]
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(2.0f)
[
SNew( SButton )
.Text( FString(TEXT("DeActivate")) )
.ToolTipText( FString(TEXT("Stop this Blueprint running in the LiveEditor context")) )
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
.Visibility( this, &SLiveEditorBlueprint::CanDeActivate )
.OnClicked( this, &SLiveEditorBlueprint::DeActivateBlueprint )
]
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(2.0f)
[
SNew( SButton )
.Text( FString(TEXT("Remove")) )
.ToolTipText( FString(TEXT("Remove this Blueprint from the LiveEditor context")) )
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
.OnClicked( this, &SLiveEditorBlueprint::RemoveBlueprint )
]
+SHorizontalBox::Slot()
.AutoWidth()
.VAlign( VAlign_Center )
.Padding(2.0f)
[
SAssignNew( NameView, STextBlock )
.Text( *Name.Get() )
.ColorAndOpacity( GetFontColor() )
]
];
}
示例7: check
void SComboButton::Construct( const FArguments& InArgs )
{
check(InArgs._ComboButtonStyle);
// Work out which values we should use based on whether we were given an override, or should use the style's version
const FButtonStyle* const OurButtonStyle = InArgs._ButtonStyle ? InArgs._ButtonStyle : &InArgs._ComboButtonStyle->ButtonStyle;
MenuBorderBrush = &InArgs._ComboButtonStyle->MenuBorderBrush;
MenuBorderPadding = InArgs._ComboButtonStyle->MenuBorderPadding;
OnComboBoxOpened = InArgs._OnComboBoxOpened;
ContentWidgetPtr = InArgs._MenuContent.Widget;
bIsFocusable = InArgs._IsFocusable;
TSharedPtr<SHorizontalBox> HBox;
SMenuAnchor::Construct( SMenuAnchor::FArguments()
.Placement(InArgs._MenuPlacement)
.Method(InArgs._Method)
.OnMenuOpenChanged(InArgs._OnMenuOpenChanged)
.OnGetMenuContent(InArgs._OnGetMenuContent)
[
SNew( SButton )
.ButtonStyle( OurButtonStyle )
.ClickMethod( EButtonClickMethod::MouseDown )
.OnClicked( this, &SComboButton::OnButtonClicked )
.ContentPadding( InArgs._ContentPadding )
.ForegroundColor( InArgs._ForegroundColor )
.ButtonColorAndOpacity( InArgs._ButtonColorAndOpacity )
.IsFocusable( InArgs._IsFocusable )
[
// Button and down arrow on the right
// +-------------------+---+
// | Button Content | v |
// +-------------------+---+
SAssignNew( HBox, SHorizontalBox )
+ SHorizontalBox::Slot()
.Expose( ButtonContentSlot )
.FillWidth( 1 )
.HAlign( InArgs._HAlign )
.VAlign( InArgs._VAlign )
[
InArgs._ButtonContent.Widget
]
+ SHorizontalBox::Slot()
.AutoWidth()
.HAlign( HAlign_Center )
.VAlign( VAlign_Center )
.Padding( InArgs._HasDownArrow ? 2 : 0 )
[
SNew( SImage )
.Visibility( InArgs._HasDownArrow ? EVisibility::Visible : EVisibility::Collapsed )
.Image( &InArgs._ComboButtonStyle->DownArrowImage )
// Inherit tinting from parent
. ColorAndOpacity( FSlateColor::UseForeground() )
]
]
]
);
// The menu that pops up when we press the button.
// We keep this content around, and then put it into a new window when we need to pop
// it up.
SetMenuContent( InArgs._MenuContent.Widget );
}
示例8: SNew
void SRealtimeProfilerLineGraph::Construct(const FArguments& InArgs)
{
MaxValue = InArgs._MaxValue;
MaxFrames = InArgs._MaxFrames;
OnGeometryChanged = InArgs._OnGeometryChanged;
Zoom = 1.0f;
Offset = 0.0f;
bIsProfiling = false;
Visualizer = InArgs._Visualizer;
bDisplayFPSChart = false;
ChildSlot
.HAlign(HAlign_Left)
.VAlign(VAlign_Top)
[
SNew(SHorizontalBox)
//START
+SHorizontalBox::Slot()
.AutoWidth()
[
SAssignNew(StartButton,SButton)
.ToolTipText(NSLOCTEXT("RealtimeProfileLineGraph", "StartProfilingButton", "Start"))
.OnClicked(this, &SRealtimeProfilerLineGraph::OnStartButtonDown)
.ContentPadding(1)
.Visibility(this, &SRealtimeProfilerLineGraph::GetStartButtonVisibility)
[
SNew(SImage)
.Image( FEditorStyle::GetBrush("Profiler.Start") )
]
]
//PAUSE
+SHorizontalBox::Slot()
.AutoWidth()
[
SAssignNew(PauseButton,SButton)
.ToolTipText(NSLOCTEXT("RealtimeProfileLineGraph", "PauseProfilingButton", "Pause"))
.OnClicked(this, &SRealtimeProfilerLineGraph::OnPauseButtonDown)
.ContentPadding(1)
.Visibility(this, &SRealtimeProfilerLineGraph::GetPauseButtonVisibility)
[
SNew(SImage)
.Image( FEditorStyle::GetBrush("Profiler.Pause") )
]
]
//STOP
+SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SButton)
.ToolTipText(NSLOCTEXT("RealtimeProfileLineGraph", "StopProfilingButton", "Stop"))
.OnClicked(this, &SRealtimeProfilerLineGraph::OnStopButtonDown)
.ContentPadding(1)
[
SNew(SImage)
.Image( FEditorStyle::GetBrush("Profiler.Stop") )
]
]
//SWITCH GRAPH VIEW
+SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SButton)
.ToolTipText(NSLOCTEXT("RealtimeProfileLineGraph", "SwitchProfilingViewButton", "Switch View"))
.OnClicked(this, &SRealtimeProfilerLineGraph::OnSwitchViewButtonDown)
.ContentPadding(1)
[
SNew(SImage)
.Image( FEditorStyle::GetBrush("Profiler.SwitchView") )
]
]
];
}
示例9: SNew
void SSessionLauncherDeployRepositorySettings::Construct( const FArguments& InArgs, const FSessionLauncherModelRef& InModel )
{
Model = InModel;
ChildSlot
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.FillHeight(1.0)
[
SNew(SBorder)
.Padding(8.0)
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(STextBlock)
.Text(LOCTEXT("RepositoryPathLabel", "Repository Path:").ToString())
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.0, 4.0, 0.0, 0.0)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1.0)
.Padding(0.0, 0.0, 0.0, 3.0)
[
// repository path text box
SAssignNew(RepositoryPathTextBox, SEditableTextBox)
.OnTextCommitted(this, &SSessionLauncherDeployRepositorySettings::OnTextCommitted)
.OnTextChanged(this, &SSessionLauncherDeployRepositorySettings::OnTextChanged)
]
+ SHorizontalBox::Slot()
.AutoWidth()
.HAlign(HAlign_Right)
.Padding(4.0, 0.0, 0.0, 0.0)
[
// browse button
SNew(SButton)
.ContentPadding(FMargin(6.0, 2.0))
.IsEnabled(true)
.Text(LOCTEXT("BrowseButtonText", "Browse...").ToString())
.ToolTipText(LOCTEXT("BrowseButtonToolTip", "Browse for the repository").ToString())
.OnClicked(this, &SSessionLauncherDeployRepositorySettings::HandleBrowseButtonClicked)
]
]
]
]
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(SBorder)
.Padding(8.0f)
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
[
// deploy targets area
SNew(SSessionLauncherDeployTargets, InModel)
]
]
];
}
示例10: GET_MEMBER_NAME_CHECKED
void FSlateFontInfoStructCustomization::CustomizeHeader(TSharedRef<IPropertyHandle> InStructPropertyHandle, FDetailWidgetRow& InHeaderRow, IPropertyTypeCustomizationUtils& InStructCustomizationUtils)
{
static const FName FontObjectPropertyName = GET_MEMBER_NAME_CHECKED(FSlateFontInfo, FontObject);
static const FName TypefaceFontNamePropertyName = GET_MEMBER_NAME_CHECKED(FSlateFontInfo, TypefaceFontName);
static const FName SizePropertyName = GET_MEMBER_NAME_CHECKED(FSlateFontInfo, Size);
StructPropertyHandle = InStructPropertyHandle;
FontObjectProperty = InStructPropertyHandle->GetChildHandle(FontObjectPropertyName);
check(FontObjectProperty.IsValid());
TypefaceFontNameProperty = InStructPropertyHandle->GetChildHandle(TypefaceFontNamePropertyName);
check(TypefaceFontNameProperty.IsValid());
FontSizeProperty = InStructPropertyHandle->GetChildHandle(SizePropertyName);
check(FontSizeProperty.IsValid());
InHeaderRow
.NameContent()
[
InStructPropertyHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(250.0f)
.MaxDesiredWidth(0.0f)
.HAlign(HAlign_Fill)
.VAlign(VAlign_Center)
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.FillWidth(2)
[
SNew(SObjectPropertyEntryBox)
.PropertyHandle(FontObjectProperty)
.AllowedClass(UFont::StaticClass())
.OnShouldFilterAsset(FOnShouldFilterAsset::CreateStatic(&FSlateFontInfoStructCustomization::OnFilterFontAsset))
.OnObjectChanged(this, &FSlateFontInfoStructCustomization::OnFontChanged)
.DisplayUseSelected(false)
.DisplayBrowse(false)
]
+SHorizontalBox::Slot()
.FillWidth(2)
.VAlign(VAlign_Center)
[
SAssignNew(FontEntryCombo, SComboBox<TSharedPtr<FName>>)
.OptionsSource(&FontEntryComboData)
.IsEnabled(this, &FSlateFontInfoStructCustomization::IsFontEntryComboEnabled)
.OnComboBoxOpening(this, &FSlateFontInfoStructCustomization::OnFontEntryComboOpening)
.OnSelectionChanged(this, &FSlateFontInfoStructCustomization::OnFontEntrySelectionChanged)
.OnGenerateWidget(this, &FSlateFontInfoStructCustomization::MakeFontEntryWidget)
[
SNew(STextBlock)
.Text(this, &FSlateFontInfoStructCustomization::GetFontEntryComboText)
.Font(FEditorStyle::GetFontStyle(TEXT("PropertyWindow.NormalFont")))
]
]
+SHorizontalBox::Slot()
.FillWidth(1)
.VAlign(VAlign_Center)
.Padding(FMargin(4.0f, 0.0f, 0.0f, 0.0f))
[
SNew(SProperty, FontSizeProperty)
.ShouldDisplayName(false)
]
];
}
示例11: ToolbarBuilder
TSharedRef<SHorizontalBox> SDistributionCurveEditor::BuildToolBar()
{
SelectedTab = TabNames[0];
FToolBarBuilder ToolbarBuilder( UICommandList, FMultiBoxCustomization::None );
ToolbarBuilder.BeginSection("CurveEditorFit");
{
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().FitHorizontally);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().FitVertically);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().FitToAll);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().FitToSelected);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("CurveEditorMode");
{
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().PanMode);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().ZoomMode);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("CurveEditorTangentTypes");
{
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().CurveAuto);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().CurveAutoClamped);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().CurveUser);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().CurveBreak);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().Linear);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().Constant);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("CurveEditorTangentOptions");
{
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().FlattenTangents);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().StraightenTangents);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().ShowAllTangents);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("CurveEditorTabs");
{
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().CreateTab);
ToolbarBuilder.AddToolBarButton(FCurveEditorCommands::Get().DeleteTab);
ToolbarBuilder.AddWidget(
SNew(SBox)
.WidthOverride(175)
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.Padding(4)
[
SNew(STextBlock)
.Text(LOCTEXT("CurrentTab", "Current Tab: "))
.Visibility( this, &SDistributionCurveEditor::GetLargeIconVisibility )
]
+SVerticalBox::Slot()
.AutoHeight()
.Padding(4,0)
[
SAssignNew(TabNamesComboBox, STextComboBox)
.OptionsSource(&TabNames)
.OnSelectionChanged(this, &SDistributionCurveEditor::TabSelectionChanged)
.InitiallySelectedItem(SelectedTab)
]
]
);
}
ToolbarBuilder.EndSection();
return
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.Padding(4,0)
[
SNew(SBorder)
.Padding(0)
.BorderImage(FEditorStyle::GetBrush("NoBorder"))
.IsEnabled(FSlateApplication::Get().GetNormalExecutionAttribute())
[
ToolbarBuilder.MakeWidget()
]
];
}
示例12: FMargin
void SScrubControlPanel::Construct( const SScrubControlPanel::FArguments& InArgs )
{
ScrubWidget = NULL;
IsRealtimeStreamingMode = InArgs._IsRealtimeStreamingMode;
FEditorWidgetsModule& EditorWidgetsModule = FModuleManager::Get().LoadModuleChecked<FEditorWidgetsModule>( "EditorWidgets" );
FTransportControlArgs TransportControlArgs;
TransportControlArgs.OnForwardPlay = InArgs._OnClickedForwardPlay;
TransportControlArgs.OnRecord = InArgs._OnClickedRecord;
TransportControlArgs.OnBackwardPlay = InArgs._OnClickedBackwardPlay;
TransportControlArgs.OnForwardStep = InArgs._OnClickedForwardStep;
TransportControlArgs.OnBackwardStep = InArgs._OnClickedBackwardStep;
TransportControlArgs.OnForwardEnd = InArgs._OnClickedForwardEnd;
TransportControlArgs.OnBackwardEnd = InArgs._OnClickedBackwardEnd;
TransportControlArgs.OnToggleLooping = InArgs._OnClickedToggleLoop;
TransportControlArgs.OnGetLooping = InArgs._OnGetLooping;
TransportControlArgs.OnGetPlaybackMode = InArgs._OnGetPlaybackMode;
FTransportControlArgs TransportControlArgsForRealtimeStreamingMode;
TransportControlArgsForRealtimeStreamingMode.OnForwardPlay = TransportControlArgs.OnForwardPlay;
TransportControlArgsForRealtimeStreamingMode.OnForwardStep = TransportControlArgs.OnForwardStep;
TransportControlArgsForRealtimeStreamingMode.OnGetPlaybackMode = TransportControlArgs.OnGetPlaybackMode;
this->ChildSlot
.Padding( FMargin( 0.0f, 1.0f) )
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.HAlign(HAlign_Fill)
.VAlign(VAlign_Center)
.FillWidth(1)
.Padding( FMargin( 0.0f, 0.0f) )
[
SNew( SBorder )
[
SAssignNew(ScrubWidget, SScrubWidget)
.Value(InArgs._Value)
.NumOfKeys(InArgs._NumOfKeys)
.SequenceLength(InArgs._SequenceLength)
.OnValueChanged(InArgs._OnValueChanged)
.OnBeginSliderMovement(InArgs._OnBeginSliderMovement)
.OnEndSliderMovement(InArgs._OnEndSliderMovement)
.ViewInputMin(InArgs._ViewInputMin)
.ViewInputMax(InArgs._ViewInputMax)
.OnSetInputViewRange(InArgs._OnSetInputViewRange)
.OnCropAnimSequence(InArgs._OnCropAnimSequence)
.OnReZeroAnimSequence(InArgs._OnReZeroAnimSequence)
.bAllowZoom(InArgs._bAllowZoom)
/** Optional, additional values to draw on the timeline **/
.DraggableBars(InArgs._DraggableBars)
.OnBarDrag(InArgs._OnBarDrag)
]
]
// Padding
+SHorizontalBox::Slot()
.AutoWidth()
[
// Padding to make controls line up with the track label widths.
// note: a more robust way to accomplish this would be nice.
SNew(SSpacer)
.Size(FVector2D(16.0f, 16.0f))
]
+SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SBorder)
.Padding(0)
.BorderImage(FEditorStyle::GetBrush("NoBorder"))
.Visibility(this, &SScrubControlPanel::GetRealtimeControlVisibility, false)
[
EditorWidgetsModule.CreateTransportControl(TransportControlArgs)
]
]
+SHorizontalBox::Slot()
.AutoWidth()
[
SNew(SBorder)
.Padding(0)
.BorderImage(FEditorStyle::GetBrush("NoBorder"))
.Visibility(this, &SScrubControlPanel::GetRealtimeControlVisibility, true)
[
EditorWidgetsModule.CreateTransportControl(TransportControlArgsForRealtimeStreamingMode)
]
]
];
}
示例13: check
void SLevelEditorActiveToolkit::Construct( const FArguments&, const TSharedPtr< IToolkit >& InitToolkit, const FEdMode* InitEditorMode )
{
Toolkit = InitToolkit;
EditorMode = InitEditorMode;
ActiveToolkitType = Toolkit.IsValid() ? ELevelEditorActiveToolkit::Toolkit : ELevelEditorActiveToolkit::LegacyEditorMode;
check( ( ActiveToolkitType == ELevelEditorActiveToolkit::Toolkit && Toolkit.IsValid() ) ||
( ActiveToolkitType == ELevelEditorActiveToolkit::LegacyEditorMode && EditorMode != NULL ) );
const bool bIsAssetEditorToolkit = ActiveToolkitType == ELevelEditorActiveToolkit::Toolkit && InitToolkit->IsAssetEditor();
// @todo toolkit major: Improve look of this:
// - draw icon for asset editor (e.g. blueprint icon)
// - Probably should appear in standalone version too!
// - make text more pronounced! maybe use two lines (put editor name on second line, smaller text?)
// - combo drop-down looks horrible...
//
// - highlight all related tabs on mouse over
// - maybe change to task bar styling?
// - icon to "tear out and edit standalone"? Or drag tear?
// - what about asset type or path?
// - animation transitions when mode is opened and killed?
// - animation when focusing tabs?
//
// - new toolkit doc area tabs should animate in (like they do when closing!) (see CreateNewTabStackBySplitting)
// - need visual cue when there are no toolkits around (currently just empty expando)
// - color distinction between modes and asset editors?
TSharedPtr< SHorizontalBox > ContentBox;
ChildSlot
[
SNew( SBorder )
.Padding( 3.0f )
[
SNew( SOverlay )
+SOverlay::Slot()
[
SNew(SImage)
// Don't allow color overlay to absorb mouse clicks
.Visibility( EVisibility::HitTestInvisible )
.Image( FEditorStyle::GetBrush( "ToolkitDisplay.ColorOverlay" ) )
.ColorAndOpacity( this, &SLevelEditorActiveToolkit::GetToolkitBackgroundOverlayColor )
]
+SOverlay::Slot()
[
SAssignNew( ContentBox, SHorizontalBox )
+SHorizontalBox::Slot()
.FillWidth( 1.0f )
[
SNew( SHorizontalBox )
+SHorizontalBox::Slot()
.AutoWidth()
.Padding( 4.0f, 7.0f, 3.0f, 3.0f )
[
// @todo toolkit major: Separate asset name from editor name (and draw unsaved change state next to asset part)
SNew( SHyperlink )
.Text( this, &SLevelEditorActiveToolkit::GetToolkitTextLabel )
.OnNavigate( this, &SLevelEditorActiveToolkit::OnNavigateToToolkit )
]
// Asset modified state
+SHorizontalBox::Slot()
.AutoWidth()
.Padding( 0.0f, 0.0f, 3.0f, 0.0f )
[
SNew( SImage )
.Visibility( this, &SLevelEditorActiveToolkit::GetVisibilityForUnsavedChangeIcon )
.Image( FEditorStyle::GetBrush( "ToolkitDisplay.UnsavedChangeIcon" ) )
.ToolTipText( LOCTEXT("UnsavedChangeToolTip", "This asset has unsaved changes").ToString() )
]
]
]
]
];
if( bIsAssetEditorToolkit )
{
TSharedRef< FAssetEditorToolkit > AssetEditorToolkit = StaticCastSharedPtr< FAssetEditorToolkit >( Toolkit ).ToSharedRef();
// We want the window to be closed after the user chooses an option from the drop-down
const bool bIsPopup = true;
ContentBox->AddSlot()
.AutoWidth()
.VAlign(VAlign_Center)
.HAlign( HAlign_Right )
[
SNew( SComboButton )
.ComboButtonStyle(FEditorStyle::Get(), "ToolkitDisplay.ComboButton")
.ButtonContent()
[
SNew(SImage)
.Image( FEditorStyle::GetBrush( "ToolkitDisplay.MenuDropdown" ) )
]
.MenuContent()
[
SNew( SAssetEditorCommon, AssetEditorToolkit, bIsPopup )
]
//.........这里部分代码省略.........
示例14: SNew
TSharedRef< SWidget > SAnimCurveListRow::GenerateWidgetForColumn( const FName& ColumnName )
{
if ( ColumnName == ColumnId_AnimCurveNameLabel )
{
TSharedPtr<SAnimCurveViewer> AnimCurveViewer = AnimCurveViewerPtr.Pin();
if (AnimCurveViewer.IsValid())
{
return
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(4)
.VAlign(VAlign_Center)
[
SAssignNew(Item->EditableText, SInlineEditableTextBlock)
.OnTextCommitted(AnimCurveViewer.Get(), &SAnimCurveViewer::OnNameCommitted, Item)
.ColorAndOpacity(this, &SAnimCurveListRow::GetItemTextColor)
.IsSelected(this, &SAnimCurveListRow::IsSelected)
.Text(this, &SAnimCurveListRow::GetItemName)
.HighlightText(this, &SAnimCurveListRow::GetFilterText)
];
}
else
{
return SNullWidget::NullWidget;
}
}
else if (ColumnName == ColumnID_AnimCurveTypeLabel)
{
TSharedPtr<SAnimCurveViewer> AnimCurveViewer = AnimCurveViewerPtr.Pin();
if (AnimCurveViewer.IsValid())
{
return
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(4)
.VAlign(VAlign_Center)
[
GetCurveTypeWidget()
];
}
else
{
return SNullWidget::NullWidget;
}
}
else if ( ColumnName == ColumnID_AnimCurveWeightLabel )
{
// Encase the SSpinbox in an SVertical box so we can apply padding. Setting ItemHeight on the containing SListView has no effect :-(
return
SNew( SVerticalBox )
+ SVerticalBox::Slot()
.AutoHeight()
.Padding( 0.0f, 1.0f )
.VAlign( VAlign_Center )
[
SNew( SSpinBox<float> )
.MinSliderValue(-1.f)
.MaxSliderValue(1.f)
.MinValue(-MaxMorphWeight)
.MaxValue(MaxMorphWeight)
.Value( this, &SAnimCurveListRow::GetWeight )
.OnValueChanged( this, &SAnimCurveListRow::OnAnimCurveWeightChanged )
.OnValueCommitted( this, &SAnimCurveListRow::OnAnimCurveWeightValueCommitted )
];
}
else
{
return
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0.0f, 1.0f)
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(SCheckBox)
.OnCheckStateChanged(this, &SAnimCurveListRow::OnAnimCurveAutoFillChecked)
.IsChecked(this, &SAnimCurveListRow::IsAnimCurveAutoFillChangedChecked)
];
}
}
示例15: SyncLeftHandWeapons
void SARCharacterSheetWidget::Construct(const FArguments& InArgs)
{
OwnerHUD = InArgs._OwnerHUD;
MyPC = InArgs._MyPC;
Character = InArgs._Character;
Equipment = InArgs._Equipment;
SyncLeftHandWeapons();
SyncRightHandWeapons();
SyncEquipmentWeapons();
ChildSlot
[
SNew(SGridPanel)
+ SGridPanel::Slot(1, 1)
.ColumnSpan(6)
[
SNew(SBorder) //add visibility check
.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
[
SNew(SOverlay)
+ SOverlay::Slot()
[
SNew(SBox)
.HeightOverride(52)
.WidthOverride(400)
[
SAssignNew(LeftWeapon, STileView<TSharedPtr<FARDragDropInfo>>)
.ListItemsSource(&LeftHandWeapons)
.OnGenerateTile(this, &SARCharacterSheetWidget::MakeLeftHandWeaponWidget)
.ItemHeight(50)
.ItemWidth(50)
]
]
]
]
+ SGridPanel::Slot(1, 2)
.ColumnSpan(6)
[
SNew(SBorder) //add visibility check
.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
[
SNew(SOverlay)
+ SOverlay::Slot()
[
SNew(SBox)
.HeightOverride(52)
.WidthOverride(400)
[
SAssignNew(RightWeapon, STileView<TSharedPtr<FARDragDropInfo>>)
.ListItemsSource(&RightHandWeapons)
.OnGenerateTile(this, &SARCharacterSheetWidget::MakeRightHandWeaponWidget)
.ItemHeight(50)
.ItemWidth(50)
]
]
]
]
+ SGridPanel::Slot(1, 3)
.ColumnSpan(6)
[
SNew(SBorder) //add visibility check
.BorderBackgroundColor(FSlateColor(FLinearColor(1, 0, 0, 1)))
[
SNew(SOverlay)
+ SOverlay::Slot()
[
SNew(SBox)
.HeightOverride(52)
.WidthOverride(400)
[
SAssignNew(EquipmentSlot, STileView<TSharedPtr<FARDragDropInfo>>)
.ListItemsSource(&EquipmentSlots)
.OnGenerateTile(this, &SARCharacterSheetWidget::MakeEquipmentSlotsWeaponWidget)
.ItemHeight(50)
.ItemWidth(50)
]
]
]
]
];
}