-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.kv
executable file
·254 lines (251 loc) · 9.43 KB
/
calculator.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
#kV File
<CalcButton@Button>:
#Custom Button Design 1
font_size: 70
background_down: "res/blue_button_back.png"
background_normal: "res/blue_button_back.png"
font_name: "res/font_roboto_thin.ttf"
<CalcButton2@Button>:
#Custom Button Design 2
font_size: 70
background_down: "res/pink_button_back.png"
background_normal: "res/pink_button_back.png"
font_name: "res/font_roboto_thin.ttf"
<CalcButton3@Button>:
#Custom Button Design 3
font_size: 70
background_down: "res/pink_button_back_5row.png"
background_normal: "res/pink_button_back_5row.png"
font_name: "res/font_roboto_thin.ttf"
<CalcLayout>:
#Main App Layout
id: cal
ModalView:
id: pop
background: "res/white_back.png"
size_hint_y: 0.313
separator_height: 0
pos_hint: {'right': 1, 'top': 0.3}
BoxLayout:
orientation: "vertical"
Label:
size_hint_y:0.3
Label:
text: "App Made By -Jack Using [u][color=5194FF][ref=http://Kivy.org]Kivy[/ref][/color][/u]"
font_size: cal.width*0.07
font_name: "res/font_roboto_thin.ttf"
color: 116/255.0,116/255.0,116/255.0,1
markup: True
on_ref_press: cal.internetActivity("https://kivy.org")
Button:
text: "[u]Source Code - GitHub[/u]"
font_size: cal.width*0.07
font_name: "res/font_roboto_thin.ttf"
markup: True
color: 81/255.0,148/255.0,1,1
background_normal: ""
background_color: 1,1,1,1
background_down: "res/trans_back.png"
on_release: cal.internetActivity("https://goo.gl/5GgiX2")
BoxLayout:
padding: 0,10,0,0
pos_hint: {'top': 1}
size_hint_y: 0.07
Button:
text: " Info"
font_name: "res/font_roboto_thin.ttf"
color: 116/255.0,116/255.0,116/255.0,1
font_size: 50
background_normal: ""
background_down: ""
background_color: 1,1,1,1
size_hint_x: 0.1
on_release: pop.open(self)
Label:
size_hint_x: 0.7
PageLayout:
border: "30dp"
swipe_threshold: 0.000001
GridLayout:
rows: 2
BoxLayout:
pos_hint: {"top":1}
size_hint_y:0.606
padding: ["20dp","40dp",0,0]
ScrollView:
bar_color: 1,1,1,0
scroll_distance: "50dp"
scroll_x: 0.5
pos_hint: {'center_x':.5, 'center_y':.5}
do_scroll_y: False
Label:
id: input_data
font_name: "res/font_roboto_thin.ttf"
text: cal.data_text
markup: True
color: 116/255.0,116/255.0,116/255.0,1
font_size: 120
size_hint_x: None
width: 1300
size_hint_min_x: self.width
GridLayout:
cols: 2
GridLayout:
rows: 5
BoxLayout:
size_hint_y: 0.5
CalcButton:
text: "7"
on_release: cal.valEnter(self.text)
CalcButton:
text: "8"
on_release: cal.valEnter(self.text)
CalcButton:
text: "9"
on_release: cal.valEnter(self.text)
BoxLayout:
size_hint_y: 0.5
CalcButton:
text: "4"
on_release: cal.valEnter(self.text)
CalcButton:
text: "5"
on_release: cal.valEnter(self.text)
CalcButton:
text: "6"
on_release: cal.valEnter(self.text)
BoxLayout:
size_hint_y: 0.5
CalcButton:
text: "1"
on_release: cal.valEnter(self.text)
CalcButton:
text: "2"
on_release: cal.valEnter(self.text)
CalcButton:
text: "3"
on_release: cal.valEnter(self.text)
BoxLayout:
size_hint_y: 0.5
CalcButton:
text: "."
on_release: cal.valEnter(self.text)
CalcButton:
text: "0"
on_release: cal.valEnter(self.text)
CalcButton:
text: "="
on_release: cal.calc(input_data.text)
BoxLayout:
orientation: "vertical"
size_hint_y: 0.5
size_hint_x:0.25
CalcButton3:
text: "DEL"
on_press: cal.onLongPressCheck("")
on_release: cal.onLongPressCheck(" ")
CalcButton3:
text: "+"
on_release: cal.valEnter(self.text)
CalcButton3:
text: "-"
on_release: cal.valEnter(self.text)
CalcButton3:
text: "*"
on_release: cal.valEnter(self.text)
CalcButton3:
text: "/"
on_release: cal.valEnter(self.text)
GridLayout:
size_hint_y: 0.9
rows: 6
AnchorLayout:
anchor_y: "top"
anchor_x: "right"
BoxLayout:
size_hint_y: 0.33
CalcButton2:
text: " INV"
on_release: cal.inverseMode()
CalcButton2:
text: cal.button_angle_text
on_release: cal.angleChange()
CalcButton2:
text: " √"
on_release: cal.valEnter(u"\u221A"+"(")
BoxLayout:
size_hint_y: 0.33
CalcButton2:
text: cal.button_sin_text
markup: True
on_release: cal.valEnter(self.text[4:]+"(")
CalcButton2:
text: cal.button_cos_text
markup: True
on_release: cal.valEnter(self.text[4:]+"(")
CalcButton2:
text: cal.button_tan_text
markup: True
on_release: cal.valEnter(self.text[4:]+"(")
BoxLayout:
size_hint_y: 0.33
CalcButton2:
text: cal.button_ln_text
markup: True
on_release: cal.inverseMode(2)
CalcButton2:
text: cal.button_log_text
markup: True
on_release: cal.inverseMode(1)
CalcButton2:
text: " !"
on_release: cal.valEnter("fact(")
BoxLayout:
size_hint_y: 0.33
CalcButton2:
text: " π"
on_release: cal.valEnter(u"\u03C0")
CalcButton2:
text: " e"
on_release: cal.valEnter(self.text[4])
CalcButton2:
text: " ^"
on_release: cal.valEnter(self.text[4])
BoxLayout:
size_hint_y: 0.33
CalcButton2:
text: " ("
on_release: cal.valEnter(self.text[4:])
CalcButton2:
text: " )"
on_release: cal.valEnter(self.text[4:])
CalcButton2:
text: " %"
on_release: cal.valEnter(self.text[4:])
ModalView:
id: updatePop
background: "res/white_back.png"
size_hint_y: 0.4
separator_height: 0
pos_hint: {'right': 1, 'top': 0.4}
on_dismiss: cal.remove_widget(updatePop)
BoxLayout:
orientation: "vertical"
Label:
id: updateTitle
text: cal.title_text
font_size: cal.width*0.05
size_hint_y:0.3
color: 116/255.0,116/255.0,116/255.0,1
ScrollView:
Label:
id: updateText
text: cal.update_text
font_size: cal.width*0.04
color: 116/255.0,116/255.0,116/255.0,1
padding_x: "30dp"
markup: True
size_hint_y: None
height: self.texture_size[1]
text_size: self.width, None
on_ref_press: cal.internetActivity("https://drive.google.com/open?id=0Bzs0vaxTnYwEMml1Rm9DeVY5ZVk")