Merge branch 'master' into docking

# Conflicts:
#	imgui.cpp
#	imgui_internal.h
This commit is contained in:
omar
2019-08-31 19:19:00 +02:00
7 changed files with 147 additions and 28 deletions

View File

@ -1098,6 +1098,8 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
// Plot/Graph widgets are currently fairly limited.
// Consider writing your own plotting widget, or using a third-party one (see "Wiki->Useful Widgets", or github.com/ocornut/imgui/issues/2747)
if (ImGui::TreeNode("Plots Widgets"))
{
static bool animate = true;
@ -1121,7 +1123,18 @@ static void ShowDemoWindowWidgets()
phase += 0.10f*values_offset;
refresh_time += 1.0f/60.0f;
}
ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80));
// Plots can display overlay texts
// (in this example, we will display an average value)
{
float average = 0.0f;
for (int n = 0; n < IM_ARRAYSIZE(values); n++)
average += values[n];
average /= (float)IM_ARRAYSIZE(values);
char overlay[32];
sprintf(overlay, "avg %f", average);
ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, overlay, -1.0f, 1.0f, ImVec2(0,80));
}
ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80));
// Use functions to generate output
@ -3112,6 +3125,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink");
if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges");
if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly");
if (io.ConfigWindowsMemoryCompactTimer >= 0.0f) ImGui::Text("io.ConfigWindowsMemoryCompactTimer = %.1ff", io.ConfigWindowsMemoryCompactTimer);
ImGui::Text("io.BackendFlags: 0x%08X", io.BackendFlags);
if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) ImGui::Text(" HasGamepad");
if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) ImGui::Text(" HasMouseCursors");
@ -4356,7 +4370,6 @@ static void ShowExampleAppWindowTitles(bool*)
// Demonstrate using the low-level ImDrawList to draw custom shapes.
static void ShowExampleAppCustomRendering(bool* p_open)
{
ImGui::SetNextWindowSize(ImVec2(350, 560), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("Example: Custom rendering", p_open))
{
ImGui::End();
@ -4476,7 +4489,9 @@ static void ShowExampleAppCustomRendering(bool* p_open)
static bool draw_bg = true;
static bool draw_fg = true;
ImGui::Checkbox("Draw in Background draw list", &draw_bg);
ImGui::SameLine(); HelpMarker("The Background draw list will be rendered below every Dear ImGui windows.");
ImGui::Checkbox("Draw in Foreground draw list", &draw_fg);
ImGui::SameLine(); HelpMarker("The Foreground draw list will be rendered over every Dear ImGui windows.");
ImVec2 window_pos = ImGui::GetWindowPos();
ImVec2 window_size = ImGui::GetWindowSize();
ImVec2 window_center = ImVec2(window_pos.x + window_size.x * 0.5f, window_pos.y + window_size.y * 0.5f);