# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1271255704 -10800 # Node ID 7e287c5c61f0f29b6266b07e69941b21d00413cc # Parent cfe32394fcd5c47f1d399120f5db2cc28efa03df Revision: 201013 Kit: 201015 diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/ConsoleUI/inc/ConsoleMenus.h --- a/stif/ConsoleUI/inc/ConsoleMenus.h Thu Apr 01 00:00:49 2010 +0300 +++ b/stif/ConsoleUI/inc/ConsoleMenus.h Wed Apr 14 17:35:04 2010 +0300 @@ -163,6 +163,12 @@ protected: // New functions // None + private: // New functions + /** + * Changes internal variables to move cursor in the menu. + */ + void MovePosition(TInt aDelta); + protected: // Functions from base classes // None @@ -217,7 +223,7 @@ TUpdateType iUpdateType; private: // Data - // None + TName iScrolledLine; //Original value of line, that was recently scrolled public: // Friend classes // None diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/ConsoleUI/src/Consolemenus.cpp --- a/stif/ConsoleUI/src/Consolemenus.cpp Thu Apr 01 00:00:49 2010 +0300 +++ b/stif/ConsoleUI/src/Consolemenus.cpp Wed Apr 14 17:35:04 2010 +0300 @@ -218,7 +218,7 @@ */ void CMenu::TimerUpdate() { - + iScrolledLine.Zero(); RRefArray texts; User::LeaveIfError( ItemTexts( texts ) ); @@ -244,7 +244,7 @@ // If menu item have not been changed after last timer, then // start scrolling - const TDesC& name = texts[ iFirst + iPosOnScreen ]; + const TDesC& name = texts[ iFirst + iPosOnScreen ]; if ( name.Length() > ( iSize.iWidth - KMenuOverhead ) ) { @@ -255,7 +255,7 @@ iStart = iStart + iDirection; // "Right end" - if ( iStart + iSize.iWidth > name.Length() + KMenuOverhead ) + if ( iStart + iSize.iWidth > name.Length() + KMenuOverhead + 2) { iStart--; iDirection = -1; @@ -277,7 +277,8 @@ LimitedAppend( iTmp, name.Mid ( iStart ) ); iConsole->SetPos( 0, iPosOnScreen+1); - iConsole->Printf ( iTmp.Left( iSize.iWidth -2 ) ); + Print(iTmp); + iScrolledLine.Copy(texts[iFirst + iPosOnScreen].Left(iScrolledLine.MaxLength())); iConsole->SetPos(x,y); } @@ -395,10 +396,14 @@ { //removing "*" sign from the previous cursor position iConsole->SetPos(0, iPrevPosOnScreen + iMenuItemsListStartIndex); - line.Append( _L(" ") ); - iConsole->Printf(line); + //line.Append( _L(" ") ); + AppendBefore(iPrevPosOnScreen + iFirst, line); + LimitedAppend(line, iScrolledLine); + //iConsole->Printf(line); + Print(line); iConsole->SetPos(0, iPosOnScreen + iMenuItemsListStartIndex); line.Zero(); + iScrolledLine.Zero(); //writing "*" sign before the currently selected line line.Append( _L(" *") ); @@ -408,7 +413,67 @@ } } - +/* +------------------------------------------------------------------------------- + + Class: CMenu + + Method: SelectL + + Description: Common method to count all variables needed for printing + page of the screen. + + Parameters: TInt aDelta :in: where to move current position + Value > 0 stands for moving down the menu. + Value < 0 stands for moving up the menu. + + Return Values: + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CMenu::MovePosition(TInt aDelta) + { + if(iItemCount > 0 && aDelta != 0) + { + // Valid screen size + TInt screenSize = iScreenSize + 1; + TInt realPosition = iFirst + iPosOnScreen; + + // Number of all pages and items in the last page + TInt rest = iItemCount % screenSize; + TInt pages = (iItemCount / screenSize) + ((rest == 0) ? (0) : (1)); + + // Current page + TInt currPage = realPosition / screenSize; + + // New page + TInt newRealPosition = realPosition + aDelta; + while(newRealPosition < 0) + newRealPosition += iItemCount; + newRealPosition %= iItemCount; + TInt newPage = newRealPosition / screenSize; + + // Change position + iFirst = newPage * screenSize; + iLast = iFirst + screenSize - 1; + if(iLast >= iItemCount) + iLast = iItemCount - 1; + iPrevPosOnScreen = iPosOnScreen; + iPosOnScreen = newRealPosition % screenSize; + if(newPage == pages - 1 && iPosOnScreen >= rest) + iPosOnScreen = rest - 1; + + // Prevent refreshing + iPreventClearScreen = (currPage == newPage); + } + else + iPreventClearScreen = ETrue; + } + /* ------------------------------------------------------------------------------- @@ -442,6 +507,7 @@ case EKeyEscape: aContinue = EFalse; return this; + // SelectL item case EKeyEnter: case EKeyRightArrow: @@ -453,139 +519,33 @@ // Go down case EKeyDownArrow: - { - if ( iFirst + iPosOnScreen == iItemCount - 1 ) - { - // If end of the list, go to beginning - iPosOnScreen = 0; - iFirst = 0; - iLast = iScreenSize; - if ( iLast > iItemCount - 1 ) - { - iLast = iItemCount - 1; - } - } - else - { - if ( iPosOnScreen == iScreenSize ) - { - iPosOnScreen = 0; - iFirst += iScreenSize + 1; - iLast += iScreenSize + 1; - } - else - { - // Going down "in-screen", no need to update items - iPrevPosOnScreen = iPosOnScreen; - iPreventClearScreen = EFalse; - if (iItemCount > 0) - { - iPosOnScreen++; - iPreventClearScreen = ETrue; - } - } - } + MovePosition(1); break; - } // Go Up case EKeyUpArrow: - { - // The second condition is needed for the cursor not to go to "next" page (if it does not exist) - if ( iFirst + iPosOnScreen == 0 ) - { - // If in the beginning of the list - if (iItemCount == iScreenSize + 1 || iItemCount == iScreenSize) - { - iPosOnScreen = iItemCount - 1; - } - else - { - iFirst = (iItemCount / iScreenSize) * iScreenSize; - iLast = iItemCount - 1; - iPosOnScreen = iItemCount % iScreenSize - 1; - if (iItemCount > iScreenSize) - { - iFirst++; - iPosOnScreen--; - } - } - } - else if ( iPosOnScreen == 0 ) - { - iPosOnScreen = iScreenSize; - iLast -= iScreenSize + 1; - iFirst -= iScreenSize + 1; - } - else - { - iPrevPosOnScreen = iPosOnScreen; - iPosOnScreen--; - iPreventClearScreen = ETrue; - } - + MovePosition(-1); break; - } // Additional keys case EKeyHome: case '3': - iPosOnScreen = 0; - iFirst = 0; - iLast = iScreenSize; - - if ( iLast > iItemCount - 1 ) - { - iLast = iItemCount - 1; - } + MovePosition(-iFirst - iPosOnScreen); break; case EKeyEnd: case '9': - iLast = iItemCount - 1; - iFirst = iLast - iScreenSize; - - if ( iFirst < 0 ) - { - iFirst = 0; - } - iPosOnScreen = iLast - iFirst; + MovePosition(iItemCount - 1 - iFirst - iPosOnScreen); break; case EKeyPageUp: case '1': - - iFirst = iFirst - iScreenSize; - iLast = iLast - iScreenSize; - - if ( iFirst < 0 ) - { - iFirst = 0; - iPosOnScreen = 0; - iLast = iScreenSize; - if ( iLast > iItemCount - 1 ) - { - iLast = iItemCount - 1; - } - } + MovePosition((iFirst + iPosOnScreen - iScreenSize - 1 >= 0) ? (-iScreenSize - 1) : (-iFirst - iPosOnScreen)); break; case EKeyPageDown: case '7': - iFirst = iFirst + iScreenSize; - iLast = iLast + iScreenSize; - - // Going too far - if ( iLast > iItemCount - 1 ) - { - iLast = iItemCount - 1; - iFirst = iLast - iScreenSize; - if ( iFirst < 0 ) - { - iFirst = 0; - } - } - iPosOnScreen = iLast - iFirst; + MovePosition((iFirst + iPosOnScreen + iScreenSize + 1 < iItemCount) ? (iScreenSize + 1) : (iItemCount - 1 - iFirst - iPosOnScreen)); break; default: // Bypass the keypress break; @@ -681,8 +641,8 @@ void CMenu::Print( const TDesC& aPrint ) { - iConsole->Printf ( aPrint.Left( iSize.iWidth - KMenuOverhead ) ); - iConsole->Printf(_L("\n")); + iConsole->Write ( aPrint.Left( iSize.iWidth - KMenuOverhead ) ); + iConsole->Write(_L("\n")); } @@ -1120,7 +1080,7 @@ error.iText.AppendNum( ret ); iMain->Error( error ); } - return iParent; + return iParent; } else { @@ -4428,17 +4388,23 @@ { case EKeyEnter: case EKeyRightArrow: - { - - const TDesC& aSetName = iFileList.operator [](iPosOnScreen)->Des(); + { + if(iPosOnScreen < iFileList.Count()) + { + const TDesC& aSetName = iFileList.operator [](iPosOnScreen)->Des(); - ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() ); - if (ret == KErrNone) - { - ((CTestSetMenu*)iParent)->SetCreated(); - ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des()); - } - return iParent; + ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() ); + if (ret == KErrNone) + { + ((CTestSetMenu*)iParent)->SetCreated(); + ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des()); + } + return iParent; + } + else + { + return this; + } } default: break; diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/TestServer/src/Testserversession.cpp --- a/stif/TestServer/src/Testserversession.cpp Thu Apr 01 00:00:49 2010 +0300 +++ b/stif/TestServer/src/Testserversession.cpp Wed Apr 14 17:35:04 2010 +0300 @@ -358,9 +358,8 @@ { TInt handle = 0; CObject* theObj = NULL; - TInt count = iTestExecutionHandle->Count(); - - for( TInt i = 0 ; i < count; i++ ) + TInt count = iTestExecutionHandle->Count(); + for ( TInt i = count - 1; i >= 0; i-- ) { theObj=iTestExecutionHandle->operator[]( i ); if( theObj ) @@ -374,7 +373,6 @@ delete iTestExecutionHandle; iTestExecutionHandle = NULL; - } // Deletion must be done here, because the "CloseSession" message is diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/TouchConsoleUI/src/Consolemenus.cpp --- a/stif/TouchConsoleUI/src/Consolemenus.cpp Thu Apr 01 00:00:49 2010 +0300 +++ b/stif/TouchConsoleUI/src/Consolemenus.cpp Wed Apr 14 17:35:04 2010 +0300 @@ -476,13 +476,16 @@ { // If in the beginning of the list - iLast = iItemCount - 1; - iFirst = iLast - iScreenSize; - if ( iFirst < 0 ) - { - iFirst = 0; - } - iPosOnScreen = iLast - iFirst; + if(iItemCount > 0) + { + iLast = iItemCount - 1; + iFirst = iLast - iScreenSize; + if ( iFirst < 0 ) + { + iFirst = 0; + } + iPosOnScreen = iLast - iFirst; + } } else if ( iPosOnScreen == 0 ) { @@ -4391,15 +4394,22 @@ { case EKeyEnter: case EKeyRightArrow: - { + { + if(iPosOnScreen < iFileList.Count()) + { - ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() ); - if (ret == KErrNone) - { - ((CTestSetMenu*)iParent)->SetCreated(); - ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des()); - } - return iParent; + ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() ); + if (ret == KErrNone) + { + ((CTestSetMenu*)iParent)->SetCreated(); + ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des()); + } + return iParent; + } + else + { + return this; + } } default: break; diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/group/ReleaseNote.txt --- a/stif/group/ReleaseNote.txt Thu Apr 01 00:00:49 2010 +0300 +++ b/stif/group/ReleaseNote.txt Wed Apr 14 17:35:04 2010 +0300 @@ -1,5 +1,5 @@ ======================================================================== -RELEASE NOTE FOR STIF - STIF_201010 (7.3.28) +RELEASE NOTE FOR STIF - STIF_201012 (7.3.29) SUPPORTING SERIES 60 3.0 -> ======================================================================== diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/inc/version.h --- a/stif/inc/version.h Thu Apr 01 00:00:49 2010 +0300 +++ b/stif/inc/version.h Wed Apr 14 17:35:04 2010 +0300 @@ -20,9 +20,9 @@ #define STIF_MAJOR_VERSION 7 #define STIF_MINOR_VERSION 3 -#define STIF_BUILD_VERSION 28 +#define STIF_BUILD_VERSION 29 -#define STIF_REL_DATE "09th Mar 2010" +#define STIF_REL_DATE "23th Mar 2010" #define TO_UNICODE(text) _L(text) diff -r cfe32394fcd5 -r 7e287c5c61f0 stif/sis/Stif_31.sis Binary file stif/sis/Stif_31.sis has changed