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

Method ShowDemoWindow

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

Demonstrate most Dear ImGui features (this is big function!) You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature.

Source from the content-addressed store, hash-verified

336// You may execute this function to experiment with the UI and understand what it does.
337// You may then search for keywords in the code when you are interested by a specific feature.
338void ImGui::ShowDemoWindow(bool* p_open)
339{
340 // Exceptionally add an extra assert here for people confused about initial Dear ImGui setup
341 // Most functions would normally just assert/crash if the context is missing.
342 IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing Dear ImGui context. Refer to examples app!");
343
344 // Verify ABI compatibility between caller code and compiled version of Dear ImGui. This helps detects some build issues.
345 IMGUI_CHECKVERSION();
346
347 // Stored data
348 static ImGuiDemoWindowData demo_data;
349
350 // Examples Apps (accessible from the "Examples" menu)
351 if (demo_data.ShowMainMenuBar) { ShowExampleAppMainMenuBar(); }
352 if (demo_data.ShowAppDocuments) { ShowExampleAppDocuments(&demo_data.ShowAppDocuments); }
353 if (demo_data.ShowAppAssetsBrowser) { ShowExampleAppAssetsBrowser(&demo_data.ShowAppAssetsBrowser); }
354 if (demo_data.ShowAppConsole) { ShowExampleAppConsole(&demo_data.ShowAppConsole); }
355 if (demo_data.ShowAppCustomRendering) { ShowExampleAppCustomRendering(&demo_data.ShowAppCustomRendering); }
356 if (demo_data.ShowAppLog) { ShowExampleAppLog(&demo_data.ShowAppLog); }
357 if (demo_data.ShowAppLayout) { ShowExampleAppLayout(&demo_data.ShowAppLayout); }
358 if (demo_data.ShowAppPropertyEditor) { ShowExampleAppPropertyEditor(&demo_data.ShowAppPropertyEditor, &demo_data); }
359 if (demo_data.ShowAppSimpleOverlay) { ShowExampleAppSimpleOverlay(&demo_data.ShowAppSimpleOverlay); }
360 if (demo_data.ShowAppAutoResize) { ShowExampleAppAutoResize(&demo_data.ShowAppAutoResize); }
361 if (demo_data.ShowAppConstrainedResize) { ShowExampleAppConstrainedResize(&demo_data.ShowAppConstrainedResize); }
362 if (demo_data.ShowAppFullscreen) { ShowExampleAppFullscreen(&demo_data.ShowAppFullscreen); }
363 if (demo_data.ShowAppLongText) { ShowExampleAppLongText(&demo_data.ShowAppLongText); }
364 if (demo_data.ShowAppWindowTitles) { ShowExampleAppWindowTitles(&demo_data.ShowAppWindowTitles); }
365
366 // Dear ImGui Tools (accessible from the "Tools" menu)
367 if (demo_data.ShowMetrics) { ImGui::ShowMetricsWindow(&demo_data.ShowMetrics); }
368 if (demo_data.ShowDebugLog) { ImGui::ShowDebugLogWindow(&demo_data.ShowDebugLog); }
369 if (demo_data.ShowIDStackTool) { ImGui::ShowIDStackToolWindow(&demo_data.ShowIDStackTool); }
370 if (demo_data.ShowAbout) { ImGui::ShowAboutWindow(&demo_data.ShowAbout); }
371 if (demo_data.ShowStyleEditor)
372 {
373 ImGui::Begin("Dear ImGui Style Editor", &demo_data.ShowStyleEditor);
374 ImGui::ShowStyleEditor();
375 ImGui::End();
376 }
377
378 // Demonstrate the various window flags. Typically you would just use the default!
379 static bool no_titlebar = false;
380 static bool no_scrollbar = false;
381 static bool no_menu = false;
382 static bool no_move = false;
383 static bool no_resize = false;
384 static bool no_collapse = false;
385 static bool no_close = false;
386 static bool no_nav = false;
387 static bool no_background = false;
388 static bool no_bring_to_front = false;
389 static bool unsaved_document = false;
390
391 ImGuiWindowFlags window_flags = 0;
392 if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
393 if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
394 if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar;
395 if (no_move) window_flags |= ImGuiWindowFlags_NoMove;

Callers

nothing calls this directly

Calls 15

GetCurrentContextFunction · 0.85
ShowExampleAppDocumentsFunction · 0.85
ShowExampleAppConsoleFunction · 0.85
ShowExampleAppLogFunction · 0.85
ShowExampleAppLayoutFunction · 0.85
ShowExampleAppAutoResizeFunction · 0.85

Tested by

no test coverage detected