(final ImBoolean showDragNDropWindow)
| 19 | private static String data = "No Data..."; |
| 20 | |
| 21 | public static void show(final ImBoolean showDragNDropWindow) { |
| 22 | if (ImGui.begin("Drag'N'Drop Demo", showDragNDropWindow, ImGuiWindowFlags.AlwaysAutoResize)) { |
| 23 | ImGui.text("Drag from here:"); |
| 24 | |
| 25 | ImGui.inputText("String payload", STRING_PAYLOAD.input, ImGuiInputTextFlags.CallbackResize); |
| 26 | setupPayload(STRING_PAYLOAD); |
| 27 | |
| 28 | ImGui.inputInt("Integer payload", INTEGER_PAYLOAD.input); |
| 29 | setupPayload(INTEGER_PAYLOAD); |
| 30 | |
| 31 | ImGui.button("Class specific payload"); |
| 32 | setupClassSpecificPayload(); |
| 33 | |
| 34 | ImGui.separator(); |
| 35 | |
| 36 | ImGui.text("Drop here any:"); |
| 37 | ImGui.pushID("any"); |
| 38 | ImGui.button(data, 100, 50); |
| 39 | setupTarget(); |
| 40 | ImGui.popID(); |
| 41 | |
| 42 | ImGui.separator(); |
| 43 | |
| 44 | ImGui.text("Drop here string payload only"); |
| 45 | ImGui.pushID("string"); |
| 46 | ImGui.button(data, 100, 50); |
| 47 | setupStringPayloadTarget(); |
| 48 | ImGui.popID(); |
| 49 | |
| 50 | ImGui.separator(); |
| 51 | |
| 52 | ImGui.text("Drop here class specific payload only"); |
| 53 | ImGui.pushID("class"); |
| 54 | ImGui.button(data, 100, 50); |
| 55 | setupClassSpecificPayloadTarget(); |
| 56 | ImGui.popID(); |
| 57 | } |
| 58 | ImGui.end(); |
| 59 | } |
| 60 | |
| 61 | private static void setupPayload(final Payload<?> payload) { |
| 62 | if (ImGui.beginDragDropSource(ImGuiDragDropFlags.SourceAllowNullID)) { |
no test coverage detected