-
Notifications
You must be signed in to change notification settings - Fork 2
/
colliscan.kv
299 lines (253 loc) · 4.68 KB
/
colliscan.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
#:kivy 1.9.0
<RootScreen>:
LoginView:
ProductView:
ScannerView:
IpView:
BasketView:
<LoginView>:
name: "LoginView"
GridLayout:
cols: 2
Label:
text: "username"
TextInput:
id: txtUsername
multiline: False
Label:
text: "password"
TextInput:
id: txtPassword
password: True
multiline: False
Button:
text: "Exit"
on_press: app.stop()
Button:
text: "Login"
on_press: root.login()
<ProductView>:
name: "ProductView"
on_pre_enter:
self.getProduct()
BoxLayout:
size: root.size
orientation: "vertical"
padding: 20
spacing: 10
ColliAsyncImage:
id: product_image
size_hint: 1, 0.69
source: ""
Label:
id: product_description
text: "<none>"
size_hint: 1, 0.1
halign: "center"
Label:
id: lblAmount
text: "%s stuk(s)" % (root.amount)
size_hint: 1, 0.1
halign: "center"
ProgressBar:
id: pbProgress
size_hint: 1, 0.01
max: 100
BoxLayout:
size_hint: 1, 0.1
orientation: "horizontal"
spacing: 20
Button:
text: "Cancel"
size_hint: 0.25, 1
on_press:
root.manager.go_back("ScannerView")
Button:
text: "-"
size_hint: 0.25, 1
on_press: root.decrease()
Button:
text: "+"
size_hint: 0.25, 1
on_press: root.increase()
Button:
text: "Ok"
size_hint: 0.25, 1
on_press: root.confirm()
<ScannerView>:
name: "ScannerView"
on_pre_enter:
self.setCallback()
BoxLayout:
size: root.size
orientation: "vertical"
padding: 20
spacing: 10
Label:
text: "Scan your product"
size_hint: 1, 0.75
halign: "center"
Label:
text: "Or search manually:"
size_hint: 1, 0.05
halign: "center"
TextInput:
id: txtBarcode
size_hint: 1, 0.05
multiline: False
Button:
text: "Search"
size_hint: 1, 0.05
on_press: root.search()
BoxLayout:
size_hint: 1, 0.1
orientation: "horizontal"
spacing: 20
Button:
text: "Exit"
size_hint: 0.25, 1
on_press: app.stop()
Button:
text: "Log out"
size_hint: 0.25, 1
on_press: root.logout()
Button:
text: "View ip"
size_hint: 0.25, 1
on_press:
root.manager.go_next("IpView")
Button:
text: "Basket"
size_hint: 0.25, 1
on_press:
root.manager.go_next("BasketView")
<IpView>:
name: "IpView"
BoxLayout:
size: root.size
orientation: "vertical"
padding: 20
spacing: 10
Label:
id: lblIp
text: "<error>"
size_hint: 1, 0.9
halign: "center"
BoxLayout:
size_hint: 1, 0.1
orientation: "horizontal"
spacing: 20
Button:
text: "Back"
size_hint: 0.25, 1
on_press:
root.manager.go_back("ScannerView")
<BasketView>:
name: "BasketView"
BoxLayout:
size: root.size
orientation: "vertical"
padding: 20
#spacing: 10
BoxLayout:
size_hint: 1, 0.05
orientation: "horizontal"
Label:
text: "image"
size_hint: 0.2, 1
Label:
size_hint: 0.3, 1
text: "Brand"
Label:
size_hint: 0.4, 1
text: "Desciption"
Label:
size_hint: 0.05, 1
text: "qty"
Label:
size_hint: 0.05, 1
text: "tot"
ScrollView:
effect_cls: "DampedScrollEffect"
do_scroll_x: False
size_hint: 1, 0.7
BoxLayout:
id: articles
orientation: "vertical"
padding: 20
BoxLayout:
size_hint: 1, 0.05
orientation: "horizontal"
spacing: 20
Label:
text: "Subtotal:"
text_size: self.size
size_hint: 0.95, 1
halign: "right"
valign: "middle"
Label:
id: txtSubtotal
text: "0"
size_hint: 0.05, 1
BoxLayout:
size_hint: 1, 0.05
orientation: "horizontal"
spacing: 20
Label:
text: "Service cost:"
text_size: self.size
size_hint: 0.95, 1
halign: "right"
valign: "middle"
Label:
id: txtServiceCost
text: "0"
size_hint: 0.05, 1
BoxLayout:
size_hint: 1, 0.05
orientation: "horizontal"
spacing: 20
Label:
text: "Total:"
text_size: self.size
size_hint: 0.95, 1
halign: "right"
valign: "middle"
Label:
id: txtTotal
text: "100"
size_hint: 0.05, 1
BoxLayout:
size_hint: 1, 0.1
orientation: "horizontal"
Button:
text: "Back"
size: 0.25, 1
on_press:
root.manager.go_back("ScannerView")
<BasketLine@BoxLayout>:
size_y: 200
orientation: "horizontal"
txtBrand: "<no brand>"
txtDescription: "<no desciption>"
txtQuantity: "0"
txtTotal: "0"
imgProduct: ""
ColliAsyncImage:
source: root.imgProduct
size: 200,200
size_hint: 0.2, 1
halign: "middle"
valign: "middle"
Label:
size_hint: 0.3, 1
text: root.txtBrand
Label:
size_hint: 0.4, 1
text: root.txtDescription
Label:
size_hint: 0.05, 1
text: root.txtQuantity
Label:
size_hint: 0.05, 1
text: root.txtTotal