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