calendarui/views/src/calentodocontainer.cpp
branchRCL_3
changeset 20 9c5b1510919f
parent 15 9711e452b5e9
child 25 bf573002ff72
--- a/calendarui/views/src/calentodocontainer.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/views/src/calentodocontainer.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -278,7 +278,7 @@
     delete iController;
     delete iDesArray;
     delete iListBox;
-    delete iEmptyListText;
+    //delete iEmptyListText;
     
     iColorUidArray.Close();
     TRACE_EXIT_POINT;
@@ -390,10 +390,16 @@
     // Transfer iconlist ownership to the listbox
     iListBox->ItemDrawer()->ColumnData()->SetIconArray( iconList );
 
-    // Save empty text and set null for list box.
+    /*// Save empty text and set null for list box.
     // It is made not to display "No data".
     iEmptyListText = iListBox->View()->EmptyListText()->AllocL();
-    iListBox->View()->SetListEmptyTextL( KNullDesC );
+    //iListBox->View()->SetListEmptyTextL( KNullDesC );*/
+    
+    // Set text for empty listbox
+    HBufC* emptyText = StringLoader::LoadLC(R_CALEN_QTN_CALE_NO_EVENTS,
+                                            iEikonEnv);
+    iListBox->View()->SetListEmptyTextL( *emptyText ); //Whenever listbox is empty, it will set with this empty text.
+    CleanupStack::PopAndDestroy(emptyText);
 
     TRACE_EXIT_POINT;
     }
@@ -476,11 +482,13 @@
     TRACE_ENTRY_POINT;
 
     TInt focusIx = KErrNotFound;
-
+    TInt topIx = KErrNotFound;
+    
+    topIx = iListBox->TopItemIndex();
     // If top item is specified, set it
-    if ( iFirstEntryOnScreenIndex != KErrNotFound )
+    if ( topIx != KErrNotFound )
         {
-        iListBox->SetTopItemIndex( iFirstEntryOnScreenIndex );
+        iListBox->SetTopItemIndex( topIx );
         }
 
     if ( iHighlightedRowNumber != KErrNotFound )
@@ -591,7 +599,7 @@
     CleanupStack::PopAndDestroy( listDes );
     CleanupStack::PopAndDestroy( &calendarInfoList ); 
     iListBox->HandleItemAdditionL();
-    iListBox->View()->SetListEmptyTextL( *iEmptyListText );
+    //iListBox->View()->SetListEmptyTextL( *iEmptyListText );
 
     TRACE_EXIT_POINT;
     }
@@ -1186,7 +1194,12 @@
         {
         TInt pointerIndex(-1);
         TBool isItem (iListBox->View()->XYPosToItemIndex(aPointerEvent.iPosition, pointerIndex));
-
+        
+        if(aPointerEvent.iType == TPointerEvent::EButton1Down)
+		{
+                this->GenerateTactileFeedback(); //Tactile feedback.
+		}	
+        
         if(isItem == EFalse && IsEmptyView())
             {
             iListBox->HandlePointerEventL(aPointerEvent);