javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistview.cpp
branchRCL_3
changeset 60 6c158198356e
parent 34 71c436fe3ce0
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
   237         iStylusPopupMarkAll = CSwtMenuItem::NewL(iDisplay, NULL, *iStylusPopupMenu, 0, 0, EAknMarkAll);
   237         iStylusPopupMarkAll = CSwtMenuItem::NewL(iDisplay, NULL, *iStylusPopupMenu, 0, 0, EAknMarkAll);
   238         iStylusPopupMarkAll->SetTextL(iMenuItemMarkAll->Text());
   238         iStylusPopupMarkAll->SetTextL(iMenuItemMarkAll->Text());
   239 
   239 
   240         iStylusPopupUnmarkAll = CSwtMenuItem::NewL(iDisplay, NULL, *iStylusPopupMenu, 1, 0, EAknUnmarkAll);
   240         iStylusPopupUnmarkAll = CSwtMenuItem::NewL(iDisplay, NULL, *iStylusPopupMenu, 1, 0, EAknUnmarkAll);
   241         iStylusPopupUnmarkAll->SetTextL(iMenuItemUnmarkAll->Text());
   241         iStylusPopupUnmarkAll->SetTextL(iMenuItemUnmarkAll->Text());
   242 #endif //RD_SCALABLE_UI_V2        
   242 #endif //RD_SCALABLE_UI_V2
   243     }
   243     }
   244 
   244 
   245     iOldSelectionArray = new(ELeave) CArrayFixFlat<TInt>(2);
   245     iOldSelectionArray = new(ELeave) CArrayFixFlat<TInt>(2);
   246     iSelectionArray = new(ELeave) CArrayFixFlat<TInt>(2);
   246     iSelectionArray = new(ELeave) CArrayFixFlat<TInt>(2);
   247     iGrid->ConstructL(this, gridFlags);
   247     iGrid->ConstructL(this, gridFlags);
   852 
   852 
   853     const MSwtImage* refImg = aImage;
   853     const MSwtImage* refImg = aImage;
   854     const TInt refImgCount = iRefImages.Count();
   854     const TInt refImgCount = iRefImages.Count();
   855     if (refImgCount > aPos)
   855     if (refImgCount > aPos)
   856     {
   856     {
   857         iRefImages.Insert(refImg, aPos);
   857         iRefImages.InsertL(refImg, aPos);
   858     }
   858     }
   859     else
   859     else
   860     {
   860     {
   861         iRefImages.Append(refImg);
   861         iRefImages.AppendL(refImg);
   862     }
   862     }
   863 
   863 
   864 #ifdef DEBUG_CHECK_IMAGES
   864 #ifdef DEBUG_CHECK_IMAGES
   865     CheckRefImages(iRefImages, *(GetIconArray()), iMaxImageSize);
   865     CheckRefImages(iRefImages, *(GetIconArray()), iMaxImageSize);
   866 #endif
   866 #endif
  1348         }
  1348         }
  1349 
  1349 
  1350         CCoeControl::HandleResourceChange(aType);
  1350         CCoeControl::HandleResourceChange(aType);
  1351         SizeChangedL();
  1351         SizeChangedL();
  1352     }
  1352     }
       
  1353     else if (aType == KEikMessageUnfadeWindows
       
  1354              || aType == KEikMessageWindowsFadeChange)
       
  1355     {
       
  1356         CCoeControl::HandleResourceChange(aType);
       
  1357     }
  1353     else
  1358     else
  1354     {
  1359     {
  1355         CCoeControl::HandleResourceChange(aType);
  1360         CCoeControl::HandleResourceChange(aType);
  1356         DoGridCellLayoutL(iDensity);
  1361         DoGridCellLayoutL(iDensity);
  1357     }
  1362     }
  1428         if (GetGridView()->SelectionIndexes()->Count() == 0)
  1433         if (GetGridView()->SelectionIndexes()->Count() == 0)
  1429         {
  1434         {
  1430             iMenuItemUnmarkAll->SetEnabled(EFalse);
  1435             iMenuItemUnmarkAll->SetEnabled(EFalse);
  1431 #ifdef RD_SCALABLE_UI_V2
  1436 #ifdef RD_SCALABLE_UI_V2
  1432             iStylusPopupUnmarkAll->SetEnabled(EFalse);
  1437             iStylusPopupUnmarkAll->SetEnabled(EFalse);
  1433 #endif //RD_SCALABLE_UI_V2            
  1438 #endif //RD_SCALABLE_UI_V2
  1434         }
  1439         }
  1435         else
  1440         else
  1436         {
  1441         {
  1437             iMenuItemUnmarkAll->SetEnabled(ETrue);
  1442             iMenuItemUnmarkAll->SetEnabled(ETrue);
  1438 #ifdef RD_SCALABLE_UI_V2
  1443 #ifdef RD_SCALABLE_UI_V2
  1439             iStylusPopupUnmarkAll->SetEnabled(ETrue);
  1444             iStylusPopupUnmarkAll->SetEnabled(ETrue);
  1440 #endif //RD_SCALABLE_UI_V2                            
  1445 #endif //RD_SCALABLE_UI_V2
  1441         }
  1446         }
  1442 
  1447 
  1443         if (GetGridView()->SelectionIndexes()->Count() == GetGridModel()->NumberOfItems())
  1448         if (GetGridView()->SelectionIndexes()->Count() == GetGridModel()->NumberOfItems())
  1444         {
  1449         {
  1445             iMenuItemMarkAll->SetEnabled(EFalse);
  1450             iMenuItemMarkAll->SetEnabled(EFalse);
  1446 #ifdef RD_SCALABLE_UI_V2
  1451 #ifdef RD_SCALABLE_UI_V2
  1447             iStylusPopupMarkAll->SetEnabled(EFalse);
  1452             iStylusPopupMarkAll->SetEnabled(EFalse);
  1448 #endif //RD_SCALABLE_UI_V2                        
  1453 #endif //RD_SCALABLE_UI_V2
  1449         }
  1454         }
  1450         else
  1455         else
  1451         {
  1456         {
  1452             iMenuItemMarkAll->SetEnabled(ETrue);
  1457             iMenuItemMarkAll->SetEnabled(ETrue);
  1453 #ifdef RD_SCALABLE_UI_V2
  1458 #ifdef RD_SCALABLE_UI_V2
  1454             iStylusPopupMarkAll->SetEnabled(ETrue);
  1459             iStylusPopupMarkAll->SetEnabled(ETrue);
  1455 #endif //RD_SCALABLE_UI_V2                                    
  1460 #endif //RD_SCALABLE_UI_V2
  1456         }
  1461         }
  1457     }
  1462     }
  1458 }
  1463 }
  1459 
  1464 
  1460 // ---------------------------------------------------------------------------
  1465 // ---------------------------------------------------------------------------
  1539 
  1544 
  1540     if (iStylusPopupMenu)
  1545     if (iStylusPopupMenu)
  1541     {
  1546     {
  1542         iStylusPopupMenu->Dispose();
  1547         iStylusPopupMenu->Dispose();
  1543     }
  1548     }
  1544 #endif //RD_SCALABLE_UI_V2    
  1549 #endif //RD_SCALABLE_UI_V2
  1545 
  1550 
  1546     delete iMarkString;
  1551     delete iMarkString;
  1547     delete iUnmarkString;
  1552     delete iUnmarkString;
  1548 
  1553 
  1549     delete iOldSelectionArray;
  1554     delete iOldSelectionArray;
  3657         }
  3662         }
  3658     }
  3663     }
  3659 }
  3664 }
  3660 #endif //RD_JAVA_S60_RELEASE_9_2
  3665 #endif //RD_JAVA_S60_RELEASE_9_2
  3661 
  3666 
       
  3667 TInt CSwtListView::FocusBackgroundPolicy() const
       
  3668 {
       
  3669 #ifdef RD_JAVA_S60_RELEASE_9_2
       
  3670     return ENoFocusBackgroundInCaptionedControl;
       
  3671 #else
       
  3672     return EDefaultFocusBackground;
       
  3673 #endif // RD_JAVA_S60_RELEASE_9_2
       
  3674 }
       
  3675 
       
  3676 void CSwtListView::PrepareForTraverse()
       
  3677 {
       
  3678     ASSERT(iGrid);
       
  3679     ASSERT(iGrid->View());
       
  3680 
       
  3681 #ifdef RD_JAVA_S60_RELEASE_9_2
       
  3682     // AvKon enables highlight only when key event is recieved.
       
  3683     // When traversing, no key event is sent to AvKon, so we
       
  3684     // have to enable highlight by ourselves.
       
  3685     CListItemDrawer* itemDrawer = iGrid->View()->ItemDrawer();
       
  3686     if (itemDrawer)
       
  3687     {
       
  3688         itemDrawer->ClearFlags(CListItemDrawer::ESingleClickDisabledHighlight);
       
  3689     }
       
  3690 #endif //RD_JAVA_S60_RELEASE_9_2
       
  3691 }
       
  3692 
  3662 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK
  3693 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK
  3663 void CSwtListView::DoControlSpecificFeedback(
  3694 void CSwtListView::DoControlSpecificFeedback(
  3664     const TBool& aFirstTap,
  3695     const TBool& aFirstTap,
  3665     const TBool& aTappedToChildRect,
  3696     const TBool& aTappedToChildRect,
  3666     const TPointerEvent& aPointerEvent) const
  3697     const TPointerEvent& aPointerEvent) const