|
History |
|
|
Version 3.10 published on 06-Jul-1999 |
|
- Code re-design in result of
modifications in TDragDrop;
handling hasn't changed
|
|
Version 3.01 published on 07-Oct-1998 |
|
- small invisible bugs fixed
|
|
Version 3.00 published on 03-Oct-1998 |
|
Total internal redesign due to
modifications of the super-class, but the
handling hasn't changed
component's icon has changed
|
|
Version 2.00 published on 06-Aug-1999 |
|
- Internal structure was totally
re-designed (has now the mother-class TDragDrop),
but the handling hasn't changed
|
|
Version 1.03 published on 29-Jun-1998 |
|
- A bug was removed (accepting
files)
|
|
Version 1.02 published on 10-Jun-1998 |
|
- The result of the method ExecuteDragDrop
has changed (new result type)
|
|
Version 1.01 published on 03-Feb-1998 |
|
- Some properties were added
- New demo
- New handling on dwEffect
|
|
Version 1.00 published on 11-Nov-1997 |
|
|
|
|
|
How Do I Use It As Drag&Drop Source |
|
|
1. |
Drop a TWinControl on the form
(e.g. a listbox). |
|
2. |
Choose the TWinControl (listbox)
in DragDropControl. |
|
3. |
Choose the drag&drop effects
under SourceEffects which the DragDropControl (listbox)
should support. If you don't want any longer that the DragDropControl
serve as drag&drop source all items must be set to
false. |
|
4. |
Now, your DragDropControl
(listbox) must detect, when the user wants to start a
drag&drop operation. You can use the event
"OnMouseDown" of your DragDropControl
(listbox). Add following to the event:
DragDropFiles1.FileList.add(<selected
items of the DragDropControl (listbox)>);
You must add the filenames
including the WHOLE PATH!!!
|
|
5. |
Tell Windows that
there is a drag&drop operation to handle: Just call
the method Execute of this component. |
|
6. |
You may use
the events OnGiveFeedback and OnQueryContinueDrag, but often you need not. |
|
|
|
|
Hints: |
|
- Drag&drop
operations cannot be done at design-time!
- IMPORTANT: If you use
the drag-detection, it's high recommended to
check the section "Problems With The
Drag-Detection".
|
|
|
|
How Do I Use It As Drag&Drop Target |
|
|
1. |
Drop a TWinControl on the form
(e.g. a listbox). |
|
2. |
Choose the TWinControl (listbox)
in DragDropControl. |
|
3. |
Choose the drag&drop effects
under TargetEffects which the DragDropControl (listbox)
should support. If you don't want any longer that the DragDropControl
serve as drag&drop target all items must be set to
false. |
|
4. |
Now, you have to program
what happen, if the user drops files on your DragDropControl (listbox). For this, the best is
to use the event OnProcessDropped. At first, you should check what
drag&drop effect was chosen by the user. You get the
effect from method's parameter dwEffect.
You get the filenames from this component with following
line:
...:=DragDropFiles1.FileList[<Index>];
FileList is a stringlist. For more info
check the Delphi's online-help. Now, do with the files
what you have to do, e.g. copy, move, delete, etc.
|
|
5. |
You may use
the events OnDragEnter, OnDragOver and OnDragLeave, but often you need not. |
|
|
|
|
Hints: |
|
- Drag&drop
operations cannot be done at design-time!
|
|
|