1, Drag Source
samples: private DropTarget dropTarget;
dropTarget = new DropTarget(dropControl, DND.DROP_COPY);//dropControl為drap操作的目標 對象
dropTarget.setTransfer(TextTransfer.getInstance());
2, Drop Target
3, Allowed Operation:DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK or DND.DROP_NONE.
4, Transfer Types:TextTransfer,RTFTransfer,FileTransfer,HtmlTransfer.
sample: TextTransfer transfers=TextTransfer.getInstance();
5,dragOver event.feedback values
dragOver event.feedback values |
Description |
DND.FEEDBACK_SELECT |
The item under the cursor is selected; applies to table and trees. |
DND.FEEDBACK_SCROLL |
The widget is scrolled up or down to allow the user to drop on items that are not currently visible; applies to tables and trees. |
DND.FEEDBACK_EXPAND |
The item currently under the cursor is expanded to allow the user to select a drop target from a sub item; applies to trees. |
DND.FEEDBACK_INSERT_BEFORE |
An insertion mark is shown before the item under the cursor; applies to trees. |
DND.FEEDBACK_INSERT_AFTER |
An insertion mark is shown after the item under the cursor; applies to trees. |
DND.FEEDBACK_NONE |
No effect is shown. |
samples: private int dropFeedback = 0;
dropFeedback = DND.FEEDBACK_SCROLL;
event.feedback = dropFeedback;
如果你的對象超界了,當你的鼠標在邊界上時就會自動住下滾動.
posted on 2006-07-05 12:39
NG 閱讀(414)
評論(0) 編輯 收藏