ae7be3c2539abe57226bdbbb816329771319e115
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
)
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
)
43 lbl_debug_title
.size
= 1.5
45 for c
in [but_test_notif
, but_test_checkin
, but_test_checkout
, but_test_menu
] do
50 redef fun on_event
(event
)
54 if event
isa ButtonPressEvent then
55 var sender
= event
.sender
56 if sender
== but_test_notif
then
57 notify
("Test Notification", "Some content\nmultiline", 5)
58 else if sender
== but_test_checkin
then
60 else if sender
== but_test_checkout
then
62 else if sender
== but_test_menu
then