issue #536, fixed selecton list (full buffer example)

This commit is contained in:
kraus 2018-03-11 16:18:31 +01:00
parent eb6b79f023
commit f2d31558fd
1 changed files with 17 additions and 6 deletions

View File

@ -198,7 +198,10 @@ void setup(void) {
// DOGM128 Shield (http://shieldlist.org/schmelle2/dogm128) + DOGXL160 Shield
// u8x8.begin(/* menu_select_pin= */ 2, /* menu_next_pin= */ 3, /* menu_prev_pin= */ 7, /* menu_home_pin= */ 8);
// MKR Zero Test Board
// u8g2.begin(/*Select=*/ 0, /*Right/Next=*/ 1, /*Left/Prev=*/ 2, /*Up=*/ 4, /*Down=*/ 3, /*Home/Cancel=*/ A6);
// Arduboy
//u8g2.begin(/*Select=*/ A0, /*Right/Next=*/ 5, /*Left/Prev=*/ 9, /*Up=*/ 8, /*Down=*/ 10, /*Home/Cancel=*/ A1); // Arduboy DevKit
u8g2.begin(/*Select=*/ 7, /*Right/Next=*/ A1, /*Left/Prev=*/ A2, /*Up=*/ A0, /*Down=*/ A3, /*Home/Cancel=*/ 8); // Arduboy 10 (Production)
@ -228,11 +231,19 @@ void loop(void) {
current_selection,
string_list);
u8g2.userInterfaceMessage(
"Selection:",
u8x8_GetStringLineStart(current_selection, string_list ),
"",
" ok \n cancel ");
if ( current_selection == 0 ) {
u8g2.userInterfaceMessage(
"Nothing selected.",
"",
"",
" ok ");
} else {
u8g2.userInterfaceMessage(
"Selection:",
u8x8_GetStringLineStart(current_selection-1, string_list ),
"",
" ok \n cancel ");
}
}