Mercurial > projects > dwt-win
annotate dwt/events/PaintEvent.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 | bef1ed4ebc50 |
children | fd9c62a2998e |
rev | line source |
---|---|
0 | 1 /******************************************************************************* |
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.events.PaintEvent; | |
14 | |
15 | |
16 import dwt.widgets.Event; | |
17 import dwt.graphics.GC; | |
18 | |
19 import dwt.events.TypedEvent; | |
20 | |
21 import tango.text.convert.Format; | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
86
diff
changeset
|
22 import dwt.dwthelper.utils; |
0 | 23 |
24 /** | |
25 * Instances of this class are sent as a result of | |
26 * visible areas of controls requiring re-painting. | |
27 * | |
28 * @see PaintListener | |
29 */ | |
30 | |
31 public final class PaintEvent : TypedEvent { | |
32 | |
33 /** | |
34 * the graphics context to use when painting | |
35 * that is configured to use the colors, font and | |
36 * damaged region of the control. It is valid | |
37 * only during the paint and must not be disposed | |
38 */ | |
39 public GC gc; | |
40 | |
41 /** | |
42 * the x offset of the bounding rectangle of the | |
43 * region that requires painting | |
44 */ | |
45 public int x; | |
46 | |
47 /** | |
48 * the y offset of the bounding rectangle of the | |
49 * region that requires painting | |
50 */ | |
51 public int y; | |
52 | |
53 /** | |
54 * the width of the bounding rectangle of the | |
55 * region that requires painting | |
56 */ | |
57 public int width; | |
58 | |
59 /** | |
60 * the height of the bounding rectangle of the | |
61 * region that requires painting | |
62 */ | |
63 public int height; | |
64 | |
65 /** | |
66 * the number of following paint events which | |
67 * are pending which may always be zero on | |
68 * some platforms | |
69 */ | |
70 public int count; | |
71 | |
72 //static final long serialVersionUID = 3256446919205992497L; | |
73 | |
74 /** | |
75 * Constructs a new instance of this class based on the | |
76 * information in the given untyped event. | |
77 * | |
78 * @param e the untyped event containing the information | |
79 */ | |
80 public this(Event e) { | |
81 super(e); | |
82 this.gc = e.gc; | |
83 this.x = e.x; | |
84 this.y = e.y; | |
85 this.width = e.width; | |
86 this.height = e.height; | |
87 this.count = e.count; | |
88 } | |
89 | |
90 /** | |
91 * Returns a string containing a concise, human-readable | |
92 * description of the receiver. | |
93 * | |
94 * @return a string representation of the event | |
95 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
86
diff
changeset
|
96 public override String toString() { |
0 | 97 return Format( "{} gc={} x={} y={} width={} height={} count={}}", |
86
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
98 super.toString[ 0 .. $-1 ], |
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
99 gc is null ? "null" : gc.toString, |
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
100 x, |
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
101 y, |
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
102 width, |
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
103 height, |
bef1ed4ebc50
again copied events from dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
48
diff
changeset
|
104 count ); |
0 | 105 } |
106 } | |
107 |