cmmanager/cmmgr/Framework/Src/cmconnselectrbpage.cpp
branchRCL_3
changeset 55 fc7b30ed2058
parent 12 ea6e024ea6f9
equal deleted inserted replaced
54:984e13af52c4 55:fc7b30ed2058
    47     , iSelectionMode( aSelectionMode )
    47     , iSelectionMode( aSelectionMode )
    48     , iDestinations( aDestinations )
    48     , iDestinations( aDestinations )
    49     , iAreDestinations( areDestinations )
    49     , iAreDestinations( areDestinations )
    50     , iOpenDestination( aOpenDestination )
    50     , iOpenDestination( aOpenDestination )
    51     , iHelpContext ( aContext )
    51     , iHelpContext ( aContext )
       
    52     , iFirstEnter( ETrue )
    52     {
    53     {
    53     CLOG_CREATE;
    54     CLOG_CREATE;
    54     iPrevItem = iDestinations[aCurrentSelectionIndex];
    55     iPrevItem = iDestinations[aCurrentSelectionIndex];
    55     }
    56     }
    56 
    57 
   254     
   255     
   255     TKeyResponse retVal ( EKeyWasNotConsumed );
   256     TKeyResponse retVal ( EKeyWasNotConsumed );
   256     // save for the future use
   257     // save for the future use
   257     iPrevItem = iDestinations[ListBoxControl()->CurrentItemIndex()];
   258     iPrevItem = iDestinations[ListBoxControl()->CurrentItemIndex()];
   258     
   259     
   259     switch ( aKeyEvent.iScanCode )
   260     TKeyEvent aKeyEventmy = aKeyEvent;
       
   261     if ( aKeyEventmy.iCode == EKeyEnter )
       
   262         {
       
   263         if ( iFirstEnter )
       
   264             {//pressing the enter key at the first time will be changed
       
   265              //to an up arrow key so the first item in the list will be highlighted
       
   266             iFirstEnter = EFalse;
       
   267             aKeyEventmy.iScanCode = EStdKeyUpArrow;
       
   268             aKeyEventmy.iCode = EKeyUpArrow;
       
   269             }
       
   270         else
       
   271             {//change back to true for the next session
       
   272             iFirstEnter=ETrue;
       
   273             }
       
   274         }
       
   275     else if ( aKeyEventmy.iScanCode == EStdKeyDownArrow || aKeyEventmy.iScanCode == EStdKeyUpArrow )
       
   276              {
       
   277              //we will have highligt so the following enter key should select the item
       
   278              iFirstEnter = EFalse;
       
   279              }
       
   280     
       
   281     switch ( aKeyEventmy.iScanCode )
   260         {
   282         {
   261         case EStdKeyDownArrow:
   283         case EStdKeyDownArrow:
   262         case EStdKeyUpArrow:
   284         case EStdKeyUpArrow:
   263             {
   285             {
   264             if ( iOpenDestination ) //only if we are on 'destination level' and we are able to
   286             if ( iOpenDestination ) //only if we are on 'destination level' and we are able to
   287         default:
   309         default:
   288             {
   310             {
   289             break;
   311             break;
   290             }
   312             }
   291         }
   313         }
   292     retVal = CAknRadioButtonSettingPage::OfferKeyEventL( aKeyEvent, aType );
   314     retVal = CAknRadioButtonSettingPage::OfferKeyEventL( aKeyEventmy, aType );
   293     
   315     
   294     return retVal;
   316     return retVal;
   295     }
   317     }
   296 
   318 
   297 // --------------------------------------------------------------------------
   319 // --------------------------------------------------------------------------
   361                     // save for the later use
   383                     // save for the later use
   362                     iPrevItem = iDestinations[ListBoxControl()->CurrentItemIndex()];
   384                     iPrevItem = iDestinations[ListBoxControl()->CurrentItemIndex()];
   363 					    
   385 					    
   364 		            if ( iOpenDestination ) //only if we are on 'destination level' and we are able to
   386 		            if ( iOpenDestination ) //only if we are on 'destination level' and we are able to
   365         		        //open destinations
   387         		        //open destinations
   366                 		{            
   388                 	    {            
   367                 		// If focus is on the 'uncategorised' destination, 
   389                 	    // If focus is on the 'uncategorised' destination, 
   368                 		// change the soft key to 'Open'
   390                 	    // change the soft key to 'Open'
   369                 		if ( iDestinations[ ListBoxControl()->CurrentItemIndex() ] == 
   391                 	    if ( iDestinations[ ListBoxControl()->CurrentItemIndex() ] == 
   370 		                                                        KDestItemUncategorized )
   392 		                                                        KDestItemUncategorized )
   371         		            {
   393         		            {
   372                 		    HBufC* text = StringLoader::LoadLC( R_QTN_MSK_OPEN );
   394                 	        HBufC* text = StringLoader::LoadLC( R_QTN_MSK_OPEN );
   373                     		Cba()->SetCommandL( EAknSoftkeySelect, *text );
   395                    		    Cba()->SetCommandL( EAknSoftkeySelect, *text );
   374                     		Cba()->DrawNow();
   396                    		    Cba()->DrawNow();
   375                     		CleanupStack::PopAndDestroy( text );                
   397                    		    CleanupStack::PopAndDestroy( text );                
   376                     		}
   398                    		    }
   377                 		else
   399                 	    else
   378                     		{
   400                    		    {
   379                     		HBufC* text = StringLoader::LoadLC( R_QTN_MSK_SELECT );
   401                    		    HBufC* text = StringLoader::LoadLC( R_QTN_MSK_SELECT );
   380                     		Cba()->SetCommandL( EAknSoftkeySelect, *text );
   402                    		    Cba()->SetCommandL( EAknSoftkeySelect, *text );
   381                     		Cba()->DrawNow();
   403                    		    Cba()->DrawNow();
   382                     		CleanupStack::PopAndDestroy( text );
   404                    		    CleanupStack::PopAndDestroy( text );
   383                     		}
   405                    		    }
   384                 		CAknRadioButtonSettingPage::SelectCurrentItemL();
   406                          CAknRadioButtonSettingPage::SelectCurrentItemL();
   385                 		}
   407                 	     }
   386                 	}
   408                     }
   387                 break;
   409                 break;
   388                 
   410                 
   389             case MEikListBoxObserver::EEventItemDoubleClicked:
   411             case MEikListBoxObserver::EEventItemDoubleClicked:
   390                 ProcessCommandL(ECmManagerUiCmdDestSelect);
   412                 ProcessCommandL(ECmManagerUiCmdDestSelect);
   391                 break;
   413                 break;