Re: Win32Lib; Events; Drag'n Drop
- Posted by Gary Shingles Jul 03, 2008
- 645 views
ZNorQ said...
According to the Win32Lib manual, it states that the drag'n drop event can be trigged when dragging elements into certain controls.
However, I'm only successful in using the form as the target control/window.
In my program, the handle for the form is "fmMAF", and I also have a ListView which handle is "lvMAFFiles". If I use lvMAFFiles in the below statement, no event is triggered. However, if I change it to fmMAF it is triggered.
setHandler(fmMAF, w32HDragAndDrop, routine_id("vMAF_DragAndDropFiles_TV"))
Is it the documentation that is wrong, or is it the code (Am I using it wrong?)?
Kenneth / ZNorQ
Yes, I can confirm that, eg this example using the example from the latest docs:
-- code generated by Win32Lib IDE v1.0.2 Build Oct-09-2007 constant TheProgramType="exw" include Win32Lib.ew without warning -------------------------------------------------------------------------------- -- Window fmMAF constant fmMAF = createEx( Window, "Window1", 0, Default, Default, 400, 333, 0, 0 ) constant lvMAFFiles = createEx( ListView, {"ListView2",""}, fmMAF, 88, 56, 200, 200, w32or_all({LVS_ICON,LVS_SHOWSELALWAYS,LVS_AUTOARRANGE}), 0 ) constant actionButton = createEx( PushButton, "Do Nothing", fmMAF, 144, 272, 88, 24, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- with trace -------------------------------------------------------------------------------- procedure lvMAFFiles_onDragAndDrop (integer self, integer event, sequence params)--params is ( int id, sequence FileName ) trace(1) if params[1] = 0 then if length(params[2]) = 1 then -- Opening call, the file count. setEnable(actionButton, w32False) eraseItems(self) --vFileCount = params[2] elsif length(params[2]) = 0 then -- Final call. setEnable(actionButton, w32True) else -- add the file name to the list addItem(self, params[2] ) end if end if end procedure setHandler( lvMAFFiles, w32HDragAndDrop, routine_id("lvMAFFiles_onDragAndDrop")) --------------------------------------------------------- WinMain( fmMAF,Normal )
You'll never see the trace window :)
Gary