MCPcopy Create free account
hub / github.com/SatDump/SatDump / ShowExampleMenuFile

Function ShowExampleMenuFile

src-core/imgui/imgui_demo.cpp:6647–6726  ·  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

6645// Note that shortcuts are currently provided for display only
6646// (future version will add explicit flags to BeginMenu() to request processing shortcuts)
6647static void ShowExampleMenuFile()
6648{
6649 IMGUI_DEMO_MARKER("Examples/Menu");
6650 ImGui::MenuItem("(demo menu)", NULL, false, false);
6651 if (ImGui::MenuItem("New")) {}
6652 if (ImGui::MenuItem("Open", "Ctrl+O")) {}
6653 if (ImGui::BeginMenu("Open Recent"))
6654 {
6655 ImGui::MenuItem("fish_hat.c");
6656 ImGui::MenuItem("fish_hat.inl");
6657 ImGui::MenuItem("fish_hat.h");
6658 if (ImGui::BeginMenu("More.."))
6659 {
6660 ImGui::MenuItem("Hello");
6661 ImGui::MenuItem("Sailor");
6662 if (ImGui::BeginMenu("Recurse.."))
6663 {
6664 ShowExampleMenuFile();
6665 ImGui::EndMenu();
6666 }
6667 ImGui::EndMenu();
6668 }
6669 ImGui::EndMenu();
6670 }
6671 if (ImGui::MenuItem("Save", "Ctrl+S")) {}
6672 if (ImGui::MenuItem("Save As..")) {}
6673
6674 ImGui::Separator();
6675 IMGUI_DEMO_MARKER("Examples/Menu/Options");
6676 if (ImGui::BeginMenu("Options"))
6677 {
6678 static bool enabled = true;
6679 ImGui::MenuItem("Enabled", "", &enabled);
6680 ImGui::BeginChild("child", ImVec2(0, 60), true);
6681 for (int i = 0; i < 10; i++)
6682 ImGui::Text("Scrolling Text %d", i);
6683 ImGui::EndChild();
6684 static float f = 0.5f;
6685 static int n = 0;
6686 ImGui::SliderFloat("Value", &f, 0.0f, 1.0f);
6687 ImGui::InputFloat("Input", &f, 0.1f);
6688 ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0");
6689 ImGui::EndMenu();
6690 }
6691
6692 IMGUI_DEMO_MARKER("Examples/Menu/Colors");
6693 if (ImGui::BeginMenu("Colors"))
6694 {
6695 float sz = ImGui::GetTextLineHeight();
6696 for (int i = 0; i < ImGuiCol_COUNT; i++)
6697 {
6698 const char* name = ImGui::GetStyleColorName((ImGuiCol)i);
6699 ImVec2 p = ImGui::GetCursorScreenPos();
6700 ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + sz, p.y + sz), ImGui::GetColorU32((ImGuiCol)i));
6701 ImGui::Dummy(ImVec2(sz, sz));
6702 ImGui::SameLine();
6703 ImGui::MenuItem(name);
6704 }

Callers 4

ShowDemoWindowMethod · 0.85
ShowDemoWindowLayoutFunction · 0.85
ShowDemoWindowPopupsFunction · 0.85

Calls 9

SeparatorFunction · 0.85
ImVec2Function · 0.85
SliderFloatFunction · 0.85
GetStyleColorNameFunction · 0.85
AddRectFilledMethod · 0.80
TextFunction · 0.50
ComboFunction · 0.50
SameLineFunction · 0.50
CheckboxFunction · 0.50

Tested by

no test coverage detected