1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Debugging features accessible from the user preference menu
22 redef class UserWindow
24 private var layout_debug
= new VerticalLayout(parent
=layout
)
26 private var lbl_debug_title
= new Label(parent
=layout_debug
,
27 text
="Debug options".t
, size
=1.5)
29 private var but_test_notif
= new Button(parent
=layout_debug
,
30 text
="Test notifications".t
)
32 private var but_test_checkin
= new Button(parent
=layout_debug
,
33 text
="Test checkin".t
)
35 private var but_test_checkout
= new Button(parent
=layout_debug
,
36 text
="Test checkout".t
)
38 private var but_test_menu
= new Button(parent
=layout_debug
,
39 text
="Test menu diff".t
)
41 redef fun on_event
(event
)
45 if event
isa ButtonPressEvent then
46 var sender
= event
.sender
47 if sender
== but_test_notif
then
48 notify
("Test Notification", "Some content\nmultiline", 5)
49 else if sender
== but_test_checkin
then
51 else if sender
== but_test_checkout
then
53 else if sender
== but_test_menu
then