I didn't want to post my entire program here, because the application itself is over 75 pages long. In any case, I should have still posted a working prototype.
Having said that, I was able to resolve my problem. In my application, I have a panel gadget with three sections. Each section (or tab) contains an editor gadget. The first of these tabs is supposed to handle
both text and file drag/drop events.
For some reason, when did the following where I call a procedure "Do_Drag_and_Drop", I would get an error (see below).
Code: Select all
If EventDropType() = #PB_Drop_Files
If iFilesCount = 1
Do_Drag_and_Drop(EventDropType(), #Gadget_frmMain_edInput, sFilesList, EventDropText())
EndIf
Else
Do_Drag_and_Drop(EventDropType(), #Gadget_frmMain_edInput, sFilesList, EventDropText())
EndIf
However, when I changed the order of the test conditions around and handle the drag and drop events locally rather than calling a procedure, things worked fine (see below).
Code: Select all
If EventDropType() = #PB_Drop_Text
SetGadgetText(#Gadget_frmMain_edInput, EventDropText())
Else
If iFilesCount = 1
SetGadgetText(#Gadget_frmMain_edInput, sFilesList)
EndIf
EndIf
I'm sure it was something I did wrong (maybe in the procedure call itself). But, the important thing is that it works now.
Thank you for your response HeX0R. Your example made me re-think what I was doing. And, sorry for the second code snippet.