zoukankan      html  css  js  c++  java
  • ue4 C++ 生成并弹出一个菜单

    FGlobalSettingModule& GSettingMod = FModuleManager::LoadModuleChecked<FGlobalSettingModule>(TEXT("GlobalSetting"));
                  FString userIdStr = FString::FromInt(GSettingMod.GetUserInfo().userId);
                  FString modelUrl = _ItemModel->_ItemInfo.modelUrl;
                  if (modelUrl.Find(userIdStr) == INDEX_NONE)
                  {
                         return FReply::Unhandled();
                  }
                  FMenuBuilder MenuBuilder(true, nullptr);
                  MenuBuilder.BeginSection("PathFolderMoveCopy", FText::FromString(TEXT("硬装操作")));
                  {
                         MenuBuilder.AddMenuEntry(
                               FText::FromString(TEXT("删除")),
                               FText::FromString(TEXT("删除该选项")),
                               FSlateIcon(),
                               FUIAction(FExecuteAction::CreateLambda([this]() {DeleteThisData(); }))
                         );
                  }
                  MenuBuilder.EndSection();
                  
                  TSharedPtr< SWindow > Parent = FSlateApplication::Get().GetActiveTopLevelWindow();
                  if (Parent.IsValid())
                  {
                         FSlateApplication::Get().PushMenu(
                               Parent.ToSharedRef(),
                               FWidgetPath(),
                               MenuBuilder.MakeWidget(),
                               FSlateApplication::Get().GetCursorPos(),
                                FPopupTransitionEffect(FPopupTransitionEffect::ContextMenu)
                         );
                  }
  • 相关阅读:
    契约测试SpringCloud Contract入门
    CircuitBreaker 组件 resilience4j
    阿里开源的15个顶级Java项目
    将军令:数据安全平台建设实践
    ResNet
    设计模式
    muduo评测摘要
    muduo 学习
    RAII
    大数据框架
  • 原文地址:https://www.cnblogs.com/huojiaoqingchun0123/p/7607409.html
Copyright © 2011-2022 走看看