-
Notifications
You must be signed in to change notification settings - Fork 0
/
randomstudent.kv
194 lines (129 loc) · 5.31 KB
/
randomstudent.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
#:import Factory kivy.factory.Factory
#:import Window kivy.core.window.Window
#:import os os
<MainScreen>:
pantalla: caja
BoxLayout:
id: caja
orientation: 'vertical'
padding: [self.height*0.2,0]
canvas.before:
Color:
rgba: 251/255, 192/255, 93/255,1
Rectangle:
pos: self.pos
size: self.size
Label:
size_hint_y: 3
halign: 'center'
valign: 'middle'
font_name: os.path.join(os.getcwd(),'fonts','AUBREY1.ttf')
font_size: 0.25*self.height
text: "Alumno\nRandom"
BoxLayout:
orientation: 'vertical'
RelativeLayout:
Label:
pos_hint: {'center_y': .5, 'center_x': .2}
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.height
color: 32/255, 20/255, 76/255, 1
text: "Alumnos:"
AlignedTextInput:
size_hint: None, None
width: 0.3*self.parent.width
height: self.minimum_height
pos_hint: {'center_y': .5, 'center_x': .8}
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.parent.height
color: 32/255, 20/255, 76/255, 1
multiline: False
halign: 'center'
input_type: 'number'
input_filter: 'int'
text: str(root.alumnos) if not root.alumnos==0 else ''
on_focus: root.alumnos_text(self, self.focus)
Button:
text: "Sortear"
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.height
on_press: root.sortear()
RelativeLayout:
Button:
size_hint: None, None
width: 0.8*self.parent.width
height: 0.5*self.parent.height
pos_hint: {'y': 0, 'center_x': .5}
text: "Resetear"
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.25*self.height
on_release: Factory.ResetPopup().open()
<ResetPopup>:
size_hint: None, None
width: 0.7*Window.width
height: 0.4*Window.height
title: "Resetear"
title_font: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
title_size: 0.08*self.height
auto_dismiss: False
BoxLayout:
orientation: 'vertical'
Label:
size_hint_y: 3
pos_hint: {'center_y': .5, 'center_x': .5}
valign: 'middle'
haling: 'center'
text_size: self.size
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.15*self.height
text: "¿Está seguro que desea restaurar todas las probabilidades?"
BoxLayout:
Button:
text: 'Sí'
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.height
on_press: root.dismiss(); root.resetear()
Button:
text: 'No'
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.height
on_press: root.dismiss()
<ErrorPopup@Popup>:
size_hint: None, None
width: 0.7*Window.width
height: 0.4*Window.height
title: "Error"
title_font: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
title_size: 0.08*self.height
Label:
size_hint_y: 3
pos_hint: {'center_y': .5, 'center_x': .5}
valign: 'middle'
haling: 'center'
text_size: self.size
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.05*self.height
text: "Debe introducir antes el número de alumnos"
<Sorteo>:
orientation: 'vertical'
canvas.before:
Color:
rgba: 251/255, 192/255, 93/255,1
Rectangle:
size: self.size
pos: self.pos
Label:
text: str(root.N)
font_name: os.path.join(os.getcwd(),'fonts','Sugar & Vinegar.ttf')
font_size: 0.5*self.height
size_hint_y: 5
Button:
text: 'Aceptar'
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.height
on_press: root.aceptar(); root.parent.close()
Button:
text: 'Rechazar'
font_name: os.path.join(os.getcwd(),'fonts','Blokletters-Balpen.ttf')
font_size: 0.3*self.height
on_press: root.parent.close()