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)
                         );
                  }
  • 相关阅读:
    容器平台选型的十大模式:Docker、DC/OS、K8S 谁与当先?
    Spring Controller里注入Feign的Interface报红提示的问题
    几种常见的日志
    个人博客搭建方案选择
    elasticsearch常用操作命令
    kafka操作命令
    centos7.0安装java环境
    CentOS安装jdk的三种方法
    在OAuth2中 自定义tokenServices来提供个性化服务,每次刷新token并让原token在5分钟内有效
    解决HttpServletRequest的输入流只能读取一次的问题(转)
  • 原文地址:https://www.cnblogs.com/huojiaoqingchun0123/p/7607409.html
Copyright © 2011-2022 走看看