Drag & Drop Cursor
Posted: Sun Mar 10, 2024 6:46 pm
When dragging items from a TreeGadget, for example, the text of the item appears under the cursor to show it's being dragged. When dragging from a CanvasGadget, obviously there are no items for the Drag & Drop Library to use. Is there a way to show what's being set? I know I can change the cursor, but that doesn't change what's underneath the cursor.
Code: Select all
Enumeration
#Window
#Canvas
#Tree
EndEnumeration
Procedure OnCanvasDragStart()
DragPrivate(0)
Debug "drag"
EndProcedure
Procedure OnTreeDragStart()
DragPrivate(0)
EndProcedure
OpenWindow(#Window, 100, 100, 640, 480, "", #PB_Window_SystemMenu)
CanvasGadget(#Canvas, 10, 10, 200, 460)
TreeGadget(#Tree, 220, 10, 200, 460)
AddGadgetItem(#Tree, 0, "Item 1")
BindGadgetEvent(#Canvas, @OnCanvasDragStart(), #PB_EventType_DragStart)
BindGadgetEvent(#Tree, @OnTreeDragStart(), #PB_EventType_DragStart)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow