-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcalc.kv
77 lines (73 loc) · 1.33 KB
/
calc.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
#:kivy 1.2.0
<CalcButton@Button>:
the_root: self.parent.my_root
on_press: self.the_root._execute(self.text)
background_color: [1, 1, 1, 1]
color: [1, 1, 1, 1]
font_size: self.width/2
<CalcButtonOp@CalcButton>:
background_color: [0.6, 0.6, 0.6, 1]
color: [0.2, 0.8, 1, 1]
<CalcButtonSpecial@CalcButton>:
background_color: [0.3, 0.6, 0.6, 1]
color: [0, 1, 1, 1]
<Calculator>:
ti: myti
BoxLayout:
size: root.width, root.height
orientation: "vertical"
spacing: 10
padding: [5, 5, 5, 5]
TextInput:
size_hint: 1, 0.20
id: myti
text: ""
readonly: True
font_size: 100
background_color: [1, 1, 1, 1]
foreground_color: [0, 0, 0, 1]
GridLayout:
cols: 4
rows: 5
spacing: [8, 8]
my_root: root
CalcButtonSpecial:
text: "^"
CalcButtonSpecial:
text: "1/2"
CalcButtonSpecial:
text: "<"
CalcButtonSpecial:
text: "C"
CalcButton:
text: "7"
CalcButton:
text: "8"
CalcButton:
text: "9"
CalcButtonOp:
text: "x"
CalcButton:
text: "4"
CalcButton:
text: "5"
CalcButton:
text: "6"
CalcButtonOp:
text: "-"
CalcButton:
text: "1"
CalcButton:
text: "2"
CalcButton:
text: "3"
CalcButtonOp:
text: "+"
CalcButton:
text: "0"
CalcButton:
text: "."
CalcButtonOp:
text: "="
CalcButtonOp:
text: "/"