From 8bd32f79d8130a41888a3a1ff43b301bba6169e3 Mon Sep 17 00:00:00 2001 From: mamata pattanaik Date: Wed, 21 Aug 2013 20:33:04 +0530 Subject: [PATCH] Made changes to fix N_SE-49371 - maintaining footer item highlight during navigation. Change-Id: I472c0efa97df3a4220b1401d9780074ae08df74b Signed-off-by: mamata pattanaik --- project/inc/MultiForm.h | 2 ++ project/src/MultiForm.cpp | 65 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/project/inc/MultiForm.h b/project/inc/MultiForm.h index 806dbbe..9082f4a 100644 --- a/project/inc/MultiForm.h +++ b/project/inc/MultiForm.h @@ -145,6 +145,8 @@ private: int __stepIndex; int __prevIndex; int __nextIndex; + bool __prevDisabled; + bool __nextDisabled; int __allocMem[2]; String __name; }; diff --git a/project/src/MultiForm.cpp b/project/src/MultiForm.cpp index 8494a93..961d443 100644 --- a/project/src/MultiForm.cpp +++ b/project/src/MultiForm.cpp @@ -1135,6 +1135,15 @@ MultiForm::SetStepInfo(int stepCount, int currIndex, int prevIndex, int nextInde __prevIndex = prevIndex; __nextIndex = nextIndex; __stepIndex = currIndex; + __prevDisabled = true; + if (__stepCount > 1) + { + __nextDisabled = false; + } + else + { + __nextDisabled = true; + } if (__stepCount > 0) { @@ -1166,31 +1175,59 @@ MultiForm::SetStepInfo(int stepCount, int currIndex, int prevIndex, int nextInde result MultiForm::SetStepIndex(int index) { - __stepIndex = index; if (__stepCount > 0) { - SetHeaderSuffix("(%d/%d)", __stepIndex + 1, __stepCount); + SetHeaderSuffix("(%d/%d)", index + 1, __stepCount); } - if (__stepCount > 1 && __stepIndex != 0) - { - ShowFooterItem(__prevIndex, true); - } - else + if (__stepIndex > index) // moved prev { - ShowFooterItem(__prevIndex, false); - } + if (__stepCount > 1 && index != 0) + { + if (__prevDisabled == true) + { + ShowFooterItem(__prevIndex, true); + __prevDisabled = false; + } + } + else + { + ShowFooterItem(__prevIndex, false); + __prevDisabled = true; + } - if (__stepCount > 1 && __stepIndex + 1 < __stepCount) - { - ShowFooterItem(__nextIndex, true); + if (__nextDisabled == true) + { + ShowFooterItem(__nextIndex, true); + __nextDisabled = false; + } } - else + else // if __stepIndex < index // moved next { - ShowFooterItem(__nextIndex, false); + if (__stepCount > 1 && index + 1 < __stepCount) + { + if (__nextDisabled == true) + { + ShowFooterItem(__nextIndex, true); + __nextDisabled = false; + } + } + else + { + ShowFooterItem(__nextIndex, false); + __nextDisabled = true; + } + + if (__prevDisabled == true) + { + ShowFooterItem(__prevIndex, true); + __prevDisabled = false; + } } + __stepIndex = index; + return E_SUCCESS; } -- 2.7.4