Mercurial > projects > dwt-win
annotate dwt/custom/MovementEvent.d @ 246:fd9c62a2998e
Updater SWT 3.4M7 to 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 01 Jul 2008 10:15:59 +0200 |
parents | ab60f3309436 |
children | 349b8c12e243 |
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 /******************************************************************************* |
246 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
155 | 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.MovementEvent; | |
14 | |
15 import dwt.events.TypedEvent; | |
16 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
|
17 import dwt.dwthelper.utils; |
155 | 18 |
19 /** | |
20 * This event is sent when a new offset is required based on the current | |
21 * offset and a movement type. | |
22 * | |
246 | 23 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> |
24 * | |
155 | 25 * @since 3.3 |
26 */ | |
27 public class MovementEvent : TypedEvent { | |
28 | |
29 /** | |
30 * line start offset (input) | |
31 */ | |
32 public int lineOffset; | |
33 | |
34 /** | |
35 * line text (input) | |
36 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
37 public String lineText; |
155 | 38 |
39 /** | |
40 * the current offset (input) | |
41 */ | |
42 public int offset; | |
43 | |
44 /** | |
45 * the new offset (input, output) | |
46 */ | |
47 public int newOffset; | |
48 | |
49 /** | |
50 * the movement type (input) | |
51 * | |
52 * @see dwt.DWT#MOVEMENT_WORD | |
53 * @see dwt.DWT#MOVEMENT_WORD_END | |
54 * @see dwt.DWT#MOVEMENT_WORD_START | |
55 * @see dwt.DWT#MOVEMENT_CHAR | |
56 * @see dwt.DWT#MOVEMENT_CLUSTER | |
57 */ | |
58 public int movement; | |
59 | |
60 static final long serialVersionUID = 3978765487853324342L; | |
61 | |
246 | 62 /** |
63 * Constructs a new instance of this class based on the | |
64 * information in the given event. | |
65 * | |
66 * @param e the event containing the information | |
67 */ | |
155 | 68 public this(StyledTextEvent e) { |
69 super(cast(Object)e); | |
70 lineOffset = e.detail; | |
71 lineText = e.text; | |
72 movement = e.count; | |
73 offset = e.start; | |
74 newOffset = e.end; | |
75 } | |
76 } | |
77 | |
78 |