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

Function DemoWindowWidgetsMultiComponents

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

Source from the content-addressed store, hash-verified

1934//-----------------------------------------------------------------------------
1935
1936static void DemoWindowWidgetsMultiComponents()
1937{
1938 if (ImGui::TreeNode("Multi-component Widgets"))
1939 {
1940 IMGUI_DEMO_MARKER("Widgets/Multi-component Widgets");
1941 static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
1942 static int vec4i[4] = { 1, 5, 100, 255 };
1943
1944 static ImGuiSliderFlags flags = 0;
1945 ImGui::CheckboxFlags("ImGuiSliderFlags_ColorMarkers", &flags, ImGuiSliderFlags_ColorMarkers); // Only passing this to Drag/Sliders
1946
1947 ImGui::SeparatorText("2-wide");
1948 ImGui::InputFloat2("input float2", vec4f);
1949 ImGui::InputInt2("input int2", vec4i);
1950 ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
1951 ImGui::DragInt2("drag int2", vec4i, 1, 0, 255, NULL, flags);
1952 ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f, NULL, flags);
1953 ImGui::SliderInt2("slider int2", vec4i, 0, 255, NULL, flags);
1954
1955 ImGui::SeparatorText("3-wide");
1956 ImGui::InputFloat3("input float3", vec4f);
1957 ImGui::InputInt3("input int3", vec4i);
1958 ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
1959 ImGui::DragInt3("drag int3", vec4i, 1, 0, 255, NULL, flags);
1960 ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f, NULL, flags);
1961 ImGui::SliderInt3("slider int3", vec4i, 0, 255, NULL, flags);
1962
1963 ImGui::SeparatorText("4-wide");
1964 ImGui::InputFloat4("input float4", vec4f);
1965 ImGui::InputInt4("input int4", vec4i);
1966 ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
1967 ImGui::DragInt4("drag int4", vec4i, 1, 0, 255, NULL, flags);
1968 ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f, NULL, flags);
1969 ImGui::SliderInt4("slider int4", vec4i, 0, 255, NULL, flags);
1970
1971 ImGui::SeparatorText("Ranges");
1972 static float begin = 10, end = 90;
1973 static int begin_i = 100, end_i = 1000;
1974 ImGui::DragFloatRange2("range float", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%", ImGuiSliderFlags_AlwaysClamp);
1975 ImGui::DragIntRange2("range int", &begin_i, &end_i, 5, 0, 1000, "Min: %d units", "Max: %d units");
1976 ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units");
1977
1978 ImGui::TreePop();
1979 }
1980}
1981
1982//-----------------------------------------------------------------------------
1983// [SECTION] DemoWindowWidgetsPlotting()

Callers 1

DemoWindowWidgetsFunction · 0.85

Calls 10

SeparatorTextFunction · 0.85
InputFloat2Function · 0.85
InputInt2Function · 0.85
DragFloat2Function · 0.85
DragInt2Function · 0.85
SliderFloat2Function · 0.85
SliderInt2Function · 0.85
DragFloatRange2Function · 0.85
DragIntRange2Function · 0.85
TreeNodeClass · 0.50

Tested by

no test coverage detected