// When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource()
IM_ASSERT(g.DragDropPayload.DataFrameCount!=-1);// Forgot to call SetDragDropSourcePayload(), at least once on the first frame of a successful BeginDragDropSource()
structImGuiPayload;// User data payload for drag and drop operations
typedefintImGuiLayoutType;// enum: horizontal or vertical // enum ImGuiLayoutType_
typedefintImGuiButtonFlags;// flags: for ButtonEx(), ButtonBehavior() // enum ImGuiButtonFlags_
typedefintImGuiDragDropFlags;// flags: for *DragDrop*() // enum ImGuiDragDropFlags_
typedefintImGuiItemFlags;// flags: for PushItemFlag() // enum ImGuiItemFlags_
typedefintImGuiSeparatorFlags;// flags: for Separator() - internal // enum ImGuiSeparatorFlags_
typedefintImGuiSliderFlags;// flags: for SliderBehavior() // enum ImGuiSliderFlags_
@ -215,6 +217,15 @@ enum ImGuiSeparatorFlags_
ImGuiSeparatorFlags_Vertical=1<<1
};
// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
enumImGuiDragDropFlags_
{
ImGuiDragDropFlags_SourceNoAutoTooltip=1<<0,
ImGuiDragDropFlags_AcceptBeforeDelivery=1<<1,// AcceptDragDropPayload() returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
ImGuiDragDropFlags_AcceptNoDrawDefaultRect=1<<2,// Do not draw the default highlight rectangle when hovering over target.
ImGuiDragDropFlags_AcceptPeekOnly=ImGuiDragDropFlags_AcceptBeforeDelivery|ImGuiDragDropFlags_AcceptNoDrawDefaultRect// For peeking ahead and inspecting the payload before delivery.
};
// FIXME: this is in development, not exposed/functional as a generic feature yet.
IMGUI_APIvoidVerticalSeparator();// Vertical separator, for menu bars (use current line height). not exposed because it is misleading what it doesn't have an effect on regular layout.
// FIXME-WIP: New Drag and Drop API
IMGUI_APIboolBeginDragDropSource(ImGuiDragDropFlagsflags=0,intmouse_button=0);// Call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource()
IMGUI_APIboolSetDragDropPayload(constchar*type,constvoid*data,size_tdata_size,ImGuiCondcond=0);// Type is a user defined string of maximum 8 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui.
IMGUI_APIvoidEndDragDropSource();
IMGUI_APIboolBeginDragDropTarget();// Call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
IMGUI_APIconstImGuiPayload*AcceptDragDropPayload(constchar*type,ImGuiDragDropFlagsflags=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_APIvoidEndDragDropTarget();
// FIXME-WIP: New Columns API
IMGUI_APIvoidBeginColumns(constchar*id,intcount,ImGuiColumnsFlagsflags=0);// setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().