changeset 531:1721b26335f1

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.
author Ideenmodellierer
date Tue, 15 Sep 2020 20:57:04 +0200
parents c880907fd1d7
children d1d15b30507a
files Discovery/Inc/tStructure.h Discovery/Src/tMenuEdit.c Discovery/Src/tMenuEditCustom.c
diffstat 3 files changed, 16 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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;
--- 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);