It seems to be due to the Z-order.
Here is a workaround.
All the gadgets except the panel and frame gadgets need the SetWindowPos_() line, or at least the parent gadget(if any).
Code: Select all
If OpenWindow(0, 0, 0, 620, 550, "FrameGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
FrameGadget(0, 10, 5, 600, 500, "FrameGadget Standard")
DisableGadget(0, 0)
FrameGadget(1, 20, 20, 550, 450, "", #PB_Frame_Single)
DisableGadget(1, 0)
FrameGadget(2, 30, 30, 500, 400, "", #PB_Frame_Double)
DisableGadget(2, 0)
h = ContainerGadget(4, 45, 45, 400, 60, #PB_Container_Single)
SetWindowPos_(h, #HWND_TOP, 0, 0, 0, 0, #SWP_NOMOVE|#SWP_NOSIZE) ;it must be added.
h = StringGadget(5, 10, 10, 380, 40, "Drag a file (or folder) to display its path")
;SetWindowPos_(h, #HWND_TOP, 0, 0, 0, 0, #SWP_NOMOVE|#SWP_NOSIZE)
EnableGadgetDrop(5, #PB_Drop_Files, #PB_Drag_Move)
CloseGadgetList()
h = ButtonGadget(6, 45, 150, 380, 20, "Button 6")
SetWindowPos_(h, #HWND_TOP, 0, 0, 0, 0, #SWP_NOMOVE|#SWP_NOSIZE) ;it must be added.
EnableGadgetDrop(6, #PB_Drop_Files, #PB_Drag_Move)
h = SpinGadget(7, 45, 180, 380, 30, 0, 100)
hUpDown = GetWindow_(h, #GW_HWNDNEXT)
Debug hUpDown
SetWindowPos_(hUpDown, #HWND_TOP, 0, 0, 0, 0, #SWP_NOMOVE|#SWP_NOSIZE)
SetWindowPos_(h, #HWND_TOP, 0, 0, 0, 0, #SWP_NOMOVE|#SWP_NOSIZE) ;it must be added.
EnableGadgetDrop(7, #PB_Drop_Files, #PB_Drag_Move)
Debug GetWindow_(h, #GW_HWNDNEXT)
h = ScrollAreaGadget(8, 45, 220, 380, 50, 500, 100)
SetWindowPos_(h, #HWND_TOP, 0, 0, 0, 0, #SWP_NOMOVE|#SWP_NOSIZE) ;it must be added.
h = ButtonGadget(13, 10, 15, 80, 24, "Button 13")
CloseGadgetList()
EnableGadgetDrop(13, #PB_Drop_Files, #PB_Drag_Move)
PanelGadget(9, 45, 280, 300, 100) ; it seems to have no need to add the SetWindowPos_() line.
AddGadgetItem(9, -1, "Panel 1")
h = ButtonGadget(10, 10, 15, 80, 24,"Button 10")
h = ButtonGadget(11, 95, 15, 80, 24,"Button 11")
AddGadgetItem(9, -1, "Panel 2")
h = ButtonGadget(12, 10, 15, 80, 24,"Button 12")
CloseGadgetList()
EnableGadgetDrop(10, #PB_Drop_Files, #PB_Drag_Move)
EnableGadgetDrop(11, #PB_Drop_Files, #PB_Drag_Move)
EnableGadgetDrop(12, #PB_Drop_Files, #PB_Drag_Move)
h = FrameGadget(3, 40, 40, 450, 350, "", #PB_Frame_Flat)
DisableGadget(3, 0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_GadgetDrop
Debug Str(EventGadget()) + " " + EventDropFiles()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf