Drag'n'Drop on Container inside Frame doesn't work
Posted: Mon Nov 22, 2010 3:20 pm
It took me a while to figure this out and in my eyes it's a pretty strange bug. The following code explains best I guess:
If someone has a good understandable workaround for this, please let me know.
Code: Select all
Enumeration
#Window
#Frame
#Container
#ContainerString
#Button
EndEnumeration
If OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 400, 90, "Drag'n'Drop Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Frame3DGadget(#Frame, 0, 0, 400, 90, "") ; 1) Comment this and drag'n'drop works, frame isn't visible
ContainerGadget(#Container, 0, 0, 400, 60)
StringGadget(#ContainerString, 10, 10, 380, 40, "Drag a file (or folder) to display its path")
EnableGadgetDrop(#ContainerString, #PB_Drop_Files, #PB_Drag_Move)
CloseGadgetList()
ButtonGadget(#Button, 10, 60, 380, 20, "Button")
; EnableGadgetDrop(#Button, #PB_Drop_Files, #PB_Drag_Move) ; 2) Uncomment this while "1)" is still uncommented, frame gets visible + position is shifted a little & drag'n'drop works now
Repeat
Select WaitWindowEvent()
Case #PB_Event_GadgetDrop
SetGadgetText(EventGadget(), EventDropFiles())
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf