MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / ShowDemoWindow

Method ShowDemoWindow

lib/imgui/imgui_demo.cpp:208–441  ·  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

206// Demonstrate most Dear ImGui features (this is big function!)
207// 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.
208void ImGui::ShowDemoWindow(bool* p_open)
209{
210 IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing dear imgui context. Refer to examples app!"); // Exceptionally add an extra assert here for people confused with initial dear imgui setup
211
212 // Examples Apps (accessible from the "Examples" menu)
213 static bool show_app_documents = false;
214 static bool show_app_main_menu_bar = false;
215 static bool show_app_console = false;
216 static bool show_app_log = false;
217 static bool show_app_layout = false;
218 static bool show_app_property_editor = false;
219 static bool show_app_long_text = false;
220 static bool show_app_auto_resize = false;
221 static bool show_app_constrained_resize = false;
222 static bool show_app_simple_overlay = false;
223 static bool show_app_window_titles = false;
224 static bool show_app_custom_rendering = false;
225
226 if (show_app_documents) ShowExampleAppDocuments(&show_app_documents);
227 if (show_app_main_menu_bar) ShowExampleAppMainMenuBar();
228 if (show_app_console) ShowExampleAppConsole(&show_app_console);
229 if (show_app_log) ShowExampleAppLog(&show_app_log);
230 if (show_app_layout) ShowExampleAppLayout(&show_app_layout);
231 if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor);
232 if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text);
233 if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize);
234 if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize);
235 if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay);
236 if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
237 if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
238
239 // Dear ImGui Apps (accessible from the "Tools" menu)
240 static bool show_app_metrics = false;
241 static bool show_app_style_editor = false;
242 static bool show_app_about = false;
243
244 if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); }
245 if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); }
246 if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); }
247
248 // Demonstrate the various window flags. Typically you would just use the default!
249 static bool no_titlebar = false;
250 static bool no_scrollbar = false;
251 static bool no_menu = false;
252 static bool no_move = false;
253 static bool no_resize = false;
254 static bool no_collapse = false;
255 static bool no_close = false;
256 static bool no_nav = false;
257 static bool no_background = false;
258 static bool no_bring_to_front = false;
259
260 ImGuiWindowFlags window_flags = 0;
261 if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
262 if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
263 if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar;
264 if (no_move) window_flags |= ImGuiWindowFlags_NoMove;
265 if (no_resize) window_flags |= ImGuiWindowFlags_NoResize;

Callers

nothing calls this directly

Calls 15

ShowExampleAppDocumentsFunction · 0.85
ShowExampleAppConsoleFunction · 0.85
ShowExampleAppLogFunction · 0.85
ShowExampleAppLayoutFunction · 0.85
ShowExampleAppLongTextFunction · 0.85
ShowExampleAppAutoResizeFunction · 0.85

Tested by

no test coverage detected