TDragDropText |
||
Description | |
TDragDropText is a comfortable and powerful component for COM/OLE drag&drop operations with plain text. The component is a child-class from TDragDrop. | |
Important for Use | |
This file (index.htm) contains more information about restrictions, the disclaimer, remarks etc. | |
History | ||
Version 2.10 published on 06-Jul-1999 | ||
|
||
Version 2.01 published on 07-Oct-1998 | ||
|
||
Version 2.00 published on 03-Oct-1998 | ||
|
||
Version 1.00 published on 06-Aug-1998 | ||
|
||
Properties | |
inherited properties | |
Click here ... | |
Lines public | |
For
Target: Use this stringlist in OnProcessDropped, if you want to get the dropped
text. For Source: Add the text to the stringlist, which you want to drag&drop, before calling Execute. |
|
Events | |
inherited events | |
Click here ... | |
Methods | |
inherited methods | |
Click here ... | |
Execute public | |
Call
this method, if you detect that the user wants to start a
drag&drop operation (e.g. MouseDown+MouseMove). Also
look: Lines. For drag detection you can also use the inherited property AutotDetectDnD or the method StartDnDDetection. 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 Source | ||
1. | Drop a TWinControl on the form (e.g. a memo). | |
2. | Choose the TWinControl (memo) in DragDropControl. | |
3. | Choose the drag&drop effects under SourceEffects which the DragDropControl (memo) 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
(memo) must detect, if the user wants to start a drag&drop
operation. You can use the event "OnMouseDown"
of your DragDropControl (memo).
Add following to the event:
|
|
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: | ||
|
||
How Do I Use It As Drag&Drop Target | ||
1. | Drop a TWinControl on the form (e.g. a memo). | |
2. | Choose the TWinControl (memo) in DragDropControl. | |
3. | Choose the drag&drop effects under TargetEffects which the DragDropControl (memo) 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 text on your DragDropControl (memo). 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 bitmap from this component with following
line:
Lines is a stringlist. For more info check the Delphi's online-help. Now, do with the text 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: | ||
|
||
Known Bugs | |
|
|
© 1998,99 by Dieter Steinwedel
Back to index