Mercurial > projects > dwt-mac
comparison dwt/events/PaintEvent.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 649b8e223d5a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
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 *******************************************************************************/ | |
11 module dwt.events.PaintEvent; | |
12 | |
13 import dwt.dwthelper.utils; | |
14 | |
15 | |
16 import dwt.graphics.GC; | |
17 import dwt.widgets.Event; | |
18 | |
19 /** | |
20 * Instances of this class are sent as a result of | |
21 * visible areas of controls requiring re-painting. | |
22 * | |
23 * @see PaintListener | |
24 */ | |
25 | |
26 public final class PaintEvent extends TypedEvent { | |
27 | |
28 /** | |
29 * the graphics context to use when painting | |
30 * that is configured to use the colors, font and | |
31 * damaged region of the control. It is valid | |
32 * only during the paint and must not be disposed | |
33 */ | |
34 public GC gc; | |
35 | |
36 /** | |
37 * the x offset of the bounding rectangle of the | |
38 * region that requires painting | |
39 */ | |
40 public int x; | |
41 | |
42 /** | |
43 * the y offset of the bounding rectangle of the | |
44 * region that requires painting | |
45 */ | |
46 public int y; | |
47 | |
48 /** | |
49 * the width of the bounding rectangle of the | |
50 * region that requires painting | |
51 */ | |
52 public int width; | |
53 | |
54 /** | |
55 * the height of the bounding rectangle of the | |
56 * region that requires painting | |
57 */ | |
58 public int height; | |
59 | |
60 /** | |
61 * the number of following paint events which | |
62 * are pending which may always be zero on | |
63 * some platforms | |
64 */ | |
65 public int count; | |
66 | |
67 static final long serialVersionUID = 3256446919205992497L; | |
68 | |
69 /** | |
70 * Constructs a new instance of this class based on the | |
71 * information in the given untyped event. | |
72 * | |
73 * @param e the untyped event containing the information | |
74 */ | |
75 public PaintEvent(Event e) { | |
76 super(e); | |
77 this.gc = e.gc; | |
78 this.x = e.x; | |
79 this.y = e.y; | |
80 this.width = e.width; | |
81 this.height = e.height; | |
82 this.count = e.count; | |
83 } | |
84 | |
85 /** | |
86 * Returns a string containing a concise, human-readable | |
87 * description of the receiver. | |
88 * | |
89 * @return a string representation of the event | |
90 */ | |
91 public String toString() { | |
92 String string = super.toString (); | |
93 return string.substring (0, string.length() - 1) // remove trailing '}' | |
94 + " gc=" + gc | |
95 + " x=" + x | |
96 + " y=" + y | |
97 + " width=" + width | |
98 + " height=" + height | |
99 + " count=" + count | |
100 + "}"; | |
101 } | |
102 } | |
103 |