uifw/EikStd/coctlsrc/EIKLBV.CPP
branchRCL_3
changeset 23 3d340a0166ff
parent 16 71dd06cfe933
child 29 a8834a2e9a96
equal deleted inserted replaced
18:0aa5fbdfbc30 23:3d340a0166ff
   954 	    {
   954 	    {
   955 	    _AKNTRACE_FUNC_EXIT;
   955 	    _AKNTRACE_FUNC_EXIT;
   956 		return;
   956 		return;
   957 	    }
   957 	    }
   958 
   958 
   959     TBool transparencyEnabled( CAknEnv::Static()->TransparencyEnabled() );
       
   960 
       
   961     if ((ITEM_EXISTS_ONCE(aItemIndex)) && ItemIsVisible(aItemIndex))
   959     if ((ITEM_EXISTS_ONCE(aItemIndex)) && ItemIsVisible(aItemIndex))
   962 		{
   960 		{
   963 		TBool drawingInitiated = ETrue;
   961 		TBool drawingInitiated = ETrue;
   964 
   962 
   965 		if ( transparencyEnabled )
   963         if ( iWin && iWin->GetDrawRect() == TRect::EUninitialized )
   966 		    {
   964             {
   967 		    if ( iWin && iWin->GetDrawRect() == TRect::EUninitialized )
       
   968 			    {
       
   969 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   965 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   970                 MAknListBoxTfxInternal* transApi =
   966             MAknListBoxTfxInternal* transApi =
   971                     CAknListLoader::TfxApiInternal( iGc );
   967                 CAknListLoader::TfxApiInternal( iGc );
   972                 drawingInitiated = transApi && !transApi->EffectsDisabled();
   968             drawingInitiated = transApi && !transApi->EffectsDisabled();
   973 #else
   969 #else
   974                 drawingInitiated = EFalse;
   970             drawingInitiated = EFalse;
   975 #endif			
   971 #endif			
   976                 }
   972             }
   977 
   973 
   978             if ( !drawingInitiated )
   974         if ( !drawingInitiated )
   979 			    {
   975             {
   980                 TRect rect( ItemPos(aItemIndex), iItemDrawer->ItemCellSize() );
   976             TRect rect( ItemPos(aItemIndex), iItemDrawer->ItemCellSize() );
   981 			    rect.Intersection( iViewRect );
   977             rect.Intersection( iViewRect );
   982 			    iWin->Invalidate( rect );
   978             iWin->Invalidate( rect );
   983 			    iWin->BeginRedraw( rect );
   979             iWin->BeginRedraw( rect );
   984 			    }
   980             }
   985 		    }
       
   986 		
   981 		
   987 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   982 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   988         MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc );
   983         MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc );
   989         if ( transApi )
   984         if ( transApi )
   990             {
   985             {
   992                                 ItemSize(aItemIndex) );
   987                                 ItemSize(aItemIndex) );
   993             transApi->BeginRedraw( MAknListBoxTfxInternal::EListItem, rect, aItemIndex );
   988             transApi->BeginRedraw( MAknListBoxTfxInternal::EListItem, rect, aItemIndex );
   994             transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
   989             transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
   995             }
   990             }
   996 #endif // RD_UI_TRANSITION_EFFECTS_LIST
   991 #endif // RD_UI_TRANSITION_EFFECTS_LIST
       
   992 
       
   993         TBool backgroundDrawingSuppressed = ( iItemDrawer 
       
   994 		        && ( iItemDrawer->Flags() 
       
   995                 & ( CListItemDrawer::EDrawWholeBackground
       
   996                 | CListItemDrawer::EBackgroundDrawn ) ) );
   997         
   997         
   998         iGc->SetClippingRect( iViewRect );
   998         if ( !backgroundDrawingSuppressed )
       
   999             {
       
  1000             iGc->SetClippingRect( iViewRect );
       
  1001             }
   999 
  1002 
  1000 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1003 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1001         if ( transApi )
  1004         if ( transApi )
  1002             {
  1005             {
  1003             transApi->StopDrawing();
  1006             transApi->StopDrawing();
  1014             {
  1017             {
  1015             transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  1018             transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  1016             }
  1019             }
  1017 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1020 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1018             
  1021             
  1019 		iGc->CancelClippingRect();
  1022         if ( !backgroundDrawingSuppressed )
       
  1023             {
       
  1024     		iGc->CancelClippingRect();
       
  1025             }
  1020 
  1026 
  1021 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1027 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1022         if ( transApi )
  1028         if ( transApi )
  1023             {
  1029             {
  1024             transApi->StopDrawing();
  1030             transApi->StopDrawing();
  1030             {
  1036             {
  1031             transApi->EndRedraw( MAknListBoxTfxInternal::EListItem, aItemIndex );
  1037             transApi->EndRedraw( MAknListBoxTfxInternal::EListItem, aItemIndex );
  1032             }
  1038             }
  1033 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1039 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1034 
  1040 
  1035 		if ( transparencyEnabled && !drawingInitiated )
  1041         if ( !drawingInitiated )
  1036 			{
  1042 			{
  1037 			iWin->EndRedraw();
  1043 			iWin->EndRedraw();
  1038 			}
  1044 			}
  1039 		}
  1045 		}
  1040     _AKNTRACE_FUNC_EXIT;
  1046     _AKNTRACE_FUNC_EXIT;
  1416     _AKNTRACE( "itemPartiallyVisible is %d", itemPartiallyVisible );
  1422     _AKNTRACE( "itemPartiallyVisible is %d", itemPartiallyVisible );
  1417     _AKNTRACE_FUNC_EXIT;
  1423     _AKNTRACE_FUNC_EXIT;
  1418     return itemPartiallyVisible;
  1424     return itemPartiallyVisible;
  1419     }
  1425     }
  1420 
  1426 
       
  1427 
       
  1428 // ---------------------------------------------------------------------------
       
  1429 // Resets the selection state so that there is nothing selected.
       
  1430 // ---------------------------------------------------------------------------
       
  1431 //
       
  1432 void CListBoxView::ClearSelection( TBool aDrawItems )
       
  1433     {
       
  1434     _AKNTRACE_FUNC_ENTER;
       
  1435 
       
  1436     __ASSERT_DEBUG( iSelectionIndexes,
       
  1437                     Panic( EEikPanicListBoxNoSelIndexArray ) );
       
  1438 
       
  1439     TInt numSelectedItems = iSelectionIndexes->Count();
       
  1440     TKeyArrayFix key( 0, ECmpTInt );
       
  1441     TInt selectedItemIndex;
       
  1442     TInt pos;
       
  1443 
       
  1444 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  1445     MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc );
       
  1446 #endif // RD_UI_TRANSITION_EFFECTS_LIST
       
  1447     
       
  1448     for ( TInt i = 0; i < numSelectedItems; i++ )
       
  1449         {
       
  1450         selectedItemIndex = ( *( iSelectionIndexes ) )[0];
       
  1451 
       
  1452         if ( !( iSelectionIndexes->Find( selectedItemIndex, key, pos ) ) )
       
  1453             {
       
  1454 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  1455             if ( transApi )
       
  1456                 {
       
  1457                 transApi->Invalidate( MAknListBoxTfxInternal::EListItem,
       
  1458                                       selectedItemIndex );
       
  1459                 }
       
  1460 #endif // RD_UI_TRANSITION_EFFECTS_LIST
       
  1461 
       
  1462             iSelectionIndexes->Delete( pos );
       
  1463 
       
  1464             if ( aDrawItems )
       
  1465                 {
       
  1466                 DrawItem( selectedItemIndex );
       
  1467                 }
       
  1468             }
       
  1469         }
       
  1470 
       
  1471     ClearSelectionAnchorAndActiveIndex();
       
  1472 
       
  1473     _AKNTRACE_FUNC_EXIT;
       
  1474     }
  1421 
  1475 
  1422 
  1476 
  1423 // class CSnakingListBoxView
  1477 // class CSnakingListBoxView
  1424 
  1478 
  1425 EXPORT_C CSnakingListBoxView::CSnakingListBoxView()
  1479 EXPORT_C CSnakingListBoxView::CSnakingListBoxView()