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

Function ShowExampleMenuFile

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

Note that shortcuts are currently provided for display only (future version will add explicit flags to BeginMenu() to request processing shortcuts)

Source from the content-addressed store, hash-verified

8795// Note that shortcuts are currently provided for display only
8796// (future version will add explicit flags to BeginMenu() to request processing shortcuts)
8797static void ShowExampleMenuFile()
8798{
8799 IMGUI_DEMO_MARKER("Examples/Menu");
8800 ImGui::MenuItem("(demo menu)", NULL, false, false);
8801 if (ImGui::MenuItem("New")) {}
8802 if (ImGui::MenuItem("Open", "Ctrl+O")) {}
8803 if (ImGui::BeginMenu("Open Recent"))
8804 {
8805 ImGui::MenuItem("fish_hat.c");
8806 ImGui::MenuItem("fish_hat.inl");
8807 ImGui::MenuItem("fish_hat.h");
8808 if (ImGui::BeginMenu("More.."))
8809 {
8810 ImGui::MenuItem("Hello");
8811 ImGui::MenuItem("Sailor");
8812 if (ImGui::BeginMenu("Recurse.."))
8813 {
8814 ShowExampleMenuFile();
8815 ImGui::EndMenu();
8816 }
8817 ImGui::EndMenu();
8818 }
8819 ImGui::EndMenu();
8820 }
8821 if (ImGui::MenuItem("Save", "Ctrl+S")) {}
8822 if (ImGui::MenuItem("Save As..")) {}
8823
8824 ImGui::Separator();
8825 if (ImGui::BeginMenu("Options"))
8826 {
8827 IMGUI_DEMO_MARKER("Examples/Menu/Options");
8828 static bool enabled = true;
8829 ImGui::MenuItem("Enabled", "", &enabled);
8830 ImGui::BeginChild("child", ImVec2(0, 60), ImGuiChildFlags_Borders);
8831 for (int i = 0; i < 10; i++)
8832 ImGui::Text("Scrolling Text %d", i);
8833 ImGui::EndChild();
8834 static float f = 0.5f;
8835 static int n = 0;
8836 ImGui::SliderFloat("Value", &f, 0.0f, 1.0f);
8837 ImGui::InputFloat("Input", &f, 0.1f);
8838 ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0");
8839 ImGui::EndMenu();
8840 }
8841
8842 if (ImGui::BeginMenu("Colors"))
8843 {
8844 IMGUI_DEMO_MARKER("Examples/Menu/Colors");
8845 float sz = ImGui::GetTextLineHeight();
8846 for (int i = 0; i < ImGuiCol_COUNT; i++)
8847 {
8848 const char* name = ImGui::GetStyleColorName((ImGuiCol)i);
8849 ImVec2 p = ImGui::GetCursorScreenPos();
8850 ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + sz, p.y + sz), ImGui::GetColorU32((ImGuiCol)i));
8851 ImGui::Dummy(ImVec2(sz, sz));
8852 ImGui::SameLine();
8853 ImGui::MenuItem(name);
8854 }

Callers 4

DemoWindowMenuBarFunction · 0.85
DemoWindowLayoutFunction · 0.85
DemoWindowPopupsFunction · 0.85

Calls 12

MenuItemFunction · 0.85
BeginMenuFunction · 0.85
SeparatorFunction · 0.85
BeginChildFunction · 0.85
ImVec2Function · 0.85
SliderFloatFunction · 0.85
InputFloatFunction · 0.85
ComboFunction · 0.85
GetStyleColorNameFunction · 0.85
CheckboxFunction · 0.85
AddRectFilledMethod · 0.80
TextFunction · 0.50

Tested by

no test coverage detected