MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / ShowExampleMenuFile

Function ShowExampleMenuFile

external/imgui/imgui_demo.cpp:8890–8969  ·  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

8888// Note that shortcuts are currently provided for display only
8889// (future version will add explicit flags to BeginMenu() to request processing shortcuts)
8890static void ShowExampleMenuFile()
8891{
8892 IMGUI_DEMO_MARKER("Examples/Menu");
8893 ImGui::MenuItem("(demo menu)", NULL, false, false);
8894 if (ImGui::MenuItem("New")) {}
8895 if (ImGui::MenuItem("Open", "Ctrl+O")) {}
8896 if (ImGui::BeginMenu("Open Recent"))
8897 {
8898 ImGui::MenuItem("fish_hat.c");
8899 ImGui::MenuItem("fish_hat.inl");
8900 ImGui::MenuItem("fish_hat.h");
8901 if (ImGui::BeginMenu("More.."))
8902 {
8903 ImGui::MenuItem("Hello");
8904 ImGui::MenuItem("Sailor");
8905 if (ImGui::BeginMenu("Recurse.."))
8906 {
8907 ShowExampleMenuFile();
8908 ImGui::EndMenu();
8909 }
8910 ImGui::EndMenu();
8911 }
8912 ImGui::EndMenu();
8913 }
8914 if (ImGui::MenuItem("Save", "Ctrl+S")) {}
8915 if (ImGui::MenuItem("Save As..")) {}
8916
8917 ImGui::Separator();
8918 if (ImGui::BeginMenu("Options"))
8919 {
8920 IMGUI_DEMO_MARKER("Examples/Menu/Options");
8921 static bool enabled = true;
8922 ImGui::MenuItem("Enabled", "", &enabled);
8923 ImGui::BeginChild("child", ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 5.0f), ImGuiChildFlags_Borders);
8924 for (int i = 0; i < 10; i++)
8925 ImGui::Text("Scrolling Text %d", i);
8926 ImGui::EndChild();
8927 static float f = 0.5f;
8928 static int n = 0;
8929 ImGui::SliderFloat("Value", &f, 0.0f, 1.0f);
8930 ImGui::InputFloat("Input", &f, 0.1f);
8931 ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0");
8932 ImGui::EndMenu();
8933 }
8934
8935 if (ImGui::BeginMenu("Colors"))
8936 {
8937 IMGUI_DEMO_MARKER("Examples/Menu/Colors");
8938 float sz = ImGui::GetTextLineHeight();
8939 for (int i = 0; i < ImGuiCol_COUNT; i++)
8940 {
8941 const char* name = ImGui::GetStyleColorName((ImGuiCol)i);
8942 ImVec2 p = ImGui::GetCursorScreenPos();
8943 ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + sz, p.y + sz), ImGui::GetColorU32((ImGuiCol)i));
8944 ImGui::Dummy(ImVec2(sz, sz));
8945 ImGui::SameLine();
8946 ImGui::MenuItem(name);
8947 }

Callers 4

DemoWindowMenuBarFunction · 0.85
DemoWindowLayoutFunction · 0.85
DemoWindowPopupsFunction · 0.85

Calls 2

ImVec2Function · 0.85
AddRectFilledMethod · 0.80

Tested by

no test coverage detected