uifw/EikStd/coctlsrc/EIKLBX.CPP
branchRCL_3
changeset 6 9f56a4e1b8ab
parent 3 8ca85d2f0db7
child 7 08e69e956a8c
--- a/uifw/EikStd/coctlsrc/EIKLBX.CPP	Fri Mar 12 15:43:43 2010 +0200
+++ b/uifw/EikStd/coctlsrc/EIKLBX.CPP	Mon Mar 15 12:41:34 2010 +0200
@@ -944,6 +944,7 @@
         {
         EnableHighlight( EFalse );
         iListBox.iView->DrawItem( iLongTappedItem );
+        iListBox.iView->SetCurrentItemIndex( 0 );
         iLongTappedItem = KErrNotFound;
         }
     }
@@ -2098,7 +2099,19 @@
         	|| iListBoxExt && iListBoxExt->iPhysics 
         	&& currentItemIndex == ( topItemIndex + numberOfItems - 1 ) )
             {
-            newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex );
+            if ( iListBoxExt && iListBoxExt->iSingleClickEnabled )
+                {
+                // is single click is enabled, highlight must also be visible
+                if ( iListBoxExt->CollectionState()
+                        & MAknCollection::EStateHighlightVisible )
+                    {
+                    newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex );
+                    }
+                }
+            else
+                {
+                newTopItemIndex = iView->CalcNewTopItemIndexSoItemIsVisible( currentItemIndex );
+                }
             }
         else
             {
@@ -3162,7 +3175,8 @@
 EXPORT_C void CEikListBox::HandleItemAdditionL()
     {
     _AKNTRACE_FUNC_ENTER;
-     //fix the bug EGGO-7SQA4S and EVSG-7TD9WZ 
+    __ASSERT_DEBUG( iView, Panic( EEikPanicListBoxNoView ) );
+    //fix the bug EGGO-7SQA4S and EVSG-7TD9WZ     
     TInt curItemIndex = iView->CurrentItemIndex();
     if(curItemIndex >= 0 && curItemIndex < iModel->NumberOfItems() )
       {
@@ -5795,6 +5809,11 @@
             	{
                 Window().Invalidate( TRect( View()->ItemPos(index), 
             		                 View()->ItemSize() ) );
+                if( iItemDrawer->Flags() & 
+                            CListItemDrawer::ESingleClickDisabledHighlight )
+                    {
+                    iView->SetCurrentItemIndex( 0 );
+                    }
             	}
             break;
             }
@@ -6340,7 +6359,7 @@
 
     TBool blockEvent = EFalse;
     
-    TBool allowDragEvent( ( iListBoxFlags & ELeftDownInViewRect ) && iSBFrame && !iListBoxExt->iScrollingDisabled );
+    TBool allowDragEvent( ( iListBoxFlags & ELeftDownInViewRect ) && !iListBoxExt->iScrollingDisabled );
 
     
     switch ( aPointerEvent.iType )