Merge branch 'master' into navigation + merge fix

# Conflicts:
#	imgui.cpp
This commit is contained in:
omar
2017-12-07 16:42:52 +01:00
4 changed files with 43 additions and 20 deletions

View File

@ -1848,6 +1848,8 @@ void ImGui::ShowTestWindow(bool* p_open)
if (ImGui::TreeNode("Dragging"))
{
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
for (int button = 0; button < 3; button++)
ImGui::Text("IsMouseDragging(%d) = %d", button, ImGui::IsMouseDragging(button));
ImGui::Button("Drag Me");
if (ImGui::IsItemActive())
{
@ -1866,12 +1868,16 @@ void ImGui::ShowTestWindow(bool* p_open)
if (ImGui::TreeNode("Mouse cursors"))
{
const char* mouse_cursors_names[] = { "Arrow", "TextInput", "Move", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE" };
IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_Count_);
ImGui::Text("Current mouse cursor = %d: %s", ImGui::GetMouseCursor(), mouse_cursors_names[ImGui::GetMouseCursor()]);
ImGui::Text("Hover to see mouse cursors:");
ImGui::SameLine(); ShowHelpMarker("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it.");
for (int i = 0; i < ImGuiMouseCursor_Count_; i++)
{
char label[32];
sprintf(label, "Mouse cursor %d", i);
sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]);
ImGui::Bullet(); ImGui::Selectable(label, false);
if (ImGui::IsItemHovered() || ImGui::IsItemFocused())
ImGui::SetMouseCursor(i);