forked from anna-lamoureux/SensorTestApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.kv
190 lines (166 loc) · 4.64 KB
/
tests.kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#: import sm kivy.uix.screenmanager
ScreenManagement:
transition: sm.NoTransition()
LoginScreen:
TestScreen:
UserScreen:
ProgressBarScreen:
CreateNewUserScreen
<LoginScreen>:
name: 'welcome'
Label:
markup: True
text: '[size=24]Welcome to [color=dd88ff]THE APP[/color][/size]'
AnchorLayout:
anchor_x: 'center'
anchor_y: 'bottom'
BoxLayout:
orientation: 'horizontal'
size_hint: 1, .1
Button:
text: 'Exit'
on_press: app.Exit()
Button:
text: 'Login'
on_press: app.root.current = 'login'
<TestScreen>:
name: 'tests'
Button:
id: btn
text: 'Select Test'
on_release: dropdown.open(self)
size_hint: .4, .05
pos_hint: {'x':.3, 'y':.5}
Widget
DropDown:
id: dropdown
on_select: btn.text = '{}'.format(args[1])
Button:
text: 'Test A'
size_hint_y: None
height: '40dp'
on_press: dropdown.select('Test A')
on_release: root.saveTest('Test A')
Button:
text: 'Test B'
size_hint_y: None
height: '40dp'
on_press: dropdown.select('Test B')
on_release: root.saveTest('Test B')
Button:
text: 'Test C'
size_hint_y: None
height: '40dp'
on_press: dropdown.select('Test C')
on_release: root.saveTest('Test C')
AnchorLayout:
anchor_x: 'center'
anchor_y: 'bottom'
BoxLayout:
orientation: 'horizontal'
size_hint: 1, .1
Button:
text: 'Exit'
on_press: app.Exit()
Button:
text: 'Back to Login'
on_press: app.root.current = 'login'
Button:
text: 'Start Test'
on_press: app.root.current = 'progressbar'
<UserScreen>:
name: 'login'
Button:
id: btn2
text: 'Select User'
on_release: dropdown2.open(self)
size_hint: .4, .05
pos_hint: {'x':.3, 'y':.5}
Widget
DropDown:
id: dropdown2
on_select: btn2.text = '{}'.format(args[1])
Button:
text: 'User 1'
size_hint_y: None
height: '40dp'
on_press: dropdown2.select('User 1')
on_release: root.saveUser('User 1')
Button:
text: 'User 2'
size_hint_y: None
height: '40dp'
on_press: dropdown2.select('User 2')
on_release: root.saveUser('User 2')
Button:
text: 'User 3'
size_hint_y: None
height: '40dp'
on_press: dropdown2.select('User 3')
on_release: root.saveUser('User 3')
Button:
text: "Create New User"
on_press: app.root.current = 'newuser'
pos_hint: {'x':.5, 'y':.44}
size_hint: .2, .04
AnchorLayout:
anchor_x: 'center'
anchor_y: 'bottom'
BoxLayout:
orientation: 'horizontal'
size_hint: 1, .1
Button:
text: 'Exit'
on_press: app.Exit()
Button:
text: 'Back to Welcome'
on_press: app.root.current = 'welcome'
Button:
text: 'Choose Test'
on_press: app.root.current = 'tests'
<ProgressBarScreen>:
name: 'progressbar'
BoxLayout:
orientation: 'horizontal'
size_hint: .5, .1
Button:
text: 'Back to Login'
on_press: app.root.current = 'login'
BoxLayout:
orientation: 'vertical'
size_hint: 1, .9
pos_hint: {'x':0, 'y':.1}
Label:
text: 'Here are the instructions for the choosen test'
Label:
text: 'Direction 1'
Label:
text: 'Direction 2'
Label:
text: 'Direction 3'
Label:
text: 'Direction 4'
Label:
text: 'Direction 5'
Label:
text: 'Direction 6'
Label:
text: 'Direction 7'
Label:
text: 'Direction 8'
Label:
text: 'Direction 9'
<CreateNewUserScreen>:
name: 'newuser'
TextInput:
id: newusertext
text: ''
size_hint: .4, .05
pos_hint: {'x':.3, 'y':.5}
Button:
id: submit
text: 'Submit'
size_hint: .3, .05
pos_hint: {'x':.35, 'y':.44}
on_press: root.createNewUser(newusertext.text)
on_release: app.root.current = 'login'