Mercurial > projects > dwt-win
comparison dwt/events/VerifyEvent.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, 2006 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.VerifyEvent; | |
14 | |
15 | |
16 import dwt.widgets.Event; | |
17 import dwt.events.KeyEvent; | |
18 | |
19 import tango.text.convert.Format; | |
20 /** | |
21 * Instances of this class are sent as a result of | |
22 * widgets handling keyboard events | |
23 * | |
24 * @see VerifyListener | |
25 */ | |
26 | |
27 public final class VerifyEvent : KeyEvent { | |
28 | |
29 /** | |
30 * the range of text being modified. | |
31 * Setting these fields has no effect. | |
32 */ | |
33 public int start, end; | |
34 | |
35 /** | |
36 * the new text that will be inserted. | |
37 * Setting this field will change the text that is about to | |
38 * be inserted or deleted. | |
39 */ | |
40 public char[] text; | |
41 | |
42 //static final long serialVersionUID = 3257003246269577014L; | |
43 | |
44 /** | |
45 * Constructs a new instance of this class based on the | |
46 * information in the given untyped event. | |
47 * | |
48 * @param e the untyped event containing the information | |
49 */ | |
50 public this(Event e) { | |
51 super(e); | |
52 this.start = e.start; | |
53 this.end = e.end; | |
54 this.text = e.text; | |
55 } | |
56 | |
57 /** | |
58 * Returns a string containing a concise, human-readable | |
59 * description of the receiver. | |
60 * | |
61 * @return a string representation of the event | |
62 */ | |
63 public char[] toString() { | |
64 return Format( "{} start={} end={} text={}}", super.toString[ 0 .. $-2 ], start, end, text ); | |
65 } | |
66 } |