| 731 | } |
| 732 | |
| 733 | bool 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 | |
| 748 | bool GuiImpl::addDragDropDest(const char dataLabel[], std::string& payloadString) |
| 749 | { |
no test coverage detected