Beispiel #1
0
    def _create_activity_label(self):
        cnf, pack = {}, {}

        cnf['text'] = f'Atividade: {self.activity_title}'
        cnf['bd'] = 4
        cnf['fg'] = 'blue'
        cnf['font'] = ('arial', 16, 'bold')

        self.activity_label =\
            TKUtils.get_label(master=self.container, cnf=cnf, pack=pack)
Beispiel #2
0
    def _create_student_label(self):
        cnf, pack = {}, {}

        cnf['text'] = f'Aluno: {self.student_name}'
        cnf['bd'] = 4
        cnf['fg'] = 'red'
        cnf['font'] = ('arial', 16, 'bold')

        self.student_label =\
            TKUtils.get_label(master=self.container, cnf=cnf, pack=pack)
Beispiel #3
0
    def _create_error_label(self):
        cnf, pack = {}, {}

        cnf['text'] = self.error_msg
        cnf['fg'] = 'red'
        cnf['font'] = ('arial', 16, 'bold')

        pack['pady'] = 10

        self.error_label = TKUtils.get_label(master=self, cnf=cnf, pack=pack)
Beispiel #4
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)
Beispiel #5
0
    def _create_title_field(self):
        cnf, grid = {}, {}

        cnf['text'] = 'Titulo'
        cnf['pady'] = 4

        grid['row'] = 0
        grid['column'] = 0
        grid['sticky'] = 'W'

        self.title_field['label'] =\
            TKUtils.get_label(master=self, cnf=cnf, grid=grid)

        cnf, grid = {}, {}

        grid['row'] = 0
        grid['column'] = 1

        self.title_field['input'] =\
            TKUtils.get_input(master=self, cnf=cnf, grid=grid)
Beispiel #6
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)
Beispiel #7
0
    def _create_desc_field(self):
        cnf, grid = {}, {}

        cnf['text'] = 'Descrição'
        cnf['pady'] = 4

        grid['row'] = 1
        grid['column'] = 0
        grid['sticky'] = 'W'

        self.desc_field['label'] = TKUtils.get_label(master=self,
                                                     cnf=cnf,
                                                     grid=grid)

        cnf, grid = {}, {}

        grid['row'] = 1
        grid['column'] = 1

        self.desc_field['input'] = TKUtils.get_input(master=self,
                                                     cnf=cnf,
                                                     grid=grid)
Beispiel #8
0
    def __init__(self, master):
        super().__init__(master=master)
        self.pack()

        label_temp = TKUtils.get_label(master=self, cnf={'text': 'Grupos'})