diff dwt/events/MenuDetectEvent.d @ 34:5123b17c98ef

Ported dwt.events.*, dwt.graphics.GC, Region, dwt.internal.image.*
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sun, 14 Sep 2008 01:45:57 +0200
parents 1a8b3cb347e0
children 43be986a1372
line wrap: on
line diff
--- a/dwt/events/MenuDetectEvent.d	Fri Sep 12 13:53:21 2008 +0200
+++ b/dwt/events/MenuDetectEvent.d	Sun Sep 14 01:45:57 2008 +0200
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
  *******************************************************************************/
 module dwt.events.MenuDetectEvent;
 
@@ -14,12 +16,15 @@
 
 
 import dwt.widgets.Event;
+import dwt.events.TypedEvent;
 
+import tango.text.convert.Format;
 /**
  * Instances of this class are sent whenever the platform-
  * specific trigger for showing a context menu is detected.
  *
  * @see MenuDetectListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
  *
  * @since 3.3
  */
@@ -31,20 +36,20 @@
      * at the time the context menu trigger occurred
      */
     public int x;
-    
+
     /**
      * the display-relative y coordinate of the pointer
      * at the time the context menu trigger occurred
-     */ 
+     */
     public int y;
-    
+
     /**
      * A flag indicating whether the operation should be allowed.
      * Setting this field to <code>false</code> will cancel the operation.
      */
     public bool doit;
 
-    private static final long serialVersionUID = -3061660596590828941L;
+    //private static final long serialVersionUID = -3061660596590828941L;
 
 /**
  * Constructs a new instance of this class based on the
@@ -65,12 +70,7 @@
  *
  * @return a string representation of the event
  */
-public String toString() {
-    String string = super.toString ();
-    return string.substring (0, string.length() - 1) // remove trailing '}'
-        + " x=" + x
-        + " y=" + y
-        + " doit=" + doit
-        + "}";
+public override String toString() {
+    return Format( "{} x={} y={} doit={}}", super.toString[ 0 .. $-2 ], x, y, doit );
 }
 }