Esempio n. 1
0
    def __init__(self, campos: int = 2) -> None:
        super().__init__()

        self.defs.qtd_campos = campos
        self.defs.cnf['geometry'] = f'420x{180 + campos * 30}'

        self.subelemento.cancelar = TKUtils.obter_botao()
        self.subelemento.confirmar = TKUtils.obter_botao()
Esempio n. 2
0
    def __init__(self):
        super().__init__()

        self.defs.cnf['bd'] = 10
        self.defs.pack['expand'] = True
        self.defs.pack['side'] = 'bottom'

        self.subelemento.evento = TKUtils.obter_botao()
        self.subelemento.tarefa = TKUtils.obter_botao()
        self.subelemento.apresentacao = TKUtils.obter_botao()
Esempio n. 3
0
    def __init__(self):
        super().__init__()

        self.defs.pack['pady'] = 6
        self.defs.pack['side'] = 'top'

        self.elemento_ativo = ''
        self.subelemento.evento = TKUtils.obter_botao()
        self.subelemento.tarefa = TKUtils.obter_botao()
        self.subelemento.apresentacao = TKUtils.obter_botao()
Esempio n. 4
0
    def __init__(self):
        super().__init__()

        self.defs.pack['side'] = 'top'

        self.subelemento.home = TKUtils.obter_botao()
        self.subelemento.aluno = TKUtils.obter_botao()
        self.subelemento.grupo = TKUtils.obter_botao()
        self.subelemento.sobre = TKUtils.obter_botao()
        self.subelemento.atividade = TKUtils.obter_botao()

        self.elemento_ativo = ''
Esempio n. 5
0
    def __init__(self):
        super().__init__()

        self.defs.cnf['bd'] = 10
        self.defs.pack['expand'] = True
        self.defs.pack['side'] = 'bottom'

        self.subelemento.cadastrar = TKUtils.obter_botao()
Esempio n. 6
0
    def criar_botao_remover(self):
        botao = TKUtils.obter_botao()

        botao.defs.cnf['text'] = 'X'
        botao.defs.cnf['bg'] = 'red'
        botao.defs.cnf['bd'] = 4
        botao.defs.cnf['width'] = 2
        botao.defs.cnf['relief'] = 'raised'

        botao.defs.pack['side'] = 'right'

        return botao
Esempio n. 7
0
    def criar_botao_de_sorteio(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Sortear Grupo'
        cnf['bg'] = 'blue'
        cnf['width'] = 20
        cnf['command'] = self.eventos['sortear']

        pack['side'] = 'left'

        self.botao_de_sorteio =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 8
0
    def criar_botao_remover(self, master, id_do_elemento, cnf={}, pack={}):
        cnf['text'] = 'X'
        cnf['bg'] = 'red'
        cnf['width'] = 2
        cnf['command'] = lambda evt=None: self.eventos['remover'](
            id_do_elemento)

        pack['side'] = 'right'

        botao = TKUtils.obter_botao(master=master, cnf=cnf, pack=pack)

        return botao
Esempio n. 9
0
    def criar_botao_cadastrar(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Cadastrar Apresentação'
        cnf['bg'] = 'green'
        cnf['width'] = 30
        cnf['command'] = self.eventos['cadastrar']

        pack['side'] = 'left'

        self.botao_cadastrar =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 10
0
    def criar_botao_ordenar(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Ordenar Apresentações'
        cnf['bg'] = 'blue'
        cnf['width'] = 30
        cnf['command'] = self.eventos['ordenar']

        pack['side'] = 'left'

        self.botao_ordenar =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 11
0
    def criar_botao_de_carregar_arquivo(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Procurar CSV'
        cnf['bg'] = 'green'
        cnf['width'] = 20
        cnf['command'] = self.eventos['arquivo']

        pack['side'] = 'right'

        self.botao_de_carregar_arquivo =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 12
0
    def criar_botao_de_sorteio(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Sortear Atividade'
        cnf['bg'] = 'blue'
        cnf['width'] = 20
        cnf['command'] = lambda evt=None: self.eventos['sortear']({})

        pack['side'] = 'left'

        self.botao_de_sorteio =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 13
0
    def criar_botao_de_cadastro(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Gerar Grupos'
        cnf['bg'] = 'green'
        cnf['width'] = 20
        cnf['command'] = self.eventos['cadastrar']

        pack['side'] = 'right'

        self.botao_de_cadastro =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 14
0
    def criar_botao_sortear(self):
        botao = TKUtils.obter_botao()

        botao.defs.cnf['text'] = 'O'
        botao.defs.cnf['bg'] = 'orange'
        botao.defs.cnf['bd'] = 4
        botao.defs.cnf['width'] = 2
        botao.defs.cnf['relief'] = 'raised'

        botao.defs.pack['side'] = 'left'

        return botao
Esempio n. 15
0
    def criar_botao_confirmar(self):
        cnf, pack = {}, {}

        cnf['text'] = 'OK'
        cnf['bg'] = 'green'
        cnf['command'] = self.destroy

        pack['pady'] = 25
        pack['side'] = 'bottom'

        self.botao_confirmar =\
            TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 16
0
    def criar_botao_cancelar(self):
        cnf, grid = {}, {}

        cnf['text'] = 'Cancelar'
        cnf['bg'] = 'red'
        cnf['command'] = self.eventos['cancelar']

        grid['row'] = self.quantidade_de_campos
        grid['column'] = 0
        grid['sticky'] = 'W'

        self.botao_cancelar =\
            TKUtils.obter_botao(master=self.corpo, cnf=cnf, grid=grid)
Esempio n. 17
0
    def criar_botao_sobre(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Sobre'
        cnf['bg'] = 'grey'
        cnf['width'] = 14
        cnf['pady'] = 9
        cnf['font'] = ('times new roman', 15, 'bold')
        cnf['command'] = self.controller.evento_tela_sobre

        pack['side'] = 'left'

        self.botao_sobre = TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 18
0
    def criar_botao_aluno(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Alunos'
        cnf['bg'] = 'red'
        cnf['width'] = 14
        cnf['pady'] = 9
        cnf['font'] = ('times new roman', 15, 'bold')
        cnf['command'] = self.controller.evento_tela_aluno

        pack['side'] = 'left'

        self.botao_aluno = TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 19
0
    def criar_botao_home(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Home'
        cnf['bg'] = 'orange'
        cnf['width'] = 28
        cnf['pady'] = 9
        cnf['font'] = ('times new roman', 15, 'bold')
        cnf['command'] = self.controller.evento_tela_home

        pack['side'] = 'left'

        self.botao_home = TKUtils.obter_botao(master=self, cnf=cnf, pack=pack)
Esempio n. 20
0
    def criar_botao_confirmar(self):
        cnf, grid = {}, {}

        cnf['text'] = self.texto
        cnf['bg'] = 'green'
        cnf['command'] = self.eventos['confirmar']

        grid['row'] = self.quantidade_de_campos
        grid['column'] = 1
        grid['sticky'] = 'E'
        grid['pady'] = 200 - self.quantidade_de_campos * 24

        self.botao_confirmar =\
            TKUtils.obter_botao(master=self.corpo, cnf=cnf, grid=grid)
Esempio n. 21
0
    def criar_botao_sortear(self, master, valor, cnf={}, pack={}):
        desativado = isinstance(valor, dict) and valor['em_uso']

        cnf['text'] = 'O'
        cnf['bg'] = 'grey' if desativado else 'orange'
        cnf['state'] = 'disabled' if desativado else 'normal'
        cnf['width'] = 2
        cnf['command'] = lambda evt=None: self.eventos['sortear'](valor=valor)

        pack['side'] = 'left'

        botao = TKUtils.obter_botao(master=master, cnf=cnf, pack=pack)

        return botao