lib/app: ToogleEvent
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 6 Apr 2016 02:04:06 +0000 (22:04 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 17 May 2016 14:49:44 +0000 (10:49 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/app/ui.nit

index 4efbb87..7c9b2f9 100644 (file)
@@ -211,12 +211,29 @@ class CheckBox
        var is_checked = false is writable
 end
 
+# Event sent from a `VIEW`
+class ViewEvent
+       super AppEvent
+
+       # The `VIEW` that raised this event
+       var sender: VIEW
+
+       # Type of the `sender`
+       type VIEW: View
+end
+
 # A `Button` press event
 class ButtonPressEvent
-       super AppEvent
+       super ViewEvent
+
+       redef type VIEW: Button
+end
+
+# The `CheckBox` `sender` has been toggled
+class ToggleEvent
+       super ViewEvent
 
-       # The `Button` that raised this event
-       var sender: Button
+       redef type VIEW: CheckBox
 end
 
 # A layout to visually organize `Control`s