Exemple #1
0
    def create_activity_label(self, activity):
        # Container
        cnf, pack = {}, {}

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

        label_container =\
            TKUtils.get_container(master=self.viewport, cnf=cnf, pack=pack)

        # Label
        cnf, pack = {}, {}

        cnf['text'] = activity['title']
        cnf['bg'] = 'blue'
        cnf['fg'] = 'white'
        cnf['width'] = 93
        cnf['height'] = 2

        pack['side'] = 'left'

        label_container.label =\
            TKUtils.get_label(master=label_container, cnf=cnf, pack=pack)

        # Raffle Button
        cnf, pack, defs = {}, {}, {}

        defs['type'] = 'activity'
        defs['value'] = activity

        cnf['text'] = 'O'
        cnf['bg'] = 'orange'
        cnf['width'] = 2
        cnf['command'] = lambda evt=None: self.commands['raffle'](defs=defs)

        pack['side'] = 'left'

        label_container.button =\
            TKUtils.get_button(master=label_container, cnf=cnf, pack=pack)

        # Remove Button
        cnf, pack = {}, {}

        cnf['text'] = 'X'
        cnf['bg'] = 'red'
        cnf['width'] = 2
        cnf['command'] =\
            lambda evt=None: self.commands['remove'](activity['activity_id'])

        pack['side'] = 'right'

        label_container.button =\
            TKUtils.get_button(master=label_container, cnf=cnf, pack=pack)

        self.label_list.append(label_container)
Exemple #2
0
    def create_group_button(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Grupos'
        cnf['bg'] = 'green'
        cnf['width'] = 14
        cnf['font'] = ('arial', 16, 'bold')
        cnf['command'] = self.commands['group']

        pack['side'] = 'left'

        self.group_button = TKUtils.get_button(master=self, cnf=cnf, pack=pack)
Exemple #3
0
    def create_activity_button(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Atividades'
        cnf['bg'] = 'blue'
        cnf['width'] = 24
        cnf['font'] = ('arial', 16, 'bold')
        cnf['command'] = self.commands['activity']

        pack['side'] = 'left'

        self.activity_button =\
            TKUtils.get_button(master=self, cnf=cnf, pack=pack)
Exemple #4
0
    def create_student_button(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Alunos'
        cnf['bg'] = 'red'
        cnf['width'] = 14
        cnf['font'] = ('arial', 16, 'bold')
        cnf['command'] = self.commands['student']

        pack['side'] = 'left'

        self.student_button =\
            TKUtils.get_button(master=self, cnf=cnf, pack=pack)
Exemple #5
0
    def _create_browse_file_button(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Procurar CSV'
        cnf['bg'] = 'green'
        cnf['width'] = 20
        cnf['command'] = self.commands['browse_file']

        pack['side'] = 'right'

        self.register_button = TKUtils.get_button(master=self,
                                                  cnf=cnf,
                                                  pack=pack)
Exemple #6
0
    def _create_raffle_button(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Sortear Aluno'
        cnf['bg'] = 'blue'
        cnf['width'] = 20
        cnf['command'] = self.commands['raffle']

        pack['side'] = 'left'

        self.raffle_button = TKUtils.get_button(master=self,
                                                cnf=cnf,
                                                pack=pack)
Exemple #7
0
    def _create_register_button(self):
        cnf, pack = {}, {}

        cnf['text'] = 'Cadastrar Atividade'
        cnf['bg'] = 'green'
        cnf['width'] = 20
        cnf['command'] = self.commands['register']

        pack['side'] = 'right'

        self.register_button = TKUtils.get_button(master=self,
                                                  cnf=cnf,
                                                  pack=pack)
Exemple #8
0
    def _create_confirm_button(self):
        cnf, pack = {}, {}

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

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

        self.confirm_button = TKUtils.get_button(master=self,
                                                 cnf=cnf,
                                                 pack=pack)
Exemple #9
0
    def _create_cancel_button(self):
        cnf, grid = {}, {}

        cnf['text'] = 'Cancelar'
        cnf['bg'] = 'red'
        cnf['command'] = self.commands['cancel']

        grid['row'] = 3
        grid['column'] = 0
        grid['sticky'] = 'W'
        grid['pady'] = 350 - self.winfo_screenmmheight()

        self.cancel_button = TKUtils.get_button(master=self,
                                                cnf=cnf,
                                                grid=grid)
Exemple #10
0
    def _create_submit_button(self):
        cnf, grid = {}, {}

        cnf['text'] = 'Salvar'
        cnf['bg'] = 'green'
        cnf['command'] = self.commands['submit']

        grid['row'] = 3
        grid['column'] = 1
        grid['sticky'] = 'E'
        grid['pady'] = 350 - self.winfo_screenmmheight()

        self.submit_button = TKUtils.get_button(master=self,
                                                cnf=cnf,
                                                grid=grid)
Exemple #11
0
    def create_student_label(self, student_name):
        # Container
        cnf, pack = {}, {}

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

        label_container =\
            TKUtils.get_container(master=self.viewport, cnf=cnf, pack=pack)

        # Label
        cnf, pack = {}, {}

        cnf['text'] = student_name
        cnf['bg'] = 'red'
        cnf['fg'] = 'white'
        cnf['width'] = 98
        cnf['height'] = 2

        pack['side'] = 'left'

        label_container.label =\
            TKUtils.get_label(master=label_container, cnf=cnf, pack=pack)

        # Raffle Button
        cnf, pack, defs = {}, {}, {}

        defs['type'] = 'student'
        defs['value'] = student_name

        cnf['text'] = 'O'
        cnf['bg'] = 'orange'
        cnf['width'] = 2
        cnf['command'] = lambda evt=None: self.commands['raffle'](defs=defs)

        pack['side'] = 'right'

        label_container.button =\
            TKUtils.get_button(master=label_container, cnf=cnf, pack=pack)

        self.label_list.append(label_container)