Mercurial > projects > dwt-linux
annotate dwt/events/MenuDetectEvent.d @ 10:63c023465156
moved from org.eclipse.swt to dwt
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 05 Jan 2008 17:58:37 +0100 |
parents | ad2b69216039 |
children | 8cec8f536af3 |
rev | line source |
---|---|
1 | 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 *******************************************************************************/ | |
10
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
11 module dwt.events.MenuDetectEvent; |
1 | 12 |
13 | |
10
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
14 import dwt.widgets.Event; |
63c023465156
moved from org.eclipse.swt to dwt
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
15 import dwt.events.TypedEvent; |
1 | 16 |
17 import tango.text.convert.Format; | |
18 /** | |
19 * Instances of this class are sent whenever the platform- | |
20 * specific trigger for showing a context menu is detected. | |
21 * | |
22 * @see MenuDetectListener | |
23 * | |
24 * @since 3.3 | |
25 */ | |
26 | |
27 public final class MenuDetectEvent : TypedEvent { | |
28 | |
29 /** | |
30 * the display-relative x coordinate of the pointer | |
31 * at the time the context menu trigger occurred | |
32 */ | |
33 public int x; | |
34 | |
35 /** | |
36 * the display-relative y coordinate of the pointer | |
37 * at the time the context menu trigger occurred | |
38 */ | |
39 public int y; | |
40 | |
41 /** | |
42 * A flag indicating whether the operation should be allowed. | |
43 * Setting this field to <code>false</code> will cancel the operation. | |
44 */ | |
45 public bool doit; | |
46 | |
47 //private static final long serialVersionUID = -3061660596590828941L; | |
48 | |
49 /** | |
50 * Constructs a new instance of this class based on the | |
51 * information in the given untyped event. | |
52 * | |
53 * @param e the untyped event containing the information | |
54 */ | |
55 public this(Event e) { | |
56 super(e); | |
57 this.x = e.x; | |
58 this.y = e.y; | |
59 this.doit = e.doit; | |
60 } | |
61 | |
62 /** | |
63 * Returns a string containing a concise, human-readable | |
64 * description of the receiver. | |
65 * | |
66 * @return a string representation of the event | |
67 */ | |
68 public char[] toString() { | |
69 return Format( "{} x={} y={} doit={}}", super.toString[ 0 .. $-2 ], x, y, doit ); | |
70 } | |
71 } |