# HG changeset patch # User Ideenmodellierer # Date 1600196224 -7200 # Node ID 1721b26335f136b5496ea9adf7388cdd49b347ba # Parent c880907fd1d7fb426da37199f4b97235fab2c3e0 Bugfix custom view selection dialog: Because of missing events / menu states and not resetting the subpage index while switching between cv and bf selection, some display errors occure. diff -r c880907fd1d7 -r 1721b26335f1 Discovery/Inc/tStructure.h --- a/Discovery/Inc/tStructure.h Tue Sep 15 20:54:54 2020 +0200 +++ b/Discovery/Inc/tStructure.h Tue Sep 15 20:57:04 2020 +0200 @@ -320,6 +320,7 @@ #define StMCustom3_CViewSelection5 _MB(2,9,3,5,0) #define StMCustom3_CViewSelection6 _MB(2,9,3,6,0) +#define StMCustom4_CViewSelection1 _MB(2,9,4,1,0) /* PAGE 10 */ #define StMPLAN _MB(2,10,0,0,0) diff -r c880907fd1d7 -r 1721b26335f1 Discovery/Src/tMenuEdit.c --- a/Discovery/Src/tMenuEdit.c Tue Sep 15 20:54:54 2020 +0200 +++ b/Discovery/Src/tMenuEdit.c Tue Sep 15 20:57:04 2020 +0200 @@ -222,13 +222,13 @@ break; case (StMCustom1_CViewTimeout & MaskFieldDigit):refreshFct = refresh_Customviews; break; - case (StMCustom3_CViewSelection1 & MaskFieldDigit) : + case (StMCustom4_CViewSelection1 & MaskFieldDigit): + case (StMCustom3_CViewSelection1 & MaskFieldDigit): case StMCustom3_CViewSelection2: case StMCustom3_CViewSelection3: case StMCustom3_CViewSelection4: case StMCustom3_CViewSelection5: - case StMCustom3_CViewSelection6: - case (StMCustom2_BFSelection & MaskFieldDigit) : refreshFct = CustomviewDivemode_refresh; + case StMCustom3_CViewSelection6: refreshFct = CustomviewDivemode_refresh; break; default: /* no menu has been updated */ break; diff -r c880907fd1d7 -r 1721b26335f1 Discovery/Src/tMenuEditCustom.c --- a/Discovery/Src/tMenuEditCustom.c Tue Sep 15 20:54:54 2020 +0200 +++ b/Discovery/Src/tMenuEditCustom.c Tue Sep 15 20:57:04 2020 +0200 @@ -313,6 +313,7 @@ case CVIEW_Profile: text = TXT2BYTE_Profile; break; + case CVIEW_Gaslist: case CVIEW_T3_GasList: text = TXT2BYTE_Gaslist; break; @@ -528,17 +529,15 @@ uint8_t i; customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1; + + if(pcv_curchangelist != pcv_changelist) /* new selection base? => reset page index */ + { + customviewsSubpage = 0; + } pcv_curchangelist = pcv_changelist; CustomviewDivemode_refresh(pcv_changelist); - - text[0] = '\001'; - text[1] = TXT_2BYTE; - text[2] = TXT2BYTE_SelectCustomviews; - text[3] = 0; - write_topline(text); - for(i=0; i<5;i++) /* fill maximum 5 items and leave last one for sub page selection */ { textPointer = 0; @@ -701,10 +700,12 @@ uint8_t i; - text[0] = '\001'; - text[1] = TXT_2BYTE; - text[2] = TXT2BYTE_SelectCustomviews; - text[3] = 0; + text[textPointer++] = '\001'; + text[textPointer++] = TXT_2BYTE; + text[textPointer++] = TXT2BYTE_SelectCustomviews; + text[textPointer++] = ' '; + text[textPointer++] = '1' + customviewsSubpage; + text[textPointer++] = 0; write_topline(text);