# HG changeset patch # User Jacob Carlborg # Date 1230667066 -3600 # Node ID d5f4a7c8aa74178efd45f3ea33cf89192137abbf # Parent bc175cd0484adde579b3b9d6af284eaf404898b5 Ported dwt.dnd.DragSourceEvent diff -r bc175cd0484a -r d5f4a7c8aa74 dwt/dnd/DragSourceEvent.d --- 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 *******************************************************************************/ 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 Sample code and further information */ -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 + , "}"); } } diff -r bc175cd0484a -r d5f4a7c8aa74 dwt/dwthelper/utils.d --- 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;