MCPcopy Create free account
hub / github.com/cinder/Cinder / ShowExampleAppMainMenuBar

Function ShowExampleAppMainMenuBar

src/imgui/imgui_demo.cpp:8650–8671  ·  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

8648// - BeginMenuBar() = menu-bar inside current window (which needs the ImGuiWindowFlags_MenuBar flag!)
8649// - BeginMainMenuBar() = helper to create menu-bar-sized window at the top of the main viewport + call BeginMenuBar() into it.
8650static void ShowExampleAppMainMenuBar()
8651{
8652 if (ImGui::BeginMainMenuBar())
8653 {
8654 if (ImGui::BeginMenu("File"))
8655 {
8656 ShowExampleMenuFile();
8657 ImGui::EndMenu();
8658 }
8659 if (ImGui::BeginMenu("Edit"))
8660 {
8661 if (ImGui::MenuItem("Undo", "CTRL+Z")) {}
8662 if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item
8663 ImGui::Separator();
8664 if (ImGui::MenuItem("Cut", "CTRL+X")) {}
8665 if (ImGui::MenuItem("Copy", "CTRL+C")) {}
8666 if (ImGui::MenuItem("Paste", "CTRL+V")) {}
8667 ImGui::EndMenu();
8668 }
8669 ImGui::EndMainMenuBar();
8670 }
8671}
8672
8673// Note that shortcuts are currently provided for display only
8674// (future version will add explicit flags to BeginMenu() to request processing shortcuts)

Callers 1

ShowDemoWindowMethod · 0.85

Calls 1

ShowExampleMenuFileFunction · 0.85

Tested by

no test coverage detected