mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Merge branch 'master' into docking
# Conflicts: # docs/CHANGELOG.txt
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.72 WIP
|
||||
// dear imgui, v1.72
|
||||
// (demo code)
|
||||
|
||||
// Message to the person tempted to delete this file when integrating Dear ImGui into their code base:
|
||||
@ -594,8 +594,19 @@ static void ShowDemoWindowWidgets()
|
||||
static float f1=0.123f, f2=0.0f;
|
||||
ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f");
|
||||
ImGui::SliderFloat("slider float (curve)", &f2, -10.0f, 10.0f, "%.4f", 2.0f);
|
||||
|
||||
static float angle = 0.0f;
|
||||
ImGui::SliderAngle("slider angle", &angle);
|
||||
|
||||
// Using the format string to display a name instead of an integer.
|
||||
// Here we completely omit '%d' from the format string, so it'll only display a name.
|
||||
// This technique can also be used with DragInt().
|
||||
enum Element { Element_Fire, Element_Earth, Element_Air, Element_Water, Element_COUNT };
|
||||
const char* element_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" };
|
||||
static int current_element = Element_Fire;
|
||||
const char* current_element_name = (current_element >= 0 && current_element < Element_COUNT) ? element_names[current_element] : "Unknown";
|
||||
ImGui::SliderInt("slider enum", ¤t_element, 0, Element_COUNT - 1, current_element_name);
|
||||
ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer.");
|
||||
}
|
||||
|
||||
{
|
||||
@ -1840,9 +1851,9 @@ static void ShowDemoWindowLayout()
|
||||
ImGui::Text("SetNextItemWidth/PushItemWidth(-1)");
|
||||
ImGui::SameLine(); HelpMarker("Align to right edge");
|
||||
ImGui::PushItemWidth(-1);
|
||||
ImGui::DragFloat("float##5a", &f);
|
||||
ImGui::DragFloat("float##5b", &f);
|
||||
ImGui::DragFloat("float##5c", &f);
|
||||
ImGui::DragFloat("##float5a", &f);
|
||||
ImGui::DragFloat("##float5b", &f);
|
||||
ImGui::DragFloat("##float5c", &f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::TreePop();
|
||||
|
Reference in New Issue
Block a user