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