-
Notifications
You must be signed in to change notification settings - Fork 0
/
myapp.kv
93 lines (80 loc) · 2.41 KB
/
myapp.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
#:kivy 1.1.0
Root:
text_input: text_input
label_wid: file_info
label_modified: is_modified
BoxLayout:
orientation: 'vertical'
BoxLayout:
ScrollView:
id: offset
TextInput:
id: text_input
text: 'Agregue valor ao seu codigo com Python, pois ele nao usa chaves.'
multiline: True
size_hint: 1, None
height: max( (len(self._lines)+1) * self.line_height, offset.height)
BoxLayout:
size_hint_y: None
height: 30
Button:
text: 'Abrir...'
on_release: root.open_dialog()
Button:
text: 'Salvar'
on_press: root.save_dialog()
BoxLayout:
size_hint_y: None
height: 30
Label:
id: file_info
height: 30
width:300
halign: 'center'
text: '--'
size_hint: (0, 0)
Label:
id: is_modified
height: 30
halign: 'right'
text: '--'
size_hint: (0, 0)
<OpenDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancelar"
on_release: root.cancel()
Button:
text: "Abrir"
on_release: root.load(filechooser.path, filechooser.selection)
<SaveDialog>:
text_input: text_input
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
on_selection: text_input.text = self.selection and self.selection[0] or ''
TextInput:
id: text_input
size_hint_y: None
height: 30
multiline: False
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancelar"
on_release: root.cancel()
Button:
text: "Salvar"
on_release: root.save(filechooser.path, text_input.text)