Mercurial > projects > doodle
diff doodle/tk/events.d @ 64:eb5436b47d13
Implemented crossing events
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Thu, 12 Aug 2010 22:21:12 +0930 |
parents | 20d6327c4a75 |
children | 31d10176415d |
line wrap: on
line diff
--- a/doodle/tk/events.d Thu Aug 12 16:35:24 2010 +0930 +++ b/doodle/tk/events.d Thu Aug 12 22:21:12 2010 +0930 @@ -6,8 +6,7 @@ } // FIXME -// Do we need FocusEvent, Enter/LeaveEvent ? -// Note, FocusEvent has no mask but Enter/Leave do. +// Do we need FocusEvent. Note, it has no mask. // Hence would need to refactor hierarchy slightly, eg InputEvent abstract class Event { @@ -58,16 +57,25 @@ } } -/* final class CrossingEvent : PointerEvent { - this(in Mask mask) { - super(mask); + this(in CrossingMode crossingMode, + in Point pixelPoint, + in Point modelPoint, + in Mask mask) { + super(pixelPoint, modelPoint, mask); + _crossingMode = crossingMode; + } + + CrossingMode crossingMode() const { return _crossingMode; } + + override string toString() const { + return std.string.format("Crossing event: %s, %s, %s, %s", enumToString(_crossingMode), pixelPoint, modelPoint, mask); } private { + CrossingMode _crossingMode; } } -*/ final class ButtonEvent : PointerEvent { this(in ButtonAction buttonAction,