Programmierung Alarmfunktion
This commit is contained in:
@@ -312,3 +312,5 @@ class Anchor(Page):
|
||||
self.draw_normal(ctx)
|
||||
else:
|
||||
self.draw_config(ctx)
|
||||
if self._bd.alarm:
|
||||
self.draw_alarm(ctx)
|
||||
|
||||
@@ -208,6 +208,20 @@ class Page():
|
||||
ctx.show_text(self.buttonlabel[i+1])
|
||||
ctx.stroke()
|
||||
|
||||
def draw_alarm(self, ctx):
|
||||
x, y, w, h = (50, 100, 300, 150)
|
||||
ctx.set_line_width(1)
|
||||
ctx.set_source_rgb(*self.fgcolor)
|
||||
ctx.rectangle(x + 0.5, y + 0.5, w, h)
|
||||
ctx.stroke()
|
||||
ctx.set_source_rgb(*self.bgcolor)
|
||||
ctx.rectangle(x + 1, y + 1, w - 1, h - 1)
|
||||
ctx.fill()
|
||||
ctx.set_source_rgb(*self.fgcolor)
|
||||
ctx.set_line_width(2)
|
||||
ctx.rectangle(x + 3, y + 3, w - 5, h - 5)
|
||||
ctx.stroke()
|
||||
|
||||
def clear(self):
|
||||
ctx.set_source_rgb(1, 1, 1)
|
||||
ctx.rectangle(0, 0, 399, 299)
|
||||
|
||||
Reference in New Issue
Block a user