672 { |
667 { |
673 AKNTASHOOK_REMOVE(); |
668 AKNTASHOOK_REMOVE(); |
674 if ( iAvkonAppUiBase ) |
669 if ( iAvkonAppUiBase ) |
675 { |
670 { |
676 CAknPointerEventModifier* modifier = iAvkonAppUiBase->PointerEventModifier(); |
671 CAknPointerEventModifier* modifier = iAvkonAppUiBase->PointerEventModifier(); |
677 |
672 |
678 if ( modifier ) |
673 if ( modifier ) |
679 { |
674 { |
680 modifier->Pop( *this ); |
675 modifier->Pop( *this ); |
681 } |
676 } |
682 } |
677 } |
683 |
678 |
684 AknsUtils::DeregisterControlPosition( this ); |
679 AknsUtils::DeregisterControlPosition( this ); |
685 } |
680 } |
686 |
681 |
687 EXPORT_C void CAknDoubleSpanScrollBar::ConstructL(TBool aWindowOwning, MEikScrollBarObserver* aScrollBarObserver,const CCoeControl* aParent, |
682 EXPORT_C void CAknDoubleSpanScrollBar::ConstructL(TBool aWindowOwning, MEikScrollBarObserver* aScrollBarObserver,const CCoeControl* aParent, |
688 TOrientation aOrientation,TInt /*aLength*/,TInt aScrollBarFlags ) |
683 TOrientation aOrientation,TInt /*aLength*/,TInt aScrollBarFlags ) |
914 |
892 |
915 |
893 |
916 EXPORT_C void CAknDoubleSpanScrollBar::SizeChanged() |
894 EXPORT_C void CAknDoubleSpanScrollBar::SizeChanged() |
917 { |
895 { |
918 CAknPointerEventModifier* modifier = iAvkonAppUiBase ? iAvkonAppUiBase->PointerEventModifier() : NULL; |
896 CAknPointerEventModifier* modifier = iAvkonAppUiBase ? iAvkonAppUiBase->PointerEventModifier() : NULL; |
919 |
897 |
920 if ( modifier && IsVisible() ) |
898 if (iExtension) |
921 { |
899 { |
922 modifier->Update( *this, ExtensionArea() ); |
900 CAknDoubleSpanScrollBarExtension* extension = static_cast<CAknDoubleSpanScrollBarExtension*> (iExtension); |
|
901 if ( modifier && IsVisible() && !( extension->iExtensionType & ENoExpandedTouchArea ) ) |
|
902 { |
|
903 modifier->Update( *this, ExtensionArea() ); |
|
904 } |
|
905 } |
|
906 else |
|
907 { |
|
908 if ( modifier && IsVisible() ) |
|
909 { |
|
910 modifier->Update( *this, ExtensionArea() ); |
|
911 } |
923 } |
912 } |
924 |
913 |
925 AknsUtils::RegisterControlPosition( this ); |
914 AknsUtils::RegisterControlPosition( this ); |
926 if (iExtension) |
915 if (iExtension) |
927 { |
916 { |
1052 // clear the pointer down info on pen up and hide info popup |
1041 // clear the pointer down info on pen up and hide info popup |
1053 TInt lastPointerDownOn = extension->iPointerDownOn; |
1042 TInt lastPointerDownOn = extension->iPointerDownOn; |
1054 // The real span area available (as pixels) |
1043 // The real span area available (as pixels) |
1055 scrollSpanPix -= thumbSpanPix; |
1044 scrollSpanPix -= thumbSpanPix; |
1056 |
1045 |
1057 |
1046 |
1058 // touch release on thumb |
1047 // touch release on thumb |
1059 TBool thumbPressed = |
1048 TBool thumbPressed = |
1060 ( position < (thumbPositionPix + thumbSpanPix) |
1049 ( position < (thumbPositionPix + thumbSpanPix) |
1061 && position > thumbPositionPix ); |
1050 && position > thumbPositionPix ); |
1062 if ( thumbPressed && |
1051 if ( thumbPressed && |
1063 aPointerEvent.iType == TPointerEvent::EButton1Up && |
1052 aPointerEvent.iType == TPointerEvent::EButton1Up && |
1064 thumbSpan < scrollSpan ) |
1053 thumbSpan < scrollSpan ) |
|
1054 { |
|
1055 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
1056 |
|
1057 CCoeControl* parent = Parent(); |
|
1058 TBool feedbackEnabled = !IsDimmed() && IsVisible(); |
|
1059 if (parent && feedbackEnabled) |
1065 { |
1060 { |
1066 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1061 // check the same for the parent |
1067 |
1062 feedbackEnabled = !parent->IsDimmed() && parent->IsVisible(); |
1068 CCoeControl* parent = Parent(); |
|
1069 TBool feedbackEnabled = !IsDimmed() && IsVisible(); |
|
1070 if (parent && feedbackEnabled) |
|
1071 { |
|
1072 // check the same for the parent |
|
1073 feedbackEnabled = !parent->IsDimmed() && parent->IsVisible(); |
|
1074 } |
|
1075 if ( feedback && feedbackEnabled ) |
|
1076 { |
|
1077 feedback->InstantFeedback( this, |
|
1078 ETouchFeedbackBasicSlider, |
|
1079 ETouchFeedbackVibra, |
|
1080 aPointerEvent ); |
|
1081 } |
|
1082 } |
1063 } |
1083 |
1064 if ( feedback && feedbackEnabled ) |
|
1065 { |
|
1066 feedback->InstantFeedback( this, |
|
1067 ETouchFeedbackSlider, |
|
1068 ETouchFeedbackVibra, |
|
1069 aPointerEvent ); |
|
1070 } |
|
1071 } |
|
1072 |
|
1073 if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
1074 { |
|
1075 extension->iPointerDownOn = CEikScrollBar::ENone; |
|
1076 |
|
1077 // Highlight off always when the pointer is lifted |
|
1078 indicator->SetHandleHighlight( EFalse ); |
|
1079 indicator->DrawDeferred(); |
|
1080 indicator->SetBackgroudHighlight( EFalse ); |
|
1081 |
|
1082 if ( extension->iPopupController ) |
|
1083 { |
|
1084 extension->iPopupController->HideInfoPopupNote(); |
|
1085 extension->iShowPopup = EFalse; |
|
1086 } |
|
1087 } |
1084 // check that scroll bar is useful |
1088 // check that scroll bar is useful |
1085 if (thumbSpan < scrollSpan) |
1089 if (thumbSpan < scrollSpan) |
1086 { |
1090 { |
1087 // check where the pointer down occured |
1091 // check where the pointer down occured |
1088 if(aPointerEvent.iType == TPointerEvent::EButton1Down ) |
1092 if(aPointerEvent.iType == TPointerEvent::EButton1Down ) |
1089 { |
1093 { |
1090 indicator->SetBackgroudHighlight( ETrue ); |
1094 indicator->SetBackgroudHighlight( ETrue ); |
1091 |
1095 |
1092 extension->iPointerDownPosition = position; |
1096 extension->iPointerDownPosition = position; |
1093 |
1097 |
1094 if(iButtons.iIncreaseNudge && |
1098 if(iButtons.iIncreaseNudge && |
1095 iButtons.iIncreaseNudge->Rect().Contains(aPointerEvent.iPosition)) |
1099 iButtons.iIncreaseNudge->Rect().Contains(aPointerEvent.iPosition)) |
1096 { |
1100 { |
1097 extension->iPointerDownOn = CEikScrollBar::EIncreaseNudgeButton; |
1101 extension->iPointerDownOn = CEikScrollBar::EIncreaseNudgeButton; |
1098 } |
1102 } |
1118 { |
1122 { |
1119 extension->iPointerDownOn = CEikScrollBar::EIncreaseShaft; |
1123 extension->iPointerDownOn = CEikScrollBar::EIncreaseShaft; |
1120 } |
1124 } |
1121 } |
1125 } |
1122 |
1126 |
1123 if (aPointerEvent.iType == TPointerEvent::EButton1Up) |
|
1124 { |
|
1125 extension->iPointerDownOn = CEikScrollBar::ENone; |
|
1126 |
|
1127 // Highlight off always when the pointer is lifted |
|
1128 indicator->SetHandleHighlight( EFalse ); |
|
1129 indicator->DrawDeferred(); |
|
1130 indicator->SetBackgroudHighlight( EFalse ); |
|
1131 |
|
1132 if ( extension->iPopupController ) |
|
1133 { |
|
1134 extension->iPopupController->HideInfoPopupNote(); |
|
1135 extension->iShowPopup = EFalse; |
|
1136 } |
|
1137 } |
|
1138 |
|
1139 // respond to the pointer event |
1127 // respond to the pointer event |
1140 switch(extension->iPointerDownOn) |
1128 switch(extension->iPointerDownOn) |
1141 { |
1129 { |
1142 case CEikScrollBar::EDecreaseShaft: |
1130 case CEikScrollBar::EDecreaseShaft: |
1143 case CEikScrollBar::EIncreaseShaft: |
1131 case CEikScrollBar::EIncreaseShaft: |
1152 thumbPosition -= thumbSpan; |
1140 thumbPosition -= thumbSpan; |
1153 thumbPosition = Max(0, thumbPosition); |
1141 thumbPosition = Max(0, thumbPosition); |
1154 |
1142 |
1155 |
1143 |
1156 TInt prevPosValue = extension->ThumbPosition(); |
1144 TInt prevPosValue = extension->ThumbPosition(); |
1157 |
1145 |
1158 // This will update the thumb's pixel extent, used |
1146 // This will update the thumb's pixel extent, used |
1159 // below |
1147 // below |
1160 extension->SetModelThumbPosition(thumbPosition); |
1148 extension->SetModelThumbPosition(thumbPosition); |
1161 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1149 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1162 |
1150 |
1172 // check the same for the parent |
1160 // check the same for the parent |
1173 feedbackEnabled = !parent->IsDimmed() && parent->IsVisible(); |
1161 feedbackEnabled = !parent->IsDimmed() && parent->IsVisible(); |
1174 } |
1162 } |
1175 if ( feedback && feedbackEnabled ) |
1163 if ( feedback && feedbackEnabled ) |
1176 { |
1164 { |
1177 feedback->InstantFeedback( this, ETouchFeedbackBasicSlider, aPointerEvent ); |
1165 feedback->InstantFeedback( this, ETouchFeedbackSlider, aPointerEvent ); |
1178 } |
1166 } |
1179 } |
1167 } |
1180 |
1168 |
1181 // request pointer repeat until the thumb reaches the pen down position |
1169 // request pointer repeat until the thumb reaches the pen down position |
1182 TInt newThumbPosPix = indicator->GetCurrentThumbPositionInPixels(); |
1170 TInt newThumbPosPix = indicator->GetCurrentThumbPositionInPixels(); |
1222 // check the same for the parent |
1210 // check the same for the parent |
1223 feedbackEnabled = !parent->IsDimmed() && parent->IsVisible(); |
1211 feedbackEnabled = !parent->IsDimmed() && parent->IsVisible(); |
1224 } |
1212 } |
1225 if ( feedback && feedbackEnabled ) |
1213 if ( feedback && feedbackEnabled ) |
1226 { |
1214 { |
1227 feedback->InstantFeedback( this, ETouchFeedbackBasicSlider, aPointerEvent ); |
1215 feedback->InstantFeedback( this, ETouchFeedbackSlider, aPointerEvent ); |
1228 } |
1216 } |
1229 } |
1217 } |
1230 |
1218 |
1231 // request pointer repeat until the thumb reaches the pen down position |
1219 // request pointer repeat until the thumb reaches the pen down position |
1232 TInt newThumbPosPix = indicator->GetCurrentThumbPositionInPixels(); |
1220 TInt newThumbPosPix = indicator->GetCurrentThumbPositionInPixels(); |
1270 { |
1258 { |
1271 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1259 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1272 |
1260 |
1273 if ( feedback ) |
1261 if ( feedback ) |
1274 { |
1262 { |
1275 TTouchFeedbackType fbType = TTouchFeedbackType( |
1263 TTouchFeedbackType fbType = TTouchFeedbackType( |
1276 ETouchFeedbackAudio | |
1264 ETouchFeedbackAudio | |
1277 ETouchFeedbackVibra ); |
1265 ETouchFeedbackVibra ); |
1278 |
1266 |
1279 feedback->InstantFeedback( this, ETouchFeedbackBasicSlider, fbType, aPointerEvent ); |
1267 feedback->InstantFeedback( this, ETouchFeedbackSlider, fbType, aPointerEvent ); |
1280 } |
1268 } |
1281 } |
1269 } |
1282 |
1270 |
1283 if( aPointerEvent.iType == TPointerEvent::EDrag |
1271 if( aPointerEvent.iType == TPointerEvent::EDrag |
1284 || aPointerEvent.iType == TPointerEvent::EButtonRepeat ) |
1272 || aPointerEvent.iType == TPointerEvent::EButtonRepeat ) |
1285 { |
1273 { |
1286 // performace improving. Too many drag event received, handling every single event |
1274 // performace improving. Too many drag event received, handling every single event |
1287 // will use too much CPU time. |
1275 // will use too much CPU time. |
1288 TTime now; |
1276 TTime now; |
1289 now.HomeTime(); |
1277 now.HomeTime(); |
1290 if ( extension->iDragged && |
1278 if ( extension->iDragged && |
1291 now.MicroSecondsFrom( extension->iLastDrag ) |
1279 now.MicroSecondsFrom( extension->iLastDrag ) |
1292 < KScrollDragTimeout ) |
1280 < KScrollDragTimeout ) |
1293 { |
1281 { |
1294 break; // ignore drag for this time |
1282 break; // ignore drag for this time |
1295 } |
1283 } |
1296 extension->iDragged = ETrue; // after this time, iLastDragged has value. |
1284 extension->iDragged = ETrue; // after this time, iLastDragged has value. |
1297 extension->iLastDrag = now; |
1285 extension->iLastDrag = now; |
1298 |
1286 |
1299 thumbPositionPix = position - extension->iPointerOffsetFromThumb; |
1287 thumbPositionPix = position - extension->iPointerOffsetFromThumb; |
1300 TInt oldPosition = thumbPosition; |
1288 TInt oldPosition = thumbPosition; |
1301 TReal newPosition = thumbPositionPix * ( scrollSpan - thumbSpan ) / (TReal)scrollSpanPix; |
1289 TReal newPosition = thumbPositionPix * ( scrollSpan - thumbSpan ) / (TReal)scrollSpanPix; |
1302 thumbPosition = newPosition; |
1290 thumbPosition = newPosition; |
1303 |
1291 |
1311 thumbPosition = Max(0, thumbPosition); |
1299 thumbPosition = Max(0, thumbPosition); |
1312 thumbPosition = Min((scrollSpan - thumbSpan), thumbPosition); |
1300 thumbPosition = Min((scrollSpan - thumbSpan), thumbPosition); |
1313 |
1301 |
1314 if(thumbPosition != oldPosition) |
1302 if(thumbPosition != oldPosition) |
1315 { |
1303 { |
1316 // Smooth continuous tactile feedback is produced |
|
1317 // during thumb dragging. The tactile feedback API |
|
1318 // filters out possible re-startings of the effect. |
|
1319 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
|
1320 |
|
1321 if ( feedback ) |
|
1322 { |
|
1323 TTimeIntervalMicroSeconds32 timeout( 300000 ); |
|
1324 feedback->StartFeedback( this, |
|
1325 ETouchContinuousSlider, |
|
1326 &aPointerEvent, |
|
1327 KIntensity, // intensity 100% |
|
1328 timeout ); |
|
1329 } |
|
1330 extension->SetModelThumbPosition(thumbPosition); |
1304 extension->SetModelThumbPosition(thumbPosition); |
1331 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1305 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1332 |
1306 |
1333 if(indicator->DrawBackgroundState()) |
1307 if(indicator->DrawBackgroundState()) |
1334 indicator->DrawNow(); |
1308 indicator->DrawNow(); |
1344 } |
1318 } |
1345 // Show popup info |
1319 // Show popup info |
1346 if ( extension->iShowPopup && extension->iPopupController ) |
1320 if ( extension->iShowPopup && extension->iPopupController ) |
1347 { |
1321 { |
1348 TPoint infoPoint = PositionRelativeToScreen(); |
1322 TPoint infoPoint = PositionRelativeToScreen(); |
1349 |
1323 |
1350 if ( iOrientation == EVertical ) |
1324 if ( iOrientation == EVertical ) |
1351 { |
1325 { |
1352 if ( AknLayoutUtils::LayoutMirrored() ) |
1326 if ( AknLayoutUtils::LayoutMirrored() ) |
|
1327 { |
|
1328 TRect mainPaneRect( 0, 0, 0, 0 ); |
|
1329 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
|
1330 mainPaneRect ); |
|
1331 TInt mainPaneWidth = mainPaneRect.Width(); |
|
1332 infoPoint.iX += ( mainPaneWidth - infoPoint.iX + Rect().Width() ) / 2 ; |
|
1333 infoPoint.iY += aPointerEvent.iPosition.iY; |
|
1334 extension->iPopupController->SetPositionAndAlignment ( |
|
1335 infoPoint, EHRightVCenter ); |
|
1336 } |
|
1337 else |
1353 { |
1338 { |
1354 infoPoint.iX += Rect().Width(); |
1339 infoPoint.iX = infoPoint.iX / 2; |
1355 infoPoint.iY += aPointerEvent.iPosition.iY; |
1340 infoPoint.iY += aPointerEvent.iPosition.iY; |
1356 extension->iPopupController->SetPositionAndAlignment ( |
1341 extension->iPopupController->SetPositionAndAlignment ( |
1357 infoPoint, EHLeftVCenter ); |
1342 infoPoint, EHLeftVCenter ); |
1358 } |
1343 } |
1359 else |
|
1360 { |
|
1361 infoPoint.iY += aPointerEvent.iPosition.iY; |
|
1362 extension->iPopupController->SetPositionAndAlignment ( |
|
1363 infoPoint, EHRightVCenter ); |
|
1364 } |
|
1365 } |
1344 } |
1366 else if ( iOrientation == EHorizontal ) |
1345 else if ( iOrientation == EHorizontal ) |
1367 { |
1346 { |
|
1347 //infoPoint.iY = infoPoint.iY / 2; |
1368 infoPoint.iX += aPointerEvent.iPosition.iX; |
1348 infoPoint.iX += aPointerEvent.iPosition.iX; |
1369 extension->iPopupController->SetPositionAndAlignment( |
1349 extension->iPopupController->SetPositionAndAlignment( |
1370 infoPoint, EHCenterVBottom ); |
1350 infoPoint, EHCenterVBottom ); |
1371 } |
1351 } |
1372 extension->iPopupController->ShowInfoPopupNote(); |
1352 extension->iPopupController->ShowInfoPopupNote(); |
1414 // button may be obsolete. |
1383 // button may be obsolete. |
1415 // Sensitive feedback given for each "nudge" |
1384 // Sensitive feedback given for each "nudge" |
1416 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1385 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1417 if ( feedback ) |
1386 if ( feedback ) |
1418 { |
1387 { |
1419 feedback->InstantFeedback ( this, ETouchFeedbackBasicSlider, aPointerEvent ); |
1388 feedback->InstantFeedback ( this, ETouchFeedbackSlider, aPointerEvent ); |
1420 } |
1389 } |
1421 extension->SetModelThumbPosition(thumbPosition); |
1390 extension->SetModelThumbPosition(thumbPosition); |
1422 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1391 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1423 if(indicator->DrawBackgroundState()) |
1392 if(indicator->DrawBackgroundState()) |
1424 indicator->DrawNow(); |
1393 indicator->DrawNow(); |
1457 // button may be obsolete. |
1426 // button may be obsolete. |
1458 // Sensitive feedback given for each "nudge" |
1427 // Sensitive feedback given for each "nudge" |
1459 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1428 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1460 if ( feedback ) |
1429 if ( feedback ) |
1461 { |
1430 { |
1462 feedback->InstantFeedback ( this, ETouchFeedbackBasicSlider, aPointerEvent ); |
1431 feedback->InstantFeedback ( this, ETouchFeedbackSlider, aPointerEvent ); |
1463 } |
1432 } |
1464 extension->SetModelThumbPosition(thumbPosition); |
1433 extension->SetModelThumbPosition(thumbPosition); |
1465 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1434 indicator->SetIndicatorValues(scrollSpan, thumbPosition, thumbSpan, 0, 0); |
1466 if(indicator->DrawBackgroundState()) |
1435 if(indicator->DrawBackgroundState()) |
1467 indicator->DrawNow(); |
1436 indicator->DrawNow(); |
2358 { |
2321 { |
2359 // Usage of hard-coded parent rectangle is acceptable since we're |
2322 // Usage of hard-coded parent rectangle is acceptable since we're |
2360 // interested in only about the ratio between scrollbar and extension. |
2323 // interested in only about the ratio between scrollbar and extension. |
2361 TAknLayoutRect layoutRect; |
2324 TAknLayoutRect layoutRect; |
2362 layoutRect.LayoutRect( TRect( 0, 0, 200, 200 ), AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ).LayoutLine() ); |
2325 layoutRect.LayoutRect( TRect( 0, 0, 200, 200 ), AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ).LayoutLine() ); |
2363 |
2326 |
2364 TRect parent( layoutRect.Rect() ); // parent of both extension and scrollbar |
2327 TRect parent( layoutRect.Rect() ); // parent of both extension and scrollbar |
2365 |
2328 |
2366 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::scroll_pane( 0 ).LayoutLine() ); |
2329 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::scroll_pane( 0 ).LayoutLine() ); |
2367 |
2330 |
2368 TRect scrollbar( layoutRect.Rect() ); |
2331 TRect scrollbar( layoutRect.Rect() ); |
2369 |
2332 |
2370 CAknDoubleSpanScrollBarExtension* extension1 = static_cast<CAknDoubleSpanScrollBarExtension*> (iExtension); |
2333 CAknDoubleSpanScrollBarExtension* extension1 = static_cast<CAknDoubleSpanScrollBarExtension*> (iExtension); |
2371 if( extension1->iExtensionType & ENormalExpandedTouchArea ) |
2334 if( extension1->iExtensionType & ENormalExpandedTouchArea ) |
2372 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar( 0 ).LayoutLine() ); |
2335 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar( 0 ).LayoutLine() ); |
2373 else if( extension1->iExtensionType & EScaleExpandedTouchArea ) |
2336 else if( extension1->iExtensionType & EScaleExpandedTouchArea ) |
2374 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar_cale( 0 ).LayoutLine() ); |
2337 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar_cale( 0 ).LayoutLine() ); |
2375 else |
2338 else |
2376 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar( 0 ).LayoutLine() ); |
2339 layoutRect.LayoutRect( parent, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar( 0 ).LayoutLine() ); |
2377 TRect extension( layoutRect.Rect() ); |
2340 TRect extension( layoutRect.Rect() ); |
2378 |
2341 |
2379 TRect area; |
2342 TRect area; |
2380 |
2343 |
|
2344 if ( iParentControl ) |
|
2345 { |
|
2346 CCoeControl* windowOwningParent = iParentControl; |
|
2347 while ( windowOwningParent && !windowOwningParent->OwnsWindow() ) |
|
2348 { |
|
2349 windowOwningParent = windowOwningParent->Parent(); |
|
2350 } |
|
2351 |
|
2352 if ( windowOwningParent ) |
|
2353 { |
|
2354 TInt xGap = 0; |
|
2355 TRect scrollBarRect = Rect(); |
|
2356 TRect parentRect = windowOwningParent->Rect(); |
|
2357 |
|
2358 if ( OwnsWindow() ) |
|
2359 { |
|
2360 scrollBarRect.Move( Position().iX - |
|
2361 windowOwningParent->Position().iX, 0 ); |
|
2362 } |
|
2363 if ( iOrientation == CEikScrollBar::EVertical ) |
|
2364 { |
|
2365 // left to right layout in use |
|
2366 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2367 { |
|
2368 xGap = parentRect.iBr.iX - scrollBarRect.iBr.iX; |
|
2369 if ( Abs( xGap ) < scrollBarRect.Width() ) |
|
2370 { |
|
2371 extension.iBr.iX += xGap; |
|
2372 } |
|
2373 } |
|
2374 // right to left layout in use |
|
2375 else |
|
2376 { |
|
2377 xGap = parentRect.iTl.iX - scrollBarRect.iTl.iX; |
|
2378 if ( Abs( xGap ) < scrollBarRect.Width() ) |
|
2379 { |
|
2380 extension.iTl.iX += xGap; |
|
2381 } |
|
2382 } |
|
2383 } |
|
2384 else |
|
2385 { |
|
2386 xGap = parentRect.iBr.iY - scrollBarRect.iBr.iY; |
|
2387 if ( Abs( xGap ) < scrollBarRect.Height() ) |
|
2388 { |
|
2389 extension.iBr.iY += xGap; |
|
2390 } |
|
2391 } |
|
2392 } |
|
2393 } |
|
2394 |
2381 if ( iOrientation == CEikScrollBar::EVertical ) |
2395 if ( iOrientation == CEikScrollBar::EVertical ) |
2382 { |
2396 { |
2383 area.iTl.iX = extension.iTl.iX - scrollbar.iTl.iX; |
2397 area.iTl.iX = extension.iTl.iX - scrollbar.iTl.iX; |
2384 area.iTl.iY = scrollbar.iTl.iY - extension.iTl.iY; |
2398 area.iTl.iY = scrollbar.iTl.iY - extension.iTl.iY; |
2385 area.iBr.iX = area.iTl.iX + extension.Width(); |
2399 area.iBr.iX = area.iTl.iX + extension.Width(); |