This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
SET DRAG ICON
|
SET DRAG ICON ( icon {; horOffset {; vertOffset}} ) | ||||||||
Parameter | Type | Description | ||||||
icon | Picture |
![]() |
Icon to use during drag | |||||
horOffset | Longint |
![]() |
Horizontal offset from left edge of picture with respect to cursor position (>0 = to the left, <0 = to the right) | |||||
vertOffset | Longint |
![]() |
Vertical offset from top edge of picture with respect to cursor position (>0 = upwards, <0 = downwards) | |||||
The SET DRAG ICON command associates the icon picture with the cursor during drag and drop operations that are managed by programming.
This command can only be called in the context of the On Begin Drag Over form event (see the Form event code command).
In the icon parameter, pass the picture to use. Its maximum size is 256x256 pixels. If one of its dimensions exceeds 256 pixels, it is automatically resized.
In horOffset and vertOffset, you can pass offset values in pixels:
If you omit this parameter, the cursor is placed at the center of the icon.
In a form, a user can generate a label by dragging and dropping a row. In the object method of the list box, you can write:
If(Form event code=On Begin Drag Over)
READ PICTURE FILE(Get 4D folder(Current resources folder)+"splash.png";vpict)
CREATE THUMBNAIL(vpict;vpict;48;48)
SET DRAG ICON(vpict)
End if
When you drag a row, the picture appears as shown here:
Note that you can modify the position of the cursor with respect to the picture:
SET DRAG ICON(vpict;0;0)
Product: 4D
Theme: Drag and Drop
Number:
1272
Created: 4D v14
4D Language Reference ( 4D v20 R7)