Example #1
0
 def refresh(self):
     c = Canvas(self.o)
     charheight = 16
     font = c.load_font("Fixedsys62.ttf", charheight)
     key_name = self.key_sequence[self.key_sequence_position][len("KEY_"):]
     c.centered_text("Press {}".format(key_name.lower().capitalize()),
                     font=font)
     self.o.display_image(c.get_image())
Example #2
0
def init():
    global columns, char_height, font1, mode, dir, degree, blink_count, waiting, help_page, values
    getcontext().prec = 15
    columns = 16  # display width in chars
    char_height = int(o.height / 4)
    c1 = Canvas(o)
    font1 = c1.load_font("Fixedsys62.ttf", char_height)
    mode = 0  # number1
    dir = +1  # move down
    degree = False  # radians
    blink_count = 0.0
    blink.clear()
    waiting.clear()
    help_page = 0
    values = Values()
Example #3
0
 def refresh(self):
     c = Canvas(self.o)
     charwidth = 20
     charheight = 32
     font = c.load_font("Fixedsys62.ttf", charheight)
     pin_width = len(self.pin) * charwidth
     x_offset = (self.o.width - pin_width) / 2
     y_offset = 15
     c.line((x_offset, y_offset + charheight, str(-x_offset),
             y_offset + charheight))
     c.line((x_offset, y_offset + charheight, x_offset,
             y_offset + charheight - 5))
     for x in range(len(self.pin)):
         i = x + 1
         if x in range(len(self.value)):
             c.text("*", (x_offset + charwidth * x, y_offset), font=font)
         c.line((x_offset + charwidth * i, y_offset + charheight,
                 x_offset + charwidth * i, y_offset + charheight - 5))
     self.o.display_image(c.get_image())