class Tarefas(Screen):
tarefas = []
cmds = []
def add_Widget_popup(self, *args):
tAux = self.ids.tAux.text
cAux = self.ids.cAux.text
if(tAux != ''):
pass
else:
tAux = '[color=ff3333]Sem descrição[/color]'
if(cAux != ''):
pass
else:
cAux = '[color=ff3333]##[/color]'
self.ids.box.add_widget(Tarefa(text = tAux, pText=cAux))
self.tarefas.append(tAux)
self.cmds.append(cAux)
self.saveData()
def addWidget(self, *args):
box2 = BoxLayout(orientation='vertical', padding=10, spacing=10)
Inputs = BoxLayout(padding=5, spacing = 10, orientation = 'vertical')
pop2 = Popup(title='Adicionar Comando', content=box2, size_hint=(None, None), size=(100, 30))
tlInput = Label(text = 'Descrição:', size_hint_y = None, height = 20)
tInput = TextInput(id='tAux', multiline = False, size_hint_y = None, height = 30)
clInput = Label(text = 'Comando:', size_hint_y = None, height = 20)
cInput = TextInput(id='cAux', multiline = False, size_hint_y = None, height = 30)
confirm = Botao(text = 'Confirmar', on_press=self.add_Widget_popup, on_release=pop2.dismiss)
Inputs.add_widget(tlInput)
Inputs.add_widget(tInput)
Inputs.add_widget(clInput)
Inputs.add_widget(cInput)
Inputs.add_widget(confirm)
box2.add_widget(Inputs)
anim = Animation(size=(500, 250), duration=0.05, t='out_back')
anim.start(pop2)
pop2.open()