The workflow for creating new menu entries is almost identical to that for creating new toolbar buttons, so this recipe will build on the previous one and show you how to add the command created therein to a menu rather than a toolbar.
Creating new menu entries
How to do it...
- Create a new function inside of the FChapter_10EditorModule class, which is in Chapter10_Editor.h:
void AddMenuExtension(FMenuBuilder &builder) { FSlateIcon IconBrush =
FSlateIcon(FEditorStyle::GetStyleSetName(),
"LevelEditor.ViewOptions",
"LevelEditor.ViewOptions.Small"); builder.AddMenuEntry(FCookbookCommands::Get().MyButton); };
- In the implementation file (Chapter_10Editor.cpp), find the following code...