equal
deleted
inserted
replaced
205 // |
205 // |
206 EXPORT_C void CHgScroller::SetSelectedIndex( TInt aIndex ) |
206 EXPORT_C void CHgScroller::SetSelectedIndex( TInt aIndex ) |
207 { |
207 { |
208 if( aIndex >= 0 && aIndex < iItems.Count() ) |
208 if( aIndex >= 0 && aIndex < iItems.Count() ) |
209 { |
209 { |
210 iSelectedIndex = iItems.Count() - 1; |
210 if( !IsDisplayed( aIndex ) ) |
211 FitSelectionToView(); |
211 { |
|
212 iSelectedIndex = iItems.Count() - 1; |
|
213 FitSelectionToView(); |
|
214 } |
212 |
215 |
213 iSelectedIndex = aIndex; |
216 iSelectedIndex = aIndex; |
214 // Move view position so that it is fully visible. |
217 // Move view position so that it is fully visible. |
215 FitSelectionToView(); |
218 FitSelectionToView(); |
216 SelectionChanged(); |
219 SelectionChanged(); |
539 // CHgScroller::InitScrollbarL() |
542 // CHgScroller::InitScrollbarL() |
540 // ----------------------------------------------------------------------------- |
543 // ----------------------------------------------------------------------------- |
541 // |
544 // |
542 void CHgScroller::InitScrollbarL() |
545 void CHgScroller::InitScrollbarL() |
543 { |
546 { |
544 if( iScrollbar && iItemCount ) |
547 if( iScrollbar ) |
545 { |
548 { |
546 TBool prevStatic = iScrollbar->IsStatic(); |
549 TBool prevStatic = iScrollbar->IsStatic(); |
547 iScrollbar->InitScrollBarL( Rect(), |
550 iScrollbar->InitScrollBarL( Rect(), |
548 TotalSize(), |
551 TotalSize(), |
549 TSize(iWidth, iHeight), |
552 TSize(iWidth, iHeight), |
1081 |
1084 |
1082 if(newRow != iCurrentRow) |
1085 if(newRow != iCurrentRow) |
1083 { |
1086 { |
1084 iCurrentRow = newRow; |
1087 iCurrentRow = newRow; |
1085 |
1088 |
|
1089 TBool needsFeedback = |
|
1090 ( iCurrentRow >= 0 && iCurrentRow <= iItems.Count() ) |
|
1091 || ( iItems.Count() - iCurrentRow > ItemsOnScreen() ); |
|
1092 |
1086 TInt action = iPhysics->OngoingPhysicsAction(); |
1093 TInt action = iPhysics->OngoingPhysicsAction(); |
1087 if( action != CAknPhysics::EAknPhysicsActionNone ) |
1094 if( action != CAknPhysics::EAknPhysicsActionNone && needsFeedback ) |
1088 { |
1095 { |
1089 TTouchFeedbackType type( ETouchFeedbackVibra ); |
1096 TTouchFeedbackType type( ETouchFeedbackVibra ); |
1090 if ( CAknPhysics::EAknPhysicsActionDragging == action ) |
1097 if ( CAknPhysics::EAknPhysicsActionDragging == action ) |
1091 { |
1098 { |
1092 type = TTouchFeedbackType(ETouchFeedbackVibra | ETouchFeedbackAudio); |
1099 type = TTouchFeedbackType(ETouchFeedbackVibra | ETouchFeedbackAudio); |
1467 // CHgScroller::HandleLosingForeground() |
1474 // CHgScroller::HandleLosingForeground() |
1468 // ----------------------------------------------------------------------------- |
1475 // ----------------------------------------------------------------------------- |
1469 // |
1476 // |
1470 void CHgScroller::HandleLosingForeground() |
1477 void CHgScroller::HandleLosingForeground() |
1471 { |
1478 { |
|
1479 iPointerDown = EFalse; |
1472 iPopupText1.Zero(); |
1480 iPopupText1.Zero(); |
1473 iPopupText2.Zero(); |
1481 iPopupText2.Zero(); |
1474 } |
1482 } |
1475 |
1483 |
1476 // --------------------------------------------------------------------------- |
1484 // --------------------------------------------------------------------------- |