Mercurial > projects > dwt-samples
diff user/doob_test1/PaintHandler.d @ 4:8d49c4eb4800
Added user examples
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 10 Feb 2008 04:28:56 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/user/doob_test1/PaintHandler.d Sun Feb 10 04:28:56 2008 +0100 @@ -0,0 +1,32 @@ +module user.doob_test1.PaintHandler; + +private import dwt.DWT; +private import dwt.events.PaintListener; +private import dwt.widgets.Canvas; +private import dwt.widgets.Display; + +private import dwt.graphics.GC; +private import dwt.graphics.Rectangle; + +private import tango.io.Stdout; + +class PaintHandler : PaintListener { + public int x, y, xDiff, yDiff; + Canvas canvas; + Display display; + + this(Canvas c, Display d) { + canvas = c; + display = d; + } + + public void paintControl(PaintEvent e) { + Rectangle clientArea = canvas.getClientArea(); + e.gc.setBackground(display.getSystemColor(DWT.COLOR_CYAN)); + e.gc.fillRoundRectangle(x,y,xDiff,yDiff,50,50); + } + + public void reDraw() { + canvas.redraw(); + } +} \ No newline at end of file