-
Notifications
You must be signed in to change notification settings - Fork 6
/
track_drag_drop_behavior.livecodescript
82 lines (56 loc) · 1.73 KB
/
track_drag_drop_behavior.livecodescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
script "DataView Track Drag and Drop Behavior"
local sControlsA
local sDispatchMessages = "true"
command dvRegisterControlForDragMessages pValue
put empty into sControlsA[the long id of pValue]
put true into sDispatchMessages
end dvRegisterControlForDragMessages
command dvResetViewsAffectedDuringDragOperation
local tControl
repeat for each key tControl in sControlsA
set the dvTrackDragReorder of tControl to false
end repeat
put false into sDispatchMessages
put empty into sControlsA
end dvResetViewsAffectedDuringDragOperation
command dvFreezeMouseRelatedDragMessagesPriorToCleanup
put false into sDispatchMessages
end dvFreezeMouseRelatedDragMessagesPriorToCleanup
on dragDrop
repeat for each key tControl in sControlsA
if tControl is in the long id of the target then
dispatch "dvDragDrop" to tControl
exit repeat
end if
end repeat
pass dragDrop
end dragDrop
/**
Summary: Restore pre-drag state after drag operation is complete.
Description: After the drag is finished we need to reset any DataViews that
were part of the drag operation.
*/
on dragEnd
local tControl
local tFoundAMatch = "false"
repeat for each key tControl in sControlsA
dispatch "dvDragEnd" to tControl
end repeat
pass dragEnd
end dragEnd
on dragMove pMouseH,pMouseV
if not sDispatchMessages then pass dragMove
local tControl
repeat for each key tControl in sControlsA
dispatch "dvDragMove" to tControl with pMouseH, pMouseV, the long id of the target
end repeat
pass dragMove
end dragMove
on dragLeave
if not sDispatchMessages then pass dragLeave
local tControl
repeat for each key tControl in sControlsA
dispatch "dvDragLeave" to tControl
end repeat
pass dragLeave
end dragLeave