Mercurial > projects > dwt-win
comparison dwt/dnd/DragSourceEvent.d @ 135:242e33c0e383
Added dnd source, ByteArrayTransfer,Clipboard completed
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 13 Feb 2008 04:51:22 +0100 |
parents | |
children | fd9c62a2998e |
comparison
equal
deleted
inserted
replaced
134:fa7d7d66b9ed | 135:242e33c0e383 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwt.dnd.DragSourceEvent; | |
14 | |
15 | |
16 import dwt.events.TypedEvent; | |
17 import dwt.widgets.Event; | |
18 import dwt.graphics.Image; | |
19 import dwt.dnd.TransferData; | |
20 import dwt.dnd.DNDEvent; | |
21 | |
22 /** | |
23 * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener. | |
24 * | |
25 * @see DragSourceListener | |
26 */ | |
27 public class DragSourceEvent : TypedEvent { | |
28 /** | |
29 * The operation that was performed. | |
30 * @see DND#DROP_NONE | |
31 * @see DND#DROP_MOVE | |
32 * @see DND#DROP_COPY | |
33 * @see DND#DROP_LINK | |
34 * @see DND#DROP_TARGET_MOVE | |
35 */ | |
36 public int detail; | |
37 | |
38 /** | |
39 * In dragStart, the doit field determines if the drag and drop operation | |
40 * should proceed; in dragFinished, the doit field indicates whether | |
41 * the operation was performed successfully. | |
42 * <p></p> | |
43 * In dragStart: | |
44 * <p>Flag to determine if the drag and drop operation should proceed. | |
45 * The application can set this value to false to prevent the drag from starting. | |
46 * Set to true by default.</p> | |
47 * | |
48 * <p>In dragFinished:</p> | |
49 * <p>Flag to indicate if the operation was performed successfully. | |
50 * True if the operation was performed successfully.</p> | |
51 */ | |
52 public bool doit; | |
53 | |
54 /** | |
55 * In dragStart, the x coordinate (relative to the control) of the | |
56 * position the mouse went down to start the drag. | |
57 * @since 3.2 | |
58 */ | |
59 public int x; | |
60 /** | |
61 * In dragStart, the y coordinate (relative to the control) of the | |
62 * position the mouse went down to start the drag . | |
63 * @since 3.2 | |
64 */ | |
65 public int y; | |
66 | |
67 /** | |
68 * The type of data requested. | |
69 * Data provided in the data field must be of the same type. | |
70 */ | |
71 public TransferData dataType; | |
72 | |
73 /** | |
74 * The drag source image to be displayed during the drag. | |
75 * <p>A value of null indicates that no drag image will be displayed.</p> | |
76 * <p>The default value is null.</p> | |
77 * | |
78 * @since 3.3 | |
79 */ | |
80 public Image image; | |
81 | |
82 static const long serialVersionUID = 3257002142513770808L; | |
83 | |
84 /** | |
85 * Constructs a new instance of this class based on the | |
86 * information in the given untyped event. | |
87 * | |
88 * @param e the untyped event containing the information | |
89 */ | |
90 public this(DNDEvent e) { | |
91 super( cast(Event) e ); | |
92 this.data = e.data; | |
93 this.detail = e.detail; | |
94 this.doit = e.doit; | |
95 this.dataType = e.dataType; | |
96 this.x = e.x; | |
97 this.y = e.y; | |
98 this.image = e.image; | |
99 } | |
100 void updateEvent(DNDEvent e) { | |
101 e.widget = this.widget; | |
102 e.time = this.time; | |
103 e.data = this.data; | |
104 e.detail = this.detail; | |
105 e.doit = this.doit; | |
106 e.dataType = this.dataType; | |
107 e.x = this.x; | |
108 e.y = this.y; | |
109 e.image = this.image; | |
110 } | |
111 } |