-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPyCSV.kv
435 lines (382 loc) · 15 KB
/
PyCSV.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<CsvEditor>:
cells_grid: cells_grid
title_grid: title_grid
title_grid2: title_grid2
rows_grid: rows_grid
for_float: for_float
scroll: scroll
scroll2: scroll2
find_button: find_button
find_textinput: find_textinput
find_textinput2: find_textinput2
find_next: find_next
find_prev: find_prev
replace_all: replace_all
open: open
save: save
save_as: save_as
canvas:
Color:
rgba: root.theme[0]
Rectangle:
size: self.size
pos: self.pos
Color:
rgba: 235/255, 245/255, 250/255, 1
Rectangle:
pos: self.x, self.y
size: self.width, self.height-58
GridLayout:
cols: 1
size: root.width, root.height
padding: [0, 0, 0, 0]
spacing: [0, 0.6]
GridLayout:
cols: 7
height: 59
size_hint: 1, None
padding: [56, 16, 0, 0]
spacing: 15
JoButton:
id: open
size: 80, 10
text: "Open"
on_release: root.load(drag="")
JoButton:
id: save
size: 80, 10
text: "Save"
on_release: root.save_file()
JoButton:
id: save_as
size: 80, 10
text: "Save as"
on_release: root.save_file(save_as=True)
FloatLayout:
size_hint: None, 1
JoButton:
id: find_button
background_color: 230/255, 230/255, 230/255, 1
size: 80, 10
pos_hint: {'x':0, 'y':0}
text: "Find/r"
on_release:
if find_button.text == "Find/r": find_button.text = "f/Replace"; \
find_button.background_color=[230/255, 230/255, 230/255, 1]; \
find_button.disabled = True; \
find_textinput2.opacity = 1; \
root.replace_animation();
else: find_button.text = "Find/r"; \
find_button.background_color=[230/255, 230/255, 230/255, 1]; \
find_button.disabled = True; \
root.replace_animation(reverse=True);
FindTextInput:
id: find_textinput
hint_text: "Find"
multiline: False
write_tab: False
posx: 0.89
posy: 0.09
pos_hint: {'x':self.posx, 'y':self.posy}
height: 0
width: 1
font_name: 'MEIRYO.TTC'
size_hint: None, None
background_normal: ''
background_color: [1, 1, 1, 1]
on_focus:
if find_button.text == "Find/r": root.find_animation([find_textinput, find_next, find_prev])
FindTextInput:
id: find_textinput2
opacity: 0
hint_text: "Replace"
multiline: False
write_tab: False
posx: 3.56
posy: -0.07
pos_hint: {'x': self.posx, 'y':self.posy}
height: 1
width: 1
font_name: 'MEIRYO.TTC'
size_hint: None, None
background_normal: ''
background_color: [1, 1, 1, 1]
JoButton:
id: find_next
text: "=>"
size: 24, 28
#pos: 492, 615
posx: 1.51
posy: 1.12
pos_hint: {'x':self.posx, 'y':self.posy}
canvas.before:
PushMatrix
Rotate:
angle: 90
origin: self.center
canvas.after:
PopMatrix
on_release: root.find_order("up")
JoButton:
id: find_prev
text: "=>"
size: 24, 28
#pos: 1002, 556
posx: 6.61
posy: 0.12
pos_hint: {'x':self.posx, 'y':self.posy}
canvas.before:
PushMatrix
Rotate:
angle: -90
origin: self.center
canvas.after:
PopMatrix
on_release: root.find_order("down")
ReplaceButton:
id: replace_all
text: "R"
size: 24, 29
#pos: 1007, 555
posx: 15.86
posy: 0.1
pos_hint: {'x': self.posx, 'y': self.posy}
on_release: root.replace_word()
Button:
size: 15, 15
size_hint: None, None
background_normal: ""
pos: 7, root.height - 17
background_color: [42 / 255, 87 / 255, 154 / 255, 1]
on_press: root.change_theme([[42 / 255, 87 / 255, 154 / 255, 1], [235 / 255, 245 / 255, 250 / 255, 1], [230 / 255, 230 / 255, 230 / 255, 1]])
Button:
size: 15, 15
background_normal: ""
size_hint: None, None
pos: 27, root.height - 17
background_color: [40/255, 168/255, 234/255, 1]
on_press: root.change_theme([[40/255, 168/255, 234/255, 1], [235 / 255, 245 / 255, 250 / 255, 1], [230 / 255, 230 / 255, 230 / 255, 1]])
Button:
size: 15, 15
background_normal: ""
size_hint: None, None
pos: 7, root.height - 37
background_color: [164/255, 55/255, 58/255, 1]
on_press: root.change_theme([[164/255, 55/255, 58/255, 1], [235 / 255, 245 / 255, 250 / 255, 1], [230 / 255, 230 / 255, 230 / 255, 1]])
Button:
size: 15, 15
background_normal: ""
size_hint: None, None
pos: 27, root.height - 37
background_color: [183/255, 71/255, 42/255, 1]
on_press: root.change_theme([[183/255, 71/255, 42/255, 1], [235 / 255, 245 / 255, 250 / 255, 1], [230 / 255, 230 / 255, 230 / 255, 1]])
Button:
size: 15, 15
background_normal: ""
size_hint: None, None
pos: 27, root.height - 57
background_color: [33/255, 115/255, 70/255, 1]
on_press: root.change_theme([[33/255, 115/255, 70/255, 1], [235 / 255, 245 / 255, 250 / 255, 1], [230 / 255, 230 / 255, 230 / 255, 1]])
Button:
size: 15, 15
background_normal: ""
size_hint: None, None
pos: 7, root.height - 57
background_color: [70/255, 71/255, 117/255, 1]
on_press: root.change_theme([[70/255, 71/255, 117/255, 1], [235 / 255, 245 / 255, 250 / 255, 1], [230 / 255, 230 / 255, 230 / 255, 1]])
GridLayout:
cols: 2
size_hint: (1, None)
height: 36
GridLayout:
cols:1
id: title_grid2
size_hint: (None, None)
height: 36
width: 52
ScrollView:
scroll_type: ['bars']
bar_width: '0dp'
scroll_wheel_distance: 0
scroll_x: scroll.scroll_x
effect_cls: 'ScrollEffect'
size_hint: (1, None)
height: 36
GridLayout:
id: title_grid
size_hint: (None, None)
width: self.minimum_width
spacing: [2, 1]
height: 36
GridLayout:
cols: 2
RecycleView:
id: scroll2
scroll_type: ['bars']
bar_width: '0dp'
scroll_wheel_distance: 0
effect_cls: 'ScrollEffect'
size_hint: (None, 1)
viewclass: 'JoButtonLabel'
width: 51
scroll_y: scroll.scroll_y
RecycleGridLayout:
id: rows_grid
cols: 1
size_hint: (None, None)
height: self.minimum_height
spacing: [2, 2]
width: 51
RecycleView:
id: scroll
scroll_type: ['bars']
bar_width: '10dp'
bar_color: root.theme[0]
scroll_wheel_distance: 50
effect_cls: 'ScrollEffect'
size_hint: (1, 1)
viewclass: 'JoTextInput'
smooth_scroll_end: 50
RecycleGridLayout:
id: cells_grid
cols: 1
size_hint: (None, None)
key_size: 'dyn_size'
size: self.minimum_size
spacing: [2, 2]
FloatLayout:
id: for_float
size_hint: None, None
size: 1, 1
<JoButton>:
state_image: self.background_normal if self.state == 'normal' else self.background_down
disabled_image: self.background_disabled_normal if self.state == 'normal' else self.background_disabled_down
background_normal: ''
background_color: ([235/255, 245/255, 250/255, 1] if not self.state == 'down' else (root.theme[0]))
color: (root.theme[0] if not self.state == 'down' else (1, 1, 1, 1))
size_hint: None, None
canvas:
####Rounded Border###
Color:
rgba: 230/255, 230/255, 230/255, 1
RoundedRectangle:
pos: self.x-6, self.y
size: self.width+12, self.height+7
radius: [10, 10, 0, 0]
###Rounded Upper-Border###
Color:
rgba: self.background_color
RoundedRectangle:
pos: self.x-4, self.y+1
size: self.width+8, self.height+4
radius: [10, 10, 0, 0]
###Text Drawing###
Color:
rgba: 1, 1, 1, 1
Rectangle:
texture: self.texture
size: self.texture_size
pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.)
<ReplaceButton>:
state_image: self.background_normal if self.state == 'normal' else self.background_down
disabled_image: self.background_disabled_normal if self.state == 'normal' else self.background_disabled_down
background_normal: ''
background_color: ([235/255, 245/255, 250/255, 1] if not self.state == 'down' else (root.theme[0]))
color: (root.theme[0] if not self.state == 'down' else (1, 1, 1, 1))
size_hint: None, None
canvas:
####Rounded Border###
Color:
rgba: 230/255, 230/255, 230/255, 1
RoundedRectangle:
pos: self.x-7, self.y-4
size: self.width+14, self.height+8
radius: [6, 6, 6, 6]
###Rounded Upper-Border###
Color:
rgba: self.background_color
RoundedRectangle:
pos: self.x-4, self.y-1
size: self.width+8, self.height+2
radius: [6, 6, 6, 6]
###Text Drawing###
Color:
rgba: 1, 1, 1, 1
Rectangle:
texture: self.texture
size: self.texture_size
pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.)
<FindTextInput>
padding: [0, 5, 0, 0]
canvas.before:
###Border###
Color:
rgba: 235/255, 245/255, 250/255, 1
Rectangle:
pos: self.x-3, self.y-3
size: self.width+6, self.height+6
###Upper Border###
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.x, self.y
size: self.width, self.height
###Curser Drawing###
Color:
rgba:
([29/255, 111/255, 66/255, 1]
if self.focus and not self._cursor_blink
else (0, 0, 0, 0))
Rectangle:
pos: [int(x) for x in self.cursor_pos]
size: root.cursor_width, -self.line_height
###Text Color###
Color:
rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color)
<JoButtonLabel>:
state_image: self.background_normal if self.state == 'normal' else self.background_down
disabled_image: self.background_disabled_normal if self.state == 'normal' else self.background_disabled_down
background_normal: ''
background_color: root.theme[0]
color: 1, 1, 1, 1
size_hint: None, None
canvas:
Color:
rgba: self.background_color
BorderImage:
border: self.border
pos: self.pos
size: self.size
source: self.disabled_image if self.disabled else self.state_image
Color:
rgba: 1, 1, 1, 1
Rectangle:
texture: self.texture
size: self.texture_size
pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.)
<JoTextInput>:
canvas.before:
###On-Focus Border###
Color:
rgba: (root.theme[0] if self.focus else (1, 1, 1, 1))
Rectangle:
pos: self.pos
size: self.size
###On-Focus Upper Border###
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.x+3, self.y+3
size: self.width-6, self.height-6
###Curser Drawing###
Color:
rgba:
([29/255, 111/255, 66/255, 1]
if self.focus and not self._cursor_blink
else (0, 0, 0, 0))
Rectangle:
pos: [int(x) for x in self.cursor_pos]
size: root.cursor_width, -self.line_height
###Text Color###
Color:
rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color)