1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-12-01 10:47:24 +01:00

DragDrop: Added IsDragDropActive() helper which is useful for binding to decide how to handle mouse inputs.

This commit is contained in:
omar 2017-12-28 16:54:16 +01:00
parent 563d04fdb1
commit 06bea369c0
2 changed files with 7 additions and 0 deletions

View File

@ -11478,6 +11478,12 @@ void ImGui::EndDragDropTarget()
IM_ASSERT(g.DragDropActive); IM_ASSERT(g.DragDropActive);
} }
bool ImGui::IsDragDropActive()
{
ImGuiContext& g = *GImGui;
return g.DragDropActive;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// PLATFORM DEPENDENT HELPERS // PLATFORM DEPENDENT HELPERS
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -433,6 +433,7 @@ namespace ImGui
IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget() IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released. IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
IMGUI_API void EndDragDropTarget(); IMGUI_API void EndDragDropTarget();
IMGUI_API bool IsDragDropActive();
// Clipping // Clipping
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect); IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect);