[1] |
strX.drag({#s / #d}) |
drag'n'drop string |
|
|
Returns |
symbol / <err> |
|
#s |
Drag only SDS data |
|
#d |
Drag only DDS data |
|
|
|
|
Description |
Initiates the Windows Drag and Drop method.
If #s is specified, only the SDS data will be dragged.
If #d is specified, only the DDS data will be dragged.
The default setting is to make both values available (CF_TEXT & CF_UNICODE) to remote applications.
If an error occurs, an <err> will be returned.
If the function succeeds, the result will be #copy / #move, or #none, if the operation was cancelled.
It's up to the developer to decide how to deal with the result. |
|
|
|
|
Examples |
--attach this script to a sprite of an editable text member.
--select some text, and then RightClick + drag.
on exitFrame me
go to the frame
end
on rightMouseDown me
pMem= sprite(me.spriteNum).member
sel=pMem.selection
if sel[1]=sel[2] then return
src=_s(pMem.text)
trg = src.c[sel[1]..sel[2]-1].ref
res = trg. drag ()
if res=#move then pMem.text = src.ref[trg].del().string
end
message window:
Since the drag & drop windows method is supposed to be initiated on (left or right) mouseDown, and end on mouseUp, it is a bit tricky -though not impossible- to test it in message window.
put _s("myText").drag() --enter this line in message window, but don't press enter yet.
click and hold the rightMouse button in the msg window.
leftClick outside any popUp menus to close them, if required, but don't release the right button.
...and press enter, while keeping the right button pressed.
-- #move
|
|
|
|
|
Notes |
Unless #s, or #d is used, this command will make available both SDS and DDS data to remote applications. It is up to the application to decide the type to use. E.g. Director will use SDS (CF_TEXT) data only, while Word will prefer DDS (unicode) data, if available.
Dragging objects like text, files, images etc, is performed by using the .drag() command on the respective objects.
To make Director behave as a drop target and access objects dropped to the stage / miaw, refer to the bgDrop class. |