690 HandleFocusChanged(aDrawNow); |
690 HandleFocusChanged(aDrawNow); |
691 } |
691 } |
692 |
692 |
693 void CSwtComposite::PositionChanged() |
693 void CSwtComposite::PositionChanged() |
694 { |
694 { |
|
695 if (IsShell()) |
|
696 { |
|
697 const TInt childCount = iChildren.Count(); |
|
698 for (TInt i = 0; i < childCount; ++i) |
|
699 { |
|
700 MSwtControl* child = iChildren[i]; |
|
701 // We reset the position of child control in order to |
|
702 // correctly display scrollbar's background |
|
703 if (!child->IsShell() && child->ScrollableInterface()) |
|
704 { |
|
705 CCoeControl& coeChild = child->CoeControl(); |
|
706 TPoint pos(coeChild.Position()); |
|
707 coeChild.SetPosition(pos); |
|
708 } |
|
709 } |
|
710 } |
695 RectChanged(); |
711 RectChanged(); |
696 HandlePositionChanged(); |
712 HandlePositionChanged(); |
697 } |
713 } |
698 |
714 |
699 void CSwtComposite::SizeChanged() |
715 void CSwtComposite::SizeChanged() |
971 utils.SetSplitInputViewSize(aSize); |
987 utils.SetSplitInputViewSize(aSize); |
972 } |
988 } |
973 else |
989 else |
974 { |
990 { |
975 ASwtScrollableBase::SetWidgetSize(aSize); |
991 ASwtScrollableBase::SetWidgetSize(aSize); |
|
992 } |
|
993 } |
|
994 |
|
995 void CSwtComposite::HandleHighlightChange() |
|
996 { |
|
997 TInt count = iChildren.Count(); |
|
998 |
|
999 for (TInt i = 0; i < count; ++i) |
|
1000 { |
|
1001 MSwtControl* child = iChildren[i]; |
|
1002 if (!child->IsShell()) |
|
1003 { |
|
1004 child->HandleHighlightChange(); |
|
1005 } |
976 } |
1006 } |
977 } |
1007 } |
978 |
1008 |
979 void CSwtComposite::DrawScrollBarBackground(const TRect& aRect) const |
1009 void CSwtComposite::DrawScrollBarBackground(const TRect& aRect) const |
980 { |
1010 { |
1417 return iPhysicsAction; |
1447 return iPhysicsAction; |
1418 } |
1448 } |
1419 |
1449 |
1420 // From MAknPhysicsObserver |
1450 // From MAknPhysicsObserver |
1421 void CSwtComposite::ViewPositionChanged(const TPoint& aNewPosition, |
1451 void CSwtComposite::ViewPositionChanged(const TPoint& aNewPosition, |
1422 TBool aDrawNow, TUint /*aFlags*/) |
1452 TBool /*aDrawNow*/, TUint /*aFlags*/) |
1423 { |
1453 { |
1424 if (!iScrlCompContent || iPhysicsViewPos == aNewPosition) |
1454 if (!iScrlCompContent || iPhysicsViewPos == aNewPosition) |
1425 { |
1455 { |
1426 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
1456 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
1427 iLastTactileFeedbackPos = iPhysicsViewPos.iY; |
1457 iLastTactileFeedbackPos = iPhysicsViewPos.iY; |
1466 } |
1496 } |
1467 |
1497 |
1468 coeCtrl.SetPosition(TPoint(x, y)); |
1498 coeCtrl.SetPosition(TPoint(x, y)); |
1469 iPhysicsViewPos = aNewPosition; |
1499 iPhysicsViewPos = aNewPosition; |
1470 |
1500 |
1471 if (aDrawNow) |
1501 if (iVScroll) |
1472 { |
1502 { |
1473 if (iVScroll) |
1503 TInt pos = viewRect.iTl.iY - y; // composite coords |
1474 { |
1504 pos = Min(pos, iVScroll->GetMaximum()); |
1475 TInt pos = viewRect.iTl.iY - y; // composite coords |
1505 pos = Max(pos, 0); |
1476 pos = Min(pos, iVScroll->GetMaximum()); |
1506 TRAP_IGNORE(iVScroll->DoSetThumbPositionL(pos)); |
1477 pos = Max(pos, 0); |
1507 } |
1478 TRAP_IGNORE(iVScroll->DoSetThumbPositionL(pos)); |
1508 if (iHScroll) |
1479 } |
1509 { |
1480 if (iHScroll) |
1510 TInt pos = viewRect.iTl.iX - x; // composite coords |
1481 { |
1511 pos = Min(pos, iHScroll->GetMaximum()); |
1482 TInt pos = viewRect.iTl.iX - x; // composite coords |
1512 pos = Max(pos, 0); |
1483 pos = Min(pos, iHScroll->GetMaximum()); |
1513 TRAP_IGNORE(iHScroll->DoSetThumbPositionL(pos)); |
1484 pos = Max(pos, 0); |
1514 } |
1485 TRAP_IGNORE(iHScroll->DoSetThumbPositionL(pos)); |
1515 // We have to always repaint the composite, since after setPosition |
1486 } |
1516 // some child controls might redraw themselves. This can cause distortions |
1487 PaintUrgently(); |
1517 // while panning the composite. |
1488 } |
1518 PaintUrgently(); |
1489 |
1519 |
1490 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
1520 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
1491 // Flicking or panning the composite content should give the feedback |
1521 // Flicking or panning the composite content should give the feedback |
1492 if (iPhysicsAction == KSwtPhysicsPanning || |
1522 if (iPhysicsAction == KSwtPhysicsPanning || |
1493 iPhysicsAction == KSwtPhysicsFlicking) |
1523 iPhysicsAction == KSwtPhysicsFlicking) |