-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.kv
86 lines (78 loc) · 1.6 KB
/
main.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
<CustomButton@Button>:
background_normal: " "
background_color: (255, 0, 255, 0)
font_size: 48
<MainScreen>:
id: access
BoxLayout:
padding: 20
spacing: 20
orientation: "vertical"
rows: 5
size: root.width, root.height
TextInput:
id: entry
keyboard_mode: "managed"
readonly: True
font_size: 32
multiline: False
BoxLayout:
spacing: 20
cols: 4
CustomButton:
text: "7"
on_press: entry.text += self.text
CustomButton:
text: "8"
on_press: entry.text += self.text
CustomButton:
text: "9"
on_press: entry.text += self.text
CustomButton:
text: "+"
on_press: entry.text += self.text
BoxLayout:
spacing: 20
cols: 4
CustomButton:
text: "4"
on_press: entry.text += self.text
CustomButton:
text: "5"
on_press: entry.text += self.text
CustomButton:
text: "6"
on_press: entry.text += self.text
CustomButton:
text: "-"
on_press: entry.text += self.text
BoxLayout:
spacing: 20
cols: 4
CustomButton:
text: "1"
on_press: entry.text += self.text
CustomButton:
text: "2"
on_press: entry.text += self.text
CustomButton:
text: "3"
on_press: entry.text += self.text
CustomButton:
text: "*"
on_press: entry.text += self.text
BoxLayout:
spacing: 20
cols: 4
CustomButton:
text: "AC"
on_press: entry.text = ""
CustomButton:
text: "0"
on_press: entry.text += self.text
CustomButton:
text: "="
on_press: entry.text = access.calculate(str(entry.text))
CustomButton:
text: "/"
on_press: entry.text += self.text