def print_header_box(self): if self.header_box == 'box': lft = self._left rt = self._right self._left = 275 self._right = 540 old_x, old_y = self.text_obj.getCursor() old_fnt = self.font old_fnt_size = self.font_size self.text_obj.setTextOrigin(self._left, 20 + self.spacing) self._x, self._y = self.text_obj.getCursor() self.headerflag=True for f in self._header_box: self.set_font(f[2][0], f[2][1]) if f[3]: f[1](self,f[0],f[3]) else: f[1](self,f[0]) self.headerflag=False x, y = self.text_obj.getCursor() Form._draw_box(self, self._left - 5, 20, self._right + 5, y + self.spacing/2.0) self._left = lft self._right = rt self.text_obj.setTextOrigin(old_x, self._y + self.spacing) self._x, self._y = self.text_obj.getCursor() self.set_font(old_fnt, old_fnt_size)
def form_name(self, name, font_name="Times-BoldItalic", font_size=20): Form.form_name(self, name, font_name, font_size) if self.header_box == 'form_name': if self.form_name_current is not None: self.remove_header_footer(self.form_name_current) self.set_header(self.fm_name, 'center',('Times-Bold', 12), True) self.form_name_current = self.fm_name
def __init__(self, *args, **kwargs): self.header_box = args[2].lower() self.multiline = args[1] name = args[0] Form.__init__(self,name, **kwargs) self._header_box = [] self.headerflag = False self.form_name_current = None
def __init__(self): self.path = [MainForm.name, TeacherForm.name,self.name] self.items = ['Attendance', 'Absence','Real-time Detail Records','Real-time Check in list','back'] Form.__init__(self, self.path, self.items)
def sql_element(self, text): Form.text_element(self, text, 2) self.multiline_check()
def dropdown_element(self, text, choices): Form.radio_element(self, text, choices) self.multiline_check()
def yesno_element(self, text): Form.radio_element(self, text, ['Yes','No']) self.multiline_check()
def descriptive_element(self, text): Form.text_element(self, text, 0) self.multiline_check()
def datetime_sec_mdy(self, question): Form.date_element(self, question, 'mmddyyyy') Form.time_element(self, '', 'hhmmss') self.multiline_check()
def time_mm_ss(self, question): Form.time_element(self, question, 'mmss') self.multiline_check()
def time_mm_ss(self, question): Form.time_element(self, question, 'mmss')
def time(self, question): Form.time_element(self, question, 'hhmm')
def date_dmy(self, question): Form.date_element(self, question, 'ddmmyyyy')
def date_ymd(self, question): Form.date_element(self, question, 'yyyymmdd')
def __init__(self): self.items = ['student login', 'teacher login', 'exit'] Form.__init__(self, self.path, self.items)
def __init__(self): self.path = [MainForm.name, self.name] self.items = ['start check in', 'update check in detail', 'history', 'progress','back'] Form.__init__(self, self.path, self.items)
def integer_element(self, question): Form.text_element(self, question, .5) self.multiline_check()
def __init__(self): self.path = [MainForm.name, TeacherForm.name, self.name] self.items = ['update once check in','back'] Form.__init__(self, self.path, self.items)
def datetime_mdy(self, question): Form.date_element(self, question, 'mmddyyyy') Form.time_element(self, '', 'hhmm')
def datetime_dmy(self, question): Form.date_element(self, question, 'ddmmyyyy') Form.time_element(self, '', 'hhmm') self.multiline_check()
def datetime_ymd(self, question): Form.date_element(self, question, 'yyyymmdd') Form.time_element(self, '', 'hhmm')
def datetime_sec_ymd(self, question): Form.date_element(self, question, 'yyyymmdd') Form.time_element(self, '', 'hhmmss') self.multiline_check()
def datetime_sec_dmy(self, question): Form.date_element(self, question, 'ddmmyyyy') Form.time_element(self, '', 'hhmmss')
def truefalse_element(self, text): Form.radio_element(self, text, ['True','False']) self.multiline_check()
def number_element(self, question): Form.text_element(self, question, 1) self.multiline_check()
def check_box_element(self, text, choices): Form.check_box_element(self, text, choices) self.multiline_check()
def text_element(self, question): Form.text_element(self, question, 2) self.multiline_check()
def note_element(self, text): Form.note_element(self, text, 3) self.multiline_check()
def new_page(self, break_text=False): if not self.is_new_page(): if len(self._header_box): self.print_header_box() Form.new_page(self,break_text)
def date_element(self, question): Form.date_element(self, question) self.multiline_check()
def __init__(self): self.path = [MainForm.name,TeacherForm.name,self.name] self.items = ['browse sum', 'browse detail file','browse once check in','back'] Form.__init__(self, self.path, self.items)
def date_ymd(self, question): Form.date_element(self, question, 'yyyymmdd') self.multiline_check()
def date_dmy(self, question): Form.date_element(self, question, 'ddmmyyyy') self.multiline_check()
def render(self): if len(self._header_box): self.print_header_box() return Form.render(self)
def time(self, question): Form.time_element(self, question, 'hhmm') self.multiline_check()
def __init__(self): self.path = [MainForm.name, self.name] self.items = ['join check in', 'back'] Form.__init__(self, self.path, self.items)
def __init__(self): self.path = [MainForm.name,TeacherForm.name,self.name] self.items = ['start auto check in', 'start manual check in','start random check in', 'back'] Form.__init__(self, self.path, self.items)