MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / ShowExampleMenuFile

Function ShowExampleMenuFile

engine/3rdparty/imgui/imgui_demo.cpp:6425–6503  ·  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

6423// Note that shortcuts are currently provided for display only
6424// (future version will add explicit flags to BeginMenu() to request processing shortcuts)
6425static void ShowExampleMenuFile()
6426{
6427 IMGUI_DEMO_MARKER("Examples/Menu");
6428 ImGui::MenuItem("(demo menu)", NULL, false, false);
6429 if (ImGui::MenuItem("New")) {}
6430 if (ImGui::MenuItem("Open", "Ctrl+O")) {}
6431 if (ImGui::BeginMenu("Open Recent"))
6432 {
6433 ImGui::MenuItem("fish_hat.c");
6434 ImGui::MenuItem("fish_hat.inl");
6435 ImGui::MenuItem("fish_hat.h");
6436 if (ImGui::BeginMenu("More.."))
6437 {
6438 ImGui::MenuItem("Hello");
6439 ImGui::MenuItem("Sailor");
6440 if (ImGui::BeginMenu("Recurse.."))
6441 {
6442 ShowExampleMenuFile();
6443 ImGui::EndMenu();
6444 }
6445 ImGui::EndMenu();
6446 }
6447 ImGui::EndMenu();
6448 }
6449 if (ImGui::MenuItem("Save", "Ctrl+S")) {}
6450 if (ImGui::MenuItem("Save As..")) {}
6451
6452 ImGui::Separator();
6453 IMGUI_DEMO_MARKER("Examples/Menu/Options");
6454 if (ImGui::BeginMenu("Options"))
6455 {
6456 static bool enabled = true;
6457 ImGui::MenuItem("Enabled", "", &enabled);
6458 ImGui::BeginChild("child", ImVec2(0, 60), true);
6459 for (int i = 0; i < 10; i++)
6460 ImGui::Text("Scrolling Text %d", i);
6461 ImGui::EndChild();
6462 static float f = 0.5f;
6463 static int n = 0;
6464 ImGui::SliderFloat("Value", &f, 0.0f, 1.0f);
6465 ImGui::InputFloat("Input", &f, 0.1f);
6466 ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0");
6467 ImGui::EndMenu();
6468 }
6469
6470 IMGUI_DEMO_MARKER("Examples/Menu/Colors");
6471 if (ImGui::BeginMenu("Colors"))
6472 {
6473 float sz = ImGui::GetTextLineHeight();
6474 for (int i = 0; i < ImGuiCol_COUNT; i++)
6475 {
6476 const char* name = ImGui::GetStyleColorName((ImGuiCol)i);
6477 ImVec2 p = ImGui::GetCursorScreenPos();
6478 ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + sz, p.y + sz), ImGui::GetColorU32((ImGuiCol)i));
6479 ImGui::Dummy(ImVec2(sz, sz));
6480 ImGui::SameLine();
6481 ImGui::MenuItem(name);
6482 }

Callers 4

ShowDemoWindowMethod · 0.85
ShowDemoWindowLayoutFunction · 0.85
ShowDemoWindowPopupsFunction · 0.85

Calls 4

ImVec2Function · 0.85
TextClass · 0.85
SliderFloatFunction · 0.85
AddRectFilledMethod · 0.80

Tested by

no test coverage detected