Drag-and-drop properties, events, and functions
Drag-and-drop properties
Each PowerBuilder control has two drag-and-drop properties:
-
DragAuto
-
DragIcon
The DragAuto property
DragAuto is a boolean property.
Value |
Meaning |
---|---|
TRUE |
When the object is clicked, the control |
FALSE |
When the object is clicked, the control |
To specify automatic drag mode for a control in
the Window painter:
-
Select the Other property page in the Properties
view for the control. -
Check the Drag Auto check box.
The DragIcon property
Use the DragIcon property to specify the icon you want displayed
when the control is in drag mode. The DragIcon property is a stock
icon or a string identifying the file that contains the icon (the ICO file). The
default icon is a box the size of the control.
When the user drags a control, the icon displays when the
control is over an area in which the user can drop it (a valid drop
area). When the control is over an area that is not a valid drop
area (such as a window scroll bar), the No-Drop icon displays.
To specify a drag icon:
-
Select the Other property page in the Properties
view for the control. -
Choose the icon you want to use from the list
of stock icons or use the Browse button to select an ICO file
and click OK.
To create icons, use a drawing application that can save files
in the Microsoft Windows ICO format.
Drag-and-drop events
There are six drag-and-drop events.
Event |
Occurs |
---|---|
BeginDrag |
When the user presses the left mouse |
BeginRightDrag |
When the user presses the right mouse |
DragDrop |
When the hot spot of a drag icon (usually |
DragEnter |
When the hot spot of a drag icon enters |
DragLeave |
When the hot spot of a drag icon leaves |
DragWithin |
When the hot spot of a drag icon moves |
Drag-and-drop functions
Each PowerBuilder control has two functions you can use to
write scripts for drag-and-drop events.
Function |
Action |
---|---|
Drag |
Starts or ends the dragging of a control |
DraggedObject |
Returns the control being dragged |
For more information about these events and
functions, see the PowerScript Reference.