Mercurial > projects > dwt-mac
comparison dwt/events/ShellEvent.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 |
comparison
equal
deleted
inserted
replaced
33:965ac0a77267 | 34:5123b17c98ef |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2004 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
10 *******************************************************************************/ | 12 *******************************************************************************/ |
11 module dwt.events.ShellEvent; | 13 module dwt.events.ShellEvent; |
12 | 14 |
13 import dwt.dwthelper.utils; | 15 import dwt.dwthelper.utils; |
14 | 16 |
15 | 17 |
16 import dwt.widgets.Event; | 18 import dwt.widgets.Event; |
19 import dwt.events.TypedEvent; | |
20 | |
21 import tango.text.convert.Format; | |
17 | 22 |
18 /** | 23 /** |
19 * Instances of this class are sent as a result of | 24 * Instances of this class are sent as a result of |
20 * operations being performed on shells. | 25 * operations being performed on shells. |
21 * | 26 * |
22 * @see ShellListener | 27 * @see ShellListener |
28 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
23 */ | 29 */ |
24 | 30 |
25 public final class ShellEvent : TypedEvent { | 31 public final class ShellEvent : TypedEvent { |
26 | 32 |
27 /** | 33 /** |
28 * A flag indicating whether the operation should be allowed. | 34 * A flag indicating whether the operation should be allowed. |
29 * Setting this field to <code>false</code> will cancel the operation. | 35 * Setting this field to <code>false</code> will cancel the operation. |
30 */ | 36 */ |
31 public bool doit; | 37 public bool doit; |
32 | 38 |
33 static final long serialVersionUID = 3257569490479888441L; | 39 //static final long serialVersionUID = 3257569490479888441L; |
34 | 40 |
35 /** | 41 /** |
36 * Constructs a new instance of this class based on the | 42 * Constructs a new instance of this class based on the |
37 * information in the given untyped event. | 43 * information in the given untyped event. |
38 * | 44 * |
39 * @param e the untyped event containing the information | 45 * @param e the untyped event containing the information |
47 * Returns a string containing a concise, human-readable | 53 * Returns a string containing a concise, human-readable |
48 * description of the receiver. | 54 * description of the receiver. |
49 * | 55 * |
50 * @return a string representation of the event | 56 * @return a string representation of the event |
51 */ | 57 */ |
52 public String toString() { | 58 public override String toString() { |
53 String string = super.toString (); | 59 return Format( "{} doit={}}", super.toString[ 0 .. $-2 ], doit ); |
54 return string.substring (0, string.length() - 1) // remove trailing '}' | |
55 + " doit=" + doit | |
56 + "}"; | |
57 } | 60 } |
58 } | 61 } |
59 | 62 |