Mercurial > projects > dwt-win
annotate dwt/custom/TextChangingEvent.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 | a5afe31f5cdd |
children | fd9c62a2998e |
rev | line source |
---|---|
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
1 /******************************************************************************* |
155 | 2 * Copyright (c) 2000, 2004 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.custom.TextChangingEvent; | |
14 | |
15 | |
16 import dwt.events.TypedEvent; | |
17 import dwt.custom.StyledTextContent; | |
18 import dwt.custom.StyledTextEvent; | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
19 import dwt.dwthelper.utils; |
155 | 20 |
21 /** | |
22 * This event is sent by the StyledTextContent implementor when a change | |
23 * to the text is about to occur. | |
24 */ | |
25 public class TextChangingEvent : TypedEvent { | |
26 /** | |
27 * Start offset of the text that is going to be replaced | |
28 */ | |
29 public int start; | |
30 /** | |
31 * Text that is going to be inserted or empty string | |
32 * if no text will be inserted | |
33 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
34 public String newText; |
155 | 35 /** |
36 * Length of text that is going to be replaced | |
37 */ | |
38 public int replaceCharCount; | |
39 /** | |
40 * Length of text that is going to be inserted | |
41 */ | |
42 public int newCharCount; | |
43 /** | |
44 * Number of lines that are going to be replaced | |
45 */ | |
46 public int replaceLineCount; | |
47 /** | |
48 * Number of new lines that are going to be inserted | |
49 */ | |
50 public int newLineCount; | |
51 | |
52 static final long serialVersionUID = 3257290210114352439L; | |
53 | |
54 /** | |
55 * Create the TextChangedEvent to be used by the StyledTextContent implementor. | |
56 * <p> | |
57 * | |
58 * @param source the object that will be sending the new TextChangingEvent, | |
59 * cannot be null | |
60 */ | |
61 public this(StyledTextContent source) { | |
62 super( cast(Object)source); | |
63 } | |
64 this(StyledTextContent source, StyledTextEvent e) { | |
65 super( cast(Object)source); | |
66 start = e.start; | |
67 replaceCharCount = e.replaceCharCount; | |
68 newCharCount = e.newCharCount; | |
69 replaceLineCount = e.replaceLineCount; | |
70 newLineCount = e.newLineCount; | |
71 newText = e.text; | |
72 } | |
73 | |
74 } |