Mercurial > projects > dwt-mac
comparison dwt/custom/LineStyleEvent.d @ 41:6337764516f1
Sync dwt/custom with dwt-linux (took copy of complete folder)
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 07 Oct 2008 16:29:55 +0200 |
parents | 1a8b3cb347e0 |
children |
comparison
equal
deleted
inserted
replaced
40:fbe68c33eeee | 41:6337764516f1 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2006 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
10 *******************************************************************************/ | 12 *******************************************************************************/ |
11 module dwt.custom; | 13 module dwt.custom.LineStyleEvent; |
12 | 14 |
13 import dwt.events.*; | 15 import dwt.dwthelper.utils; |
16 | |
17 import dwt.events.TypedEvent; | |
18 import dwt.custom.StyleRange; | |
19 import dwt.custom.Bullet; | |
20 import dwt.custom.StyledTextEvent; | |
14 | 21 |
15 /** | 22 /** |
16 * This event is sent when a line is about to be drawn. | 23 * This event is sent when a line is about to be drawn. |
24 * | |
25 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
17 */ | 26 */ |
18 public class LineStyleEvent : TypedEvent { | 27 public class LineStyleEvent : TypedEvent { |
19 | 28 |
20 /** | 29 /** |
21 * line start offset (input) | 30 * line start offset (input) |
22 */ | 31 */ |
23 public int lineOffset; | 32 public int lineOffset; |
24 | 33 |
25 /** | 34 /** |
26 * line text (input) | 35 * line text (input) |
27 */ | 36 */ |
28 public String lineText; | 37 public String lineText; |
29 | 38 |
30 /** | 39 /** |
31 * line ranges (output) | 40 * line ranges (output) |
32 * | 41 * |
33 * @since 3.2 | 42 * @since 3.2 |
34 */ | 43 */ |
35 public int[] ranges; | 44 public int[] ranges; |
36 | 45 |
37 /** | 46 /** |
38 * line styles (output) | 47 * line styles (output) |
39 * | 48 * |
40 * Note: Because a StyleRange includes the start and length, the | 49 * Note: Because a StyleRange includes the start and length, the |
41 * same instance cannot occur multiple times in the array of styles. | 50 * same instance cannot occur multiple times in the array of styles. |
42 * If the same style attributes, such as font and color, occur in | 51 * If the same style attributes, such as font and color, occur in |
43 * multiple StyleRanges, <code>ranges</code> can be used to share | 52 * multiple StyleRanges, <code>ranges</code> can be used to share |
44 * styles and reduce memory usage. | 53 * styles and reduce memory usage. |
45 */ | 54 */ |
46 public StyleRange[] styles; | 55 public StyleRange[] styles; |
47 | 56 |
48 /** | 57 /** |
49 * line alignment (input, output) | 58 * line alignment (input, output) |
50 * | 59 * |
51 * @since 3.2 | 60 * @since 3.2 |
52 */ | 61 */ |
53 public int alignment; | 62 public int alignment; |
54 | 63 |
55 /** | 64 /** |
56 * line indent (input, output) | 65 * line indent (input, output) |
57 * | 66 * |
58 * @since 3.2 | 67 * @since 3.2 |
59 */ | 68 */ |
60 public int indent; | 69 public int indent; |
61 | 70 |
62 /** | 71 /** |
63 * line justification (input, output) | 72 * line justification (input, output) |
64 * | 73 * |
65 * @since 3.2 | 74 * @since 3.2 |
66 */ | 75 */ |
67 public bool justify; | 76 public bool justify; |
68 | 77 |
69 /** | 78 /** |
75 /** | 84 /** |
76 * line bullet index (output) | 85 * line bullet index (output) |
77 * @since 3.2 | 86 * @since 3.2 |
78 */ | 87 */ |
79 public int bulletIndex; | 88 public int bulletIndex; |
80 | 89 |
81 static final long serialVersionUID = 3906081274027192884L; | 90 static final long serialVersionUID = 3906081274027192884L; |
82 | 91 |
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 */ | |
83 public this(StyledTextEvent e) { | 98 public this(StyledTextEvent e) { |
84 super(e); | 99 super(cast(Object)e); |
85 styles = e.styles; | 100 styles = e.styles; |
86 ranges = e.ranges; | 101 ranges = e.ranges; |
87 lineOffset = e.detail; | 102 lineOffset = e.detail; |
88 lineText = e.text; | 103 lineText = e.text; |
89 alignment = e.alignment; | 104 alignment = e.alignment; |