MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / addDragDropSource

Method addDragDropSource

Source/Falcor/Utils/UI/Gui.cpp:733–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731}
732
733bool GuiImpl::addDragDropSource(const char label[], const char dataLabel[], const std::string& payloadString)
734{
735 if (ImGui::IsItemHovered() && (ImGui::IsMouseClicked(0) || ImGui::IsMouseClicked(1)))
736 ImGui::SetWindowFocus();
737 if (!(ImGui::IsWindowFocused()))
738 return false;
739 bool b = ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID);
740 if (b)
741 {
742 ImGui::SetDragDropPayload(dataLabel, payloadString.data(), payloadString.size() * sizeof(payloadString[0]), ImGuiCond_Once);
743 ImGui::EndDragDropSource();
744 }
745 return b;
746}
747
748bool GuiImpl::addDragDropDest(const char dataLabel[], std::string& payloadString)
749{

Callers 1

dragDropSourceMethod · 0.80

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected