changeset 26:87265a206638

Add toString() on some events.
author Jordan Miner <jminer7@gmail.com>
date Sat, 25 Jul 2009 15:10:32 -0500
parents 0577e8738dc8
children dfaa3da21b27
files dynamin/gui/events.d
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dynamin/gui/events.d	Sat Jul 25 15:03:39 2009 -0500
+++ b/dynamin/gui/events.d	Sat Jul 25 15:10:32 2009 -0500
@@ -72,6 +72,10 @@
 	real y() { return _location.y; }
 	///
 	MouseButton button() { return _button; }
+	string toString() {
+		return format("MouseEventArgs [x={}, y={}, button={}]",
+			_x, _y, _button);
+	}
 }
 ///
 class MouseTurnedEventArgs : StopEventArgs {
@@ -108,6 +112,10 @@
 	bool scrollScreen() {
 		return false;
 	}
+	string toString() {
+		return format("MouseTurnedEventArgs [scrollAmount={}, scrollScreen={}]",
+			_scrollAmount, scrollScreen);
+	}
 }
 ///
 class KeyEventArgs : StopEventArgs {
@@ -129,6 +137,9 @@
 	 *          if the key was just pressed
 	 */
 	bool repeat() { return _repeat; }
+	string toString() {
+		return format("KeyEventArgs [key={}, repeat={}]", _key, _repeat);
+	}
 }
 ///
 class KeyTypedEventArgs : StopEventArgs {