of the loop. May be a pointer to your own node type, etc.
530{
532 return;
533
535 {
536 static int clicked = 0;
538 clicked++;
539 if (clicked & 1)
540 {
543 }
544
545 static bool check =
true;
547
548 static int e = 0;
552
553
554 for (int i = 0; i < 7; i++)
555 {
556 if (i > 0)
565 }
566
567
568
569
573
574
575 static int counter = 0;
584
588
592 {
595 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
598 }
599
601
603
604 {
605
606
607 const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" };
608 static int item_current = 0;
611 "Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API.");
612 }
613
614 {
615
616
617 static char str0[128] = "Hello, world!";
620 "USER:\n"
621 "Hold SHIFT or use mouse to select text.\n"
622 "CTRL+Left/Right to word jump.\n"
623 "CTRL+A or double-click to select all.\n"
624 "CTRL+X,CTRL+C,CTRL+V clipboard.\n"
625 "CTRL+Z,CTRL+Y undo/redo.\n"
626 "ESCAPE to revert.\n\n"
627 "PROGRAMMER:\n"
628 "You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() "
629 "to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated "
630 "in imgui_demo.cpp).");
631
632 static char str1[128] = "";
634
635 static int i0 = 123;
638 "You can apply arithmetic operators +,*,/ on numerical values.\n"
639 " e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\n"
640 "Use +- to subtract.");
641
642 static float f0 = 0.001f;
644
645 static double d0 = 999999.00000001;
647
648 static float f1 = 1.e10f;
651 "You can input value using the scientific notation,\n"
652 " e.g. \"1e+8\" becomes \"100000000\".");
653
654 static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
656 }
657
658 {
659 static int i1 = 50, i2 = 42;
662 "Click and drag to edit value.\n"
663 "Hold SHIFT/ALT for faster/slower edit.\n"
664 "Double-click or CTRL+click to input value.");
665
667
668 static float f1 = 1.00f, f2 = 0.0067f;
671 }
672
673 {
674 static int i1 = 0;
677
678 static float f1 = 0.123f, f2 = 0.0f;
681
682 static float angle = 0.0f;
684
685
686
687
688 enum Element { Element_Fire, Element_Earth, Element_Air, Element_Water, Element_COUNT };
689 static int elem = Element_Fire;
690 const char* elems_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" };
691 const char* elem_name = (elem >= 0 && elem < Element_COUNT) ? elems_names[elem] : "Unknown";
694 }
695
696 {
697 static float col1[3] = { 1.0f, 0.0f, 0.2f };
698 static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
701 "Click on the color square to open a color picker.\n"
702 "Click and hold to use drag and drop.\n"
703 "Right-click on the color square to show options.\n"
704 "CTRL+click on individual component to input value.\n");
705
707 }
708
709 {
710
711
712 const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
713 static int item_current = 1;
716 "Using the simplified one-liner ListBox API here.\nRefer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API.");
717 }
718
720 }
721
722
723
724
725
726
727
729 {
731 {
732 for (int i = 0; i < 5; i++)
733 {
734
735
736 if (i == 0)
738
740 {
745 }
746 }
748 }
749
751 {
753 "This is a more typical looking tree with selectable nodes.\n"
754 "Click to select, CTRL+Click to toggle, click on arrows or double-click to open.");
756 static bool align_label_with_current_x_position = false;
757 static bool test_drag_and_drop = false;
762 ImGui::Checkbox(
"Align label with current X position", &align_label_with_current_x_position);
765 if (align_label_with_current_x_position)
767
768
769
770
772 static int selection_mask = (1 << 2);
773 int node_clicked = -1;
774 for (int i = 0; i < 6; i++)
775 {
776
778 const bool is_selected = (selection_mask & (1 << i)) != 0;
779 if (is_selected)
781 if (i < 3)
782 {
783
784 bool node_open =
ImGui::TreeNodeEx((
void*)(intptr_t)i, node_flags,
"Selectable Node %d", i);
786 node_clicked = i;
788 {
792 }
793 if (node_open)
794 {
797 }
798 }
799 else
800 {
801
802
803
807 node_clicked = i;
809 {
813 }
814 }
815 }
816 if (node_clicked != -1)
817 {
818
819
821 selection_mask ^= (1 << node_clicked);
822 else
823 selection_mask = (1 << node_clicked);
824 }
825 if (align_label_with_current_x_position)
828 }
830 }
831
833 {
834 static bool closable_group = true;
837 {
839 for (int i = 0; i < 5; i++)
841 }
843 {
845 for (int i = 0; i < 5; i++)
847 }
848
849
850
851
853 }
854
856 {
860 {
863 }
867 }
868
870 {
872 {
873
879 }
880
882 {
883
885 "This text should automatically wrap on the edge of the window. The current implementation "
886 "for text wrapping follows simple rules suitable for English and possibly other languages.");
888
889 static float wrap_width = 200.0f;
891
893 for (int n = 0; n < 2; n++)
894 {
900 if (n == 0)
901 ImGui::Text(
"The lazy dog is a good dog. This paragraph should fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
902 else
903 ImGui::Text(
"aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh");
904
905
909 }
910
912 }
913
915 {
916
917
918
919
920
921
922
923
924
925
927 "CJK text will only appears if the font was loaded with the appropriate CJK character ranges. "
928 "Call io.Fonts->AddFontFromFileTTF() manually to load extra character ranges. "
929 "Read docs/FONTS.md for details.");
930 ImGui::Text(
"Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
931 ImGui::Text(
"Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
932 static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
933
936 }
938 }
939
941 {
944 "Below we are displaying the font texture (which is the only texture we have access to in this demo). "
945 "Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. "
946 "Hover the texture for a zoomed view!");
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
965 float my_tex_h = (float)io.Fonts->TexHeight;
966 {
973 ImGui::Image(my_tex_id,
ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col);
975 {
977 float region_sz = 32.0f;
978 float region_x = io.MousePos.x -
pos.x - region_sz * 0.5f;
979 float region_y = io.MousePos.y -
pos.y - region_sz * 0.5f;
980 float zoom = 4.0f;
981 if (region_x < 0.0f) { region_x = 0.0f; }
982 else if (region_x > my_tex_w - region_sz) { region_x = my_tex_w - region_sz; }
983 if (region_y < 0.0f) { region_y = 0.0f; }
984 else if (region_y > my_tex_h - region_sz) { region_y = my_tex_h - region_sz; }
985 ImGui::Text(
"Min: (%.2f, %.2f)", region_x, region_y);
986 ImGui::Text(
"Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz);
987 ImVec2 uv0 =
ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h);
988 ImVec2 uv1 =
ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h);
989 ImGui::Image(my_tex_id,
ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, tint_col, border_col);
991 }
992 }
994 static int pressed_count = 0;
995 for (int i = 0; i < 8; i++)
996 {
998 int frame_padding = -1 + i;
1001 ImVec2 uv1 =
ImVec2(32.0f / my_tex_w, 32.0f / my_tex_h);
1005 pressed_count += 1;
1008 }
1012 }
1013
1015 {
1016
1021 flags &= ~ImGuiComboFlags_NoPreview;
1023 flags &= ~ImGuiComboFlags_NoArrowButton;
1024
1025
1026
1027
1028 const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
1029 static int item_current_idx = 0;
1030 const char* combo_label = items[item_current_idx];
1032 {
1034 {
1035 const bool is_selected = (item_current_idx == n);
1037 item_current_idx = n;
1038
1039
1040 if (is_selected)
1042 }
1044 }
1045
1046
1047 static int item_current_2 = 0;
1048 ImGui::Combo(
"combo 2 (one-liner)", &item_current_2,
"aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
1049
1050
1051 static int item_current_3 = -1;
1053
1054
1055 struct Funcs { static bool ItemGetter(void* data, int n, const char** out_str) { *out_str = ((const char**)data)[n]; return true; } };
1056 static int item_current_4 = 0;
1058
1060 }
1061
1063 {
1064
1065
1066
1067 const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" };
1068 static int item_current_idx = 0;
1070 {
1072 {
1073 const bool is_selected = (item_current_idx == n);
1075 item_current_idx = n;
1076
1077
1078 if (is_selected)
1080 }
1082 }
1083
1084
1087 {
1089 {
1090 const bool is_selected = (item_current_idx == n);
1092 item_current_idx = n;
1093
1094
1095 if (is_selected)
1097 }
1099 }
1100
1102 }
1103
1105 {
1106
1107
1108
1109
1110
1111
1113 {
1114 static bool selection[5] = { false, true, false, false, false };
1121 selection[4] = !selection[4];
1123 }
1125 {
1126 static int selected = -1;
1127 for (int n = 0; n < 5; n++)
1128 {
1129 char buf[32];
1130 sprintf(buf, "Object %d", n);
1132 selected = n;
1133 }
1135 }
1137 {
1138 HelpMarker(
"Hold CTRL and click to select multiple items.");
1139 static bool selection[5] = { false, false, false, false, false };
1140 for (int n = 0; n < 5; n++)
1141 {
1142 char buf[32];
1143 sprintf(buf, "Object %d", n);
1145 {
1147 memset(selection, 0, sizeof(selection));
1148 selection[n] ^= 1;
1149 }
1150 }
1152 }
1154 {
1155
1156
1157 static bool selected[3] = { false, false, false };
1162 }
1164 {
1165 static bool selected[10] = {};
1166
1168 {
1169 for (int i = 0; i < 10; i++)
1170 {
1171 char label[32];
1172 sprintf(label, "Item %d", i);
1175 }
1177 }
1180 {
1181 for (int i = 0; i < 10; i++)
1182 {
1183 char label[32];
1184 sprintf(label, "Item %d", i);
1192 }
1194 }
1196 }
1198 {
1199 static char selected[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } };
1200
1201
1203 const bool winning_state = memchr(selected, 0, sizeof(selected)) == NULL;
1204 if (winning_state)
1206
1207 for (
int y = 0;
y < 4;
y++)
1208 for (
int x = 0;
x < 4;
x++)
1209 {
1210 if (x > 0)
1214 {
1215
1216 selected[
y][
x] ^= 1;
1217 if (x > 0) { selected[
y][
x - 1] ^= 1; }
1218 if (x < 3) { selected[
y][
x + 1] ^= 1; }
1219 if (y > 0) { selected[
y - 1][
x] ^= 1; }
1220 if (y < 3) { selected[
y + 1][
x] ^= 1; }
1221 }
1223 }
1224
1225 if (winning_state)
1228 }
1230 {
1232 "By default, Selectables uses style.SelectableTextAlign but it can be overridden on a per-item "
1233 "basis using PushStyleVar(). You'll probably want to always keep your default situation to "
1234 "left-align otherwise it becomes difficult to layout multiple items on a same line");
1235 static bool selected[3 * 3] = { true, false, true, false, true, false, true, false, true };
1236 for (
int y = 0;
y < 3;
y++)
1237 {
1238 for (
int x = 0;
x < 3;
x++)
1239 {
1240 ImVec2 alignment =
ImVec2((
float)x / 2.0f, (
float)y / 2.0f);
1241 char name[32];
1242 sprintf(name,
"(%.1f,%.1f)", alignment.
x, alignment.
y);
1247 }
1248 }
1250 }
1252 }
1253
1254
1255
1257 {
1259 {
1260
1261
1262 static char text[1024 * 16] =
1263 "/*\n"
1264 " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
1265 " the hexadecimal encoding of one offending instruction,\n"
1266 " more formally, the invalid operand with locked CMPXCHG8B\n"
1267 " instruction bug, is a design flaw in the majority of\n"
1268 " Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
1269 " processors (all in the P5 microarchitecture).\n"
1270 "*/\n\n"
1271 "label:\n"
1272 "\tlock cmpxchg8b eax\n";
1273
1275 HelpMarker(
"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 because we don't want to include <string> in here)");
1281 }
1282
1284 {
1285 struct TextFilters
1286 {
1287
1289 {
1290 if (
data->EventChar < 256 && strchr(
"imgui", (
char)
data->EventChar))
1291 return 0;
1292 return 1;
1293 }
1294 };
1295
1303 }
1304
1306 {
1307 static char password[64] = "password123";
1313 }
1314
1316 {
1317 struct Funcs
1318 {
1320 {
1322 {
1323 data->InsertChars(
data->CursorPos,
"..");
1324 }
1326 {
1328 {
1329 data->DeleteChars(0,
data->BufTextLen);
1330 data->InsertChars(0,
"Pressed Up!");
1332 }
1334 {
1335 data->DeleteChars(0,
data->BufTextLen);
1336 data->InsertChars(0,
"Pressed Down!");
1338 }
1339 }
1341 {
1342
1343 char c =
data->Buf[0];
1344 if ((c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z'))
data->Buf[0] ^= 32;
1345 data->BufDirty =
true;
1346
1347
1348 int* p_int = (
int*)
data->UserData;
1349 *p_int = *p_int + 1;
1350 }
1351 return 0;
1352 }
1353 };
1354 static char buf1[64];
1356 ImGui::SameLine();
HelpMarker(
"Here we append \"..\" each time Tab is pressed. See 'Examples>Console' for a more meaningful demonstration of using this callback.");
1357
1358 static char buf2[64];
1360 ImGui::SameLine();
HelpMarker(
"Here we replace and select text each time Up/Down are pressed. See 'Examples>Console' for a more meaningful demonstration of using this callback.");
1361
1362 static char buf3[64];
1363 static int edit_count = 0;
1367
1369 }
1370
1372 {
1373
1374
1375
1377 "Using ImGuiInputTextFlags_CallbackResize to wire your custom string type to InputText().\n\n"
1378 "See misc/cpp/imgui_stdlib.h for an implementation of this for std::string.");
1379 struct Funcs
1380 {
1382 {
1384 {
1387 my_str->resize(
data->BufSize);
1388 data->Buf = my_str->begin();
1389 }
1390 return 0;
1391 }
1392
1393
1394
1396 {
1399 }
1400 };
1401
1402
1403
1404
1411 }
1412
1414 }
1415
1416
1418 {
1420 {
1423 {
1425 {
1426 ImGui::Text(
"This is the Avocado tab!\nblah blah blah blah blah");
1428 }
1430 {
1431 ImGui::Text(
"This is the Broccoli tab!\nblah blah blah blah blah");
1433 }
1435 {
1436 ImGui::Text(
"This is the Cucumber tab!\nblah blah blah blah blah");
1438 }
1440 }
1443 }
1444
1446 {
1447
1459
1460
1461 const char* names[4] = { "Artichoke", "Beetroot", "Celery", "Daikon" };
1462 static bool opened[4] = { true, true, true, true };
1464 {
1467 }
1468
1469
1470
1472 {
1475 {
1477 if (n & 1)
1480 }
1482 }
1485 }
1486
1488 {
1490 static int next_tab_id = 0;
1491 if (next_tab_id == 0)
1492 for (int i = 0; i < 3; i++)
1494
1495
1496
1497
1498 static bool show_leading_button = true;
1499 static bool show_trailing_button = true;
1500 ImGui::Checkbox(
"Show Leading TabItemButton()", &show_leading_button);
1501 ImGui::Checkbox(
"Show Trailing TabItemButton()", &show_trailing_button);
1502
1503
1510
1512 {
1513
1514 if (show_leading_button)
1518 {
1521 }
1522
1523
1524
1525 if (show_trailing_button)
1528
1529
1530 for (
int n = 0; n < active_tabs.
Size; )
1531 {
1532 bool open = true;
1533 char name[16];
1536 {
1539 }
1540
1541 if (!open)
1542 active_tabs.
erase(active_tabs.
Data + n);
1543 else
1544 n++;
1545 }
1546
1548 }
1551 }
1553 }
1554
1555
1556
1557
1558
1560 {
1561 static bool animate = true;
1563
1564 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
1566
1567
1568
1569
1570 static float values[90] = {};
1571 static int values_offset = 0;
1572 static double refresh_time = 0.0;
1573 if (!animate || refresh_time == 0.0)
1576 {
1577 static float phase = 0.0f;
1578 values[values_offset] = cosf(phase);
1579 values_offset = (values_offset + 1) %
IM_ARRAYSIZE(values);
1580 phase += 0.10f * values_offset;
1581 refresh_time += 1.0f / 60.0f;
1582 }
1583
1584
1585
1586 {
1587 float average = 0.0f;
1589 average += values[n];
1591 char overlay[32];
1592 sprintf(overlay, "avg %f", average);
1594 }
1596
1597
1598
1599
1600 struct Funcs
1601 {
1602 static float Sin(void*, int i) { return sinf(i * 0.1f); }
1603 static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; }
1604 };
1605 static int func_type = 0, display_count = 70;
1611 float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
1615
1616
1617 static float progress = 0.0f, progress_dir = 1.0f;
1618 if (animate)
1619 {
1621 if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; }
1622 if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; }
1623 }
1624
1625
1626
1630
1631 float progress_saturated =
IM_CLAMP(progress, 0.0f, 1.0f);
1632 char buf[32];
1633 sprintf(buf, "%d/%d", (int)(progress_saturated * 1753), 1753);
1636 }
1637
1639 {
1640 static ImVec4 color =
ImVec4(114.0f / 255.0f, 144.0f / 255.0f, 154.0f / 255.0f, 200.0f / 255.0f);
1641
1642 static bool alpha_preview = true;
1643 static bool alpha_half_preview = false;
1644 static bool drag_and_drop = true;
1645 static bool options_menu = true;
1646 static bool hdr = false;
1653
1656 "Click on the color square to open a color picker.\n"
1657 "CTRL+click on individual component to input value.\n");
1659
1662
1665
1668 "With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\n"
1669 "With the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only "
1670 "be used for the tooltip and picker popup.");
1672
1673 ImGui::Text(
"Color button with Custom Picker Popup:");
1674
1675
1676 static bool saved_palette_init = true;
1677 static ImVec4 saved_palette[32] = {};
1678 if (saved_palette_init)
1679 {
1681 {
1683 saved_palette[n].x, saved_palette[n].y, saved_palette[n].z);
1684 saved_palette[n].
w = 1.0f;
1685 }
1686 saved_palette_init = false;
1687 }
1688
1689 static ImVec4 backup_color;
1693 if (open_popup)
1694 {
1696 backup_color = color;
1697 }
1699 {
1700 ImGui::Text(
"MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
1704
1710 color = backup_color;
1714 {
1716 if ((n % 8) != 0)
1718
1721 color =
ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.
w);
1722
1723
1724
1726 {
1728 memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3);
1730 memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4);
1732 }
1733
1735 }
1738 }
1739
1741 static bool no_border = false;
1744
1746 static bool alpha = true;
1747 static bool alpha_bar = true;
1748 static bool side_preview = true;
1749 static bool ref_color = false;
1750 static ImVec4 ref_color_v(1.0f, 0.0f, 1.0f, 0.5f);
1751 static int display_mode = 0;
1752 static int picker_mode = 0;
1756 if (side_preview)
1757 {
1760 if (ref_color)
1761 {
1764 }
1765 }
1766 ImGui::Combo(
"Display Mode", &display_mode,
"Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0");
1768 "ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, "
1769 "but the user can change it with a right-click.\n\nColorPicker defaults to displaying RGB+HSV+Hex "
1770 "if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions().");
1771 ImGui::Combo(
"Picker Mode", &picker_mode,
"Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0");
1783 ImGui::ColorPicker4(
"MyColor##4", (
float*)&color, flags, ref_color ? &ref_color_v.x : NULL);
1784
1787 "SetColorEditOptions() is designed to allow you to set boot-time default.\n"
1788 "We don't have Push/Pop functions because you can force options on a per-widget basis if needed,"
1789 "and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid"
1790 "encouraging you to persistently save values that aren't forward-compatible.");
1795
1796
1797 static ImVec4 color_hsv(0.23f, 1.0f, 1.0f, 1.0f);
1801 "By default, colors are given to ColorEdit and ColorPicker in RGB, but ImGuiColorEditFlags_InputHSV"
1802 "allows you to store colors as HSV and pass them to ColorEdit and ColorPicker as HSV. This comes with the"
1803 "added benefit that you can manipulate hue values with the picker even when saturation or value are zero.");
1808
1810 }
1811
1813 {
1814
1821 ImGui::SameLine();
HelpMarker(
"Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits).");
1824
1825
1826 static float drag_f = 0.5f;
1827 static int drag_i = 50;
1828 ImGui::Text(
"Underlying float value: %f", drag_f);
1829 ImGui::DragFloat(
"DragFloat (0 -> 1)", &drag_f, 0.005f, 0.0f, 1.0f,
"%.3f", flags);
1830 ImGui::DragFloat(
"DragFloat (0 -> +inf)", &drag_f, 0.005f, 0.0f, FLT_MAX,
"%.3f", flags);
1831 ImGui::DragFloat(
"DragFloat (-inf -> 1)", &drag_f, 0.005f, -FLT_MAX, 1.0f,
"%.3f", flags);
1832 ImGui::DragFloat(
"DragFloat (-inf -> +inf)", &drag_f, 0.005f, -FLT_MAX, +FLT_MAX,
"%.3f", flags);
1833 ImGui::DragInt(
"DragInt (0 -> 100)", &drag_i, 0.5f, 0, 100,
"%d", flags);
1834
1835
1836 static float slider_f = 0.5f;
1837 static int slider_i = 50;
1838 ImGui::Text(
"Underlying float value: %f", slider_f);
1841
1843 }
1844
1846 {
1848 static int begin_i = 100, end_i = 1000;
1850 ImGui::DragIntRange2(
"range int", &begin_i, &end_i, 5, 0, 1000,
"Min: %d units",
"Max: %d units");
1851 ImGui::DragIntRange2(
"range int (no bounds)", &begin_i, &end_i, 5, 0, 0,
"Min: %d units",
"Max: %d units");
1853 }
1854
1856 {
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874 #ifndef LLONG_MIN
1875 ImS64 LLONG_MIN = -9223372036854775807LL - 1;
1876 ImS64 LLONG_MAX = 9223372036854775807LL;
1877 ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1);
1878 #endif
1879 const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127;
1880 const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255;
1881 const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767;
1882 const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535;
1883 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;
1884 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;
1885 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;
1886 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;
1887 const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f;
1888 const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0;
1889
1890
1891 static char s8_v = 127;
1892 static ImU8 u8_v = 255;
1893 static short s16_v = 32767;
1894 static ImU16 u16_v = 65535;
1895 static ImS32 s32_v = -1;
1897 static ImS64 s64_v = -1;
1899 static float f32_v = 0.123f;
1900 static double f64_v = 90000.01234567890123456789;
1901
1902 const float drag_speed = 0.2f;
1903 static bool drag_clamp = false;
1907 "As with every widgets in dear imgui, we never modify values unless there is a user interaction.\n"
1908 "You can override the clamping limits by using CTRL+Click to input a value.");
1921
1945
1953
1954 static bool inputs_step = true;
1969
1971 }
1972
1974 {
1975 static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
1976 static int vec4i[4] = { 1, 5, 100, 255 };
1977
1985
1993
2000
2002 }
2003
2005 {
2006 const float spacing = 4;
2008
2009 static int int_value = 0;
2012
2013 static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f };
2015 for (int i = 0; i < 7; i++)
2016 {
2028 }
2030
2033 static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f };
2035 const ImVec2 small_slider_size(18, (
float)(
int)((160.0f - (rows - 1) * spacing) / rows));
2036 for (int nx = 0; nx < 4; nx++)
2037 {
2040 for (
int ny = 0; ny <
rows; ny++)
2041 {
2047 }
2049 }
2051
2054 for (int i = 0; i < 4; i++)
2055 {
2062 }
2066 }
2067
2069 {
2071 {
2072
2073
2074
2075
2076 HelpMarker(
"You can drag from the color squares.");
2077 static float col1[3] = { 1.0f, 0.0f, 0.2f };
2078 static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
2082 }
2083
2085 {
2087 {
2088 Mode_Copy,
2089 Mode_Move,
2090 Mode_Swap
2091 };
2092 static int mode = 0;
2096 static const char* names[9] =
2097 {
2098 "Bobby", "Beatrice", "Betty",
2099 "Brianna", "Barry", "Bernard",
2100 "Bibi", "Blaine", "Bryn"
2101 };
2103 {
2105 if ((n % 3) != 0)
2108
2109
2111 {
2112
2114
2115
2116
2117 if (mode == Mode_Copy) {
ImGui::Text(
"Copy %s", names[n]); }
2118 if (mode == Mode_Move) {
ImGui::Text(
"Move %s", names[n]); }
2119 if (mode == Mode_Swap) {
ImGui::Text(
"Swap %s", names[n]); }
2121 }
2123 {
2125 {
2126 IM_ASSERT(payload->DataSize ==
sizeof(
int));
2127 int payload_n = *(const int*)payload->Data;
2128 if (mode == Mode_Copy)
2129 {
2130 names[n] = names[payload_n];
2131 }
2132 if (mode == Mode_Move)
2133 {
2134 names[n] = names[payload_n];
2135 names[payload_n] = "";
2136 }
2137 if (mode == Mode_Swap)
2138 {
2139 const char* tmp = names[n];
2140 names[n] = names[payload_n];
2141 names[payload_n] = tmp;
2142 }
2143 }
2145 }
2147 }
2149 }
2150
2152 {
2153
2155 "We don't use the drag and drop api at all here! "
2156 "Instead we query when the item is held but not hovered, and order items accordingly.");
2157 static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" };
2159 {
2160 const char* item = item_names[n];
2162
2164 {
2167 {
2168 item_names[n] = item_names[n_next];
2169 item_names[n_next] = item;
2171 }
2172 }
2173 }
2175 }
2176
2178 }
2179
2180 if (
ImGui::TreeNode(
"Querying Status (Edited/Active/Focused/Hovered etc.)"))
2181 {
2182
2183 const char* item_names[] =
2184 {
2185 "Text", "Button", "Button (w/ repeat)", "Checkbox", "SliderFloat", "InputText", "InputFloat",
2186 "InputFloat3", "ColorEdit4", "MenuItem", "TreeNode", "TreeNode (w/ double-click)", "Combo", "ListBox"
2187 };
2188 static int item_type = 1;
2191 HelpMarker(
"Testing how various types of items are interacting with the IsItemXXX functions. Note that the bool return value of most ImGui function is generally equivalent to calling ImGui::IsItemHovered().");
2192
2193
2194 bool ret = false;
2195 static bool b =
false;
2196 static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
2197 static char str[16] = {};
2198 if (item_type == 0) {
ImGui::Text(
"ITEM: Text"); }
2199 if (item_type == 1) { ret =
ImGui::Button(
"ITEM: Button"); }
2202 if (item_type == 4) { ret =
ImGui::SliderFloat(
"ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); }
2204 if (item_type == 6) { ret =
ImGui::InputFloat(
"ITEM: InputFloat", col4f, 1.0f); }
2210 if (item_type == 12){
const char* items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi" };
static int current = 1; ret =
ImGui::Combo(
"ITEM: Combo", ¤t, items,
IM_ARRAYSIZE(items)); }
2211 if (item_type == 13){
const char* items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi" };
static int current = 1; ret =
ImGui::ListBox(
"ITEM: ListBox", ¤t, items,
IM_ARRAYSIZE(items),
IM_ARRAYSIZE(items)); }
2212
2213
2214
2215
2216
2218 "Return value = %d\n"
2219 "IsItemFocused() = %d\n"
2220 "IsItemHovered() = %d\n"
2221 "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
2222 "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
2223 "IsItemHovered(_AllowWhenOverlapped) = %d\n"
2224 "IsItemHovered(_RectOnly) = %d\n"
2225 "IsItemActive() = %d\n"
2226 "IsItemEdited() = %d\n"
2227 "IsItemActivated() = %d\n"
2228 "IsItemDeactivated() = %d\n"
2229 "IsItemDeactivatedAfterEdit() = %d\n"
2230 "IsItemVisible() = %d\n"
2231 "IsItemClicked() = %d\n"
2232 "IsItemToggledOpen() = %d\n"
2233 "GetItemRectMin() = (%.1f, %.1f)\n"
2234 "GetItemRectMax() = (%.1f, %.1f)\n"
2235 "GetItemRectSize() = (%.1f, %.1f)",
2236 ret,
2254 );
2255
2256 static bool embed_all_inside_a_child_window = false;
2257 ImGui::Checkbox(
"Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window);
2258 if (embed_all_inside_a_child_window)
2260
2261
2262
2264 "IsWindowFocused() = %d\n"
2265 "IsWindowFocused(_ChildWindows) = %d\n"
2266 "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n"
2267 "IsWindowFocused(_RootWindow) = %d\n"
2268 "IsWindowFocused(_AnyWindow) = %d\n",
2274
2275
2276
2278 "IsWindowHovered() = %d\n"
2279 "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
2280 "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
2281 "IsWindowHovered(_ChildWindows) = %d\n"
2282 "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n"
2283 "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n"
2284 "IsWindowHovered(_RootWindow) = %d\n"
2285 "IsWindowHovered(_AnyWindow) = %d\n",
2294
2296 ImGui::Text(
"This is another child window for testing the _ChildWindows flag.");
2298 if (embed_all_inside_a_child_window)
2300
2301 static char unused_str[] = "This widget is only here to be able to tab-out of the widgets above.";
2303
2304
2305
2306 static bool test_window = false;
2307 ImGui::Checkbox(
"Hovered/Active tests after Begin() for title bar testing", &test_window);
2308 if (test_window)
2309 {
2310 ImGui::Begin(
"Title bar Hovered/Active tests", &test_window);
2312 {
2315 }
2317 "IsItemHovered() after begin = %d (== is title bar hovered)\n"
2318 "IsItemActive() after begin = %d (== is window being clicked/moved)\n",
2321 }
2322
2324 }
2325}
@ ImGuiFocusedFlags_RootWindow
Definition imgui.h:1231
@ ImGuiFocusedFlags_AnyWindow
Definition imgui.h:1232
@ ImGuiFocusedFlags_ChildWindows
Definition imgui.h:1230
int ImGuiTreeNodeFlags
Definition imgui.h:199
@ ImGuiDragDropFlags_None
Definition imgui.h:1257
@ ImGuiDataType_Float
Definition imgui.h:1287
@ ImGuiDataType_U32
Definition imgui.h:1284
@ ImGuiDataType_U16
Definition imgui.h:1282
@ ImGuiDataType_S8
Definition imgui.h:1279
@ ImGuiDataType_U64
Definition imgui.h:1286
@ ImGuiDataType_S32
Definition imgui.h:1283
@ ImGuiDataType_S16
Definition imgui.h:1281
@ ImGuiDataType_S64
Definition imgui.h:1285
@ ImGuiDataType_Double
Definition imgui.h:1288
@ ImGuiDataType_U8
Definition imgui.h:1280
@ ImGuiHoveredFlags_AllowWhenBlockedByActiveItem
Definition imgui.h:1247
@ ImGuiHoveredFlags_AllowWhenBlockedByPopup
Definition imgui.h:1245
@ ImGuiHoveredFlags_RectOnly
Definition imgui.h:1250
@ ImGuiHoveredFlags_ChildWindows
Definition imgui.h:1242
@ ImGuiHoveredFlags_RootWindow
Definition imgui.h:1243
@ ImGuiHoveredFlags_AnyWindow
Definition imgui.h:1244
@ ImGuiHoveredFlags_AllowWhenOverlapped
Definition imgui.h:1248
void * ImTextureID
Definition imgui.h:205
unsigned char ImU8
Definition imgui.h:225
int ImGuiSliderFlags
Definition imgui.h:193
@ ImGuiTabBarFlags_NoCloseWithMiddleMouseButton
Definition imgui.h:1060
@ ImGuiTabBarFlags_TabListPopupButton
Definition imgui.h:1059
@ ImGuiTabBarFlags_FittingPolicyDefault_
Definition imgui.h:1066
@ ImGuiTabBarFlags_FittingPolicyMask_
Definition imgui.h:1065
@ ImGuiTabBarFlags_None
Definition imgui.h:1056
@ ImGuiTabBarFlags_FittingPolicyScroll
Definition imgui.h:1064
@ ImGuiTabBarFlags_AutoSelectNewTabs
Definition imgui.h:1058
@ ImGuiTabBarFlags_FittingPolicyResizeDown
Definition imgui.h:1063
@ ImGuiTabBarFlags_Reorderable
Definition imgui.h:1057
@ ImGuiTabItemFlags_Trailing
Definition imgui.h:1080
@ ImGuiTabItemFlags_Leading
Definition imgui.h:1079
@ ImGuiTabItemFlags_NoTooltip
Definition imgui.h:1077
@ ImGuiTabItemFlags_None
Definition imgui.h:1072
int ImGuiTabBarFlags
Definition imgui.h:194
@ ImGuiStyleVar_GrabMinSize
Definition imgui.h:1498
@ ImGuiStyleVar_SelectableTextAlign
Definition imgui.h:1502
@ ImGuiSliderFlags_Logarithmic
Definition imgui.h:1571
@ ImGuiSliderFlags_None
Definition imgui.h:1569
@ ImGuiSliderFlags_NoRoundToFormat
Definition imgui.h:1572
@ ImGuiKey_DownArrow
Definition imgui.h:1318
@ ImGuiKey_UpArrow
Definition imgui.h:1317
unsigned long long ImU64
Definition imgui.h:239
int ImGuiColorEditFlags
Definition imgui.h:183
@ ImGuiInputTextFlags_CharsNoBlank
Definition imgui.h:959
@ ImGuiInputTextFlags_CallbackHistory
Definition imgui.h:963
@ ImGuiInputTextFlags_CallbackCharFilter
Definition imgui.h:965
@ ImGuiInputTextFlags_AllowTabInput
Definition imgui.h:966
@ ImGuiInputTextFlags_CharsHexadecimal
Definition imgui.h:957
@ ImGuiInputTextFlags_CharsDecimal
Definition imgui.h:956
@ ImGuiInputTextFlags_CallbackCompletion
Definition imgui.h:962
@ ImGuiInputTextFlags_Password
Definition imgui.h:971
@ ImGuiInputTextFlags_CtrlEnterForNewLine
Definition imgui.h:967
@ ImGuiInputTextFlags_ReadOnly
Definition imgui.h:970
@ ImGuiInputTextFlags_CharsUppercase
Definition imgui.h:958
@ ImGuiInputTextFlags_CallbackResize
Definition imgui.h:974
@ ImGuiInputTextFlags_CallbackEdit
Definition imgui.h:975
unsigned short ImU16
Definition imgui.h:227
int ImGuiInputTextFlags
Definition imgui.h:189
signed long long ImS64
Definition imgui.h:238
@ ImGuiCol_FrameBgHovered
Definition imgui.h:1421
@ ImGuiCol_FrameBgActive
Definition imgui.h:1422
@ ImGuiCol_SliderGrab
Definition imgui.h:1432
#define IMGUI_PAYLOAD_TYPE_COLOR_4F
Definition imgui.h:1274
int ImGuiComboFlags
Definition imgui.h:185
@ ImGuiComboFlags_NoPreview
Definition imgui.h:1049
@ ImGuiComboFlags_PopupAlignLeft
Definition imgui.h:1043
@ ImGuiComboFlags_NoArrowButton
Definition imgui.h:1048
@ ImGuiTreeNodeFlags_Selected
Definition imgui.h:987
@ ImGuiTreeNodeFlags_OpenOnArrow
Definition imgui.h:994
@ ImGuiTreeNodeFlags_OpenOnDoubleClick
Definition imgui.h:993
@ ImGuiTreeNodeFlags_SpanAvailWidth
Definition imgui.h:998
@ ImGuiTreeNodeFlags_None
Definition imgui.h:986
@ ImGuiSelectableFlags_AllowDoubleClick
Definition imgui.h:1034
@ ImGuiCond_Once
Definition imgui.h:1616
@ ImGuiDir_Right
Definition imgui.h:1297
@ ImGuiDir_Left
Definition imgui.h:1296
signed int ImS32
Definition imgui.h:228
@ ImGuiColorEditFlags_DisplayRGB
Definition imgui.h:1539
@ ImGuiColorEditFlags_AlphaPreview
Definition imgui.h:1536
@ ImGuiColorEditFlags_NoSmallPreview
Definition imgui.h:1526
@ ImGuiColorEditFlags_DisplayHex
Definition imgui.h:1541
@ ImGuiColorEditFlags_Uint8
Definition imgui.h:1542
@ ImGuiColorEditFlags_NoOptions
Definition imgui.h:1525
@ ImGuiColorEditFlags_NoAlpha
Definition imgui.h:1523
@ ImGuiColorEditFlags_NoPicker
Definition imgui.h:1524
@ ImGuiColorEditFlags_NoSidePreview
Definition imgui.h:1530
@ ImGuiColorEditFlags_NoLabel
Definition imgui.h:1529
@ ImGuiColorEditFlags_InputHSV
Definition imgui.h:1547
@ ImGuiColorEditFlags_NoBorder
Definition imgui.h:1532
@ ImGuiColorEditFlags_NoInputs
Definition imgui.h:1527
@ ImGuiColorEditFlags_PickerHueWheel
Definition imgui.h:1545
@ ImGuiColorEditFlags_AlphaPreviewHalf
Definition imgui.h:1537
@ ImGuiColorEditFlags_AlphaBar
Definition imgui.h:1535
@ ImGuiColorEditFlags_HDR
Definition imgui.h:1538
@ ImGuiColorEditFlags_NoDragDrop
Definition imgui.h:1531
@ ImGuiColorEditFlags_PickerHueBar
Definition imgui.h:1544
@ ImGuiColorEditFlags_NoTooltip
Definition imgui.h:1528
@ ImGuiColorEditFlags_DisplayHSV
Definition imgui.h:1540
@ ImGuiColorEditFlags_Float
Definition imgui.h:1543
#define IMGUI_PAYLOAD_TYPE_COLOR_3F
Definition imgui.h:1273
#define IM_CLAMP(V, MN, MX)
Definition imgui_demo.cpp:156
#define IM_PRId64
Definition imgui_demo.cpp:146
#define IM_PRIu64
Definition imgui_demo.cpp:147
IMGUI_API void EndDragDropSource()
Definition imgui.cpp:9889
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)
Definition imgui_widgets.cpp:3512
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
Definition imgui.cpp:1843
IMGUI_API bool IsItemVisible()
Definition imgui.cpp:4917
IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button=0)
Definition imgui.cpp:4882
IMGUI_API bool DragScalar(const char *label, ImGuiDataType data_type, void *p_data, float v_speed=1.0f, const void *p_min=NULL, const void *p_max=NULL, const char *format=NULL, ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2307
IMGUI_API bool TabItemButton(const char *label, ImGuiTabItemFlags flags=0)
Definition imgui_widgets.cpp:7693
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, ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2500
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))
Definition imgui_widgets.cpp:6441
IMGUI_API bool IsItemToggledOpen()
Definition imgui.cpp:4887
IMGUI_API ImVec2 GetCursorPos()
Definition imgui.cpp:7493
IMGUI_API bool InputInt(const char *label, int *v, int step=1, int step_fast=100, ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3469
IMGUI_API bool InputInt4(const char *label, int v[4], ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3486
IMGUI_API bool VSliderInt(const char *label, const ImVec2 &size, int *v, int v_min, int v_max, const char *format="%d", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3152
IMGUI_API double GetTime()
Definition imgui.cpp:3453
IMGUI_API void ProgressBar(float fraction, const ImVec2 &size_arg=ImVec2(-FLT_MIN, 0), const char *overlay=NULL)
Definition imgui_widgets.cpp:1240
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", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2441
IMGUI_API bool SetDragDropPayload(const char *type, const void *data, size_t sz, ImGuiCond cond=0)
Definition imgui.cpp:9905
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0)
Definition imgui.cpp:6672
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", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2484
IMGUI_API bool IsItemActivated()
Definition imgui.cpp:4842
IMGUI_API bool ColorEdit3(const char *label, float col[3], ImGuiColorEditFlags flags=0)
Definition imgui_widgets.cpp:4684
IMGUI_API float GetTreeNodeToLabelSpacing()
Definition imgui_widgets.cpp:5941
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", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2494
IMGUI_API const ImGuiPayload * AcceptDragDropPayload(const char *type, ImGuiDragDropFlags flags=0)
Definition imgui.cpp:10008
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", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2436
IMGUI_API bool IsItemEdited()
Definition imgui.cpp:4923
IMGUI_API bool InputFloat4(const char *label, float v[4], const char *format="%.3f", ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3464
IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button=0)
Definition imgui.cpp:4803
IMGUI_API void NewLine()
Definition imgui_widgets.cpp:1331
IMGUI_API bool ColorButton(const char *desc_id, const ImVec4 &col, ImGuiColorEditFlags flags=0, ImVec2 size=ImVec2(0, 0))
Definition imgui_widgets.cpp:5334
IMGUI_API bool InputInt2(const char *label, int v[2], ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3476
IMGUI_API bool InputFloat2(const char *label, float v[2], const char *format="%.3f", ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3454
IMGUI_API bool IsItemDeactivatedAfterEdit()
Definition imgui.cpp:4863
IMGUI_API bool InputFloat3(const char *label, float v[3], const char *format="%.3f", ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3459
IMGUI_API bool VSliderFloat(const char *label, const ImVec2 &size, float *v, float v_min, float v_max, const char *format="%.3f", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3147
IMGUI_API bool SliderInt2(const char *label, int v[2], int v_min, int v_max, const char *format="%d", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3073
IMGUI_API bool SliderInt4(const char *label, int v[4], int v_min, int v_max, const char *format="%d", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3083
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, ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2447
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0)
Definition imgui.cpp:6633
IMGUI_API bool SliderInt3(const char *label, int v[3], int v_min, int v_max, const char *format="%d", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3078
IMGUI_API bool InputInt3(const char *label, int v[3], ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3481
IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags=0)
Definition imgui.cpp:9775
IMGUI_API bool BeginDragDropTarget()
Definition imgui.cpp:9975
IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags)
Definition imgui_widgets.cpp:5418
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))
Definition imgui_widgets.cpp:1055
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", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3058
IMGUI_API bool SliderFloat4(const char *label, float v[4], float v_min, float v_max, const char *format="%.3f", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:3053
IMGUI_API bool ArrowButton(const char *str_id, ImGuiDir dir)
Definition imgui_widgets.cpp:785
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))
Definition imgui_widgets.cpp:1000
IMGUI_API void LabelText(const char *label, const char *fmt,...) IM_FMTARGS(2)
Definition imgui_widgets.cpp:338
IMGUI_API bool InputDouble(const char *label, double *v, double step=0.0, double step_fast=0.0, const char *format="%.6f", ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3491
IMGUI_API bool ColorPicker4(const char *label, float col[4], ImGuiColorEditFlags flags=0, const float *ref_col=NULL, const char *current_label=NULL, const char *original_label=NULL)
Definition imgui_widgets.cpp:4955
IMGUI_API bool IsItemFocused()
Definition imgui.cpp:4870
IMGUI_API void EndDragDropTarget()
Definition imgui.cpp:10058
IMGUI_API bool InputTextWithHint(const char *label, const char *hint, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition imgui_widgets.cpp:3517
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", ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2489
IMGUI_API bool InputScalar(const char *label, ImGuiDataType data_type, void *p_data, const void *p_step=NULL, const void *p_step_fast=NULL, const char *format=NULL, ImGuiInputTextFlags flags=0)
Definition imgui_widgets.cpp:3341
IMGUI_API bool SliderScalar(const char *label, ImGuiDataType data_type, void *p_data, const void *p_min, const void *p_max, const char *format=NULL, ImGuiSliderFlags flags=0)
Definition imgui_widgets.cpp:2922
Mode
Definition CustomGCode.hpp:48
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:14
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:112
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195
IGL_INLINE void mode(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &X, const int d, Eigen::Matrix< T, Eigen::Dynamic, 1 > &M)
Definition mode.cpp:14
S::iterator begin(S &sh, const PathTag &)
Definition geometry_traits.hpp:614
S::iterator end(S &sh, const PathTag &)
Definition geometry_traits.hpp:620
size_t rows(const T &raster)
Definition MarchingSquares.hpp:55
bool check(const DataBase &input, bool check_fontfile=true, bool use_surface=false)
Assert check of inputs data.
Definition EmbossJob.cpp:348
IMGUI_API void AddRect(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawFlags flags=0, float thickness=1.0f)
Definition imgui_draw.cpp:1377
ImTextureID TexID
Definition imgui.h:2654
int TexWidth
Definition imgui.h:2664
ImFontAtlas * Fonts
Definition imgui.h:1795
float w
Definition imgui.h:259
T * erase(const T *it)
Definition imgui.h:1699
int size() const
Definition imgui.h:1671
bool empty() const
Definition imgui.h:1670
T * begin()
Definition imgui.h:1679
T * Data
Definition imgui.h:1657
int capacity() const
Definition imgui.h:1674
#define snprintf
Definition unistd.h:49