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