dragStart

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
dragStart
Associationsfield, button, graphic, scrollbar, player, image
Summary

Sent to a control when the user clicked on it and then started to drag the mouse pointer.

Introduced2.0
OSmac, windows, linux
Platformsdesktop, 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
RelatedProperty: dragData, dragImageOffset, dragAction, dragDelta
Message: dragEnter
Command: click
Glossary: control structure, handler, message
Control Structure: pass
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

Tagsui