PB_Event_GadgetDrop hängt sich auf

Anfängerfragen zum Programmieren mit PureBasic.
Benutzeravatar
silbersurfer
Beiträge: 174
Registriert: 06.07.2014 12:21

PB_Event_GadgetDrop hängt sich auf

Beitrag von silbersurfer »

Hallo Leute,
jetzt habe ich doch ein Problem mit Dropfiles
Das beispiel von edel geht nur eingeschränkt mit Dropfiles, sobald eine Zeile Selektiert ist und dann etwas
gedropt wird friet das Programm ein.
Könnt ihr diesen Fehler bestätigen, und hat da jemand eine Idee woran das liegen kann.
Bin wie immer dankbar über jeden hinweis.

Bitte mal einfach eine File in die Liste Droppen einmal ohne eine Zeile zu Selektieren und einmal mit.

Code: Alles auswählen

EnableExplicit

Structure struct
  a.s
  b.s
  c.s
  d.s
EndStructure

#ARRAY_SIZE = 37000

Global Dim List.struct(#ARRAY_SIZE)

Procedure Callback(hwnd, msg, wparam, lparam)
  Protected *hdr.NMHDR
  Protected *di.NMLVDISPINFO
  Protected str.i
 
  If msg = #WM_NOTIFY
    *hdr = lparam
   
    If *hdr\code = #LVN_GETDISPINFO
      *di = lparam     
     
      Select *di\item\iSubItem
        Case 0
          str.i = @List(*di\item\iItem)\a
        Case 1
          str.i = @List(*di\item\iItem)\b
        Case 2
          str.i = @List(*di\item\iItem)\c
        Case 3
          str.i = @List(*di\item\iItem)\d
      EndSelect
     
      *di\item\pszText = str
     
      ProcedureReturn #True
    EndIf
   
  EndIf
 
  ProcedureReturn #PB_ProcessPureBasicEvents 
EndProcedure 

Procedure InitArray()
  Protected a
  For a = 0 To #ARRAY_SIZE   
    List(a)\a = "Hallo " + Str(a)
    List(a)\b = "Pure " + Str(a)
    List(a)\c = "Basic " + Str(a)
    List(a)\d = "Welt " + Str(a)
  Next
EndProcedure

Procedure Main()
  Protected EventID
 
  InitArray()
 
  If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   
    SetWindowCallback(@Callback(), 0)
   
    ListIconGadget(1, 10, 10, 480, 380, "Spalte 1", 100, #LVS_OWNERDATA | #PB_ListIcon_FullRowSelect)
    EnableGadgetDrop(1,#PB_Drop_Files,#PB_Drag_Copy |#PB_Drag_Copy)
    AddGadgetColumn(1, 1, "Spalte 2", 100)
    AddGadgetColumn(1, 2, "Spalte 3", 100)
    AddGadgetColumn(1, 3, "Spalte 4", 100)
   
    SendMessage_(GadgetID(1), #LVM_SETITEMCOUNT, #ARRAY_SIZE, 0)
   
    Repeat   
    	Define Event=WaitWindowEvent()
    	If Event= #PB_Event_GadgetDrop 
    		Debug "Drop Files"
    	EndIf 	
    Until Event  = #PB_Event_CloseWindow
   
  EndIf
 
EndProcedure:End Main()
Intel Quad Core 3,2 Ghz - GTX 1060 - BlitzBasic Plus 1.48 , PureBasic 5.70 LTS / Aktuelles Projekt PureCommander