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

Function DemoWindowMenuBar

src/imgui/imgui_demo.cpp:652–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650//-----------------------------------------------------------------------------
651
652static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
653{
654 IMGUI_DEMO_MARKER("Menu");
655 if (ImGui::BeginMenuBar())
656 {
657 if (ImGui::BeginMenu("Menu"))
658 {
659 IMGUI_DEMO_MARKER("Menu/File");
660 ShowExampleMenuFile();
661 ImGui::EndMenu();
662 }
663 if (ImGui::BeginMenu("Examples"))
664 {
665 IMGUI_DEMO_MARKER("Menu/Examples");
666 ImGui::MenuItem("Main menu bar", NULL, &demo_data->ShowMainMenuBar);
667
668 ImGui::SeparatorText("Mini apps");
669 ImGui::MenuItem("Assets Browser", NULL, &demo_data->ShowAppAssetsBrowser);
670 ImGui::MenuItem("Console", NULL, &demo_data->ShowAppConsole);
671 ImGui::MenuItem("Custom rendering", NULL, &demo_data->ShowAppCustomRendering);
672 ImGui::MenuItem("Documents", NULL, &demo_data->ShowAppDocuments);
673 ImGui::MenuItem("Log", NULL, &demo_data->ShowAppLog);
674 ImGui::MenuItem("Property editor", NULL, &demo_data->ShowAppPropertyEditor);
675 ImGui::MenuItem("Simple layout", NULL, &demo_data->ShowAppLayout);
676 ImGui::MenuItem("Simple overlay", NULL, &demo_data->ShowAppSimpleOverlay);
677
678 ImGui::SeparatorText("Concepts");
679 ImGui::MenuItem("Auto-resizing window", NULL, &demo_data->ShowAppAutoResize);
680 ImGui::MenuItem("Constrained-resizing window", NULL, &demo_data->ShowAppConstrainedResize);
681 ImGui::MenuItem("Fullscreen window", NULL, &demo_data->ShowAppFullscreen);
682 ImGui::MenuItem("Long text display", NULL, &demo_data->ShowAppLongText);
683 ImGui::MenuItem("Manipulating window titles", NULL, &demo_data->ShowAppWindowTitles);
684
685 ImGui::EndMenu();
686 }
687 //if (ImGui::MenuItem("MenuItem")) {} // You can also use MenuItem() inside a menu bar!
688 if (ImGui::BeginMenu("Tools"))
689 {
690 IMGUI_DEMO_MARKER("Menu/Tools");
691 ImGuiIO& io = ImGui::GetIO();
692#ifndef IMGUI_DISABLE_DEBUG_TOOLS
693 const bool has_debug_tools = true;
694#else
695 const bool has_debug_tools = false;
696#endif
697 ImGui::MenuItem("Metrics/Debugger", NULL, &demo_data->ShowMetrics, has_debug_tools);
698 if (ImGui::BeginMenu("Debug Options"))
699 {
700 ImGui::BeginDisabled(!has_debug_tools);
701 ImGui::Checkbox("Highlight ID Conflicts", &io.ConfigDebugHighlightIdConflicts);
702 ImGui::EndDisabled();
703 ImGui::Checkbox("Assert on error recovery", &io.ConfigErrorRecoveryEnableAssert);
704 ImGui::TextDisabled("(see Demo->Configuration for details & more)");
705 ImGui::EndMenu();
706 }
707 ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools);
708 ImGui::MenuItem("ID Stack Tool", NULL, &demo_data->ShowIDStackTool, has_debug_tools);
709 bool is_debugger_present = io.ConfigDebugIsDebuggerPresent;

Callers 1

ShowDemoWindowMethod · 0.85

Calls 1

ShowExampleMenuFileFunction · 0.85

Tested by

no test coverage detected