textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutchoicelist.cpp
branchRCL_3
changeset 20 ebd48d2de13c
parent 9 e6a39382bb9c
child 21 ecbabf52600f
equal deleted inserted replaced
19:ac7e4d1d9209 20:ebd48d2de13c
   236     :CFepLayoutPopupWnd(TSize(0,0), aUiLayout, aControlId)
   236     :CFepLayoutPopupWnd(TSize(0,0), aUiLayout, aControlId)
   237     {
   237     {
   238     SetControlType(ECtrlPopupChoiceList);
   238     SetControlType(ECtrlPopupChoiceList);
   239 	iSubItemSkinID 		= KAknsIIDNone;
   239 	iSubItemSkinID 		= KAknsIIDNone;
   240 	iBackgroundSkinID   = KAknsIIDNone;
   240 	iBackgroundSkinID   = KAknsIIDNone;
   241 	iAlign              = CGraphicsContext::ELeft;
       
   242     }
   241     }
   243 
   242 
   244 // CFepLayoutChoiceList::HitTest
   243 // CFepLayoutChoiceList::HitTest
   245 // Get item whose region contains the point.
   244 // Get item whose region contains the point.
   246 // (other items were commented in a header).
   245 // (other items were commented in a header).
   293         event.iCommand = 0;
   292         event.iCommand = 0;
   294         ReportChoiceEvent(event);
   293         ReportChoiceEvent(event);
   295 		#ifdef RD_TACTILE_FEEDBACK
   294 		#ifdef RD_TACTILE_FEEDBACK
   296         if (UiLayout()->SupportTactileFeedback())
   295         if (UiLayout()->SupportTactileFeedback())
   297         	{
   296         	{
   298         	UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveInput, ETrue, EFalse);
   297         	UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveKeypad, ETrue, EFalse);
   299         	}
   298         	}
   300 		#endif //RD_TACTILE_FEEDBACK     
   299 		#endif //RD_TACTILE_FEEDBACK     
   301         }
   300         }
   302     else
   301     else
   303         {
   302         {
   306             {
   305             {
   307             //TInt prev = iCurFocusItem;
   306             //TInt prev = iCurFocusItem;
   308             iCurFocusItem = index;
   307             iCurFocusItem = index;
   309        		Draw();
   308        		Draw();
   310             UpdateArea(Rect(),EFalse);
   309             UpdateArea(Rect(),EFalse);
       
   310 			#ifdef RD_TACTILE_FEEDBACK
       
   311             if (UiLayout()->SupportTactileFeedback())
       
   312             	{
       
   313             	UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveKeypad);
       
   314             	}
       
   315 			#endif //RD_TACTILE_FEEDBACK
   311             }
   316             }
   312         }
   317         }
   313     return this;
   318     return this;
   314     }
   319     }
   315 
   320 
   346     #ifdef RD_TACTILE_FEEDBACK
   351     #ifdef RD_TACTILE_FEEDBACK
   347         if (UiLayout()->SupportTactileFeedback())
   352         if (UiLayout()->SupportTactileFeedback())
   348             {
   353             {
   349             if ( iLastSelIndex != iCurFocusItem) 
   354             if ( iLastSelIndex != iCurFocusItem) 
   350                 {
   355                 {
   351                 UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveInput);
   356                 UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveKeypad);
   352                 iLastSelIndex = iCurFocusItem;
   357                 iLastSelIndex = iCurFocusItem;
   353                 }
   358                 }
   354             }
   359             }
   355     #endif //RD_TACTILE_FEEDBACK
   360     #endif //RD_TACTILE_FEEDBACK
   356 
   361 
   384         ReportChoiceEvent(event);
   389         ReportChoiceEvent(event);
   385         
   390         
   386 		#ifdef RD_TACTILE_FEEDBACK
   391 		#ifdef RD_TACTILE_FEEDBACK
   387 		if (UiLayout()->SupportTactileFeedback())
   392 		if (UiLayout()->SupportTactileFeedback())
   388 			{
   393 			{
   389 			UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveInput, ETrue, EFalse);
   394 			UiLayout()->DoTactileFeedback(ETouchFeedbackSensitiveKeypad, ETrue, EFalse);
   390 			}
   395 			}
   391 		#endif //RD_TACTILE_FEEDBACK	
   396 		#endif //RD_TACTILE_FEEDBACK	
   392         }
   397         }
   393     else if( index == EListOutside )
   398     else if( index == EListOutside )
   394     	{
   399     	{
   444         
   449         
   445        	if( iSubItemSkinID.iMajor != EAknsMajorNone && 
   450        	if( iSubItemSkinID.iMajor != EAknsMajorNone && 
   446        	    iSubItemSkinID.iMinor != EAknsMinorNone)
   451        	    iSubItemSkinID.iMinor != EAknsMinorNone)
   447        		{
   452        		{
   448        		gc->Activate( BitmapDevice() ); 
   453        		gc->Activate( BitmapDevice() ); 
   449 			AknsDrawUtils::DrawFrame( UiLayout()->SkinInstance(), 
   454 			AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
   450                          *gc, 
   455                          *gc, 
   451                          rtFocusRect, 
   456                          rtFocusRect, 
   452                          rtInnerRect,
   457                          rtInnerRect,
   453                          iSubItemSkinID,
   458                          iSubItemSkinID,
   454                          KAknsIIDDefault );       	
   459                          KAknsIIDDefault );       	
   480 
   485 
   481         gc->SetBrushStyle( CGraphicsContext::ENullBrush );
   486         gc->SetBrushStyle( CGraphicsContext::ENullBrush );
   482         gc->SetPenColor(iFontColor);
   487         gc->SetPenColor(iFontColor);
   483         gc->SetPenStyle(CGraphicsContext::ESolidPen);
   488         gc->SetPenStyle(CGraphicsContext::ESolidPen);
   484 
   489 
   485         gc->DrawText(aItem.iText, aRect, iBaseline, iAlign, iMargin);
   490         gc->DrawText(aItem.iText, aRect, iBaseline, CGraphicsContext::ELeft, iMargin);
   486 
   491 
   487         gc->DiscardFont();
   492         gc->DiscardFont();
   488         }
   493         }
   489     }
   494     }
   490 
   495 
   503 	    TRect rtInnerRect( aRect );
   508 	    TRect rtInnerRect( aRect );
   504 	    rtInnerRect.Shrink( 1, 1 );
   509 	    rtInnerRect.Shrink( 1, 1 );
   505 	    CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
   510 	    CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
   506 	    
   511 	    
   507 	    gc->Activate( BitmapDevice() ); 
   512 	    gc->Activate( BitmapDevice() ); 
   508 		AknsDrawUtils::DrawFrame( UiLayout()->SkinInstance(), 
   513 		AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
   509 	                     *gc, 
   514 	                     *gc, 
   510 	                     aRect, 
   515 	                     aRect, 
   511 	                     rtInnerRect,
   516 	                     rtInnerRect,
   512 	                     iBackgroundSkinID,
   517 	                     iBackgroundSkinID,
   513 	                     KAknsIIDDefault );       
   518 	                     KAknsIIDDefault );       
   578 // (other items were commented in a header).
   583 // (other items were commented in a header).
   579 // ---------------------------------------------------------------------------
   584 // ---------------------------------------------------------------------------
   580 //
   585 //
   581 EXPORT_C void CFepLayoutChoiceList::OnDisplay()
   586 EXPORT_C void CFepLayoutChoiceList::OnDisplay()
   582     {
   587     {
   583     iCurFocusItem = -1; 
       
   584     ReCalcLayout();
   588     ReCalcLayout();
   585     }
   589     }
   586 
   590 
   587 // CFepLayoutChoiceList::ReCalcLayout
   591 // CFepLayoutChoiceList::ReCalcLayout
   588 // Calculates the displaying rect.
   592 // Calculates the displaying rect.
   651 
   655 
   652 EXPORT_C void CFepLayoutChoiceList::AfterDisplayed()
   656 EXPORT_C void CFepLayoutChoiceList::AfterDisplayed()
   653     {
   657     {
   654     TRAP_IGNORE(AfterDisplayedL());
   658     TRAP_IGNORE(AfterDisplayedL());
   655     }
   659     }
   656 
       
   657 EXPORT_C void CFepLayoutChoiceList::SetTextAlignment(const CGraphicsContext::TTextAlign aAlign)
       
   658 	{
       
   659 	iAlign = aAlign;
       
   660 	}
       
   661 //End Of File
   660 //End Of File