Mercurial > projects > dwt-win
annotate dwt/events/SelectionEvent.d @ 212:ab60f3309436
reverted the char[] to String and use the an alias.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:12:38 +0200 |
parents | bef1ed4ebc50 |
children | fd9c62a2998e |
rev | line source |
---|---|
0 | 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.SelectionEvent; | |
14 | |
15 | |
16 import dwt.widgets.Event; | |
17 import dwt.widgets.Widget; | |
18 import dwt.events.TypedEvent; | |
19 | |
20 import tango.text.convert.Format; | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
86
diff
changeset
|
21 import dwt.dwthelper.utils; |
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
86
diff
changeset
|
22 |
0 | 23 /** |
24 * Instances of this class are sent as a result of | |
25 * widgets being selected. | |
26 * <p> | |
27 * Note: The fields that are filled in depend on the widget. | |
28 * </p> | |
29 * | |
30 * @see SelectionListener | |
31 */ | |
32 | |
33 public class SelectionEvent : TypedEvent { | |
34 | |
35 /** | |
36 * The item that was selected. | |
37 */ | |
38 public Widget item; | |
39 | |
40 /** | |
41 * Extra detail information about the selection, depending on the widget. | |
42 * | |
43 * <p><b>Sash</b><ul> | |
44 * <li>{@link dwt.DWT#DRAG}</li> | |
45 * </ul></p><p><b>ScrollBar and Slider</b><ul> | |
46 * <li>{@link dwt.DWT#DRAG}</li> | |
47 * <li>{@link dwt.DWT#HOME}</li> | |
48 * <li>{@link dwt.DWT#END}</li> | |
49 * <li>{@link dwt.DWT#ARROW_DOWN}</li> | |
50 * <li>{@link dwt.DWT#ARROW_UP}</li> | |
51 * <li>{@link dwt.DWT#PAGE_DOWN}</li> | |
52 * <li>{@link dwt.DWT#PAGE_UP}</li> | |
53 * </ul></p><p><b>Table and Tree</b><ul> | |
54 * <li>{@link dwt.DWT#CHECK}</li> | |
55 * </ul></p><p><b>Text</b><ul> | |
56 * <li>{@link dwt.DWT#CANCEL}</li> | |
57 * </ul></p><p><b>CoolItem and ToolItem</b><ul> | |
58 * <li>{@link dwt.DWT#ARROW}</li> | |
59 * </ul></p> | |
60 */ | |
61 public int detail; | |
62 | |
63 /** | |
64 * The x location of the selected area. | |
65 */ | |
66 public int x; | |
67 | |
68 /** | |
69 * The y location of selected area. | |
70 */ | |
71 public int y; | |
72 | |
73 /** | |
74 * The width of selected area. | |
75 */ | |
76 public int width; | |
77 | |
78 /** | |
79 * The height of selected area. | |
80 */ | |
81 public int height; | |
82 | |
83 /** | |
84 * The state of the keyboard modifier keys at the time | |
85 * the event was generated. | |
86 */ | |
87 public int stateMask; | |
88 | |
89 /** | |
90 * The text of the hyperlink that was selected. | |
91 * This will be either the text of the hyperlink or the value of its HREF, | |
92 * if one was specified. | |
93 * | |
94 * @see dwt.widgets.Link#setText(String) | |
95 * @since 3.1 | |
96 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
86
diff
changeset
|
97 public String text; |
0 | 98 |
99 /** | |
100 * A flag indicating whether the operation should be allowed. | |
101 * Setting this field to <code>false</code> will cancel the | |
102 * operation, depending on the widget. | |
103 */ | |
104 public bool doit; | |
105 | |
106 //static final long serialVersionUID = 3976735856884987953L; | |
107 | |
108 /** | |
109 * Constructs a new instance of this class based on the | |
110 * information in the given untyped event. | |
111 * | |
112 * @param e the untyped event containing the information | |
113 */ | |
114 public this(Event e) { | |
115 super(e); | |
116 this.item = e.item; | |
117 this.x = e.x; | |
118 this.y = e.y; | |
119 this.width = e.width; | |
120 this.height = e.height; | |
121 this.detail = e.detail; | |
122 this.stateMask = e.stateMask; | |
123 this.text = e.text; | |
124 this.doit = e.doit; | |
125 } | |
126 | |
127 /** | |
128 * Returns a string containing a concise, human-readable | |
129 * description of the receiver. | |
130 * | |
131 * @return a string representation of the event | |
132 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
86
diff
changeset
|
133 public override String toString() { |
0 | 134 return Format( "{} item={} detail={} x={} y={} width={} height={} stateMask={} text={} doit={}}", |
135 super.toString[ 0 .. $-2 ], | |
136 item, | |
137 detail, | |
138 x, | |
139 y, | |
140 width, | |
141 height, | |
142 stateMask, | |
143 text, | |
144 doit ); | |
145 } | |
146 } | |
147 |