47 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) 48 #define _CRT_SECURE_NO_WARNINGS 57 #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier 64 #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen 65 #define vsnprintf _vsnprintf 68 #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. 69 #pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code) 70 #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' 71 #pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal 72 #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. 73 #if __has_warning("-Wreserved-id-macro") 74 #pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier // 76 #elif defined(__GNUC__) 77 #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size 78 #pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure) 79 #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function 80 #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value 82 #pragma GCC diagnostic ignored "-Wmisleading-indentation" // warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub. 88 #define IM_NEWLINE "\r\n" 90 #define IM_NEWLINE "\n" 93 #define IM_MAX(_A,_B) (((_A) >= (_B)) ? (_A) : (_B)) 99 #if !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && defined(IMGUI_DISABLE_TEST_WINDOWS) && !defined(IMGUI_DISABLE_DEMO_WINDOWS) // Obsolete name since 1.53, TEST->DEMO 100 #define IMGUI_DISABLE_DEMO_WINDOWS 103 #if !defined(IMGUI_DISABLE_DEMO_WINDOWS) 138 ImGui::BulletText(
"Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents).");
153 ImGui::BulletText(
"You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
173 static bool show_app_documents =
false;
174 static bool show_app_main_menu_bar =
false;
175 static bool show_app_console =
false;
176 static bool show_app_log =
false;
177 static bool show_app_layout =
false;
178 static bool show_app_property_editor =
false;
179 static bool show_app_long_text =
false;
180 static bool show_app_auto_resize =
false;
181 static bool show_app_constrained_resize =
false;
182 static bool show_app_simple_overlay =
false;
183 static bool show_app_window_titles =
false;
184 static bool show_app_custom_rendering =
false;
200 static bool show_app_metrics =
false;
201 static bool show_app_style_editor =
false;
202 static bool show_app_about =
false;
209 static bool no_titlebar =
false;
210 static bool no_scrollbar =
false;
211 static bool no_menu =
false;
212 static bool no_move =
false;
213 static bool no_resize =
false;
214 static bool no_collapse =
false;
215 static bool no_close =
false;
216 static bool no_nav =
false;
217 static bool no_background =
false;
218 static bool no_bring_to_front =
false;
230 if (no_close) p_open = NULL;
266 ImGui::MenuItem(
"Constrained-resizing window", NULL, &show_app_constrained_resize);
268 ImGui::MenuItem(
"Manipulating window titles", NULL, &show_app_window_titles);
287 ImGui::BulletText(
"Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
290 ImGui::BulletText(
"Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
291 ImGui::BulletText(
"Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
306 ImGui::SameLine();
ShowHelpMarker(
"Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
325 ImGui::SameLine();
ShowHelpMarker(
"Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
328 ImGui::SameLine();
ShowHelpMarker(
"Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
352 ImGui::TextWrapped(
"The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded.");
353 ShowHelpMarker(
"Try opening any of the contents below in this window and then click one of the \"Log To\" button.");
355 ImGui::TextWrapped(
"You can also call ImGui::LogText() to output directly to the log without a visual output.");
398 static int clicked = 0;
407 static bool check =
true;
416 for (
int i = 0; i < 7; i++)
435 static int counter = 0;
455 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
467 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD",
"EEEE",
"FFFF",
"GGGG",
"HHHH",
"IIII",
"JJJJ",
"KKKK",
"LLLLLLL",
"MMMM",
"OOOOOOO" };
468 static int item_current = 0;
470 ImGui::SameLine();
ShowHelpMarker(
"Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n");
474 static char str0[128] =
"Hello, world!";
477 ImGui::SameLine();
ShowHelpMarker(
"USER:\nHold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n\nPROGRAMMER:\nYou can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated in imgui_demo.cpp).");
480 ImGui::SameLine();
ShowHelpMarker(
"You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
482 static float f0 = 0.001f;
485 static double d0 = 999999.00000001;
488 static float f1 = 1.e10f;
492 static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
497 static int i1 = 50, i2 = 42;
499 ImGui::SameLine();
ShowHelpMarker(
"Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value.");
503 static float f1=1.00f, f2=0.0067f;
513 static float f1=0.123f, f2=0.0f;
516 static float angle = 0.0f;
521 static float col1[3] = { 1.0f,0.0f,0.2f };
522 static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
524 ImGui::SameLine();
ShowHelpMarker(
"Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
531 const char* listbox_items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi",
"Mango",
"Orange",
"Pineapple",
"Strawberry",
"Watermelon" };
532 static int listbox_item_current = 1;
554 for (
int i = 0; i < 5; i++)
567 ShowHelpMarker(
"This is a more standard looking tree with selectable nodes.\nClick to select, CTRL+Click to toggle, click on arrows or double-click to open.");
568 static bool align_label_with_current_x_position =
false;
569 ImGui::Checkbox(
"Align label with current X position)", &align_label_with_current_x_position);
571 if (align_label_with_current_x_position)
574 static int selection_mask = (1 << 2);
575 int node_clicked = -1;
577 for (
int i = 0; i < 6; i++)
584 bool node_open =
ImGui::TreeNodeEx((
void*)(intptr_t)i, node_flags,
"Selectable Node %d", i);
602 if (node_clicked != -1)
606 selection_mask ^= (1 << node_clicked);
608 selection_mask = (1 << node_clicked);
611 if (align_label_with_current_x_position)
620 static bool closable_group =
true;
625 for (
int i = 0; i < 5; i++)
631 for (
int i = 0; i < 5; i++)
661 ImGui::TextWrapped(
"This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages.");
664 static float wrap_width = 200.0f;
671 ImGui::Text(
"The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
679 ImGui::Text(
"aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh");
696 ImGui::TextWrapped(
"CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read misc/fonts/README.txt for details.");
697 ImGui::Text(
"Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
698 ImGui::Text(
"Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
699 static char buf[32] =
"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
710 ImGui::TextWrapped(
"Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
725 ImGui::Image(my_tex_id,
ImVec2(my_tex_w, my_tex_h),
ImVec2(0,0),
ImVec2(1,1),
ImColor(255,255,255,255),
ImColor(255,255,255,128));
729 float region_sz = 32.0f;
730 float region_x = io.
MousePos.
x - pos.
x - region_sz * 0.5f;
if (region_x < 0.0
f) region_x = 0.0f;
else if (region_x > my_tex_w - region_sz) region_x = my_tex_w - region_sz;
731 float region_y = io.
MousePos.
y - pos.
y - region_sz * 0.5f;
if (region_y < 0.0
f) region_y = 0.0f;
else if (region_y > my_tex_h - region_sz) region_y = my_tex_h - region_sz;
733 ImGui::Text(
"Min: (%.2f, %.2f)", region_x, region_y);
734 ImGui::Text(
"Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz);
735 ImVec2 uv0 =
ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h);
736 ImVec2 uv1 =
ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h);
737 ImGui::Image(my_tex_id,
ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1,
ImColor(255,255,255,255),
ImColor(255,255,255,128));
741 static int pressed_count = 0;
742 for (
int i = 0; i < 8; i++)
745 int frame_padding = -1 + i;
746 if (
ImGui::ImageButton(my_tex_id,
ImVec2(32,32),
ImVec2(0,0),
ImVec2(32.0
f/my_tex_w,32/my_tex_h), frame_padding,
ImColor(0,0,0,255)))
768 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD",
"EEEE",
"FFFF",
"GGGG",
"HHHH",
"IIII",
"JJJJ",
"KKKK",
"LLLLLLL",
"MMMM",
"OOOOOOO" };
769 static const char* item_current = items[0];
774 bool is_selected = (item_current == items[n]);
776 item_current = items[n];
784 static int item_current_2 = 0;
785 ImGui::Combo(
"combo 2 (one-liner)", &item_current_2,
"aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
788 static int item_current_3 = -1;
792 struct FuncHolder {
static bool ItemGetter(
void* data,
int idx,
const char** out_str) { *out_str = ((
const char**)data)[idx];
return true; } };
793 static int item_current_4 = 0;
807 static bool selection[5] = {
false,
true,
false,
false,
false };
814 selection[4] = !selection[4];
819 static int selected = -1;
820 for (
int n = 0; n < 5; n++)
823 sprintf(buf,
"Object %d", n);
832 static bool selection[5] = {
false,
false,
false,
false,
false };
833 for (
int n = 0; n < 5; n++)
836 sprintf(buf,
"Object %d", n);
840 memset(selection, 0,
sizeof(selection));
849 static bool selected[3] = {
false,
false,
false };
858 static bool selected[16] = { 0 };
859 for (
int i = 0; i < 16; i++)
861 char label[32]; sprintf(label,
"Item %d", i);
870 static bool selected[16] = {
true,
false,
false,
false,
false,
true,
false,
false,
false,
false,
true,
false,
false,
false,
false,
true };
871 for (
int i = 0; i < 16; i++)
876 int x = i % 4, y = i / 4;
877 if (x > 0) selected[i - 1] ^= 1;
878 if (x < 3) selected[i + 1] ^= 1;
879 if (y > 0) selected[i - 4] ^= 1;
880 if (y < 3) selected[i + 4] ^= 1;
901 static char bufpass[64] =
"password123";
913 static bool read_only =
false;
914 static char text[1024*16] =
916 " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n" 917 " the hexadecimal encoding of one offending instruction,\n" 918 " more formally, the invalid operand with locked CMPXCHG8B\n" 919 " instruction bug, is a design flaw in the majority of\n" 920 " Intel Pentium, Pentium MMX, and Pentium OverDrive\n" 921 " processors (all in the P5 microarchitecture).\n" 924 "\tlock cmpxchg8b eax\n";
926 ShowHelpMarker(
"You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp)");
935 static bool animate =
true;
938 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
943 static float values[90] = { 0 };
944 static int values_offset = 0;
945 static double refresh_time = 0.0;
946 if (!animate || refresh_time == 0.0
f)
950 static float phase = 0.0f;
951 values[values_offset] = cosf(phase);
952 values_offset = (values_offset+1) %
IM_ARRAYSIZE(values);
953 phase += 0.10f*values_offset;
954 refresh_time += 1.0f/60.0f;
963 static float Sin(
void*,
int i) {
return sinf(i * 0.1
f); }
964 static float Saw(
void*,
int i) {
return (i & 1) ? 1.0f : -1.0f; }
966 static int func_type = 0, display_count = 70;
971 float (*func)(
void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
977 static float progress = 0.0f, progress_dir = 1.0f;
981 if (progress >= +1.1
f) { progress = +1.1f; progress_dir *= -1.0f; }
982 if (progress <= -0.1
f) { progress = -0.1f; progress_dir *= -1.0f; }
990 float progress_saturated = (progress < 0.0f) ? 0.0
f : (progress > 1.0
f) ? 1.0f : progress;
992 sprintf(buf,
"%d/%d", (
int)(progress_saturated*1753), 1753);
1001 static bool alpha_preview =
true;
1002 static bool alpha_half_preview =
false;
1003 static bool drag_and_drop =
true;
1004 static bool options_menu =
true;
1005 static bool hdr =
false;
1014 ImGui::SameLine();
ShowHelpMarker(
"Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n");
1024 ImGui::SameLine();
ShowHelpMarker(
"With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup.");
1027 ImGui::Text(
"Color button with Custom Picker Popup:");
1030 static bool saved_palette_inited =
false;
1031 static ImVec4 saved_palette[32];
1032 if (!saved_palette_inited)
1036 saved_palette[n].
w = 1.0f;
1038 saved_palette_inited =
true;
1040 static ImVec4 backup_color;
1047 backup_color = color;
1052 ImGui::Text(
"MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
1061 color = backup_color;
1070 color =
ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.
w);
1075 memcpy((
float*)&saved_palette[n], payload->Data,
sizeof(
float) * 3);
1077 memcpy((
float*)&saved_palette[n], payload->Data,
sizeof(
float) * 4);
1091 static bool alpha =
true;
1092 static bool alpha_bar =
true;
1093 static bool side_preview =
true;
1094 static bool ref_color =
false;
1095 static ImVec4 ref_color_v(1.0
f,0.0
f,1.0
f,0.5
f);
1096 static int inputs_mode = 2;
1097 static int picker_mode = 0;
1111 ImGui::Combo(
"Inputs Mode", &inputs_mode,
"All Inputs\0No Inputs\0RGB Input\0HSV Input\0HEX Input\0");
1112 ImGui::Combo(
"Picker Mode", &picker_mode,
"Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0");
1127 ImGui::SameLine();
ShowHelpMarker(
"SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible.");
1138 static float begin = 10, end = 90;
1139 static int begin_i = 100, end_i = 1000;
1141 ImGui::DragIntRange2(
"range int (no bounds)", &begin_i, &end_i, 5, 0, 0,
"Min: %d units",
"Max: %d units");
1162 ImS64 LLONG_MIN = -9223372036854775807LL - 1;
1163 ImS64 LLONG_MAX = 9223372036854775807LL;
1164 ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1);
1166 const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2;
1167 const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2;
1168 const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2;
1169 const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2;
1170 const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f;
1171 const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0;
1174 static ImS32 s32_v = -1;
1176 static ImS64 s64_v = -1;
1178 static float f32_v = 0.123f;
1179 static double f64_v = 90000.01234567890123456789;
1181 const float drag_speed = 0.2f;
1182 static bool drag_clamp =
false;
1184 ImGui::Checkbox(
"Clamp integers to 0..50", &drag_clamp);
ImGui::SameLine();
ShowHelpMarker(
"As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value.");
1214 static bool inputs_step =
true;
1231 static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
1232 static int vec4i[4] = { 1, 5, 100, 255 };
1262 const float spacing = 4;
1265 static int int_value = 0;
1269 static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f };
1271 for (
int i = 0; i < 7; i++)
1289 static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f };
1291 const ImVec2 small_slider_size(18, (160.0
f-(rows-1)*spacing)/rows);
1292 for (
int nx = 0; nx < 4; nx++)
1296 for (
int ny = 0; ny < rows; ny++)
1310 for (
int i = 0; i < 4; i++)
1332 static float col1[3] = { 1.0f,0.0f,0.2f };
1333 static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
1348 static int mode = 0;
1352 static const char* names[9] = {
"Bobby",
"Beatrice",
"Betty",
"Brianna",
"Barry",
"Bernard",
"Bibi",
"Blaine",
"Bryn" };
1364 if (mode == Mode_Copy) {
ImGui::Text(
"Copy %s", names[n]); }
1365 if (mode == Mode_Move) {
ImGui::Text(
"Move %s", names[n]); }
1366 if (mode == Mode_Swap) {
ImGui::Text(
"Swap %s", names[n]); }
1373 IM_ASSERT(payload->DataSize ==
sizeof(
int));
1374 int payload_n = *(
const int*)payload->Data;
1375 if (mode == Mode_Copy)
1377 names[n] = names[payload_n];
1379 if (mode == Mode_Move)
1381 names[n] = names[payload_n];
1382 names[payload_n] =
"";
1384 if (mode == Mode_Swap)
1386 const char* tmp = names[n];
1387 names[n] = names[payload_n];
1388 names[payload_n] = tmp;
1405 static int item_type = 1;
1406 static bool b =
false;
1407 static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
1416 if (item_type == 0) {
ImGui::Text(
"ITEM: Text"); }
1417 if (item_type == 1) { ret =
ImGui::Button(
"ITEM: Button"); }
1421 if (item_type == 5) {
const char* items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi" };
static int current = 1; ret =
ImGui::ListBox(
"ITEM: ListBox", ¤t, items,
IM_ARRAYSIZE(items),
IM_ARRAYSIZE(items)); }
1423 "Return value = %d\n" 1424 "IsItemFocused() = %d\n" 1425 "IsItemHovered() = %d\n" 1426 "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n" 1427 "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n" 1428 "IsItemHovered(_AllowWhenOverlapped) = %d\n" 1429 "IsItemHovered(_RectOnly) = %d\n" 1430 "IsItemActive() = %d\n" 1431 "IsItemEdited() = %d\n" 1432 "IsItemDeactivated() = %d\n" 1433 "IsItemDeactivatedEdit() = %d\n" 1434 "IsItemVisible() = %d\n" 1435 "GetItemRectMin() = (%.1f, %.1f)\n" 1436 "GetItemRectMax() = (%.1f, %.1f)\n" 1437 "GetItemRectSize() = (%.1f, %.1f)",
1455 static bool embed_all_inside_a_child_window =
false;
1456 ImGui::Checkbox(
"Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window);
1457 if (embed_all_inside_a_child_window)
1462 "IsWindowFocused() = %d\n" 1463 "IsWindowFocused(_ChildWindows) = %d\n" 1464 "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n" 1465 "IsWindowFocused(_RootWindow) = %d\n" 1466 "IsWindowFocused(_AnyWindow) = %d\n",
1475 "IsWindowHovered() = %d\n" 1476 "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n" 1477 "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n" 1478 "IsWindowHovered(_ChildWindows) = %d\n" 1479 "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n" 1480 "IsWindowHovered(_RootWindow) = %d\n" 1481 "IsWindowHovered(_AnyWindow) = %d\n",
1491 ImGui::Text(
"This is another child window for testing the _ChildWindows flag.");
1493 if (embed_all_inside_a_child_window)
1498 static bool test_window =
false;
1499 ImGui::Checkbox(
"Hovered/Active tests after Begin() for title bar testing", &test_window);
1502 ImGui::Begin(
"Title bar Hovered/Active tests", &test_window);
1509 "IsItemHovered() after begin = %d (== is title bar hovered)\n" 1510 "IsItemActive() after begin = %d (== is window being clicked/moved)\n",
1526 ShowHelpMarker(
"Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window.");
1527 static bool disable_mouse_wheel =
false;
1528 static bool disable_menu =
false;
1532 static int line = 50;
1543 for (
int i = 0; i < 100; i++)
1546 if (goto_line && line == i)
1549 if (goto_line && line >= 100)
1571 for (
int i = 0; i < 100; i++)
1574 sprintf(buf,
"%03d", i);
1594 for (
int n = 0; n < 50; n++)
1600 ImGui::Text(
"Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.
x, child_rect_min.
y, child_rect_max.
x, child_rect_max.
y);
1608 static float f = 0.0f;
1615 ImGui::Text(
"PushItemWidth(GetWindowWidth() * 0.5f)");
1621 ImGui::Text(
"PushItemWidth(GetContentRegionAvailWidth() * 0.5f)");
1644 ImGui::TextWrapped(
"(Use ImGui::SameLine() to keep adding items to the right of the preceding item)");
1675 static bool c1 =
false, c2 =
false, c3 =
false, c4 =
false;
1682 static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f;
1684 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD" };
1685 static int item = -1;
1694 static int selection[4] = { 0, 1, 2, 3 };
1695 for (
int i = 0; i < 4; i++)
1706 ImVec2 button_sz(40, 40);
1714 int buttons_count = 20;
1716 for (
int n = 0; n < buttons_count; n++)
1721 float next_button_x2 = last_button_x2 + style.
ItemSpacing.
x + button_sz.
x;
1722 if (n + 1 < buttons_count && next_button_x2 < window_visible_x2)
1739 ImGui::Text(
"This is the Avocado tab!\nblah blah blah blah blah");
1744 ImGui::Text(
"This is the Broccoli tab!\nblah blah blah blah blah");
1749 ImGui::Text(
"This is the Cucumber tab!\nblah blah blah blah blah");
1773 const char* names[4] = {
"Artichoke",
"Beetroot",
"Celery",
"Daikon" };
1774 static bool opened[4] = {
true,
true,
true,
true };
1802 ShowHelpMarker(
"Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.");
1822 const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f };
1846 ShowHelpMarker(
"This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets.");
1901 ShowHelpMarker(
"Use SetScrollHereY() or SetScrollFromPosY() to scroll to a given position.");
1903 static bool track =
true;
1904 static int track_line = 50, scroll_to_px = 200;
1911 if (scroll_to) track =
false;
1913 for (
int i = 0; i < 5; i++)
1917 ImGui::Text(
"%s", i == 0 ?
"Top" : i == 1 ?
"25%" : i == 2 ?
"Center" : i == 3 ?
"75%" :
"Bottom");
1921 for (
int line = 0; line < 100; line++)
1923 if (track && line == track_line)
1943 ShowHelpMarker(
"Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.\n\nYou may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
1944 static int lines = 7;
1949 for (
int line = 0; line < lines; line++)
1953 int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
1954 for (
int n = 0; n < num_buttons; n++)
1959 sprintf(num_buf,
"%d", n);
1960 const char* label = (!(n%15)) ?
"FizzBuzz" : (!(n%3)) ?
"Fizz" : (!(n%5)) ?
"Buzz" : num_buf;
1961 float hue = n*0.05f;
1973 float scroll_x_delta = 0.0f;
1978 if (scroll_x_delta != 0.0
f)
1989 static ImVec2 size(100, 100), offset(50, 20);
1990 ImGui::TextWrapped(
"On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost.");
1994 ImVec4 clip_rect(pos.
x, pos.
y, pos.
x + size.x, pos.
y + size.y);
1998 ImGui::GetWindowDrawList()->
AddText(
ImGui::GetFont(),
ImGui::GetFontSize()*2.0
f,
ImVec2(pos.
x + offset.
x, pos.
y + offset.
y),
IM_COL32(255, 255, 255, 255),
"Line 1 hello\nLine 2 clip me!", NULL, 0.0
f, &clip_rect);
2026 ImGui::TextWrapped(
"When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it.");
2028 static int selected_fish = -1;
2029 const char* names[] = {
"Bream",
"Haddock",
"Mackerel",
"Pollock",
"Tilefish" };
2030 static bool toggles[] = {
true,
false,
false,
false,
false };
2101 static float value = 0.5f;
2102 ImGui::Text(
"Value = %.3f (<-- right-click here)", value);
2115 ImGui::Text(
"(You can also right-click me to the same popup as above.)");
2121 static char name[32] =
"Label1";
2122 char buf[64]; sprintf(buf,
"Button: %s###Button", name);
2139 ImGui::TextWrapped(
"Modal windows are like popups but the user cannot close them by clicking outside the window.");
2146 ImGui::Text(
"All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");
2152 static bool dont_ask_me_next_time =
false;
2168 ImGui::Text(
"Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it.");
2169 static int item = 1;
2170 ImGui::Combo(
"Combo", &item,
"aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
2171 static float color[4] = { 0.4f,0.7f,0.0f,0.5f };
2179 bool dummy_open =
true;
2198 ImGui::TextWrapped(
"Below we are testing adding menu items to a regular window. It's rather unusual but should work!");
2229 for (
int n = 0; n < 14; n++)
2232 sprintf(label,
"Item %d", n);
2248 const char* names[3] = {
"One",
"Two",
"Three" };
2249 const char* paths[3] = {
"/path/one",
"/path/two",
"/path/three" };
2250 static int selected = -1;
2251 for (
int i = 0; i < 3; i++)
2254 sprintf(label,
"%04d", i);
2280 static float foo = 1.0f;
2287 static float bar = 1.0f;
2317 static bool h_borders =
true;
2318 static bool v_borders =
true;
2323 for (
int i = 0; i < 4*3; i++)
2368 int ITEMS_COUNT = 2000;
2370 while (clipper.
Step())
2373 for (
int j = 0; j < 10; j++)
2405 " \"\" display all lines\n" 2406 " \"xxx\" display lines containing \"xxx\"\n" 2407 " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n" 2408 " \"-xxx\" hide lines containing \"xxx\"");
2410 const char* lines[] = {
"aaa1.c",
"bbb1.c",
"ccc1.c",
"aaa2.cpp",
"bbb2.cpp",
"ccc2.cpp",
"abc.h",
"hello, world" };
2448 ImGui::Button(
"Hovering me sets the\nkeyboard capture flag");
2452 ImGui::Button(
"Holding me clears the\nthe keyboard capture flag");
2461 ImGui::Text(
"Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
2462 static char buf[32] =
"dummy";
2480 static char buf[128] =
"click on a button to set focus";
2502 static float f3[3] = { 0.0f, 0.0f, 0.0f };
2503 int focus_ahead = -1;
2510 ImGui::TextWrapped(
"NB: Cursor & selection are preserved when refocusing last used item in code.");
2516 ImGui::TextWrapped(
"You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
2517 for (
int button = 0; button < 3; button++)
2518 ImGui::Text(
"IsMouseDragging(%d):\n w/ default threshold: %d,\n w/ zero threshold: %d\n w/ large threshold: %d",
2534 ImGui::SameLine();
ImGui::Text(
"Raw (%.1f, %.1f), WithLockThresold (%.1f, %.1f), MouseDelta (%.1f, %.1f)", value_raw.
x, value_raw.
y, value_with_lock_threshold.
x, value_with_lock_threshold.
y, mouse_delta.
x, mouse_delta.
y);
2541 const char* mouse_cursors_names[] = {
"Arrow",
"TextInput",
"Move",
"ResizeNS",
"ResizeEW",
"ResizeNESW",
"ResizeNWSE",
"Hand" };
2546 ImGui::SameLine();
ShowHelpMarker(
"Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it.");
2550 sprintf(label,
"Mouse cursor %d: %s", i, mouse_cursors_names[i]);
2574 ImGui::Text(
"By Omar Cornut and all dear imgui contributors.");
2575 ImGui::Text(
"Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
2577 static bool show_config_info =
false;
2579 if (show_config_info)
2584 bool copy_to_clipboard =
ImGui::Button(
"Copy to clipboard");
2586 if (copy_to_clipboard)
2591 ImGui::Text(
"sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (
int)
sizeof(
size_t), (
int)
sizeof(
ImDrawIdx), (
int)
sizeof(
ImDrawVert));
2592 ImGui::Text(
"define: __cplusplus=%d", (
int)__cplusplus);
2593 #ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 2594 ImGui::Text(
"define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
2596 #ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS 2597 ImGui::Text(
"define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS");
2599 #ifdef IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS 2600 ImGui::Text(
"define: IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS");
2602 #ifdef IMGUI_DISABLE_WIN32_FUNCTIONS 2603 ImGui::Text(
"define: IMGUI_DISABLE_WIN32_FUNCTIONS");
2605 #ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS 2606 ImGui::Text(
"define: IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS");
2608 #ifdef IMGUI_DISABLE_MATH_FUNCTIONS 2609 ImGui::Text(
"define: IMGUI_DISABLE_MATH_FUNCTIONS");
2611 #ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS 2612 ImGui::Text(
"define: IMGUI_DISABLE_DEFAULT_ALLOCATORS");
2614 #ifdef IMGUI_USE_BGRA_PACKED_COLOR 2615 ImGui::Text(
"define: IMGUI_USE_BGRA_PACKED_COLOR");
2639 ImGui::Text(
"define: __GNUC__=%d", (
int)__GNUC__);
2641 #ifdef __clang_version__ 2642 ImGui::Text(
"define: __clang_version__=%s", __clang_version__);
2675 if (copy_to_clipboard)
2690 static int style_idx = -1;
2691 if (
ImGui::Combo(label, &style_idx,
"Classic\0Dark\0Light\0"))
2719 "- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n" 2720 "- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n" 2721 "- Read FAQ and documentation in misc/fonts/ for more details.\n" 2722 "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
2732 static bool init =
true;
2733 if (init && ref == NULL)
2734 ref_saved_style = style;
2737 ref = &ref_saved_style;
2742 ref_saved_style = style;
2756 *ref = ref_saved_style = style;
2761 ShowHelpMarker(
"Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export Colors\" below to save them somewhere.");
2802 static int output_dest = 0;
2803 static bool output_only_modified =
true;
2806 if (output_dest == 0)
2815 if (!output_only_modified || memcmp(&col, &ref->
Colors[i],
sizeof(
ImVec4)) != 0)
2816 ImGui::LogText(
"colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23 - (
int)strlen(name),
"", col.
x, col.
y, col.
z, col.
w);
2830 ShowHelpMarker(
"In the color list:\nLeft-click on colored square to open color picker,\nRight-click to open edit options menu.");
2861 ShowHelpMarker(
"Read FAQ and misc/fonts/README.txt for details on font loading.");
2863 for (
int i = 0; i < atlas->
Fonts.
Size; i++)
2869 if (font_details_opened)
2872 ImGui::Text(
"The quick brown fox jumps over the lazy dog");
2875 ImGui::SameLine();
ShowHelpMarker(
"Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");
2882 ImGui::BulletText(
"Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
2886 for (
int base = 0; base < 0x10000; base += 256)
2889 for (
int n = 0; n < 256; n++)
2891 if (count > 0 &&
ImGui::TreeNode((
void*)(intptr_t)base,
"U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ?
"glyphs" :
"glyph"))
2893 float cell_size = font->
FontSize * 1;
2897 for (
int n = 0; n < 256; n++)
2899 ImVec2 cell_p1(base_pos.
x + (n % 16) * (cell_size + cell_spacing), base_pos.
y + (n / 16) * (cell_size + cell_spacing));
2900 ImVec2 cell_p2(cell_p1.
x + cell_size, cell_p1.
y + cell_size);
2916 ImGui::Dummy(
ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
2928 ImGui::Image(atlas->
TexID,
ImVec2((
float)atlas->
TexWidth, (
float)atlas->
TexHeight),
ImVec2(0, 0),
ImVec2(1, 1),
ImColor(255, 255, 255, 255),
ImColor(255, 255, 255, 128));
2932 static float window_scale = 1.0f;
3016 static bool enabled =
true;
3019 for (
int i = 0; i < 10; i++)
3022 static float f = 0.5f;
3024 static bool b =
true;
3071 memset(InputBuf, 0,
sizeof(InputBuf));
3077 AddLog(
"Welcome to Dear ImGui!");
3082 for (
int i = 0; i < History.
Size; i++)
3087 static int Stricmp(
const char* str1,
const char* str2) {
int d;
while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; }
return d; }
3088 static int Strnicmp(
const char* str1,
const char* str2,
int n) {
int d = 0;
while (n > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; n--; }
return d; }
3089 static char*
Strdup(
const char *str) {
size_t len = strlen(str) + 1;
void* buff = malloc(len);
return (
char*)memcpy(buff, (
const void*)str, len); }
3090 static void Strtrim(
char* str) {
char* str_end = str + strlen(str);
while (str_end > str && str_end[-1] ==
' ') str_end--; *str_end = 0; }
3094 for (
int i = 0; i < Items.
Size; i++)
3097 ScrollToBottom =
true;
3105 va_start(args, fmt);
3110 ScrollToBottom =
true;
3113 void Draw(
const char* title,
bool* p_open)
3131 ImGui::TextWrapped(
"This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc.");
3147 filter.
Draw(
"Filter (\"incl,-excl\") (\"error\")", 180);
3171 if (copy_to_clipboard)
3174 for (
int i = 0; i < Items.
Size; i++)
3176 const char* item = Items[i];
3179 ImVec4 col = col_default_text;
3180 if (strstr(item,
"[error]")) col =
ImColor(1.0
f,0.4
f,0.4
f,1.0
f);
3181 else if (strncmp(item,
"# ", 2) == 0) col =
ImColor(1.0
f,0.78
f,0.58
f,1.0
f);
3186 if (copy_to_clipboard)
3190 ScrollToBottom =
false;
3196 bool reclaim_focus =
false;
3204 reclaim_focus =
true;
3217 AddLog(
"# %s\n", command_line);
3221 for (
int i = History.
Size-1; i >= 0; i--)
3222 if (Stricmp(History[i], command_line) == 0)
3228 History.
push_back(Strdup(command_line));
3231 if (Stricmp(command_line,
"CLEAR") == 0)
3235 else if (Stricmp(command_line,
"HELP") == 0)
3237 AddLog(
"Commands:");
3238 for (
int i = 0; i < Commands.
Size; i++)
3239 AddLog(
"- %s", Commands[i]);
3241 else if (Stricmp(command_line,
"HISTORY") == 0)
3243 int first = History.
Size - 10;
3244 for (
int i = first > 0 ? first : 0; i < History.
Size; i++)
3245 AddLog(
"%3d: %s\n", i, History[i]);
3249 AddLog(
"Unknown command: '%s'\n", command_line);
3270 const char* word_start = word_end;
3271 while (word_start > data->
Buf)
3273 const char c = word_start[-1];
3274 if (c ==
' ' || c ==
'\t' || c ==
',' || c ==
';')
3281 for (
int i = 0; i < Commands.
Size; i++)
3282 if (Strnicmp(Commands[i], word_start, (
int)(word_end-word_start)) == 0)
3285 if (candidates.
Size == 0)
3288 AddLog(
"No match for \"%.*s\"!\n", (
int)(word_end-word_start), word_start);
3290 else if (candidates.
Size == 1)
3293 data->
DeleteChars((
int)(word_start-data->
Buf), (
int)(word_end-word_start));
3300 int match_len = (int)(word_end - word_start);
3304 bool all_candidates_matches =
true;
3305 for (
int i = 0; i < candidates.
Size && all_candidates_matches; i++)
3307 c = toupper(candidates[i][match_len]);
3308 else if (c == 0 || c != toupper(candidates[i][match_len]))
3309 all_candidates_matches =
false;
3310 if (!all_candidates_matches)
3317 data->
DeleteChars((
int)(word_start - data->
Buf), (
int)(word_end-word_start));
3322 AddLog(
"Possible matches:\n");
3323 for (
int i = 0; i < candidates.
Size; i++)
3324 AddLog(
"- %s\n", candidates[i]);
3332 const int prev_history_pos = HistoryPos;
3335 if (HistoryPos == -1)
3336 HistoryPos = History.
Size - 1;
3337 else if (HistoryPos > 0)
3342 if (HistoryPos != -1)
3343 if (++HistoryPos >= History.
Size)
3348 if (prev_history_pos != HistoryPos)
3350 const char* history_str = (HistoryPos >= 0) ? History[HistoryPos] :
"";
3363 console.
Draw(
"Example: Console", p_open);
3384 LineOffsets.
clear();
3390 int old_size = Buf.
size();
3392 va_start(args, fmt);
3395 for (
int new_size = Buf.
size(); old_size < new_size; old_size++)
3396 if (Buf[old_size] ==
'\n')
3398 ScrollToBottom =
true;
3401 void Draw(
const char* title,
bool* p_open = NULL)
3412 Filter.
Draw(
"Filter", -100.0
f);
3419 const char* buf = Buf.
begin();
3420 const char* buf_end = Buf.
end();
3423 for (
int line_no = 0; line_no < LineOffsets.
Size; line_no++)
3425 const char* line_start = buf + LineOffsets[line_no];
3426 const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
3444 while (clipper.
Step())
3448 const char* line_start = buf + LineOffsets[line_no];
3449 const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
3459 ScrollToBottom =
false;
3476 static int counter = 0;
3477 for (
int n = 0; n < 5; n++)
3479 const char* categories[3] = {
"info",
"warn",
"error" };
3480 const char* words[] = {
"Bumfuzzled",
"Cattywampus",
"Snickersnee",
"Abibliophobia",
"Absquatulate",
"Nincompoop",
"Pauciloquent" };
3481 log.
AddLog(
"[%05d] [%s] Hello, current time is %.1f, here's a word: '%s'\n",
3488 log.
Draw(
"Example: Log", p_open);
3512 static int selected = 0;
3514 for (
int i = 0; i < 100; i++)
3517 sprintf(label,
"MyObject %d", i);
3533 ImGui::TextWrapped(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
3566 ShowHelpMarker(
"This example shows how you may implement a property editor using two columns.\nAll objects/fields data are dummies here.\nRemember that in many simple cases, you can use ImGui::SameLine(xxx) to position\nyour cursor horizontally instead of using the Columns() API.");
3574 static void ShowDummyObject(
const char* prefix,
int uid)
3585 static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f };
3586 for (
int i = 0; i < 8; i++)
3591 ShowDummyObject(
"Child", 424242);
3616 for (
int obj_i = 0; obj_i < 3; obj_i++)
3617 funcs::ShowDummyObject(
"Object", obj_i);
3633 if (!
ImGui::Begin(
"Example: Long text display", p_open))
3639 static int test_type = 0;
3641 static int lines = 0;
3642 ImGui::Text(
"Printing unusually long amount of text.");
3643 ImGui::Combo(
"Test type", &test_type,
"Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped (slow)\0");
3644 ImGui::Text(
"Buffer contents: %d lines, %d bytes", lines, log.
size());
3649 for (
int i = 0; i < 1000; i++)
3650 log.
appendf(
"%i The quick brown fox jumps over the lazy dog\n", lines+i);
3665 while (clipper.
Step())
3667 ImGui::Text(
"%i The quick brown fox jumps over the lazy dog", i);
3674 for (
int i = 0; i < lines; i++)
3675 ImGui::Text(
"%i The quick brown fox jumps over the lazy dog", i);
3696 static int lines = 10;
3697 ImGui::Text(
"Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop.");
3699 for (
int i = 0; i < lines; i++)
3711 struct CustomConstraints
3717 static bool auto_resize =
false;
3718 static int type = 0;
3719 static int display_lines = 10;
3729 if (
ImGui::Begin(
"Example: Constrained Resize", p_open, flags))
3731 const char* desc[] =
3733 "Resize vertical only",
3734 "Resize horizontal only",
3735 "Width > 100, Height > 100",
3738 "Custom: Always Square",
3739 "Custom: Fixed Steps (100)",
3749 for (
int i = 0; i < display_lines; i++)
3750 ImGui::Text(
"%*sHello, sailor! Making this line long enough for the example.", i * 4,
"");
3762 const float DISTANCE = 10.0f;
3763 static int corner = 0;
3765 ImVec2 window_pos_pivot =
ImVec2((corner & 1) ? 1.0
f : 0.0
f, (corner & 2) ? 1.0f : 0.0f);
3771 ImGui::Text(
"Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)");
3805 ImGui::Text(
"This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
3810 ImGui::Text(
"This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
3830 if (!
ImGui::Begin(
"Example: Custom rendering", p_open))
3844 static float sz = 36.0f;
3845 static float thickness = 4.0f;
3853 float x = p.
x + 4.0f, y = p.
y + 4.0f, spacing = 8.0f;
3854 for (
int n = 0; n < 2; n++)
3856 float curr_thickness = (n == 0) ? 1.0
f : thickness;
3857 draw_list->
AddCircle(
ImVec2(x+sz*0.5
f, y+sz*0.5f), sz*0.5f, col32, 20, curr_thickness); x += sz+spacing;
3862 draw_list->
AddLine(
ImVec2(x, y),
ImVec2(x+sz, y ), col32, curr_thickness); x += sz+spacing;
3864 draw_list->
AddLine(
ImVec2(x, y),
ImVec2(x+sz, y+sz), col32, curr_thickness); x += sz+spacing;
3877 draw_list->
AddRectFilledMultiColor(
ImVec2(x, y),
ImVec2(x+sz, y+sz),
IM_COL32(0,0,0,255),
IM_COL32(255,0,0,255),
IM_COL32(255,255,0,255),
IM_COL32(0,255,0,255));
3883 static bool adding_line =
false;
3887 ImGui::Text(
"Left-click and drag to add lines,\nRight-click to undo");
3894 if (canvas_size.
x < 50.0f) canvas_size.
x = 50.0f;
3895 if (canvas_size.
y < 50.0f) canvas_size.
y = 50.0f;
3896 draw_list->
AddRectFilledMultiColor(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y),
IM_COL32(50, 50, 50, 255),
IM_COL32(50, 50, 60, 255),
IM_COL32(60, 60, 70, 255),
IM_COL32(50, 50, 60, 255));
3897 draw_list->
AddRect(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y),
IM_COL32(255, 255, 255, 255));
3899 bool adding_preview =
false;
3904 adding_preview =
true;
3907 adding_line = adding_preview =
false;
3918 adding_line = adding_preview =
false;
3923 draw_list->
PushClipRect(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y),
true);
3924 for (
int i = 0; i < points.
Size - 1; i += 2)
3925 draw_list->
AddLine(
ImVec2(canvas_pos.
x + points[i].x, canvas_pos.
y + points[i].y),
ImVec2(canvas_pos.
x + points[i + 1].x, canvas_pos.
y + points[i + 1].y),
IM_COL32(255, 255, 0, 255), 2.0
f);
3950 Open = OpenPrev = open;
3966 ImGui::TextWrapped(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
3984 sprintf(buf,
"Save %s", doc->
Name);
4037 static bool opt_reorderable =
true;
4047 open_count += app.
Documents[doc_n].Open ? 1 : 0;
4060 if (
ImGui::MenuItem(
"Close All Documents", NULL,
false, open_count > 0))
4089 if (opt_reorderable)
4127 if (close_queue.
empty())
4142 if (!close_queue.
empty())
4144 int close_queue_unsaved_documents = 0;
4145 for (
int n = 0; n < close_queue.
Size; n++)
4146 if (close_queue[n]->Dirty)
4147 close_queue_unsaved_documents++;
4149 if (close_queue_unsaved_documents == 0)
4152 for (
int n = 0; n < close_queue.
Size; n++)
4153 close_queue[n]->DoForceClose();
4154 close_queue.
clear();
4162 ImGui::Text(
"Save change to the following items?");
4165 for (
int n = 0; n < close_queue.
Size; n++)
4166 if (close_queue[n]->Dirty)
4172 for (
int n = 0; n < close_queue.
Size; n++)
4174 if (close_queue[n]->Dirty)
4175 close_queue[n]->DoSave();
4176 close_queue[n]->DoForceClose();
4178 close_queue.
clear();
4184 for (
int n = 0; n < close_queue.
Size; n++)
4185 close_queue[n]->DoForceClose();
4186 close_queue.
clear();
4192 close_queue.
clear();
float NavInputs[ImGuiNavInput_COUNT]
static void ShowExampleAppConstrainedResize(bool *p_open)
IMGUI_API bool BeginPopupContextItem(const char *str_id=NULL, int mouse_button=1)
IMGUI_API bool DragIntRange2(const char *label, int *v_current_min, int *v_current_max, float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d", const char *format_max=NULL)
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiCond cond=0)
IMGUI_API void ShowFontSelector(const char *label)
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0)
IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value=true)
ImVector< char * > History
IMGUI_API bool InputFloat4(const char *label, float v[4], const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API ImVec2 GetCursorStartPos()
IMGUI_API void SetTooltip(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool IsMouseReleased(int button)
IMGUI_API bool RadioButton(const char *label, bool active)
IMGUI_API ImVec2 GetCursorPos()
bool ConfigWindowsResizeFromEdges
IMGUI_API void RenderChar(ImDrawList *draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const
const char * GetDebugName() const
IMGUI_API float GetFontSize()
IMGUI_API void AddCircle(const ImVec2 ¢re, float radius, ImU32 col, int num_segments=12, float thickness=1.0f)
IMGUI_API void AddRectFilledMultiColor(const ImVec2 &a, const ImVec2 &b, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left)
IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), int frame_padding=-1, const ImVec4 &bg_col=ImVec4(0, 0, 0, 0), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1))
bool ConfigMacOSXBehaviors
IMGUI_API bool SliderInt3(const char *label, int v[3], int v_min, int v_max, const char *format="%d")
IMGUI_API void SetTabItemClosed(const char *tab_or_docked_window_label)
IMGUI_API void ProgressBar(float fraction, const ImVec2 &size_arg=ImVec2(-1, 0), const char *overlay=NULL)
IMGUI_API void AlignTextToFramePadding()
IMGUI_API void PopClipRect()
IMGUI_API bool ArrowButton(const char *str_id, ImGuiDir dir)
IMGUI_API void StyleColorsDark(ImGuiStyle *dst=NULL)
TF2SIMD_FORCE_INLINE tf2Scalar angle(const Quaternion &q1, const Quaternion &q2)
IMGUI_API void appendf(const char *fmt,...) IM_FMTARGS(2)
IMGUI_API bool OpenPopupOnItemClick(const char *str_id=NULL, int mouse_button=1)
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
std::vector< double > values
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
bool ConfigInputTextCursorBlink
IMGUI_API const ImGuiPayload * AcceptDragDropPayload(const char *type, ImGuiDragDropFlags flags=0)
ImGuiInputTextFlags EventFlag
IMGUI_API bool IsItemDeactivatedAfterEdit()
IMGUI_API bool IsMouseClicked(int button, bool repeat=false)
IMGUI_API bool IsItemClicked(int mouse_button=0)
IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat=true)
float CurveTessellationTol
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
IMGUI_API void PopTextWrapPos()
void push_back(const T &v)
IMGUI_API bool IsMouseDown(int button)
IMGUI_API void AddBezierCurve(const ImVec2 &pos0, const ImVec2 &cp0, const ImVec2 &cp1, const ImVec2 &pos1, ImU32 col, float thickness, int num_segments=0)
IMGUI_API bool IsItemEdited()
void init(const M_string &remappings)
ImVector< ImFontGlyph > Glyphs
MyDocument(const char *name, bool open=true, const ImVec4 &color=ImVec4(1.0f, 1.0f, 1.0f, 1.0f))
IMGUI_API ImVec2 GetItemRectMin()
IMGUI_API bool IsItemActive()
IMGUI_API bool ColorPicker4(const char *label, float col[4], ImGuiColorEditFlags flags=0, const float *ref_col=NULL)
IMGUI_API bool InputFloat3(const char *label, float v[3], const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API bool SliderInt4(const char *label, int v[4], int v_min, int v_max, const char *format="%d")
IMGUI_API ImVec2 GetMouseDragDelta(int button=0, float lock_threshold=-1.0f)
static void ShowDemoWindowPopups()
static void ShowExampleAppSimpleOverlay(bool *p_open)
IMGUI_API void SetItemDefaultFocus()
IMGUI_API bool DragFloatRange2(const char *label, float *v_current_min, float *v_current_max, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", const char *format_max=NULL, float power=1.0f)
IMGUI_API void EndTooltip()
IMGUI_API void LogButtons()
IMGUI_API bool InputInt(const char *label, int *v, int step=1, int step_fast=100, ImGuiInputTextFlags flags=0)
IMGUI_API void PopAllowKeyboardFocus()
IMGUI_API bool SmallButton(const char *label)
IMGUI_API bool IsMouseHoveringRect(const ImVec2 &r_min, const ImVec2 &r_max, bool clip=true)
const char * BackendPlatformName
IMGUI_API bool BeginPopup(const char *str_id, ImGuiWindowFlags flags=0)
IMGUI_API bool DragFloat2(const char *label, float v[2], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
IMGUI_API void ShowMetricsWindow(bool *p_open=NULL)
IMGUI_API bool Draw(const char *label="Filter (inc,-exc)", float width=0.0f)
IMGUI_API void BeginTooltip()
IMGUI_API bool TreeNodeEx(const char *label, ImGuiTreeNodeFlags flags=0)
IMGUI_API bool VSliderFloat(const char *label, const ImVec2 &size, float *v, float v_min, float v_max, const char *format="%.3f", float power=1.0f)
IMGUI_API bool DragScalar(const char *label, ImGuiDataType data_type, void *v, float v_speed, const void *v_min=NULL, const void *v_max=NULL, const char *format=NULL, float power=1.0f)
IMGUI_API bool ListBox(const char *label, int *current_item, const char *const items[], int items_count, int height_in_items=-1)
float KeysDownDuration[512]
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2 &size_min, const ImVec2 &size_max, ImGuiSizeCallback custom_callback=NULL, void *custom_callback_data=NULL)
static void ShowDemoWindowLayout()
IMGUI_API void Indent(float indent_w=0.0f)
#define IM_ARRAYSIZE(_ARR)
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0)
IMGUI_API void AddTriangleFilled(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, ImU32 col)
IMGUI_API void PushButtonRepeat(bool repeat)
ImVec2 MouseClickedPos[5]
static void ShowExampleAppWindowTitles(bool *p_open)
IMGUI_API void AddRect(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners_flags=ImDrawCornerFlags_All, float thickness=1.0f)
int TextEditCallback(ImGuiInputTextCallbackData *data)
IMGUI_API ImGuiMouseCursor GetMouseCursor()
IMGUI_API float GetColumnOffset(int column_index=-1)
IMGUI_API void SetScrollHereY(float center_y_ratio=0.5f)
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API void AddLine(const ImVec2 &a, const ImVec2 &b, ImU32 col, float thickness=1.0f)
static void DisplayContents(MyDocument *doc)
IMGUI_API bool PassFilter(const char *text, const char *text_end=NULL) const
IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect=false)
IMGUI_API void EndTabItem()
float NavInputsDownDuration[ImGuiNavInput_COUNT]
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags=0)
ImVector< ImFont * > Fonts
IMGUI_API bool InputInt4(const char *label, int v[4], ImGuiInputTextFlags flags=0)
IMGUI_API ImVec2 GetItemRectSize()
IMGUI_API float GetWindowWidth()
IMGUI_API bool TreeNode(const char *label)
IMGUI_API bool CheckboxFlags(const char *label, unsigned int *flags, unsigned int flags_value)
IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2 &size, ImGuiWindowFlags flags=0)
IMGUI_API bool InputInt2(const char *label, int v[2], ImGuiInputTextFlags flags=0)
IMGUI_API bool ColorEdit4(const char *label, float col[4], ImGuiColorEditFlags flags=0)
IMGUI_API bool BeginMenuBar()
IMGUI_API void PlotHistogram(const char *label, const float *values, int values_count, int values_offset=0, const char *overlay_text=NULL, float scale_min=FLT_MAX, float scale_max=FLT_MAX, ImVec2 graph_size=ImVec2(0, 0), int stride=sizeof(float))
IMGUI_API bool IsMousePosValid(const ImVec2 *mouse_pos=NULL)
static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments &app)
void AddLog(const char *fmt,...) IM_FMTARGS(2)
IMGUI_API void EndDragDropSource()
static void ShowExampleAppConsole(bool *p_open)
static void ShowDemoWindowWidgets()
IMGUI_API void EndDragDropTarget()
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type)
IMGUI_API ImVec2 GetContentRegionAvail()
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
IMGUI_API float GetScrollMaxY()
static void ShowDemoWindowColumns()
IMGUI_API ImDrawList * GetWindowDrawList()
IMGUI_API void ShowDemoWindow(bool *p_open=NULL)
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
void Draw(const char *title, bool *p_open)
IMGUI_API void PopStyleVar(int count=1)
ImVector< const char * > Commands
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
IMGUI_API void AddTriangle(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, ImU32 col, float thickness=1.0f)
IMGUI_API bool BeginPopupContextWindow(const char *str_id=NULL, int mouse_button=1, bool also_over_items=true)
IMGUI_API bool ListBoxHeader(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API void Dummy(const ImVec2 &size)
IMGUI_API void BulletText(const char *fmt,...) IM_FMTARGS(1)
static void Strtrim(char *str)
IMGUI_API const char * GetStyleColorName(ImGuiCol idx)
IMGUI_API bool IsMouseDragging(int button=0, float lock_threshold=-1.0f)
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags flags=0)
IMGUI_API ImVec2 GetWindowContentRegionMax()
IMGUI_API void SetScrollFromPosY(float local_y, float center_y_ratio=0.5f)
IMGUI_API bool SliderFloat4(const char *label, float v[4], float v_min, float v_max, const char *format="%.3f", float power=1.0f)
static void DisplayContextMenu(MyDocument *doc)
IMGUI_API void TextUnformatted(const char *text, const char *text_end=NULL)
IMGUI_API bool InputScalar(const char *label, ImGuiDataType data_type, void *v, const void *step=NULL, const void *step_fast=NULL, const char *format=NULL, ImGuiInputTextFlags flags=0)
float MouseDownDuration[5]
#define IMGUI_PAYLOAD_TYPE_COLOR_3F
static char * Strdup(const char *str)
IMGUI_API void Unindent(float indent_w=0.0f)
IMGUI_API bool DragInt2(const char *label, int v[2], float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
#define IM_COL32(R, G, B, A)
IMGUI_API bool ColorEdit3(const char *label, float col[3], ImGuiColorEditFlags flags=0)
static int TextEditCallbackStub(ImGuiInputTextCallbackData *data)
IMGUI_API bool DragInt4(const char *label, int v[4], float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
IMGUI_API void AddText(const ImVec2 &pos, ImU32 col, const char *text_begin, const char *text_end=NULL)
IMGUI_API const ImFontGlyph * FindGlyphNoFallback(ImWchar c) const
IMGUI_API bool ShowStyleSelector(const char *label)
IMGUI_API ImGuiIO & GetIO()
IMGUI_API ImFont * GetFont()
IMGUI_API void EndGroup()
static int Strnicmp(const char *str1, const char *str2, int n)
IMGUI_API int GetColumnIndex()
IMGUI_API bool IsItemDeactivated()
IMGUI_API bool IsKeyReleased(int user_key_index)
IMGUI_API bool SliderAngle(const char *label, float *v_rad, float v_degrees_min=-360.0f, float v_degrees_max=+360.0f, const char *format="%.0f deg")
static void ShowExampleAppLayout(bool *p_open)
IMGUI_API void EndCombo()
static void ShowExampleAppDocuments(bool *p_open)
IMGUI_API void ShowStyleEditor(ImGuiStyle *ref=NULL)
IMGUI_API bool DragFloat4(const char *label, float v[4], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
IMGUI_API float GetContentRegionAvailWidth()
IMGUI_API bool VSliderInt(const char *label, const ImVec2 &size, int *v, int v_min, int v_max, const char *format="%d")
IMGUI_API void PushItemWidth(float item_width)
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API bool IsItemFocused()
IMGUI_API void Separator()
bool ConfigWindowsMoveFromTitleBarOnly
IMGUI_API bool InputFloat2(const char *label, float v[2], const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API void BeginGroup()
IMGUI_API void AddCircleFilled(const ImVec2 ¢re, float radius, ImU32 col, int num_segments=12)
IMGUI_API float GetScrollX()
IMGUI_API void Begin(int items_count, float items_height=-1.0f)
IMGUI_API bool Combo(const char *label, int *current_item, const char *const items[], int items_count, int popup_max_height_in_items=-1)
IMGUI_API void SetCursorPosX(float local_x)
IMGUI_API void SameLine(float local_pos_x=0.0f, float spacing_w=-1.0f)
IMGUI_API float GetColumnWidth(int column_index=-1)
IMGUI_API void EndPopup()
IMGUI_API float GetTreeNodeToLabelSpacing()
IMGUI_API void NextColumn()
IMGUI_API bool ColorButton(const char *desc_id, const ImVec4 &col, ImGuiColorEditFlags flags=0, ImVec2 size=ImVec2(0, 0))
IMGUI_API void EndTabBar()
const char * begin() const
IMGUI_API bool SliderScalar(const char *label, ImGuiDataType data_type, void *v, const void *v_min, const void *v_max, const char *format=NULL, float power=1.0f)
#define IMGUI_VERSION_NUM
const char * BackendRendererName
IMGUI_API bool BeginMainMenuBar()
static void ShowHelpMarker(const char *desc)
ImVec2 DisplaySafeAreaPadding
static void ShowExampleAppPropertyEditor(bool *p_open)
IMGUI_API void AddRectFilled(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners_flags=ImDrawCornerFlags_All)
IMGUI_API void PushFont(ImFont *font)
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiCond cond=0, const ImVec2 &pivot=ImVec2(0, 0))
IMGUI_API bool InvisibleButton(const char *str_id, const ImVec2 &size)
static void ShowExampleMenuFile()
IMGUI_API void appendfv(const char *fmt, va_list args) IM_FMTLIST(2)
IMGUI_API void EndChild()
IMGUI_API float GetWindowContentRegionWidth()
IMGUI_API float GetScrollMaxX()
IMGUI_API bool BeginMenu(const char *label, bool enabled=true)
IMGUI_API bool DragInt(const char *label, int *v, float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
IMGUI_API float GetTextLineHeightWithSpacing()
IMGUI_API void TextWrapped(const char *fmt,...) IM_FMTARGS(1)
ImVector< MyDocument > Documents
IMGUI_API bool DragInt3(const char *label, int v[3], float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
static void ShowDemoWindowMisc()
IMGUI_API void ListBoxFooter()
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...) IM_FMTARGS(2)
ImVec4 Colors[ImGuiCol_COUNT]
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *format="%d")
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void LogToTTY(int max_depth=-1)
ImGuiBackendFlags BackendFlags
IMGUI_API ImVec2 GetCursorScreenPos()
IMGUI_API void PushTextWrapPos(float wrap_local_pos_x=0.0f)
IMGUI_API void EndChildFrame()
IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags=0)
IMGUI_API void ShowAboutWindow(bool *p_open=NULL)
IMGUI_API bool SliderFloat(const char *label, float *v, float v_min, float v_max, const char *format="%.3f", float power=1.0f)
IMGUI_API void PopItemWidth()
IMGUI_API void SetNextWindowBgAlpha(float alpha)
static int Stricmp(const char *str1, const char *str2)
static void ShowExampleAppAutoResize(bool *p_open)
static void ShowExampleAppLongText(bool *p_open)
IMGUI_API void LogText(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool IsItemVisible()
IMGUI_API bool SliderFloat3(const char *label, float v[3], float v_min, float v_max, const char *format="%.3f", float power=1.0f)
IMGUI_API double GetTime()
IMGUI_API bool BeginDragDropTarget()
void ExecCommand(const char *command_line)
IMGUI_API float GetTextLineHeight()
IMGUI_API void DeleteChars(int pos, int bytes_count)
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col)
IMGUI_API void LabelText(const char *label, const char *fmt,...) IM_FMTARGS(2)
ImGuiConfigFlags ConfigFlags
IMGUI_API bool MenuItem(const char *label, const char *shortcut=NULL, bool selected=false, bool enabled=true)
IMGUI_API int GetFrameCount()
IMGUI_API void StyleColorsLight(ImGuiStyle *dst=NULL)
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API void SetNextWindowContentSize(const ImVec2 &size)
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key)
IMGUI_API void PopButtonRepeat()
IMGUI_API bool Checkbox(const char *label, bool *v)
static void ShowExampleAppMainMenuBar()
IMGUI_API void InsertChars(int pos, const char *text, const char *text_end=NULL)
IMGUI_API bool DragFloat3(const char *label, float v[3], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
IMGUI_API ImVec2 GetItemRectMax()
IMGUI_API float GetScrollY()
#define IMGUI_PAYLOAD_TYPE_COLOR_4F
std::optional< LaunchData > app
IMGUI_API void LogToClipboard(int max_depth=-1)
IMGUI_API void EndMenuBar()
IMGUI_API const char * GetVersion()
IMGUI_API void PushID(const char *str_id)
IMGUI_API ImGuiID GetID(const char *str_id)
ImVector< int > LineOffsets
IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus)
static void ShowExampleAppLog(bool *p_open)
IMGUI_API ImVec2 GetWindowPos()
IMGUI_API ImGuiStyle & GetStyle()
IMGUI_API bool SliderInt2(const char *label, int v[2], int v_min, int v_max, const char *format="%d")
IMGUI_API bool SliderFloat2(const char *label, float v[2], float v_min, float v_max, const char *format="%.3f", float power=1.0f)
IMGUI_API void CloseCurrentPopup()
IMGUI_API void PushClipRectFullScreen()
static void ShowExampleAppCustomRendering(bool *p_open)
IMGUI_API void OpenPopup(const char *str_id)
void AddLog(const char *fmt,...) IM_FMTARGS(2)
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API void TextDisabled(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void ShowUserGuide()
IMGUI_API const ImVec4 & GetStyleColorVec4(ImGuiCol idx)
ImFontConfig * ConfigData
IMGUI_API void Columns(int count=1, const char *id=NULL, bool border=true)
IMGUI_API void SetWindowFontScale(float scale)
IMGUI_API float GetFrameHeightWithSpacing()
IMGUI_API bool IsMouseDoubleClicked(int button)
IMGUI_API void StyleColorsClassic(ImGuiStyle *dst=NULL)
IMGUI_API bool BeginTabItem(const char *label, bool *p_open=NULL, ImGuiTabItemFlags flags=0)
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
IMGUI_API bool SetDragDropPayload(const char *type, const void *data, size_t size, ImGuiCond cond=0)
IMGUI_API void PlotLines(const char *label, const float *values, int values_count, int values_offset=0, const char *overlay_text=NULL, float scale_min=FLT_MAX, float scale_max=FLT_MAX, ImVec2 graph_size=ImVec2(0, 0), int stride=sizeof(float))
IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags)
IMGUI_API void SetKeyboardFocusHere(int offset=0)
IMGUI_API bool InputFloat(const char *label, float *v, float step=0.0f, float step_fast=0.0f, const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API void LogFinish()
static ImColor HSV(float h, float s, float v, float a=1.0f)
IMGUI_API void SetScrollX(float scroll_x)
IMGUI_API bool InputDouble(const char *label, double *v, double step=0.0f, double step_fast=0.0f, const char *format="%.6f", ImGuiInputTextFlags flags=0)
void Draw(const char *title, bool *p_open=NULL)
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul=1.0f)
IMGUI_API void PopStyleColor(int count=1)
IMGUI_API void EndMainMenuBar()
IMGUI_API bool BeginTabBar(const char *str_id, ImGuiTabBarFlags flags=0)
IMGUI_API bool IsPopupOpen(const char *str_id)
IMGUI_API void SetWindowSize(const ImVec2 &size, ImGuiCond cond=0)
IMGUI_API bool InputInt3(const char *label, int v[3], ImGuiInputTextFlags flags=0)