Mercurial > projects > dwt-win
annotate dwt/custom/LineStyleEvent.d @ 315:349b8c12e243
Sync dwt/custom with dwt-linux
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 07 Oct 2008 16:18:26 +0200 |
parents | fd9c62a2998e |
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.LineStyleEvent; | |
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.StyleRange; | |
19 import dwt.custom.Bullet; | |
20 import dwt.custom.StyledTextEvent; | |
21 | |
22 /** | |
23 * This event is sent when a line is about to be drawn. | |
246 | 24 * |
25 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
155 | 26 */ |
27 public class LineStyleEvent : 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 * line ranges (output) | |
41 * | |
42 * @since 3.2 | |
43 */ | |
44 public int[] ranges; | |
45 | |
46 /** | |
47 * line styles (output) | |
48 * | |
49 * Note: Because a StyleRange includes the start and length, the | |
50 * same instance cannot occur multiple times in the array of styles. | |
51 * If the same style attributes, such as font and color, occur in | |
52 * multiple StyleRanges, <code>ranges</code> can be used to share | |
53 * styles and reduce memory usage. | |
54 */ | |
55 public StyleRange[] styles; | |
56 | |
57 /** | |
58 * line alignment (input, output) | |
59 * | |
60 * @since 3.2 | |
61 */ | |
62 public int alignment; | |
63 | |
64 /** | |
65 * line indent (input, output) | |
66 * | |
67 * @since 3.2 | |
68 */ | |
69 public int indent; | |
70 | |
71 /** | |
72 * line justification (input, output) | |
73 * | |
74 * @since 3.2 | |
75 */ | |
76 public bool justify; | |
77 | |
78 /** | |
79 * line bullet (output) | |
80 * @since 3.2 | |
81 */ | |
82 public Bullet bullet; | |
83 | |
84 /** | |
85 * line bullet index (output) | |
86 * @since 3.2 | |
87 */ | |
88 public int bulletIndex; | |
89 | |
90 static final long serialVersionUID = 3906081274027192884L; | |
91 | |
246 | 92 /** |
93 * Constructs a new instance of this class based on the | |
94 * information in the given event. | |
95 * | |
96 * @param e the event containing the information | |
97 */ | |
155 | 98 public this(StyledTextEvent e) { |
99 super(cast(Object)e); | |
213 | 100 styles = e.styles; |
101 ranges = e.ranges; | |
155 | 102 lineOffset = e.detail; |
103 lineText = e.text; | |
104 alignment = e.alignment; | |
105 justify = e.justify; | |
106 indent = e.indent; | |
107 bullet = e.bullet; | |
108 bulletIndex = e.bulletIndex; | |
109 } | |
110 } |