equal
deleted
inserted
replaced
666 } |
666 } |
667 |
667 |
668 // Deliver event to scrollbar |
668 // Deliver event to scrollbar |
669 if (iVScrollBarGrabsPointerEvents && vsb) |
669 if (iVScrollBarGrabsPointerEvents && vsb) |
670 { |
670 { |
671 vsb->HandlePointerEventL(aPointerEvent); |
671 if (!iFlickScrollingOngoing |
672 } |
672 && aPointerEvent.iType == TPointerEvent::EButton1Down) |
|
673 { |
|
674 // Scrollbar was tapped after scrolling stopped |
|
675 // by itself, so no need to redirect events |
|
676 iScrollbarPointerEventToListbox = EFalse; |
|
677 } |
|
678 |
|
679 if (iScrollbarPointerEventToListbox) |
|
680 { |
|
681 // Stops kinetic scrolling when scrollbar is tapped |
|
682 CEikTextListBox::HandlePointerEventL(aPointerEvent); |
|
683 // Continue delivering events until button up appears to prevent |
|
684 // some unexpected behavior in both scrollbar and listbox |
|
685 switch (aPointerEvent.iType) |
|
686 { |
|
687 case TPointerEvent::EButton1Up: |
|
688 iScrollbarPointerEventToListbox = EFalse; |
|
689 break; |
|
690 } |
|
691 } |
|
692 else |
|
693 { |
|
694 // Handles scrollbar behavior |
|
695 vsb->HandlePointerEventL(aPointerEvent); |
|
696 } |
|
697 } |
|
698 |
673 if (iHScrollBarGrabsPointerEvents && hsb) |
699 if (iHScrollBarGrabsPointerEvents && hsb) |
674 { |
700 { |
675 hsb->HandlePointerEventL(aPointerEvent); |
701 hsb->HandlePointerEventL(aPointerEvent); |
676 } |
702 } |
677 |
703 |
867 if (aListBox != this) |
893 if (aListBox != this) |
868 { |
894 { |
869 return; |
895 return; |
870 } |
896 } |
871 |
897 |
|
898 UpdateFlickScrollingState(aEventType); |
|
899 |
872 switch (aEventType) |
900 switch (aEventType) |
873 { |
901 { |
874 // On 5.0, drawing trough Java gives simply a better fps. |
902 // On 5.0, drawing trough Java gives simply a better fps. |
875 #ifdef RD_JAVA_S60_RELEASE_9_2 |
903 #ifdef RD_JAVA_S60_RELEASE_9_2 |
876 case EEventPanningStarted: |
904 case EEventPanningStarted: |
1128 } |
1156 } |
1129 |
1157 |
1130 |
1158 |
1131 CSwtTableListBox::CSwtTableListBox(MSwtDisplay& aDisplay, CSwtTable &aTable) |
1159 CSwtTableListBox::CSwtTableListBox(MSwtDisplay& aDisplay, CSwtTable &aTable) |
1132 : iDisplay(aDisplay), |
1160 : iDisplay(aDisplay), |
1133 iTable(aTable) |
1161 iTable(aTable), |
|
1162 iFlickScrollingOngoing(EFalse) |
|
1163 |
1134 { |
1164 { |
1135 } |
1165 } |
1136 |
1166 |
1137 |
1167 |
1138 void CSwtTableListBox::ConstructL() |
1168 void CSwtTableListBox::ConstructL() |
1188 |
1218 |
1189 TInt CSwtTableListBox::HorizontalScrollPixelsPerPageEvent() |
1219 TInt CSwtTableListBox::HorizontalScrollPixelsPerPageEvent() |
1190 { |
1220 { |
1191 return iTable.ClientRect().Width(); |
1221 return iTable.ClientRect().Width(); |
1192 } |
1222 } |
|
1223 |
|
1224 // --------------------------------------------------------------------------- |
|
1225 // CSwtTableListBox::UpdateFlickScrollingState |
|
1226 // Updates flick scrolling status based on received listbox event. |
|
1227 // --------------------------------------------------------------------------- |
|
1228 // |
|
1229 void CSwtTableListBox::UpdateFlickScrollingState(TListBoxEvent aEventType) |
|
1230 { |
|
1231 switch (aEventType) |
|
1232 { |
|
1233 case EEventFlickStarted: |
|
1234 iFlickScrollingOngoing = ETrue; |
|
1235 iScrollbarPointerEventToListbox = ETrue; |
|
1236 break; |
|
1237 case EEventFlickStopped: |
|
1238 iFlickScrollingOngoing = EFalse; |
|
1239 break; |
|
1240 } |
|
1241 } |