forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdragStart.lcdoc
More file actions
56 lines (38 loc) · 1.57 KB
/
dragStart.lcdoc
File metadata and controls
56 lines (38 loc) · 1.57 KB
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
Name: dragStart
Type: message
Syntax: dragStart
Summary:
Sent to a control when the user clicked on it and then started to drag
the mouse pointer.
Associations: field, button, graphic, scrollbar, player, image
Introduced: 2.0
OS: mac, windows, linux
Platforms: desktop, server
Example:
on dragStart -- in a field script
-- color the text that's being dragged:
set the textColor of the selectedChunk to "#333399"
pass dragStart
end dragStart
Description:
The <dragStart> <message> is sent to a control when the user clicks on
it and then drags the mouse pointer at least <dragDelta> pixels from its
original position.
Use this handler to initiate a drag-drop operation if required. An
operation can be initiated by setting a data-type of the
<dragData> property.
LiveCode automatically handles the mechanics of dragging and dropping
text between and within unlocked fields. To support this type of drag
and drop operation, you don't need to do any scripting: the drag begins
automatically when LiveCode receives the <dragStart> <message>.
If you don't want to allow dragging text from a particular field, you
should place a <dragStart> <handler> in the field that does not contain
a <pass> <control structure>:
on dragStart -- in script of field or one of its owners
-- do nothing, but trap the message
end dragStart
References: click (command), pass (control structure),
control structure (glossary), handler (glossary), message (glossary),
dragEnter (message), dragData (property), dragImageOffset (property),
dragAction (property), dragDelta (property)
Tags: ui