dragtext
dragtext
TEXT
,
OPTION
,
VALUE

The dragtext statement starts drag-and-drop of text.

Parameters

This statement has three parameters:

text – is the text you want to drag.

option – The name of an option that modifies the operation of this statement. See below for descriptions of each option. The option can be specified in either upper or lower case.

value – The new value for this option.

Description

The dragtext statement allows a program to start a drag-and-drop sequence. This statement is designed to be used as part of a procedure that is triggered by a button. (The button should be set up to trigger the procedure when the mouse is clicked, not when it is released.)

In its simplest form all you need to supply is the text to be dragged.

    dragtext "Drag Me"

When the user clicks on the button, they can drag the text to anything that can receive text (typically text editors, but you can also set up form objects to receive dragged text). During the drag, a semi-transparent image of the button that was clicked will follow the mouse.

#### Drag Options

The appearance and operation of the drag can be modified by adding one or more pairs of option/value parameters to the dragtext statement, like this:

    dragtext text,option1,value1,option2,value2,option3,value3,option4,value4

Each of the available options are described below.

##### Image

During the drag, Panorama normally creates a semi-transparent image of the button that was clicked. This semi-transparent image follows the mouse as you drag. Use the image option to specify a custom image to drag instead.

    dragtext userName,"image","~/Pictures/person.png"

The image file can be a .png, jpg, .tif or .pdf file.

##### Rectangle

During the drag, Panorama normally creates a semi-transparent image of the button that was clicked. Use the Rectangle function to create a semi-transparent image of a custom region of the screen. For example, perhaps in addition to the button itself you would like to drag a larger area – perhaps an area that includes both the button and some displayed data. If you use this parameter, the rectangle must be specified in screen co-ordinates. You should also make sure that the rectangle includes the mouse position – otherwise it could be confusing for the user. (Note: This parameter can be abbreviated as rect instead of rectangle).

##### VCard

Set this option to true if the text contains VCard data.

    dragtext vCardData,"vcard","true"

##### SlideBack

Set this option to false if you don’t want the dragged image to slide back to the source after a failed drag. If this option is set to false the image will simply fade in place instead of sliding back to the original position.

See Also

- dropfromfinder -- processes any files or folders that have been dropped on a form from the finder.
- dropimagesfromfinder -- processes images that have been dropped on a form from the Finder. The images may be added to new records in the database or put in the current record.
- info("dropdatabase") -- returns the name of the database that contains the form data was dropped on.
- info("dropfiles") -- returns a list of files dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("dropform") -- returns the name of the form data was dropped on.
- info("dropobject") -- returns the name of the object that data was dropped on.
- info("droptext") -- returns text dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("droptypes") -- returns a list of all the data types dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("dropvcard") -- returns the text of any VCards dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("dropwindow") -- returns the name of the window that contains the form data was dropped on.
- info("dropwindownumber") -- returns the number of the window that contains the form data was dropped on.

History

Version | Status | Notes
10.0 | Updated | New in this version.