Merge branch 'master' into docking

# Conflicts:
#	docs/CHANGELOG.txt
This commit is contained in:
omar
2019-07-27 18:21:41 -07:00
11 changed files with 73 additions and 44 deletions

View File

@ -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", &current_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();