From ff7f0ea42219da5e217b902e7b000a2d533b4b39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 5 Apr 2016 22:04:06 -0400 Subject: [PATCH] lib/app: ToogleEvent MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/app/ui.nit | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/app/ui.nit b/lib/app/ui.nit index 4efbb87..7c9b2f9 100644 --- a/lib/app/ui.nit +++ b/lib/app/ui.nit @@ -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 -- 1.7.9.5