MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / ShowExampleAppMainMenuBar

Function ShowExampleAppMainMenuBar

Source/3rdParty/imgui/imgui_demo.cpp:8770–8793  ·  view source on GitHub ↗

Demonstrate creating a "main" fullscreen menu bar and populating it. Note the difference between BeginMainMenuBar() and BeginMenuBar(): - BeginMenuBar() = menu-bar inside current window (which needs the ImGuiWindowFlags_MenuBar flag!) - BeginMainMenuBar() = helper to create menu-bar-sized window at the top of the main viewport + call BeginMenuBar() into it.

Source from the content-addressed store, hash-verified

8768// - BeginMenuBar() = menu-bar inside current window (which needs the ImGuiWindowFlags_MenuBar flag!)
8769// - BeginMainMenuBar() = helper to create menu-bar-sized window at the top of the main viewport + call BeginMenuBar() into it.
8770static void ShowExampleAppMainMenuBar()
8771{
8772 if (ImGui::BeginMainMenuBar())
8773 {
8774 if (ImGui::BeginMenu("File"))
8775 {
8776 IMGUI_DEMO_MARKER("Menu/File");
8777 ShowExampleMenuFile();
8778 ImGui::EndMenu();
8779 }
8780 if (ImGui::BeginMenu("Edit"))
8781 {
8782 IMGUI_DEMO_MARKER("Menu/Edit");
8783 if (ImGui::MenuItem("Undo", "Ctrl+Z")) {}
8784 if (ImGui::MenuItem("Redo", "Ctrl+Y", false, false)) {} // Disabled item
8785 ImGui::Separator();
8786 if (ImGui::MenuItem("Cut", "Ctrl+X")) {}
8787 if (ImGui::MenuItem("Copy", "Ctrl+C")) {}
8788 if (ImGui::MenuItem("Paste", "Ctrl+V")) {}
8789 ImGui::EndMenu();
8790 }
8791 ImGui::EndMainMenuBar();
8792 }
8793}
8794
8795// Note that shortcuts are currently provided for display only
8796// (future version will add explicit flags to BeginMenu() to request processing shortcuts)

Callers 1

ShowDemoWindowMethod · 0.85

Calls 4

BeginMenuFunction · 0.85
ShowExampleMenuFileFunction · 0.85
MenuItemFunction · 0.85
SeparatorFunction · 0.85

Tested by

no test coverage detected