javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdisplaybase.cpp
branchRCL_3
changeset 24 0fd27995241b
parent 19 04becd199f91
child 34 71c436fe3ce0
equal deleted inserted replaced
20:f9bb0fca356a 24:0fd27995241b
   788 TBool ASwtDisplayBase::RevertPointerEvent() const
   788 TBool ASwtDisplayBase::RevertPointerEvent() const
   789 {
   789 {
   790     return iRevertPointerEvent || iLongTapDetected;
   790     return iRevertPointerEvent || iLongTapDetected;
   791 }
   791 }
   792 
   792 
   793 void ASwtDisplayBase::SetRevertPointerEvent(TBool aStatus) 
   793 void ASwtDisplayBase::SetRevertPointerEvent(TBool aStatus)
   794 {
   794 {
   795     iRevertPointerEvent = aStatus;
   795     iRevertPointerEvent = aStatus;
   796 }
   796 }
   797 
   797 
   798 //
   798 //
  1080 
  1080 
  1081     if (aPointerEvent.iType == TPointerEvent::EButton1Down)
  1081     if (aPointerEvent.iType == TPointerEvent::EButton1Down)
  1082     {
  1082     {
  1083         iLongTapControl = NULL;
  1083         iLongTapControl = NULL;
  1084         iLongTapDetected = EFalse;
  1084         iLongTapDetected = EFalse;
       
  1085 
       
  1086         // The Shell is required to already have handled the pointer down.
  1085         MSwtControl* ctrl = iUiUtils->GetPointerGrabbingControl();
  1087         MSwtControl* ctrl = iUiUtils->GetPointerGrabbingControl();
  1086 
  1088 
  1087         // No long tap animation on scrollbars or trimings.
  1089         // No long tap animation on scrollbars or trimings.
  1088         // Long tap animation only if there is a popup menu.
  1090         // Long tap animation only if there is a popup menu.
  1089         if (ctrl && ctrl->IsLongTapAnimationCandidate(aPointerEvent))
  1091         if (ctrl && ctrl->IsLongTapAnimationCandidate(aPointerEvent))
  1090         {
  1092         {
  1091             iLongTapControl = ctrl;
  1093             iLongTapControl = ctrl;
  1092         }
  1094         }
  1093     }
  1095     }
  1094     
  1096 
  1095     iLongTapPointerEvent = aPointerEvent;
  1097     iLongTapPointerEvent = aPointerEvent;
  1096 
  1098 
  1097     if (iLongTapControl)
  1099     if (iLongTapControl)
  1098     {
  1100     {
  1099         iLongTapDetector->PointerEventL(aPointerEvent);
  1101         iLongTapDetector->PointerEventL(aPointerEvent);
  1126         // Control disposed or pen lifted just before menu was about to open.
  1128         // Control disposed or pen lifted just before menu was about to open.
  1127         iLongTapDetected = EFalse;
  1129         iLongTapDetected = EFalse;
  1128         return;
  1130         return;
  1129     }
  1131     }
  1130 
  1132 
  1131     // Will be switched back after the popup menu closes 
  1133     // Will be switched back after the popup menu closes
  1132     // and the late pointer up event was delivered.
  1134     // and the late pointer up event was delivered.
  1133     iLongTapDetected = ETrue;
  1135     iLongTapDetected = ETrue;
  1134 
  1136 
  1135     // Open menu on the longTap cursor position
  1137     // Open menu on the longTap cursor position
  1136     iMenuArranger->OpenStylusPopupMenuL(*ctrl, aPenEventScreenLocation, this);
  1138     iMenuArranger->OpenStylusPopupMenuL(*ctrl, aPenEventScreenLocation, this);
  1146         // Forward delayed pointer event
  1148         // Forward delayed pointer event
  1147         TPointerEvent event(iLongTapPointerEvent);
  1149         TPointerEvent event(iLongTapPointerEvent);
  1148         event.iType = TPointerEvent::EButton1Up;
  1150         event.iType = TPointerEvent::EButton1Up;
  1149         iLongTapControl->HandlePointerEventL(event); // revert
  1151         iLongTapControl->HandlePointerEventL(event); // revert
  1150     }
  1152     }
  1151     
  1153 
  1152     // Just to clear the flags.
  1154     // Just to clear the flags.
  1153     CancelLongTapAnimation();
  1155     CancelLongTapAnimation();
  1154 }
  1156 }
  1155 
  1157 
  1156 // From MSwtMediaKeysListener
  1158 // From MSwtMediaKeysListener