From dd3813157066fbcc82d3434c7ca606a68a0a1144 Mon Sep 17 00:00:00 2001 From: "K.Ohta" Date: Fri, 6 Sep 2013 01:16:01 +0900 Subject: [PATCH] [UI][HELP] Add help for User freq. --- helps.c | 81 ++++++++++++++++++++++++++++++++++++++++++------------- helps.h | 2 +- menu_memoryfreq.c | 5 +++- 3 files changed, 68 insertions(+), 20 deletions(-) diff --git a/helps.c b/helps.c index 480f284..fbbb26c 100644 --- a/helps.c +++ b/helps.c @@ -29,34 +29,47 @@ #include "menu.h" #include "power.h" #include "commondef.h" +#if 0 +const char *userfreq_helpstr[16] = { +#else +const char *userfreq_helpstr[10] = { +#endif + "5: Reload", " ", + "1: -1", "7: +1", + "4: Call direct", "6: Set", +#if 0 + "2: -28", "8: +28", + "3: -100", "9: +100", +#endif + "A: Exit", "D: Reset", + "E: Backlight", "F: (Exit) Help", + }; -const char *updown_helpstr[20] = { - "Help", "F=exit any=continue", +const char *updown_helpstr[18] = { "5: Menu", " ", "1: Slow Down", "3: Slow Up", "4: Down", "6: Up", "7: Fast Down", "9: Fast Up", "2: Band Down", "8: Band Up", - "0: Mode3K", " ", - "a: AM/FM", "b: Volume", - "c: Scan", "d: Stereo mode", - "e: Backlight", "f: (Exit) Help", + "0: Narrow/Broad", " ", + "A: AM/FM", "B: User freq", + "C Scan", "D: Stereo mode", + "E: Backlight", "F: (Exit) Help", }; const char *setup_helpstr[14] = { - "Help", "F=exit any=continue", - "0: Power OFF", "C: Save status", - "d: Reset default", "E: BL time", - "A: Load", "", - "1: FM CNR", "2: AM CNR" - "3: FM STEREO", "4: Reserve" + "0: Power OFF", " ", + "3: BL Level", "E: BL time", + "A: Load", "D: Reset default", + "C: Save status", " ", + "7: FM CNR", "8: AM CNR" + "9: FM STEREO", "4: FM BW", "5: Cancel", "f: (Exit) Help", }; -const char *mainmenu_helpstr[16] = { - "Help", "F=exit any=continue", +const char *mainmenu_helpstr[14] = { "0: Setup", "1: Band", - "3: Freq", "" + "3: Freq", " " "4: Call user", "6: Set user", "7: Power Off", "8: Volume", "9: Width", "a: AM/FM", @@ -73,18 +86,25 @@ const char *numeric_helpstr[10] = { }; +static unsigned char help_header(void) +{ + return printhelp_2lines("Help", "F=exit any=continue"); +} + void setup_help(void) { unsigned char c; char l; l = 0; + if(help_header() == charcode_f) return; do { c = printhelp_2lines(setup_helpstr[l], setup_helpstr[l + 1]); if(c == charcode_f) return; l += 2; - if(l >= 16) { + if(l >= 14) { c = numeric_help(); if(c == charcode_f) return; + if(help_header() == charcode_f) return; l = 0; } } while(1); @@ -125,7 +145,7 @@ void mainmenu_help(void) c = printhelp_2lines(mainmenu_helpstr[l], mainmenu_helpstr[l + 1]); if(c == charcode_f) return; l += 2; - if(l >= 16) { + if(l >= 14) { c = numeric_help(); if(c == charcode_f) return; l = 0; @@ -139,14 +159,39 @@ void updown_help(void) char l; l = 0; + if(help_header() == charcode_f) return; do { c = printhelp_2lines(updown_helpstr[l], updown_helpstr[l + 1]); if(c == charcode_f) return; l += 2; - if(l >= 20) { + if(l >= 18) { + c = numeric_help(); + if(c == charcode_f) return; + if(help_header() == charcode_f) return; + l = 0; + } + } while(1); +} + + +void userfreq_help(void) +{ + unsigned char c; + char l; + + l = 0; + if(help_header() == charcode_f) return; + do { + c = printhelp_2lines(userfreq_helpstr[l], userfreq_helpstr[l + 1]); + if(c == charcode_f) return; + l += 2; + if(l >= 10) { c = numeric_help(); if(c == charcode_f) return; + if(help_header() == charcode_f) return; l = 0; } } while(1); } + + diff --git a/helps.h b/helps.h index bbb866d..1ccfa73 100644 --- a/helps.h +++ b/helps.h @@ -42,7 +42,7 @@ extern "C" { extern void updown_help(void); extern void mainmenu_help(void); extern void setup_help(void); - + extern void userfreq_help(void); #ifdef __cplusplus diff --git a/menu_memoryfreq.c b/menu_memoryfreq.c index 160606f..ab87502 100644 --- a/menu_memoryfreq.c +++ b/menu_memoryfreq.c @@ -140,7 +140,7 @@ void on_updown_userfreq(void) _LOCATE(0,0); printstr("CH:"); print_numeric_nosupress(setup.memorynum, 2); - printstr(" 7/1/A/D"); + printstr(" HELP = F"); update_status(); print_freq(1); _HOME(); @@ -183,6 +183,9 @@ void on_updown_userfreq(void) case charcode_a: goto _l0; break; + case charcode_f: + userfreq_help(); + break; case charcode_e: // Set Light default: break; -- 2.11.0