changeset 97:d5f4a7c8aa74

Ported dwt.dnd.DragSourceEvent
author Jacob Carlborg <doob@me.com>
date Tue, 30 Dec 2008 20:57:46 +0100
parents bc175cd0484a
children 5acb3346c926
files dwt/dnd/DragSourceEvent.d dwt/dwthelper/utils.d
diffstat 2 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dnd/DragSourceEvent.d	Tue Dec 30 20:52:35 2008 +0100
+++ b/dwt/dnd/DragSourceEvent.d	Tue Dec 30 20:57:46 2008 +0100
@@ -7,6 +7,9 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D programming language:
+ *     Jacob Carlborg <doob@me.com>
  *******************************************************************************/
 module dwt.dnd.DragSourceEvent;
 
@@ -15,13 +18,16 @@
 import dwt.events.TypedEvent;
 import dwt.graphics.Image;
 
+import dwt.dnd.DNDEvent;
+import dwt.dnd.TransferData;
+
 /**
  * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener.
  * 
  * @see DragSourceListener
  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  */
-public class DragSourceEvent extends TypedEvent {
+public class DragSourceEvent : TypedEvent {
     /**
      * The operation that was performed.
      * @see DND#DROP_NONE
@@ -91,7 +97,7 @@
      */
     public int offsetY;
 
-    static final long serialVersionUID = 3257002142513770808L;
+    static const long serialVersionUID = 3257002142513770808L;
     
 /**
  * Constructs a new instance of this class based on the
@@ -99,7 +105,7 @@
  *
  * @param e the untyped event containing the information
  */
-public DragSourceEvent(DNDEvent e) {
+public this(DNDEvent e) {
     super(e);
     this.data = e.data;
     this.detail = e.detail;
@@ -132,10 +138,10 @@
  */
 public String toString() {
     String string = super.toString ();
-    return string.substring (0, string.length() - 1) // remove trailing '}'
-        + " operation=" + detail
-        + " type=" + (dataType !is null ? dataType.type : 0)
-        + " doit=" + doit
-        + "}";
+    return Format("{}{}{}{}{}{}{}", string.substring (0, string.length() - 1) // remove trailing '}'
+        , " operation=" , detail
+        , " type=" , (dataType !is null ? dataType.type : 0)
+        , " doit=" , doit
+        , "}");
 }
 }
--- a/dwt/dwthelper/utils.d	Tue Dec 30 20:52:35 2008 +0100
+++ b/dwt/dwthelper/utils.d	Tue Dec 30 20:57:46 2008 +0100
@@ -19,6 +19,8 @@
 else
     import tango.io.Print;
 
+public import tango.text.convert.Format;
+
 import tango.stdc.stringz;
 static import tango.text.Util;
 static import tango.text.Text;