Esempio n. 1
0
    def inicializar_devs(self):
        def criar_label(master, texto):
            label = TKUtils.obter_label()
            label.defs.cnf['text'] = texto
            label.defs.cnf['width'] = 200
            label.defs.mcnf['fz'] = 18
            label.iniciar(master=master)

        devs = TKUtils.obter_container(instanciar=True)
        devs.defs.pack['pady'] = 6
        devs.iniciar(master=self)

        label = TKUtils.obter_label()
        label.defs.cnf['text'] = 'Desenvolvedores'
        label.defs.mcnf['fz'] = 24
        label.defs.pack['padx'] = 20
        label.defs.pack['side'] = 'left'
        label.iniciar(master=devs)

        membros = TKUtils.obter_container(instanciar=True)
        membros.defs.cnf['bd'] = 4
        membros.defs.cnf['bg'] = 'grey'
        membros.defs.pack['side'] = 'right'
        membros.iniciar(master=devs)

        criar_label(membros, 'Paulo Ricardo: github.com/paulloclara')
        criar_label(membros, 'Josivan Cardoso: github.com/josivancs')
        criar_label(membros, 'Weslley Isidorio: github.com/weslleyisidorio')
Esempio n. 2
0
    def criar_container(self):
        cnf = {}
        cnf['bd'] = 10

        self.container = TKUtils.obter_container(master=self, cnf=cnf)

        self.criar_label_de_erro()
        self.criar_botao_confirmar()
Esempio n. 3
0
    def criar_container(self, master):
        cnf = {}

        cnf['bd'] = 1
        cnf['bg'] = 'grey'

        container = TKUtils.obter_container(master=master, cnf=cnf)

        return container
Esempio n. 4
0
class Filtro(TKUtils.obter_container()):
    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()

    def iniciar(self, master):
        super().iniciar(master=master)

        self.inicializar_botao_evento()
        self.inicializar_botao_tarefa()
        self.inicializar_botao_apresentacao()

    def desativar_(self, elemento: str):
        getattr(self.subelemento, elemento).desativar()

        if self.elemento_ativo:
            getattr(self.subelemento, self.elemento_ativo).ativar()

        self.elemento_ativo = elemento

    def inicializar_botao_tarefa(self):
        self.subelemento.tarefa.defs.cnf['text'] = 'Tarefa'
        self.subelemento.tarefa.defs.cnf['bg'] = 'blue'
        self.subelemento.tarefa.defs.cnf['width'] = 8
        self.subelemento.tarefa.defs.cnf['pady'] = 2

        self.subelemento.tarefa.defs.pack['side'] = 'left'

        self.subelemento.tarefa.iniciar(master=self)

    def inicializar_botao_apresentacao(self):
        self.subelemento.apresentacao.defs.cnf['text'] = 'Apresentação'
        self.subelemento.apresentacao.defs.cnf['bg'] = 'green'
        self.subelemento.apresentacao.defs.cnf['width'] = 14
        self.subelemento.apresentacao.defs.cnf['pady'] = 2

        self.subelemento.apresentacao.defs.pack['side'] = 'right'

        self.subelemento.apresentacao.iniciar(master=self)

    def inicializar_botao_evento(self):
        self.subelemento.evento.defs.cnf['text'] = 'Evento'
        self.subelemento.evento.defs.cnf['bg'] = 'orange'
        self.subelemento.evento.defs.cnf['width'] = 8
        self.subelemento.evento.defs.cnf['pady'] = 2

        self.subelemento.evento.defs.pack['side'] = 'right'

        self.subelemento.evento.iniciar(master=self)
Esempio n. 5
0
    def criar_elemento(self, dados, integrantes=False):
        instanciar = True

        elemento = TKUtils.obter_container(instanciar)
        elemento.subelemento.primario = TKUtils.obter_container(instanciar)
        elemento.subelemento.secundario = TKUtils.obter_container(instanciar)

        elemento.defs.cnf['bd'] = 2
        elemento.defs.cnf['bg'] = 'grey'
        elemento.defs.cnf['relief'] = 'ridge'

        elemento.dados = dados

        elemento.subelemento.primario.defs.cnf['bd'] = 1
        elemento.subelemento.primario.defs.cnf['bg'] = 'grey'
        elemento.subelemento.primario.defs.cnf['relief'] = 'ridge'

        elemento.subelemento.primario.defs.pack['side'] = 'top'

        elemento.subelemento.secundario.defs.cnf['bd'] = 1
        elemento.subelemento.secundario.defs.cnf['bg'] = 'grey'
        elemento.subelemento.secundario.defs.cnf['relief'] = 'ridge'

        elemento.subelemento.secundario.defs.pack['side'] = 'bottom'

        if integrantes:
            elemento.subelemento.integrantes =\
                TKUtils.obter_container(instanciar)
            elemento.subelemento.integrantes.defs.cnf['bd'] = 1
            elemento.subelemento.integrantes.defs.cnf['bg'] = 'grey'
            elemento.subelemento.integrantes.defs.cnf['relief'] = 'ridge'
            elemento.subelemento.integrantes.lista = []

        elemento.iniciar(master=self.viewport)

        return elemento
Esempio n. 6
0
class Aluno(TKUtils.obter_container()):
    def __init__(self):
        super().__init__()

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

        self.actions = Actions()
        self.listagem = ListaDeAlunos()

    def iniciar(self, master):
        super().iniciar(master=master)

        self.actions.iniciar(master=self)
        self.listagem.iniciar(master=self)

        self.ocultar()
Esempio n. 7
0
class Actions(TKUtils.obter_container()):
    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()

    def iniciar(self, master):
        super().iniciar(master=master)

        self.inicializar_botao_cadastro_evento()
        self.inicializar_botao_cadastro_tarefa()
        self.inicializar_botao_cadastro_apresentacao()

    def inicializar_botao_cadastro_apresentacao(self):
        self.subelemento.apresentacao.defs.cnf['text'] =\
            'Cadastrar Apresentação'
        self.subelemento.apresentacao.defs.cnf['bg'] = 'green'
        self.subelemento.apresentacao.defs.cnf['width'] = 26

        self.subelemento.apresentacao.defs.pack['side'] = 'right'

        self.subelemento.apresentacao.iniciar(master=self)

    def inicializar_botao_cadastro_tarefa(self):
        self.subelemento.tarefa.defs.cnf['text'] = 'Cadastrar Tarefa'
        self.subelemento.tarefa.defs.cnf['bg'] = 'blue'
        self.subelemento.tarefa.defs.cnf['width'] = 20

        self.subelemento.tarefa.defs.pack['side'] = 'left'

        self.subelemento.tarefa.iniciar(master=self)

    def inicializar_botao_cadastro_evento(self):
        self.subelemento.evento.defs.cnf['text'] = 'Cadastrar Evento'
        self.subelemento.evento.defs.cnf['bg'] = 'orange'
        self.subelemento.evento.defs.cnf['width'] = 20

        self.subelemento.evento.defs.pack['side'] = 'right'

        self.subelemento.evento.iniciar(master=self)
Esempio n. 8
0
class Home(TKUtils.obter_container()):
    def __init__(self):
        super().__init__()

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

        self.filtro = Filtro()
        self.actions = Actions()
        self.listagem = ListaDeElementos()
        self.cadastro_evento = FormularioEvento()
        self.cadastro_tarefa = FormularioTarefa()
        self.cadastro_apresentacao = FormularioApresentacao()

    def iniciar(self, master):
        super().iniciar(master=master)

        self.filtro.iniciar(master=self)
        self.actions.iniciar(master=self)
        self.listagem.iniciar(master=self)

        self.ocultar()
Esempio n. 9
0
class Actions(TKUtils.obter_container()):
    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()

    def iniciar(self, master):
        super().iniciar(master=master)

        self.inicializar_botao_cadastro()

    def inicializar_botao_cadastro(self):
        self.subelemento.cadastrar.defs.cnf['text'] = 'Cadastrar Atividade'
        self.subelemento.cadastrar.defs.cnf['bg'] = 'green'
        self.subelemento.cadastrar.defs.cnf['width'] = 20

        self.subelemento.cadastrar.defs.pack['side'] = 'right'

        self.subelemento.cadastrar.iniciar(master=self)
Esempio n. 10
0
class Actions(TKUtils.obter_container()):
    def __init__(self):
        super().__init__()

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

        self.subelemento.arquivo = TKUtils.obter_botao()

    def iniciar(self, master):
        super().iniciar(master=master)

        self.inicializar_botao_carregar_arquivo()

    def inicializar_botao_carregar_arquivo(self):
        self.subelemento.arquivo.defs.cnf['text'] = 'Procurar CSV'
        self.subelemento.arquivo.defs.cnf['bg'] = 'green'
        self.subelemento.arquivo.defs.cnf['width'] = 20

        self.subelemento.arquivo.defs.pack['side'] = 'right'

        self.subelemento.arquivo.iniciar(master=self)
Esempio n. 11
0
class Sobre(TKUtils.obter_container()):
    def __init__(self):
        super().__init__()

        self.defs.pack['padx'] = 20

    def iniciar(self, master):
        super().iniciar(master=master)

        self.inicializar_infos()
        self.inicializar_repositorio()
        self.inicializar_devs()

        self.ocultar()

    def inicializar_infos(self):
        infos = TKUtils.obter_mensagem()
        infos.defs.cnf['text'] = (
            'Projeto referente à disciplina de ' +
            'Engenharia de Software I do Instituto Federal do Piauí - IFPI')
        infos.defs.cnf['width'] = 700
        infos.defs.mcnf['fz'] = 18
        infos.defs.pack['padx'] = 20
        infos.defs.pack['pady'] = 20
        infos.iniciar(master=self)

    def inicializar_devs(self):
        def criar_label(master, texto):
            label = TKUtils.obter_label()
            label.defs.cnf['text'] = texto
            label.defs.cnf['width'] = 200
            label.defs.mcnf['fz'] = 18
            label.iniciar(master=master)

        devs = TKUtils.obter_container(instanciar=True)
        devs.defs.pack['pady'] = 6
        devs.iniciar(master=self)

        label = TKUtils.obter_label()
        label.defs.cnf['text'] = 'Desenvolvedores'
        label.defs.mcnf['fz'] = 24
        label.defs.pack['padx'] = 20
        label.defs.pack['side'] = 'left'
        label.iniciar(master=devs)

        membros = TKUtils.obter_container(instanciar=True)
        membros.defs.cnf['bd'] = 4
        membros.defs.cnf['bg'] = 'grey'
        membros.defs.pack['side'] = 'right'
        membros.iniciar(master=devs)

        criar_label(membros, 'Paulo Ricardo: github.com/paulloclara')
        criar_label(membros, 'Josivan Cardoso: github.com/josivancs')
        criar_label(membros, 'Weslley Isidorio: github.com/weslleyisidorio')

    def inicializar_repositorio(self):
        label = TKUtils.obter_label()
        label.defs.cnf['text'] = 'Stuki: github.com/paulloclara/stuki'
        label.defs.mcnf['fz'] = 16
        label.defs.pack['pady'] = 10
        label.defs.pack['side'] = 'bottom'
        label.iniciar(master=self)
Esempio n. 12
0
 def criar_corpo(self):
     self.corpo = TKUtils.obter_container(master=self, cnf={'bd': 10})
Esempio n. 13
0
 def criar_container(self):
     return TKUtils.obter_container(master=self)
Esempio n. 14
0
class Navbar(TKUtils.obter_container()):
    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 = ''

    def iniciar(self, master):
        super().iniciar(master=master)

        self.inicializar_botao_aluno()
        self.inicializar_botao_grupo()
        self.inicializar_botao_home()
        self.inicializar_botao_atividade()
        self.inicializar_botao_sobre()

    def desativar_(self, elemento: str):
        if self.elemento_ativo:
            getattr(self.subelemento, self.elemento_ativo).ativar()

        getattr(self.subelemento, elemento).desativar()

        self.elemento_ativo = elemento

    def inicializar_botao_home(self):
        self.subelemento.home.defs.cnf['text'] = 'Home'
        self.subelemento.home.defs.cnf['bg'] = 'orange'
        self.subelemento.home.defs.cnf['width'] = 28
        self.subelemento.home.defs.cnf['pady'] = 9
        self.subelemento.home.defs.cnf['bd'] = 1
        self.subelemento.home.defs.mcnf['fz'] = 15

        self.subelemento.home.defs.pack['side'] = 'left'

        self.subelemento.home.iniciar(master=self)

    def inicializar_botao_aluno(self):
        self.subelemento.aluno.defs.cnf['text'] = 'Alunos'
        self.subelemento.aluno.defs.cnf['bg'] = 'red'
        self.subelemento.aluno.defs.cnf['width'] = 14
        self.subelemento.aluno.defs.cnf['pady'] = 9
        self.subelemento.aluno.defs.cnf['bd'] = 1
        self.subelemento.aluno.defs.mcnf['fz'] = 15

        self.subelemento.aluno.defs.pack['side'] = 'left'

        self.subelemento.aluno.iniciar(master=self)

    def inicializar_botao_atividade(self):
        self.subelemento.atividade.defs.cnf['text'] = 'Atividades'
        self.subelemento.atividade.defs.cnf['bg'] = 'blue'
        self.subelemento.atividade.defs.cnf['width'] = 14
        self.subelemento.atividade.defs.cnf['pady'] = 9
        self.subelemento.atividade.defs.cnf['bd'] = 1
        self.subelemento.atividade.defs.mcnf['fz'] = 15

        self.subelemento.atividade.defs.pack['side'] = 'left'

        self.subelemento.atividade.iniciar(master=self)

    def inicializar_botao_grupo(self):
        self.subelemento.grupo.defs.cnf['text'] = 'Grupos'
        self.subelemento.grupo.defs.cnf['bg'] = 'green'
        self.subelemento.grupo.defs.cnf['width'] = 14
        self.subelemento.grupo.defs.cnf['pady'] = 9
        self.subelemento.grupo.defs.cnf['bd'] = 1
        self.subelemento.grupo.defs.mcnf['fz'] = 15

        self.subelemento.grupo.defs.pack['side'] = 'left'

        self.subelemento.grupo.iniciar(master=self)

    def inicializar_botao_sobre(self):
        self.subelemento.sobre.defs.cnf['text'] = 'Sobre'
        self.subelemento.sobre.defs.cnf['bg'] = '#FFD700'
        self.subelemento.sobre.defs.cnf['width'] = 14
        self.subelemento.sobre.defs.cnf['pady'] = 9
        self.subelemento.sobre.defs.cnf['bd'] = 1
        self.subelemento.sobre.defs.mcnf['fz'] = 15

        self.subelemento.sobre.defs.pack['side'] = 'left'

        self.subelemento.sobre.iniciar(master=self)