Ok, the problem was...
In dragstart there was a command..
Code: Select all
set the dragData["text"] to myText
set the dragImage to CreateDragImage("212,225,252"
)
This code creates an image that can be used for the drag image, and seemed to work quite well, it will be from one of the sample stacks.
Code: Select all
function CreateDragImage bColor
local tRect,tempImage
-----
if there is a fld "ImageTemplate" then
delete fld "ImageTemplate" -- just in case
end if
set the visible of the templateField to false
set the height of the templateField to the effective textHeight of me + 6
set the width of the templateField to 450
set the threeD of the templateField to false
set the borderWidth of the templateField to 1
set the fixedLineHeight of the templateField to false
set the dontWrap of the templateField to true
set showFocusBorder of the templateField to false
set backColor of the templateField to bColor
set borderColor of the templateField to "red"
set name of the templateField to "ImageTemplate"
create field
reset the templateField
-----
set the itemdel to tab
put (item 1 of dragData["text"]) into fld "ImageTemplate"
set the textalign of fld "ImageTemplate" to "center"
--set the width of fld "ImageTemplate" to the formattedWidth of fld "ImageTemplate"
put the rect of fld "ImageTemplate" into tRect
-----
lock screen
show fld "ImageTemplate"
-- combination of visble property and screen lock make that nothing appear but the snapshot is OK :-)
--********** next line caused the problem **********
export snapshot from rect tRect of this cd to tempImage as jpeg
--********** previous line caused the problem **********
-- export image to a variable
hide fld "ImageTemplate"
unlock screen
lock messages -- important to speed up the process
create invisible image -- we don't want to see it
set the text of last image to tempImage
if there is an image ID 6001 then delete image ID 6001
set the ID of last image to 6001
unlock messages
return the ID of last image -- we need it to set the dragImage property
end CreateDragImage
The problem line is 'export snapshot from rect tRect of this cd to tempImage as jpeg'
As long as that line is commented out, everything works as designed (apart from the image being created), if I add the line back the drag image is created and shown, but after the drop all keyboard focus on the control is lost, and I cant seem to get it back, even clicking on the field doesn't get the keyboard focus back.
I guess for now Ill abandon the drag image!
Thanks again.
Andy