diff --git a/README.md b/README.md index f39ce9f..8f2d1e1 100644 --- a/README.md +++ b/README.md @@ -49,21 +49,116 @@ menuItems = [("first item", first), button_mappings = {"prev_btn":prev_btn, "next_btn": next_btn, "ok_btn": ok_btn} ``` -| Result | Code | -| --------- | ------- | -| ![No title, first item & cycling on -> up & down, vertical scrolling](images/2x16-title-vertical-up-down-cycling.jpg) | ```python -menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=True, hide_menu_name=True, name="Fullscreen!") + +
Cycling | +Title shown | +Scroll direction | +Initial selection | +Result | +Code | +
---|---|---|---|---|---|
yes | +no | +vertical | +first | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=True, hide_menu_name=True) menu.setup(menuItems) -menu.run() -``` | -| ![No title, first item & no cycling -> only down, vertical scrolling](images/2x16-no-title-vertical-only-down.jpg) | | -| ![No title, middle item -> up & down, vertical scrolling](images/2x16-no-title-vertical-up-down.jpg) | | -| ![No title, last item & no cycling -> only up, vertical scrolling](images/2x16-no-title-vertical-only-up.jpg) | | -| ![With title, only one option, vertical scrolling](images/2x16-title-vertical-no-options.jpg) | | -| ![With title, first item & no cycling -> only down, vertical scrolling](images/2x16-title-vertical-only-down.jpg) | | -| ![With title, middle item -> up & down, vertical scrolling](images/2x16-title-vertical-up-down.jpg) | | -| ![With title, last item & no cycling -> only up, vertical scrolling](images/2x16-title-vertical-only-up.jpg) | | -| ![With title, middle item -> forward and backward, horizontal scrolling](images/2x16-title-horizontal.jpg) | | +menu.run() |
+
no | +no | +vertical | +first | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=True) # <- change of cycle to False! +menu.setup(menuItems) +menu.run() |
+
no | +no | +vertical | +middle | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=True +menu.setup(menuItems, start_selection=1) # <- change of the initial selection +menu.run() |
+
no | +no | +vertical | +last | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=True) +menu.setup(menuItems, start_selection=2) # <- set initial selection to the last element +menu.run() |
+
no | +yes | +vertical | +no options (first and last) | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=False, name="No options!") # now with a title +menu.setup([("Only option", lambda: print("Only option chosen!"))]) # now with only one option (ignoring menuItems!) +menu.run() |
+
no | +yes | +vertical | +first | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=False, name="No options!") +menu.setup(menuItems) # now with menuItems again +menu.run() |
+
no | +yes | +vertical | +middle | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=False, name="lcdMenu!") +menu.setup(menuItems, start_selection=1) # now with an index again +menu.run() |
+
no | +yes | +vertical | +last | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=False, cycle=False, hide_menu_name=False, name="lcdMenu!") +menu.setup(menuItems, start_selection=2) # <- set initial selection to the last element +menu.run() |
+
yes | +yes | +horizontal | +first | ++ | +menu = lcdMenu(LCD, button_mappings, scroll_direction=True, cycle=True, hide_menu_name=False, name="lcdMenu!") +menu.setup(menuItems) +menu.run() |
+