menu: enhancements

- changes that make easier to use menu as module UI
- new helper method for delayed callbacks
- method for getting the menu instance from display
- new action for sending menu:action events
- allow_without_selection option for cards

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
This commit is contained in:
Janar Sööt
2018-12-20 21:09:19 +02:00
committed by Kevin O'Connor
parent 005cbe157a
commit 0cbe851777
3 changed files with 120 additions and 26 deletions

View File

@@ -49,6 +49,9 @@ class PrinterLCD:
self.gcode.register_command('M117', self.cmd_M117)
# Start screen update timer
self.reactor.update_timer(self.screen_update_timer, self.reactor.NOW)
# Get menu instance
def get_menu(self):
return self.menu
# Graphics drawing
def animate_glyphs(self, eventtime, x, y, glyph_name, do_animate):
frame = do_animate and int(eventtime) & 1