uifw/EikStd/coctlsrc/EIKLBX.CPP
branchRCL_3
changeset 6 9f56a4e1b8ab
parent 3 8ca85d2f0db7
child 7 08e69e956a8c
equal deleted inserted replaced
5:aabf2c525e0f 6:9f56a4e1b8ab
   942     {
   942     {
   943     if ( iLongTappedItem != KErrNotFound )
   943     if ( iLongTappedItem != KErrNotFound )
   944         {
   944         {
   945         EnableHighlight( EFalse );
   945         EnableHighlight( EFalse );
   946         iListBox.iView->DrawItem( iLongTappedItem );
   946         iListBox.iView->DrawItem( iLongTappedItem );
       
   947         iListBox.iView->SetCurrentItemIndex( 0 );
   947         iLongTappedItem = KErrNotFound;
   948         iLongTappedItem = KErrNotFound;
   948         }
   949         }
   949     }
   950     }
   950 
   951 
   951 
   952 
  2096         // Current item not visible or current item is the last item (not fully visible)
  2097         // Current item not visible or current item is the last item (not fully visible)
  2097         if ( !iView->ItemIsVisible(currentItemIndex)
  2098         if ( !iView->ItemIsVisible(currentItemIndex)
  2098         	|| iListBoxExt && iListBoxExt->iPhysics 
  2099         	|| iListBoxExt && iListBoxExt->iPhysics 
  2099         	&& currentItemIndex == ( topItemIndex + numberOfItems - 1 ) )
  2100         	&& currentItemIndex == ( topItemIndex + numberOfItems - 1 ) )
  2100             {
  2101             {
  2101             newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex );
  2102             if ( iListBoxExt && iListBoxExt->iSingleClickEnabled )
       
  2103                 {
       
  2104                 // is single click is enabled, highlight must also be visible
       
  2105                 if ( iListBoxExt->CollectionState()
       
  2106                         & MAknCollection::EStateHighlightVisible )
       
  2107                     {
       
  2108                     newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex );
       
  2109                     }
       
  2110                 }
       
  2111             else
       
  2112                 {
       
  2113                 newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex );
       
  2114                 }
  2102             }
  2115             }
  2103         else
  2116         else
  2104             {
  2117             {
  2105             // recalculates top index of list when mode be changed
  2118             // recalculates top index of list when mode be changed
  2106             TInt totalItems = iModel->NumberOfItems();
  2119             TInt totalItems = iModel->NumberOfItems();
  3160     }
  3173     }
  3161 
  3174 
  3162 EXPORT_C void CEikListBox::HandleItemAdditionL()
  3175 EXPORT_C void CEikListBox::HandleItemAdditionL()
  3163     {
  3176     {
  3164     _AKNTRACE_FUNC_ENTER;
  3177     _AKNTRACE_FUNC_ENTER;
  3165      //fix the bug EGGO-7SQA4S and EVSG-7TD9WZ 
  3178     __ASSERT_DEBUG( iView, Panic( EEikPanicListBoxNoView ) );
       
  3179     //fix the bug EGGO-7SQA4S and EVSG-7TD9WZ     
  3166     TInt curItemIndex = iView->CurrentItemIndex();
  3180     TInt curItemIndex = iView->CurrentItemIndex();
  3167     if(curItemIndex >= 0 && curItemIndex < iModel->NumberOfItems() )
  3181     if(curItemIndex >= 0 && curItemIndex < iModel->NumberOfItems() )
  3168       {
  3182       {
  3169       TInt newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( curItemIndex );
  3183       TInt newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( curItemIndex );
  3170       iView->SetTopItemIndex( newTopItemIndex );
  3184       iView->SetTopItemIndex( newTopItemIndex );
  5793             TInt index = View()->CurrentItemIndex();
  5807             TInt index = View()->CurrentItemIndex();
  5794             if ( index != KErrNotFound )
  5808             if ( index != KErrNotFound )
  5795             	{
  5809             	{
  5796                 Window().Invalidate( TRect( View()->ItemPos(index), 
  5810                 Window().Invalidate( TRect( View()->ItemPos(index), 
  5797             		                 View()->ItemSize() ) );
  5811             		                 View()->ItemSize() ) );
       
  5812                 if( iItemDrawer->Flags() & 
       
  5813                             CListItemDrawer::ESingleClickDisabledHighlight )
       
  5814                     {
       
  5815                     iView->SetCurrentItemIndex( 0 );
       
  5816                     }
  5798             	}
  5817             	}
  5799             break;
  5818             break;
  5800             }
  5819             }
  5801         case KEikDynamicLayoutVariantSwitch:
  5820         case KEikDynamicLayoutVariantSwitch:
  5802         case KEikMessageColorSchemeChange:
  5821         case KEikMessageColorSchemeChange:
  6338             }
  6357             }
  6339         }
  6358         }
  6340 
  6359 
  6341     TBool blockEvent = EFalse;
  6360     TBool blockEvent = EFalse;
  6342     
  6361     
  6343     TBool allowDragEvent( ( iListBoxFlags & ELeftDownInViewRect ) && iSBFrame && !iListBoxExt->iScrollingDisabled );
  6362     TBool allowDragEvent( ( iListBoxFlags & ELeftDownInViewRect ) && !iListBoxExt->iScrollingDisabled );
  6344 
  6363 
  6345     
  6364     
  6346     switch ( aPointerEvent.iType )
  6365     switch ( aPointerEvent.iType )
  6347         {
  6366         {
  6348         case TPointerEvent::EButton1Down:
  6367         case TPointerEvent::EButton1Down: