| 2218 | } |
| 2219 | |
| 2220 | static void ShowExampleMenuFile() |
| 2221 | { |
| 2222 | ImGui::MenuItem("(dummy menu)", NULL, false, false); |
| 2223 | if (ImGui::MenuItem("New")) {} |
| 2224 | if (ImGui::MenuItem("Open", "Ctrl+O")) {} |
| 2225 | if (ImGui::BeginMenu("Open Recent")) |
| 2226 | { |
| 2227 | ImGui::MenuItem("fish_hat.c"); |
| 2228 | ImGui::MenuItem("fish_hat.inl"); |
| 2229 | ImGui::MenuItem("fish_hat.h"); |
| 2230 | if (ImGui::BeginMenu("More..")) |
| 2231 | { |
| 2232 | ImGui::MenuItem("Hello"); |
| 2233 | ImGui::MenuItem("Sailor"); |
| 2234 | if (ImGui::BeginMenu("Recurse..")) |
| 2235 | { |
| 2236 | ShowExampleMenuFile(); |
| 2237 | ImGui::EndMenu(); |
| 2238 | } |
| 2239 | ImGui::EndMenu(); |
| 2240 | } |
| 2241 | ImGui::EndMenu(); |
| 2242 | } |
| 2243 | if (ImGui::MenuItem("Save", "Ctrl+S")) {} |
| 2244 | if (ImGui::MenuItem("Save As..")) {} |
| 2245 | ImGui::Separator(); |
| 2246 | if (ImGui::BeginMenu("Options")) |
| 2247 | { |
| 2248 | static bool enabled = true; |
| 2249 | ImGui::MenuItem("Enabled", "", &enabled); |
| 2250 | ImGui::BeginChild("child", ImVec2(0, 60), true); |
| 2251 | for (int i = 0; i < 10; i++) |
| 2252 | ImGui::Text("Scrolling Text %d", i); |
| 2253 | ImGui::EndChild(); |
| 2254 | static float f = 0.5f; |
| 2255 | static int n = 0; |
| 2256 | static bool b = true; |
| 2257 | ImGui::SliderFloat("Value", &f, 0.0f, 1.0f); |
| 2258 | ImGui::InputFloat("Input", &f, 0.1f); |
| 2259 | ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0"); |
| 2260 | ImGui::Checkbox("Check", &b); |
| 2261 | ImGui::EndMenu(); |
| 2262 | } |
| 2263 | if (ImGui::BeginMenu("Colors")) |
| 2264 | { |
| 2265 | ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0)); |
| 2266 | for (int i = 0; i < ImGuiCol_COUNT; i++) |
| 2267 | { |
| 2268 | const char* name = ImGui::GetStyleColorName((ImGuiCol)i); |
| 2269 | ImGui::ColorButton(name, ImGui::GetStyleColorVec4((ImGuiCol)i)); |
| 2270 | ImGui::SameLine(); |
| 2271 | ImGui::MenuItem(name); |
| 2272 | } |
| 2273 | ImGui::PopStyleVar(); |
| 2274 | ImGui::EndMenu(); |
| 2275 | } |
| 2276 | if (ImGui::BeginMenu("Disabled", false)) // Disabled |
| 2277 | { |
no test coverage detected