Files
XCEngine/docs/api/XCEngine/Editor/UI/MenuCommand/MenuCommand.md

1.1 KiB

MenuCommand

命名空间: XCEngine::Editor::UI

类型: struct

源文件: editor/src/UI/MenuCommand.h

描述: 定义 Editor 菜单项的轻量数据模型,支持普通 action 和 separator 两种项类型。

概述

MenuCommand 自身不负责绘制或执行,它只是把菜单项所需的最小数据整理成统一结构。

当前公开内容

MenuCommandKind

  • Action
  • Separator

MenuCommand

字段包括:

  • kind
  • label
  • shortcut
  • selected
  • enabled

并提供两个便捷构造函数:

  • MenuCommand::Action(...)
  • MenuCommand::Separator()

当前使用位置

  • ActionBinding.h 会把 action 绑定转换成 MenuCommand
  • Widgets.h 负责把 MenuCommand 真正绘制成菜单项
  • HierarchyActionRouter.h 当前直接声明 MenuCommand 数组做排序菜单

当前实现边界

  • 这里只是数据对象,不内置回调。
  • 菜单执行逻辑仍由 Widgets::DrawMenuCommand(...) 外部提供。

相关文档