本文整理汇总了C++中MenuBuilder函数的典型用法代码示例。如果您正苦于以下问题:C++ MenuBuilder函数的具体用法?C++ MenuBuilder怎么用?C++ MenuBuilder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MenuBuilder函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MenuBuilder
TSharedRef<SWidget> SDistributionCurveEditor::BuildMenuWidgetCurve()
{
const bool bShouldCloseWindowAfterMenuSelection = true; // Set the menu to automatically close when the user commits to a choice
FMenuBuilder MenuBuilder(bShouldCloseWindowAfterMenuSelection, UICommandList);
{
MenuBuilder.BeginSection("AllCurvesSection", LOCTEXT("AllCurvesMenuHeader", "All Curves"));
{
MenuBuilder.AddMenuEntry(FCurveEditorCommands::Get().ScaleTimes);
MenuBuilder.AddMenuEntry(FCurveEditorCommands::Get().ScaleValues);
}
MenuBuilder.EndSection();
MenuBuilder.BeginSection("CurrentCurveSection", LOCTEXT("CurrentCurveMenuHeader", "Current Curve"));
{
MenuBuilder.AddMenuEntry(FCurveEditorCommands::Get().ScaleSingleCurveTimes);
MenuBuilder.AddMenuEntry(FCurveEditorCommands::Get().ScaleSingleCurveValues);
}
MenuBuilder.EndSection();
MenuBuilder.BeginSection("SubCurveSection", LOCTEXT("SubCurveMenuHeader", "Sub-Curve"));
{
MenuBuilder.AddMenuEntry(FCurveEditorCommands::Get().ScaleSingleSubCurveValues);
}
MenuBuilder.EndSection();
}
return MenuBuilder.MakeWidget();
}
示例2: MenuBuilder
TSharedPtr<SWidget> FLightmapCustomNodeBuilder::OnGetLightMapContextMenuContent()
{
TArray<TSharedPtr<FLightmapItem>> SelectedLightmaps = LightmapListView->GetSelectedItems();
TSharedPtr<FLightmapItem> SelectedLightmap;
if ( SelectedLightmaps.Num() > 0 )
{
SelectedLightmap = SelectedLightmaps[0];
}
if ( SelectedLightmap.IsValid() )
{
FMenuBuilder MenuBuilder(/*bInShouldCloseWindowAfterMenuSelection=*/true, NULL);
MenuBuilder.BeginSection("LightMapsContextMenuSection", LOCTEXT("LightMapsContextMenuHeading", "Options") );
{
MenuBuilder.AddMenuEntry(
LOCTEXT("ViewLightmapLabel", "View"),
LOCTEXT("ViewLightmapTooltip", "Opens the texture editor with this lightmap."),
FSlateIcon(),
FUIAction(FExecuteAction::CreateSP(this, &FLightmapCustomNodeBuilder::ExecuteViewLightmap, SelectedLightmap->ObjectPath))
);
}
MenuBuilder.EndSection(); //LightMapsContextMenuSection
return MenuBuilder.MakeWidget();
}
return NULL;
}
示例3: MenuBuilder
TSharedRef< SWidget > SProfileVisualizer::MakeMainMenu()
{
FMenuBarBuilder MenuBuilder( NULL );
{
// File
MenuBuilder.AddPullDownMenu(
NSLOCTEXT("TaskGraph", "FileMenu", "File"),
NSLOCTEXT("TaskGraph", "FileMenu_ToolTip", "Open the file menu"),
FNewMenuDelegate::CreateSP( this, &SProfileVisualizer::FillFileMenu ) );
// Apps
MenuBuilder.AddPullDownMenu(
NSLOCTEXT("TaskGraph", "AppMenu", "Window"),
NSLOCTEXT("TaskGraph", "AppMenu_ToolTip", "Open the summoning menu"),
FNewMenuDelegate::CreateSP( this, &SProfileVisualizer::FillAppMenu ) );
// Help
MenuBuilder.AddPullDownMenu(
NSLOCTEXT("TaskGraph", "HelpMenu", "Help"),
NSLOCTEXT("TaskGraph", "HelpMenu_ToolTip", "Open the help menu"),
FNewMenuDelegate::CreateSP( this, &SProfileVisualizer::FillHelpMenu ) );
}
// Create the menu bar
TSharedRef< SWidget > MenuBarWidget = MenuBuilder.MakeWidget();
return MenuBarWidget;
}
示例4: MenuBuilder
TSharedRef<SWidget> SVisualLoggerTimelinesContainer::GetRightClickMenuContent()
{
FMenuBuilder MenuBuilder(true, NULL);
MenuBuilder.BeginSection("VisualLogReports", LOCTEXT("VisualLogReports", "VisualLog Reports"));
{
MenuBuilder.AddMenuEntry(
LOCTEXT("GenarateReport", "Genarate Report"),
LOCTEXT("GenarateReportTooltip", "Genarate report from Visual Log events."),
FSlateIcon(),
FUIAction(FExecuteAction::CreateSP(this, &SVisualLoggerTimelinesContainer::GenerateReport))
);
}
MenuBuilder.EndSection();
FDisplayMetrics DisplayMetrics;
FSlateApplication::Get().GetDisplayMetrics(DisplayMetrics);
const FVector2D DisplaySize(
DisplayMetrics.PrimaryDisplayWorkAreaRect.Right - DisplayMetrics.PrimaryDisplayWorkAreaRect.Left,
DisplayMetrics.PrimaryDisplayWorkAreaRect.Bottom - DisplayMetrics.PrimaryDisplayWorkAreaRect.Top);
return
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.MaxHeight(DisplaySize.Y * 0.5)
[
MenuBuilder.MakeWidget()
];
}
示例5: MenuBuilder
TSharedRef<SWidget> SSequencerCurveEditorToolBar::MakeCurveEditorViewOptionsMenu(TSharedPtr<FUICommandList> CurveEditorCommandList)
{
FMenuBuilder MenuBuilder( true, CurveEditorCommandList );
MenuBuilder.BeginSection( "CurveVisibility", LOCTEXT( "CurveEditorMenuCurveVisibilityHeader", "Curve Visibility" ) );
{
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetAllCurveVisibility );
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetSelectedCurveVisibility );
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetAnimatedCurveVisibility );
}
MenuBuilder.EndSection();
MenuBuilder.BeginSection( "TangentVisibility", LOCTEXT( "CurveEditorMenuTangentVisibilityHeader", "Tangent Visibility" ) );
{
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetAllTangentsVisibility );
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetSelectedKeysTangentVisibility );
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetNoTangentsVisibility );
}
MenuBuilder.EndSection();
MenuBuilder.AddMenuSeparator();
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().ToggleAutoFrameCurveEditor);
MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().ToggleShowCurveEditorCurveToolTips);
return MenuBuilder.MakeWidget();
}
示例6: MenuBuilder
TSharedRef<SWidget> SFilterWidget::GetRightClickMenuContent()
{
FMenuBuilder MenuBuilder(true, NULL);
if (IsEnabled())
{
FText FiletNameAsText = FText::FromString(GetFilterNameAsString());
MenuBuilder.BeginSection("VerbositySelection", LOCTEXT("VerbositySelection", "Current verbosity selection"));
{
for (int32 Index = ELogVerbosity::NoLogging + 1; Index <= ELogVerbosity::VeryVerbose; Index++)
{
const FString VerbosityStr = FOutputDevice::VerbosityToString((ELogVerbosity::Type)Index);
MenuBuilder.AddMenuEntry(
FText::Format(LOCTEXT("UseVerbosity", "Use: {0}"), FText::FromString(VerbosityStr)),
LOCTEXT("UseVerbosityTooltip", "Applay verbosity to selected flter."),
FSlateIcon(),
FUIAction(FExecuteAction::CreateSP(this, &SFilterWidget::SetVerbosityFilter, Index))
);
}
}
MenuBuilder.EndSection();
}
return MenuBuilder.MakeWidget();
}
示例7: MenuBuilder
TSharedRef<SWidget> STextureEditorViewportToolbar::GenerateViewOptionsMenu( ) const
{
FMenuBuilder MenuBuilder(true, ToolkitCommands);
FTextureEditorViewOptionsMenu::MakeMenu(MenuBuilder);
return MenuBuilder.MakeWidget();
}
示例8: MenuBuilder
TSharedRef<SWidget> FCameraDetails::OnGetComboContent() const
{
// Fill the combo menu with presets of common screen resolutions
FMenuBuilder MenuBuilder(true, NULL);
TArray<FText> Items;
Items.Add(LOCTEXT("PresetRatio640x480", "640x480 (4:3, 1.33) SDTV"));
Items.Add(LOCTEXT("PresetRatio852x480", "852x480 (16:9, 1.78) SDTV Widescreen"));
Items.Add(LOCTEXT("PresetRatio1280x720", "1280x720 (16:9, 1.78) HDTV 720"));
Items.Add(LOCTEXT("PresetRatio1920x1080", "1920x1080 (16:9, 1.78) HDTV 1080"));
Items.Add(LOCTEXT("PresetRatio960x544", "960x544 (16:9, 1.76) PS Vita"));
Items.Add(LOCTEXT("PresetRatio1024x640", "1024x640 (1.6)"));
Items.Add(LOCTEXT("PresetRatio1024x76", "1024x768 (4:3, 1.33)"));
Items.Add(LOCTEXT("PresetRatio1366x768", "1366x768 (16:9, 1.78)"));
Items.Add(LOCTEXT("PresetRatio2048x1536", "2048x1536 (4:3, 1.33) iPad 3"));
Items.Add(LOCTEXT("PresetRatio4096x2304", "4096x2304 (16:9, 1.78) 4K"));
for (auto ItemIter = Items.CreateConstIterator(); ItemIter; ++ItemIter)
{
FText ItemText = *ItemIter;
FUIAction ItemAction( FExecuteAction::CreateSP( this, &FCameraDetails::CommitAspectRatioText, ItemText ) );
MenuBuilder.AddMenuEntry(ItemText, TAttribute<FText>(), FSlateIcon(), ItemAction);
}
return MenuBuilder.MakeWidget();
}
示例9: TEXT
TSharedRef< SWidget > FLevelEditorToolBar::GenerateCompileMenuContent( TSharedRef<FUICommandList> InCommandList )
{
#define LOCTEXT_NAMESPACE "LevelToolBarViewMenu"
// Get all menu extenders for this context menu from the level editor module
FLevelEditorModule& LevelEditorModule = FModuleManager::GetModuleChecked<FLevelEditorModule>( TEXT("LevelEditor") );
TArray<FLevelEditorModule::FLevelEditorMenuExtender> MenuExtenderDelegates = LevelEditorModule.GetAllLevelEditorToolbarCompileMenuExtenders();
TArray<TSharedPtr<FExtender>> Extenders;
for (int32 i = 0; i < MenuExtenderDelegates.Num(); ++i)
{
if (MenuExtenderDelegates[i].IsBound())
{
Extenders.Add(MenuExtenderDelegates[i].Execute(InCommandList));
}
}
TSharedPtr<FExtender> MenuExtender = FExtender::Combine(Extenders);
const bool bShouldCloseWindowAfterMenuSelection = true;
FMenuBuilder MenuBuilder( bShouldCloseWindowAfterMenuSelection, InCommandList, MenuExtender );
if (LevelEditorModule.CanBeRecompiled())
{
MenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().RecompileLevelEditor );
MenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().ReloadLevelEditor );
}
MenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().RecompileGameCode );
#undef LOCTEXT_NAMESPACE
return MenuBuilder.MakeWidget();
}
示例10: MenuBuilder
void UJavascriptEditorLibrary::OpenPopupWindow(UWidget* Widget, const FVector2D& PopupDesiredSize, const FText& HeadingText)
{
// Create the contents of the popup
TSharedRef<SWidget> ActualWidget = Widget->TakeWidget();
// Wrap the picker widget in a multibox-style menu body
FMenuBuilder MenuBuilder(/*BShouldCloseAfterSelection=*/ false, /*CommandList=*/ nullptr);
MenuBuilder.BeginSection("OpenPopupWindow", HeadingText);
MenuBuilder.AddWidget(ActualWidget, FText::GetEmpty(), /*bNoIndent=*/ true);
MenuBuilder.EndSection();
auto WindowContents = MenuBuilder.MakeWidget();
// Determine where the pop-up should open
TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().GetActiveTopLevelWindow();
FVector2D WindowPosition = FSlateApplication::Get().GetCursorPos();
if (!ParentWindow.IsValid())
{
return;
}
if (ParentWindow.IsValid())
{
FSlateRect ParentMonitorRect = ParentWindow->GetFullScreenInfo();
const FVector2D MonitorCenter((ParentMonitorRect.Right + ParentMonitorRect.Left) * 0.5f, (ParentMonitorRect.Top + ParentMonitorRect.Bottom) * 0.5f);
WindowPosition = MonitorCenter - PopupDesiredSize * 0.5f;
// Open the pop-up
FPopupTransitionEffect TransitionEffect(FPopupTransitionEffect::None);
auto Menu = FSlateApplication::Get().PushMenu(ParentWindow.ToSharedRef(), FWidgetPath(), WindowContents, WindowPosition, TransitionEffect, /*bFocusImmediately=*/ true);
}
}
示例11: MenuBuilder
void SScrubWidget::CreateContextMenu(float CurrentFrameTime)
{
if ((OnCropAnimSequence.IsBound() || OnReZeroAnimSequence.IsBound()) && (SequenceLength.Get() >= MINIMUM_ANIMATION_LENGTH))
{
const bool CloseAfterSelection = true;
FMenuBuilder MenuBuilder( CloseAfterSelection, NULL );
MenuBuilder.BeginSection("SequenceEditingContext", LOCTEXT("SequenceEditing", "Sequence Editing") );
{
float CurrentFrameFraction = CurrentFrameTime / SequenceLength.Get();
uint32 CurrentFrameNumber = CurrentFrameFraction * NumOfKeys.Get();
FUIAction Action;
FText Label;
if (OnCropAnimSequence.IsBound())
{
//Menu - "Remove Before"
//Only show this option if the selected frame is greater than frame 1 (first frame)
if (CurrentFrameNumber > 0)
{
CurrentFrameFraction = float(CurrentFrameNumber) / (float)NumOfKeys.Get();
//Corrected frame time based on selected frame number
float CorrectedFrameTime = CurrentFrameFraction * SequenceLength.Get();
Action = FUIAction(FExecuteAction::CreateSP(this, &SScrubWidget::OnSequenceCropped, true, CorrectedFrameTime));
Label = FText::Format(LOCTEXT("RemoveTillFrame", "Remove frame 0 to frame {0}"), FText::AsNumber(CurrentFrameNumber));
MenuBuilder.AddMenuEntry(Label, LOCTEXT("RemoveBefore_ToolTip", "Remove sequence before current position"), FSlateIcon(), Action);
}
uint32 NextFrameNumber = CurrentFrameNumber + 1;
//Menu - "Remove After"
//Only show this option if next frame (CurrentFrameNumber + 1) is valid
if (NextFrameNumber < NumOfKeys.Get())
{
float NextFrameFraction = float(NextFrameNumber) / (float)NumOfKeys.Get();
float NextFrameTime = NextFrameFraction * SequenceLength.Get();
Action = FUIAction(FExecuteAction::CreateSP(this, &SScrubWidget::OnSequenceCropped, false, NextFrameTime));
Label = FText::Format(LOCTEXT("RemoveFromFrame", "Remove from frame {0} to frame {1}"), FText::AsNumber(NextFrameNumber), FText::AsNumber(NumOfKeys.Get()));
MenuBuilder.AddMenuEntry(Label, LOCTEXT("RemoveAfter_ToolTip", "Remove sequence after current position"), FSlateIcon(), Action);
}
}
if (OnReZeroAnimSequence.IsBound())
{
//Menu - "ReZero"
Action = FUIAction(FExecuteAction::CreateSP(this, &SScrubWidget::OnReZero));
Label = FText::Format(LOCTEXT("ReZeroAtFrame", "ReZero at frame {0}"), FText::AsNumber(CurrentFrameNumber));
MenuBuilder.AddMenuEntry(Label, LOCTEXT("ReZeroAtFrame_ToolTip", "Resets the root track of the frame to (0, 0, 0), and apply the difference to all root transform of the sequence. It moves whole sequence to the amount of current root transform. "), FSlateIcon(), Action);
}
}
MenuBuilder.EndSection();
FSlateApplication::Get().PushMenu( SharedThis( this ), MenuBuilder.MakeWidget(), FSlateApplication::Get().GetCursorPos(), FPopupTransitionEffect( FPopupTransitionEffect::ContextMenu ) );
}
}
示例12: MenuBuilder
TSharedPtr<SWidget> FSplineComponentVisualizer::GenerateContextMenu() const
{
FMenuBuilder MenuBuilder(true, SplineComponentVisualizerActions);
{
MenuBuilder.BeginSection("SplinePointEdit", LOCTEXT("SplinePoint", "Spline Point"));
{
if (SelectedSegmentIndex != INDEX_NONE)
{
MenuBuilder.AddMenuEntry(FSplineComponentVisualizerCommands::Get().AddKey);
}
else if (LastKeyIndexSelected != INDEX_NONE)
{
MenuBuilder.AddMenuEntry(FSplineComponentVisualizerCommands::Get().DeleteKey);
MenuBuilder.AddMenuEntry(FSplineComponentVisualizerCommands::Get().DuplicateKey);
MenuBuilder.AddSubMenu(
LOCTEXT("SplinePointType", "Spline Point Type"),
LOCTEXT("KeyTypeTooltip", "Define the type of the spline point."),
FNewMenuDelegate::CreateSP(this, &FSplineComponentVisualizer::GenerateSplinePointTypeSubMenu));
// Only add the Automatic Tangents submenu if any of the keys is a curve type
USplineComponent* SplineComp = GetEditedSplineComponent();
if (SplineComp != nullptr)
{
for (int32 SelectedKeyIndex : SelectedKeys)
{
const auto& Point = SplineComp->SplineInfo.Points[SelectedKeyIndex];
if (Point.IsCurveKey())
{
MenuBuilder.AddSubMenu(
LOCTEXT("ResetToAutomaticTangent", "Reset to Automatic Tangent"),
LOCTEXT("ResetToAutomaticTangentTooltip", "Reset the spline point tangent to an automatically generated value."),
FNewMenuDelegate::CreateSP(this, &FSplineComponentVisualizer::GenerateTangentTypeSubMenu));
break;
}
}
}
}
}
MenuBuilder.EndSection();
MenuBuilder.BeginSection("Spline", LOCTEXT("Spline", "Spline"));
{
MenuBuilder.AddMenuEntry(FSplineComponentVisualizerCommands::Get().ResetToDefault);
}
MenuBuilder.EndSection();
MenuBuilder.BeginSection("Visualization", LOCTEXT("Visualization", "Visualization"));
{
MenuBuilder.AddMenuEntry(FSplineComponentVisualizerCommands::Get().VisualizeRollAndScale);
}
MenuBuilder.EndSection();
}
TSharedPtr<SWidget> MenuWidget = MenuBuilder.MakeWidget();
return MenuWidget;
}
示例13: MenuBuilder
TSharedRef< SWidget > SRealtimeProfilerVisualizer::MakeMainMenu()
{
FMenuBarBuilder MenuBuilder( NULL );
// Create the menu bar
TSharedRef< SWidget > MenuBarWidget = MenuBuilder.MakeWidget();
return MenuBarWidget;
}
示例14: MenuBuilder
TSharedPtr<SWidget> SHierarchyView::WidgetHierarchy_OnContextMenuOpening()
{
FMenuBuilder MenuBuilder(true, nullptr);
FWidgetBlueprintEditorUtils::CreateWidgetContextMenu(MenuBuilder, BlueprintEditor.Pin().ToSharedRef(), FVector2D(0, 0));
MenuBuilder.AddMenuEntry(FGenericCommands::Get().Rename);
return MenuBuilder.MakeWidget();
}
示例15: MenuBuilder
// NOTE: We intentionally receive a WEAK pointer here because we want to be callable by a delegate whose
// payload contains a weak reference to a level editor instance
TSharedPtr< SWidget > FLevelEditorContextMenu::BuildMenuWidget( TWeakPtr< SLevelEditor > LevelEditor, LevelEditorMenuContext ContextType, TSharedPtr<FExtender> Extender )
{
// Build up the menu
const bool bShouldCloseWindowAfterMenuSelection = true;
FMenuBuilder MenuBuilder(bShouldCloseWindowAfterMenuSelection, TSharedPtr<const FUICommandList>());
FillMenu(MenuBuilder, LevelEditor, ContextType, Extender);
return MenuBuilder.MakeWidget();
}