#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
// EXTERNAL INCLUDES
+#include <cstring> // for strcmp
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/events/mouse-wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
+#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
//#define ENABLED_SCROLL_STATE_LOGGING
namespace
{
-
-// Signals
-
-const char* const SIGNAL_SNAP_STARTED = "snap-started";
-
-const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f); ///< minimum distance for pan before flick allowed
-const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f); ///< Minimum pan speed required for flick in pixels/s
-const float FREE_FLICK_SPEED_THRESHOLD = 200.0f; ///< Free-Flick threshold in pixels/ms
-const float AUTOLOCK_AXIS_MINIMUM_DISTANCE2 = 100.0f; ///< Auto-lock axis after minimum distance squared.
-const float FLICK_ORTHO_ANGLE_RANGE = 75.0f; ///< degrees. (if >45, then supports diagonal flicking)
+const float DEFAULT_SLOW_SNAP_ANIMATION_DURATION(0.5f); ///< Default Drag-Release animation time.
+const float DEFAULT_FAST_SNAP_ANIMATION_DURATION(0.25f); ///< Default Drag-Flick animation time.
+const float DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f); ///< Default Overshoot snapping animation time.
+const float DEFAULT_MAX_OVERSHOOT(100.0f); ///< Default maximum allowed overshoot in pixels
+
+const float DEFAULT_AXIS_AUTO_LOCK_GRADIENT(0.36f); ///< Default Axis-AutoLock gradient threshold. default is 0.36:1 (20 degrees)
+const float DEFAULT_FRICTION_COEFFICIENT(1.0f); ///< Default Friction Co-efficient. (in stage diagonals per second)
+const float DEFAULT_FLICK_SPEED_COEFFICIENT(1.0f); ///< Default Flick speed coefficient (multiples input touch velocity)
+const float DEFAULT_MAX_FLICK_SPEED(3.0f); ///< Default Maximum flick speed. (in stage diagonals per second)
+
+const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f); ///< minimum distance for pan before flick allowed
+const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f); ///< Minimum pan speed required for flick in pixels/s
+const float FREE_FLICK_SPEED_THRESHOLD = 200.0f; ///< Free-Flick threshold in pixels/ms
+const float AUTOLOCK_AXIS_MINIMUM_DISTANCE2 = 100.0f; ///< Auto-lock axis after minimum distance squared.
+const float FLICK_ORTHO_ANGLE_RANGE = 75.0f; ///< degrees. (if >45, then supports diagonal flicking)
const Vector2 DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION = Vector2(0.17f, 0.1f); ///< The step of horizontal scroll distance in the proportion of stage size for each mouse wheel event received.
const unsigned long MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET( 150u );
const float TOUCH_DOWN_TIMER_INTERVAL = 100.0f;
-const float DEFAULT_SCROLL_UPDATE_DISTANCE( 30.0f ); ///< Default distance to travel in pixels for scroll update signal
+const float DEFAULT_SCROLL_UPDATE_DISTANCE( 30.0f ); ///< Default distance to travel in pixels for scroll update signal
+
+const std::string INTERNAL_MAX_POSITION_PROPERTY_NAME( "internal-max-position" );
// Helpers ////////////////////////////////////////////////////////////////////////////////////////
* scroll domain. This is a value from 0.0f to 1.0f in each
* scroll position axis.
*/
-Vector3 InternalRelativePositionConstraint(const Vector3& current,
- const PropertyInput& scrollPositionProperty,
- const PropertyInput& scrollMinProperty,
- const PropertyInput& scrollMaxProperty,
- const PropertyInput& scrollSizeProperty)
+void InternalRelativePositionConstraint( Vector2& relativePosition, const PropertyInputContainer& inputs)
{
- Vector3 position = -scrollPositionProperty.GetVector3();
- const Vector3& min = scrollMinProperty.GetVector3();
- const Vector3& max = scrollMaxProperty.GetVector3();
- const Vector3& size = scrollSizeProperty.GetVector3();
+ Vector2 position = -inputs[0]->GetVector2();
+ const Vector2& min = inputs[1]->GetVector2();
+ const Vector2& max = inputs[2]->GetVector2();
+ const Vector3& size = inputs[3]->GetVector3();
position.x = WrapInDomain(position.x, min.x, max.x);
position.y = WrapInDomain(position.y, min.y, max.y);
- Vector3 relativePosition;
- Vector3 domainSize = (max - min) - size;
+ Vector2 domainSize = (max - min) - size.GetVectorXY();
relativePosition.x = domainSize.x > Math::MACHINE_EPSILON_1 ? fabsf((position.x - min.x) / domainSize.x) : 0.0f;
relativePosition.y = domainSize.y > Math::MACHINE_EPSILON_1 ? fabsf((position.y - min.y) / domainSize.y) : 0.0f;
+}
- return relativePosition;
+/**
+ * Internal scroll domain Constraint
+ * Generates the scroll domain of the scroll view.
+ */
+void InternalScrollDomainConstraint( Vector2& scrollDomain, const PropertyInputContainer& inputs)
+{
+ const Vector2& min = inputs[0]->GetVector2();
+ const Vector2& max = inputs[1]->GetVector2();
+ const Vector3& size = inputs[2]->GetVector3();
+
+ scrollDomain = (max - min) - size.GetVectorXY();
+}
+
+/**
+ * Internal maximum scroll position Constraint
+ * Generates the maximum scroll position of the scroll view.
+ */
+void InternalPrePositionMaxConstraint( Vector2& scrollMax, const PropertyInputContainer& inputs)
+{
+ const Vector2& max = inputs[0]->GetVector2();
+ const Vector3& size = inputs[1]->GetVector3();
+
+ scrollMax = max - size.GetVectorXY();
}
} // unnamed namespace
namespace
{
+BaseHandle Create()
+{
+ return Toolkit::ScrollView::New();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
+
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position", VECTOR2, SCROLL_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position", VECTOR2, SCROLL_PRE_POSITION)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-x", SCROLL_PRE_POSITION_X, SCROLL_PRE_POSITION, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-y", SCROLL_PRE_POSITION_Y, SCROLL_PRE_POSITION, 1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-max", VECTOR2, SCROLL_PRE_POSITION_MAX)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-max-x", SCROLL_PRE_POSITION_MAX_X, SCROLL_PRE_POSITION_MAX, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-max-y", SCROLL_PRE_POSITION_MAX_Y, SCROLL_PRE_POSITION_MAX, 1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "overshoot-x", FLOAT, OVERSHOOT_X)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "overshoot-y", FLOAT, OVERSHOOT_Y)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-final", VECTOR2, SCROLL_FINAL)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-final-x", SCROLL_FINAL_X, SCROLL_FINAL,0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-final-y", SCROLL_FINAL_Y, SCROLL_FINAL,1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "wrap", BOOLEAN, WRAP)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "panning", BOOLEAN, PANNING)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scrolling", BOOLEAN, SCROLLING)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-domain-size", VECTOR2, SCROLL_DOMAIN_SIZE)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-domain-size-x", SCROLL_DOMAIN_SIZE_X, SCROLL_DOMAIN_SIZE, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-domain-size-y", SCROLL_DOMAIN_SIZE_Y, SCROLL_DOMAIN_SIZE, 1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-domain-offset", VECTOR2, SCROLL_DOMAIN_OFFSET)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position-delta", VECTOR2, SCROLL_POSITION_DELTA)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "start-page-position", VECTOR3, START_PAGE_POSITION)
+
+DALI_SIGNAL_REGISTRATION( Toolkit, ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
+
+DALI_TYPE_REGISTRATION_END()
+
/**
* Returns whether to lock scrolling to a particular axis
*
{
}
- Vector3 operator()(const Vector3& current,
- const PropertyInput& gesturePositionProperty,
- const PropertyInput& sizeProperty)
+ void operator()( Vector2& scrollPostPosition, const PropertyInputContainer& inputs )
{
- Vector3 scrollPostPosition = current;
- Vector2 panPosition = gesturePositionProperty.GetVector2();
+ const Vector2& panPosition = inputs[0]->GetVector2();
if(!mWasPanning)
{
- mPrePosition = current;
+ mPrePosition = scrollPostPosition;
mCurrentPanMask = mInitialPanMask;
mWasPanning = true;
}
// Calculate Deltas...
- Vector2 currentPosition = gesturePositionProperty.GetVector2();
+ const Vector2& currentPosition = panPosition;
Vector2 panDelta( currentPosition - mLocalStart );
// Axis Auto Lock - locks the panning to the horizontal or vertical axis if the pan
// Perform Position transform based on input deltas...
scrollPostPosition = mPrePosition;
- scrollPostPosition.GetVectorXY() += panDelta;
+ scrollPostPosition += panDelta;
// if no wrapping then clamp preposition to maximum overshoot amount
- const Vector3& size = sizeProperty.GetVector3();
+ const Vector3& size = inputs[1]->GetVector3();
if( mClampX )
{
float newXPosition = Clamp(scrollPostPosition.x, (mDomainMax.x + size.x) - mMaxOvershoot.x, mDomainMin.x + mMaxOvershoot.x );
}
scrollPostPosition.y = newYPosition;
}
-
- return scrollPostPosition;
}
- Vector3 mPrePosition;
+ Vector2 mPrePosition;
Vector2 mLocalStart;
Vector2 mInitialPanMask; ///< Initial pan mask (based on ruler settings)
Vector2 mCurrentPanMask; ///< Current pan mask that can be altered by axis lock mode.
{
}
- Vector3 operator()(const Vector3& current,
- const PropertyInput& scrollPositionProperty,
- const PropertyInput& scrollMinProperty,
- const PropertyInput& scrollMaxProperty,
- const PropertyInput& scrollSizeProperty)
+ void operator()( Vector2& position, const PropertyInputContainer& inputs )
{
- Vector3 position = scrollPositionProperty.GetVector3();
- const Vector2& size = scrollSizeProperty.GetVector3().GetVectorXY();
- const Vector3& min = scrollMinProperty.GetVector3();
- const Vector3& max = scrollMaxProperty.GetVector3();
+ position = inputs[0]->GetVector2();
+ const Vector2& size = inputs[3]->GetVector3().GetVectorXY();
+ const Vector2& min = inputs[1]->GetVector2();
+ const Vector2& max = inputs[2]->GetVector2();
if( mWrap )
{
position.x = mClampX ? Clamp(position.x, mDomainMax.x + size.x, mDomainMin.x ) : position.x;
position.y = mClampY ? Clamp(position.y, mDomainMax.y + size.y, mDomainMin.y ) : position.y;
}
-
- return position;
}
Vector2 mDomainMin;
/**
* This constraint updates the X overshoot property using the difference
- * mPropertyPrePosition.x and mPropertyPosition.x, returning a relative value between 0.0f and 1.0f
+ * SCROLL_PRE_POSITION.x and SCROLL_POSITION.x, returning a relative value between 0.0f and 1.0f
*/
struct OvershootXConstraint
{
OvershootXConstraint(float maxOvershoot) : mMaxOvershoot(maxOvershoot) {}
- float operator()(const float& current,
- const PropertyInput& scrollPrePositionProperty,
- const PropertyInput& scrollPostPositionProperty,
- const PropertyInput& canScrollProperty)
+ void operator()( float& current, const PropertyInputContainer& inputs )
{
- if( canScrollProperty.GetBoolean() )
+ if( inputs[2]->GetBoolean() )
{
- const Vector3& scrollPrePosition = scrollPrePositionProperty.GetVector3();
- const Vector3& scrollPostPosition = scrollPostPositionProperty.GetVector3();
+ const Vector2& scrollPrePosition = inputs[0]->GetVector2();
+ const Vector2& scrollPostPosition = inputs[1]->GetVector2();
float newOvershoot = scrollPrePosition.x - scrollPostPosition.x;
- return (newOvershoot > 0.0f ? std::min(newOvershoot, mMaxOvershoot) : std::max(newOvershoot, -mMaxOvershoot)) / mMaxOvershoot;
+ current = (newOvershoot > 0.0f ? std::min(newOvershoot, mMaxOvershoot) : std::max(newOvershoot, -mMaxOvershoot)) / mMaxOvershoot;
+ }
+ else
+ {
+ current = 0.0f;
}
- return 0.0f;
}
float mMaxOvershoot;
/**
* This constraint updates the Y overshoot property using the difference
- * mPropertyPrePosition.y and mPropertyPosition.y, returning a relative value between 0.0f and 1.0f
+ * SCROLL_PRE_POSITION.y and SCROLL_POSITION.y, returning a relative value between 0.0f and 1.0f
*/
struct OvershootYConstraint
{
OvershootYConstraint(float maxOvershoot) : mMaxOvershoot(maxOvershoot) {}
- float operator()(const float& current,
- const PropertyInput& scrollPrePositionProperty,
- const PropertyInput& scrollPostPositionProperty,
- const PropertyInput& canScrollProperty)
+ void operator()( float& current, const PropertyInputContainer& inputs )
{
- if( canScrollProperty.GetBoolean() )
+ if( inputs[2]->GetBoolean() )
{
- const Vector3& scrollPrePosition = scrollPrePositionProperty.GetVector3();
- const Vector3& scrollPostPosition = scrollPostPositionProperty.GetVector3();
+ const Vector2& scrollPrePosition = inputs[0]->GetVector2();
+ const Vector2& scrollPostPosition = inputs[1]->GetVector2();
float newOvershoot = scrollPrePosition.y - scrollPostPosition.y;
- return (newOvershoot > 0.0f ? std::min(newOvershoot, mMaxOvershoot) : std::max(newOvershoot, -mMaxOvershoot)) / mMaxOvershoot;
+ current = (newOvershoot > 0.0f ? std::min(newOvershoot, mMaxOvershoot) : std::max(newOvershoot, -mMaxOvershoot)) / mMaxOvershoot;
+ }
+ else
+ {
+ current = 0.0f;
}
- return 0.0f;
}
float mMaxOvershoot;
*
* Generates position-delta property based on scroll-position + scroll-offset properties.
*/
-Vector3 InternalPositionDeltaConstraint(const Vector3& current,
- const PropertyInput& scrollPositionProperty,
- const PropertyInput& scrollOffsetProperty)
+void InternalPositionDeltaConstraint( Vector2& current, const PropertyInputContainer& inputs )
{
- const Vector3& scrollPosition = scrollPositionProperty.GetVector3();
- const Vector3& scrollOffset = scrollOffsetProperty.GetVector3();
+ const Vector2& scrollPosition = inputs[0]->GetVector2();
+ const Vector2& scrollOffset = inputs[1]->GetVector2();
- return scrollPosition + scrollOffset;
+ current = scrollPosition + scrollOffset;
}
/**
*/
struct InternalFinalConstraint
{
- InternalFinalConstraint(AlphaFunction functionX,
- AlphaFunction functionY)
+ InternalFinalConstraint(AlphaFunctionPrototype functionX,
+ AlphaFunctionPrototype functionY)
: mFunctionX(functionX),
mFunctionY(functionY)
{
}
- Vector3 operator()(const Vector3& current,
- const PropertyInput& scrollPositionProperty,
- const PropertyInput& scrollOvershootXProperty,
- const PropertyInput& scrollOvershootYProperty)
+ void operator()( Vector2& current, const PropertyInputContainer& inputs )
{
- const float& overshootx = scrollOvershootXProperty.GetFloat();
- const float& overshooty = scrollOvershootYProperty.GetFloat();
- Vector3 offset( mFunctionX(overshootx),
- mFunctionY(overshooty),
- 0.0f);
+ const float& overshootx = inputs[1]->GetFloat();
+ const float& overshooty = inputs[2]->GetFloat();
+ Vector2 offset( mFunctionX(overshootx),
+ mFunctionY(overshooty) );
- return scrollPositionProperty.GetVector3() - offset;
+ current = inputs[0]->GetVector2() - offset;
}
- AlphaFunction mFunctionX;
- AlphaFunction mFunctionY;
+ AlphaFunctionPrototype mFunctionX;
+ AlphaFunctionPrototype mFunctionY;
};
-
-BaseHandle Create()
-{
- return Toolkit::ScrollView::New();
-}
-
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollView ), typeid( Toolkit::Scrollable ), Create );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_SNAP_STARTED, &ScrollView::DoConnectSignal );
-
}
}
ScrollView::ScrollView()
-: ScrollBase(),
+: ScrollBase( ControlBehaviour( REQUIRES_MOUSE_WHEEL_EVENTS ) ), // Enable size negotiation
mTouchDownTime(0u),
mGestureStackDepth(0),
mScrollStateFlags(0),
mLockAxis(LockPossible),
mScrollUpdateDistance(DEFAULT_SCROLL_UPDATE_DISTANCE),
- mMaxOvershoot(Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT, Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT),
- mUserMaxOvershoot(Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT, Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT),
- mSnapOvershootDuration(Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION),
- mSnapOvershootAlphaFunction(AlphaFunctions::EaseOut),
- mSnapDuration(Toolkit::ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION),
- mSnapAlphaFunction(AlphaFunctions::EaseOut),
+ mMaxOvershoot(DEFAULT_MAX_OVERSHOOT, DEFAULT_MAX_OVERSHOOT),
+ mUserMaxOvershoot(DEFAULT_MAX_OVERSHOOT, DEFAULT_MAX_OVERSHOOT),
+ mSnapOvershootDuration(DEFAULT_SNAP_OVERSHOOT_DURATION),
+ mSnapOvershootAlphaFunction(AlphaFunction::EASE_OUT),
+ mSnapDuration(DEFAULT_SLOW_SNAP_ANIMATION_DURATION),
+ mSnapAlphaFunction(AlphaFunction::EASE_OUT),
mMinFlickDistance(DEFAULT_MIN_FLICK_DISTANCE),
mFlickSpeedThreshold(DEFAULT_MIN_FLICK_SPEED_THRESHOLD),
- mFlickDuration(Toolkit::ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION),
- mFlickAlphaFunction(AlphaFunctions::EaseOut),
- mAxisAutoLockGradient(Toolkit::ScrollView::DEFAULT_AXIS_AUTO_LOCK_GRADIENT),
- mFrictionCoefficient(Toolkit::ScrollView::DEFAULT_FRICTION_COEFFICIENT),
- mFlickSpeedCoefficient(Toolkit::ScrollView::DEFAULT_FLICK_SPEED_COEFFICIENT),
- mMaxFlickSpeed(Toolkit::ScrollView::DEFAULT_MAX_FLICK_SPEED),
+ mFlickDuration(DEFAULT_FAST_SNAP_ANIMATION_DURATION),
+ mFlickAlphaFunction(AlphaFunction::EASE_OUT),
+ mAxisAutoLockGradient(DEFAULT_AXIS_AUTO_LOCK_GRADIENT),
+ mFrictionCoefficient(DEFAULT_FRICTION_COEFFICIENT),
+ mFlickSpeedCoefficient(DEFAULT_FLICK_SPEED_COEFFICIENT),
+ mMaxFlickSpeed(DEFAULT_MAX_FLICK_SPEED),
+ mMouseWheelScrollDistanceStep(Vector2::ZERO),
mInAccessibilityPan(false),
mInitialized(false),
mScrolling(false),
mCanScrollHorizontal(true),
mCanScrollVertical(true)
{
- SetRequiresMouseWheelEvents(true);
}
void ScrollView::OnInitialize()
mInternalActor = Actor::New();
mInternalActor.SetDrawMode(DrawMode::OVERLAY);
self.Add(mInternalActor);
- mInternalActor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+
mInternalActor.SetParentOrigin(ParentOrigin::CENTER);
mInternalActor.SetAnchorPoint(AnchorPoint::CENTER);
+ mInternalActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mAlterChild = true;
- // Register Scroll Properties.
- RegisterProperties();
-
- mScrollPostPosition = mScrollPrePosition = Vector3::ZERO;
+ mScrollPostPosition = mScrollPrePosition = Vector2::ZERO;
mMouseWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
mRulerX = ruler;
mRulerY = ruler;
- EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
+ SetOvershootEnabled(true);
+
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, mCanScrollVertical);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, mCanScrollHorizontal);
Vector3 size = GetControlSize();
UpdatePropertyDomain(size);
SetScrollSensitive( false );
SetScrollSensitive( true );
}
- if(IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator))
+ if(IsOvershootEnabled())
{
// try and make sure property notifications are set
- EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
+ EnableScrollOvershoot(true);
}
}
void ScrollView::UpdatePropertyDomain(const Vector3& size)
{
Actor self = Self();
- Vector3 min = mMinScroll;
- Vector3 max = mMaxScroll;
+ Vector2 min = mMinScroll;
+ Vector2 max = mMaxScroll;
bool scrollPositionChanged = false;
bool domainChanged = false;
if( mCanScrollVertical != canScrollVertical )
{
mCanScrollVertical = canScrollVertical;
- self.SetProperty(mPropertyCanScrollVertical, canScrollVertical);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, canScrollVertical);
}
if( mCanScrollHorizontal != canScrollHorizontal )
{
mCanScrollHorizontal = canScrollHorizontal;
- self.SetProperty(mPropertyCanScrollHorizontal, canScrollHorizontal);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, canScrollHorizontal);
}
if( scrollPositionChanged )
{
- DALI_LOG_SCROLL_STATE("[0x%X] Domain Changed, setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
- self.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+ DALI_LOG_SCROLL_STATE("[0x%X] Domain Changed, setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
}
if( domainChanged )
{
mMinScroll = min;
mMaxScroll = max;
- self.SetProperty(mPropertyPositionMin, mMinScroll );
- self.SetProperty(mPropertyPositionMax, mMaxScroll );
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, mMinScroll );
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, mMaxScroll );
}
}
void ScrollView::SetWrapMode(bool enable)
{
mWrapMode = enable;
- Self().SetProperty(mPropertyWrap, enable);
+ Self().SetProperty(Toolkit::ScrollView::Property::WRAP, enable);
}
int ScrollView::GetScrollUpdateDistance() const
unsigned int ScrollView::GetCurrentPage() const
{
// in case animation is currently taking place.
- Vector3 position = GetPropertyPosition();
+ Vector2 position = GetPropertyPosition();
Actor self = Self();
unsigned int page = 0;
return volume * pagesPerVolume + page;
}
-Vector3 ScrollView::GetCurrentScrollPosition() const
+Vector2 ScrollView::GetCurrentScrollPosition() const
{
return -GetPropertyPosition();
}
-void ScrollView::SetScrollPosition(const Vector3& position)
+void ScrollView::SetScrollPosition(const Vector2& position)
{
mScrollPrePosition = position;
}
-Vector3 ScrollView::GetDomainSize() const
+Vector2 ScrollView::GetDomainSize() const
{
Vector3 size = Self().GetCurrentSize();
const RulerDomain& xDomain = GetRulerX()->GetDomain();
const RulerDomain& yDomain = GetRulerY()->GetDomain();
- Vector3 domainSize = Vector3( xDomain.max - xDomain.min, yDomain.max - yDomain.min, 0.0f ) - size;
+ Vector2 domainSize;
+ domainSize.x = xDomain.max - xDomain.min - size.x;
+ domainSize.y = yDomain.max - yDomain.min - size.y;
return domainSize;
}
-void ScrollView::TransformTo(const Vector3& position,
+void ScrollView::TransformTo(const Vector2& position,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
TransformTo(position, mSnapDuration, mSnapAlphaFunction, horizontalBias, verticalBias);
}
-void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
+void ScrollView::TransformTo(const Vector2& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
// If this is called while the timer is running, then cancel it
DALI_LOG_SCROLL_STATE("[0x%X] pos[%.2f,%.2f], duration[%.2f] bias[%d, %d]",
this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
- Vector3 currentScrollPosition = GetCurrentScrollPosition();
- self.SetProperty( mPropertyScrollStartPagePosition, currentScrollPosition );
+ Vector2 currentScrollPosition = GetCurrentScrollPosition();
+ self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(currentScrollPosition) );
if( mScrolling ) // are we interrupting a current scroll?
{
DALI_LOG_SCROLL_STATE("[0x%X] Interrupting Pan, set to false", this );
mPanning = false;
mGestureStackDepth = 0;
- self.SetProperty( mPropertyPanning, false );
+ self.SetProperty( Toolkit::ScrollView::Property::PANNING, false );
if( mScrollMainInternalPrePositionConstraint )
{
- self.RemoveConstraint(mScrollMainInternalPrePositionConstraint);
+ mScrollMainInternalPrePositionConstraint.Remove();
}
}
- self.SetProperty(mPropertyScrolling, true);
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
mScrolling = true;
DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 1 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollStartedSignal.Emit( currentScrollPosition );
bool animating = AnimateTo(-position,
- Vector3::ONE * duration,
+ Vector2::ONE * duration,
alpha,
true,
horizontalBias,
if(!animating)
{
// if not animating, then this pan has completed right now.
- self.SetProperty(mPropertyScrolling, false);
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
mScrolling = false;
// If we have no duration, then in the next update frame, we will be at the position specified as we just set.
// In this scenario, we cannot return the currentScrollPosition as this is out-of-date and should instead return the requested final position
- Vector3 completedPosition( currentScrollPosition );
+ Vector2 completedPosition( currentScrollPosition );
if( duration <= Math::MACHINE_EPSILON_10 )
{
completedPosition = position;
}
}
-void ScrollView::ScrollTo(const Vector3& position)
+void ScrollView::ScrollTo(const Vector2& position)
{
ScrollTo(position, mSnapDuration );
}
-void ScrollView::ScrollTo(const Vector3& position, float duration)
+void ScrollView::ScrollTo(const Vector2& position, float duration)
{
ScrollTo(position, duration, DirectionBiasNone, DirectionBiasNone);
}
-void ScrollView::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha)
+void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
{
ScrollTo(position, duration, alpha, DirectionBiasNone, DirectionBiasNone);
}
-void ScrollView::ScrollTo(const Vector3& position, float duration,
+void ScrollView::ScrollTo(const Vector2& position, float duration,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
ScrollTo(position, duration, mSnapAlphaFunction, horizontalBias, verticalBias);
}
-void ScrollView::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha,
+void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
DALI_LOG_SCROLL_STATE("[0x%X] position[%.2f, %.2f] duration[%.2f], bias[%d, %d]", this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
void ScrollView::ScrollTo(unsigned int page, float duration, DirectionBias bias)
{
- Vector3 position;
+ Vector2 position;
unsigned int volume;
unsigned int libraries;
Actor self = Self();
Vector3 size = self.GetCurrentSize();
Vector3 position = actor.GetCurrentPosition();
- position -= GetPropertyPrePosition();
+ Vector2 prePosition = GetPropertyPrePosition();
+ position.GetVectorXY() -= prePosition;
- ScrollTo(Vector3(position.x - size.width * 0.5f, position.y - size.height * 0.5f, 0.0f), duration);
+ ScrollTo(Vector2(position.x - size.width * 0.5f, position.y - size.height * 0.5f), duration);
}
Actor ScrollView::FindClosestActor()
float angle = atan2(velocity.y, velocity.x);
float speed2 = velocity.LengthSquared();
AlphaFunction alphaFunction = mSnapAlphaFunction;
- Vector3 positionDuration = Vector3::ONE * mSnapDuration;
+ Vector2 positionDuration = Vector2::ONE * mSnapDuration;
float biasX = 0.5f;
float biasY = 0.5f;
FindDirection horizontal = None;
const float orthoAngleRange = FLICK_ORTHO_ANGLE_RANGE * M_PI / 180.0f;
const float flickSpeedThreshold2 = mFlickSpeedThreshold * mFlickSpeedThreshold;
- Vector3 positionSnap = mScrollPrePosition;
+ Vector2 positionSnap = mScrollPrePosition;
// Flick logic X Axis
if(isFlick || isFreeFlick)
{
- positionDuration = Vector3::ONE * mFlickDuration;
+ positionDuration = Vector2::ONE * mFlickDuration;
alphaFunction = mFlickAlphaFunction;
}
if(child)
{
- Vector3 position = Self().GetProperty<Vector3>(mPropertyPosition);
+ Vector2 position = Self().GetProperty<Vector2>(Toolkit::ScrollView::Property::SCROLL_POSITION);
// Get center-point of the Actor.
Vector3 childPosition = GetPositionOfAnchor(child, AnchorPoint::CENTER);
}
}
- Vector3 startPosition = positionSnap;
+ Vector2 startPosition = positionSnap;
positionSnap.x = -mRulerX->Snap(-positionSnap.x, biasX); // NOTE: X & Y rulers think in -ve coordinate system.
positionSnap.y = -mRulerY->Snap(-positionSnap.y, biasY); // That is scrolling RIGHT (e.g. 100.0, 0.0) means moving LEFT.
- Vector3 clampDelta(Vector3::ZERO);
+ Vector2 clampDelta(Vector2::ZERO);
ClampPosition(positionSnap);
if( (mRulerX->GetType() == Ruler::Free || mRulerY->GetType() == Ruler::Free)
}
else
{
- clampDelta = Vector3::ZERO;
+ clampDelta = Vector2::ZERO;
}
// If Axis is Free and has velocity, then calculate time taken
}
}
- if(IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator))
+ if(IsOvershootEnabled())
{
// Scroll to the end of the overshoot only when overshoot is enabled.
positionSnap += clampDelta;
}
}
-bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDuration,
+bool ScrollView::AnimateTo(const Vector2& position, const Vector2& positionDuration,
AlphaFunction alpha, bool findShortcuts,
DirectionBias horizontalBias, DirectionBias verticalBias,
SnapType snapType)
if( !(mScrollStateFlags & SCROLL_ANIMATION_FLAGS) )
{
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y );
- self.SetProperty(mPropertyPrePosition, mScrollTargetPosition);
+ DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y );
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollTargetPosition);
mScrollPrePosition = mScrollTargetPosition;
mScrollPostPosition = mScrollTargetPosition;
WrapPosition(mScrollPostPosition);
}
DALI_LOG_SCROLL_STATE("[0x%X] position-changed, mScrollTargetPosition[%.2f, %.2f], mScrollPrePosition[%.2f, %.2f], mScrollPostPosition[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y, mScrollPrePosition.x, mScrollPrePosition.y, mScrollPostPosition.x, mScrollPostPosition.y );
- DALI_LOG_SCROLL_STATE("[0x%X] mPropertyPrePosition[%.2f, %.2f], mPropertyPosition[%.2f, %.2f]", this, self.GetProperty( mPropertyPrePosition ).Get<Vector3>().x, self.GetProperty( mPropertyPrePosition ).Get<Vector3>().y, self.GetProperty( mPropertyPosition ).Get<Vector3>().x, self.GetProperty( mPropertyPosition ).Get<Vector3>().y );
+ DALI_LOG_SCROLL_STATE("[0x%X] SCROLL_PRE_POSITION[%.2f, %.2f], SCROLL_POSITION[%.2f, %.2f]", this, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector2>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector2>().y, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector2>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector2>().y );
}
SetScrollUpdateNotification(true);
return (mScrollStateFlags & SCROLL_ANIMATION_FLAGS) != 0;
}
-void ScrollView::SetOvershootEnabled(bool enabled)
+void ScrollView::EnableScrollOvershoot(bool enable)
{
- if(enabled && !mOvershootIndicator)
+ if(enable && !mOvershootIndicator)
{
mOvershootIndicator = ScrollOvershootIndicator::New();
}
- if( enabled )
+ if( enable )
{
mOvershootIndicator->AttachToScrollable(*this);
}
UnbindActor(child);
}
-Vector3 ScrollView::GetPropertyPrePosition() const
+Vector2 ScrollView::GetPropertyPrePosition() const
{
- Vector3 position = Self().GetProperty<Vector3>(mPropertyPrePosition);
+ Vector2 position = Self().GetProperty<Vector2>(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION);
WrapPosition(position);
return position;
}
-Vector3 ScrollView::GetPropertyPosition() const
+Vector2 ScrollView::GetPropertyPosition() const
{
- Vector3 position = Self().GetProperty<Vector3>(mPropertyPosition);
+ Vector2 position = Self().GetProperty<Vector2>(Toolkit::ScrollView::Property::SCROLL_POSITION);
WrapPosition(position);
return position;
// Emit Signal that scrolling has completed.
mScrolling = false;
Actor self = Self();
- self.SetProperty(mPropertyScrolling, false);
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
- Vector3 deltaPosition(mScrollPrePosition);
+ Vector2 deltaPosition(mScrollPrePosition);
UpdateLocalScrollProperties();
WrapPosition(mScrollPrePosition);
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
- self.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+ DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
- Vector3 currentScrollPosition = GetCurrentScrollPosition();
+ Vector2 currentScrollPosition = GetCurrentScrollPosition();
DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 3 current[%.2f, %.2f], mScrollTargetPosition[%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y, -mScrollTargetPosition.x, -mScrollTargetPosition.y );
mScrollCompletedSignal.Emit( currentScrollPosition );
mDomainOffset += deltaPosition - mScrollPostPosition;
- self.SetProperty(mPropertyDomainOffset, mDomainOffset);
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, mDomainOffset);
HandleStoppedAnimation();
}
if( enabled && !mScrollUpdatedSignal.Empty())
{
// Only set up the notification when the application has connected to the updated signal
- mScrollXUpdateNotification = self.AddPropertyNotification(mPropertyPosition, 0, StepCondition(mScrollUpdateDistance, 0.0f));
+ mScrollXUpdateNotification = self.AddPropertyNotification(Toolkit::ScrollView::Property::SCROLL_POSITION, 0, StepCondition(mScrollUpdateDistance, 0.0f));
mScrollXUpdateNotification.NotifySignal().Connect( this, &ScrollView::OnScrollUpdateNotification );
}
if( mScrollYUpdateNotification )
if( enabled && !mScrollUpdatedSignal.Empty())
{
// Only set up the notification when the application has connected to the updated signal
- mScrollYUpdateNotification = self.AddPropertyNotification(mPropertyPosition, 1, StepCondition(mScrollUpdateDistance, 0.0f));
+ mScrollYUpdateNotification = self.AddPropertyNotification(Toolkit::ScrollView::Property::SCROLL_POSITION, 1, StepCondition(mScrollUpdateDistance, 0.0f));
mScrollYUpdateNotification.NotifySignal().Connect( this, &ScrollView::OnScrollUpdateNotification );
}
}
// Guard against destruction during signal emission
Toolkit::ScrollView handle( GetOwner() );
- Vector3 currentScrollPosition = GetCurrentScrollPosition();
+ Vector2 currentScrollPosition = GetCurrentScrollPosition();
mScrollUpdatedSignal.Emit( currentScrollPosition );
}
{
mUserMaxOvershoot.x = size.x * 0.5f;
mUserMaxOvershoot.y = size.y * 0.5f;
- if( !IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator) )
+ if( !IsOvershootEnabled() )
{
mMaxOvershoot = mUserMaxOvershoot;
}
}
UpdatePropertyDomain(size);
UpdateMainInternalConstraint();
- if( IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator) )
+ if( IsOvershootEnabled() )
{
mOvershootIndicator->Reset();
}
void ScrollView::OnChildAdd(Actor& child)
{
- if(mAlterChild)
+ Dali::Toolkit::ScrollBar scrollBar = Dali::Toolkit::ScrollBar::DownCast(child);
+ if(scrollBar)
+ {
+ mInternalActor.Add(scrollBar);
+ if(scrollBar.GetScrollDirection() == Toolkit::ScrollBar::Horizontal)
+ {
+ scrollBar.SetScrollPropertySource(Self(),
+ Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_X,
+ Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_X,
+ Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_MAX_X,
+ Toolkit::ScrollView::Property::SCROLL_DOMAIN_SIZE_X);
+ }
+ else
+ {
+ scrollBar.SetScrollPropertySource(Self(),
+ Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_Y,
+ Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y,
+ Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y,
+ Toolkit::ScrollView::Property::SCROLL_DOMAIN_SIZE_Y);
+ }
+ }
+ else if(mAlterChild)
{
BindActor(child);
}
UnbindActor(child);
}
-void ScrollView::OnPropertySet( Property::Index index, Property::Value propertyValue )
-{
- Actor self = Self();
- if( index == mPropertyPrePosition )
- {
- DALI_LOG_SCROLL_STATE("[0x%X]: mPropertyPrePosition[%.2f, %.2f]", this, propertyValue.Get<Vector3>().x, propertyValue.Get<Vector3>().y);
- propertyValue.Get(mScrollPrePosition);
- }
-}
-
void ScrollView::StartTouchDownTimer()
{
if ( !mTouchDownTimer )
mScrollInterrupted = true;
// reset domain offset as scrolling from original plane.
- mDomainOffset = Vector3::ZERO;
- Self().SetProperty(mPropertyDomainOffset, Vector3::ZERO);
+ mDomainOffset = Vector2::ZERO;
+ Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector2::ZERO);
UpdateLocalScrollProperties();
- Vector3 currentScrollPosition = GetCurrentScrollPosition();
+ Vector2 currentScrollPosition = GetCurrentScrollPosition();
DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 4 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollCompletedSignal.Emit( currentScrollPosition );
}
return false;
}
- Vector3 targetScrollPosition = GetPropertyPosition();
+ Vector2 targetScrollPosition = GetPropertyPosition();
if(mRulerX->IsEnabled() && !mRulerY->IsEnabled())
{
void ScrollView::ResetScrolling()
{
Actor self = Self();
- self.GetProperty(mPropertyPosition).Get(mScrollPostPosition);
+ self.GetProperty(Toolkit::ScrollView::Property::SCROLL_POSITION).Get(mScrollPostPosition);
mScrollPrePosition = mScrollPostPosition;
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPostPosition.x, mScrollPostPosition.y );
- self.SetProperty(mPropertyPrePosition, mScrollPostPosition);
+ DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPostPosition.x, mScrollPostPosition.y );
+ self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPostPosition);
}
void ScrollView::UpdateLocalScrollProperties()
{
Actor self = Self();
- self.GetProperty(mPropertyPrePosition).Get(mScrollPrePosition);
- self.GetProperty(mPropertyPosition).Get(mScrollPostPosition);
+ self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get(mScrollPrePosition);
+ self.GetProperty(Toolkit::ScrollView::Property::SCROLL_POSITION).Get(mScrollPostPosition);
}
// private functions
void ScrollView::PreAnimatedScrollSetup()
{
- // mPropertyPrePosition is our unclamped property with wrapping
- // mPropertyPosition is our final scroll position after clamping
+ // SCROLL_PRE_POSITION is our unclamped property with wrapping
+ // SCROLL_POSITION is our final scroll position after clamping
Actor self = Self();
- Vector3 deltaPosition(mScrollPostPosition);
+ Vector2 deltaPosition(mScrollPostPosition);
WrapPosition(mScrollPostPosition);
mDomainOffset += deltaPosition - mScrollPostPosition;
- Self().SetProperty(mPropertyDomainOffset, mDomainOffset);
+ Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, mDomainOffset);
if( mScrollStateFlags & SCROLL_X_STATE_MASK )
{
if( duration > Math::MACHINE_EPSILON_10 )
{
Actor self = Self();
- DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(mPropertyPrePosition).Get<Vector3>().x, position );
+ DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>().x, position );
mInternalXAnimation = Animation::New(duration);
DALI_LOG_SCROLL_STATE("[0x%X], mInternalXAnimation[0x%X]", this, mInternalXAnimation.GetObjectPtr() );
mInternalXAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
- mInternalXAnimation.AnimateTo( Property(self, mPropertyPrePosition, 0), position, alpha, duration);
+ mInternalXAnimation.AnimateTo( Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 0), position, alpha, TimePeriod(duration));
mInternalXAnimation.Play();
// erase current state flags
if( duration > Math::MACHINE_EPSILON_10 )
{
Actor self = Self();
- DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(mPropertyPrePosition).Get<Vector3>().y, position );
+ DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>().y, position );
mInternalYAnimation = Animation::New(duration);
DALI_LOG_SCROLL_STATE("[0x%X], mInternalYAnimation[0x%X]", this, mInternalYAnimation.GetObjectPtr() );
mInternalYAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
- mInternalYAnimation.AnimateTo( Property(self, mPropertyPrePosition, 1), position, alpha, TimePeriod(duration));
+ mInternalYAnimation.AnimateTo( Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 1), position, alpha, TimePeriod(duration));
mInternalYAnimation.Play();
// erase current state flags
if( source == mInternalXAnimation )
{
- DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(mPropertyPrePosition).Get<Vector3>().x, mScrollPostPosition.x );
+ DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector2>().x, mScrollPostPosition.x );
if( !(mScrollStateFlags & AnimatingInternalY) )
{
{
const RulerDomain rulerDomain = mRulerX->GetDomain();
mScrollPrePosition.x = -WrapInDomain(-mScrollPrePosition.x, rulerDomain.min, rulerDomain.max);
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
- handle.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+ DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+ handle.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
}
SnapInternalXTo(mScrollPostPosition.x);
}
if( source == mInternalYAnimation )
{
- DALI_LOG_SCROLL_STATE("[0x%X] mInternalYAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalYAnimation.GetObjectPtr(), mScrollTargetPosition.y, Self().GetProperty(mPropertyPrePosition).Get<Vector3>().y, mScrollPostPosition.y );
+ DALI_LOG_SCROLL_STATE("[0x%X] mInternalYAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalYAnimation.GetObjectPtr(), mScrollTargetPosition.y, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector2>().y, mScrollPostPosition.y );
if( !(mScrollStateFlags & AnimatingInternalX) )
{
// wrap pre scroll y position and set it
const RulerDomain rulerDomain = mRulerY->GetDomain();
mScrollPrePosition.y = -WrapInDomain(-mScrollPrePosition.y, rulerDomain.min, rulerDomain.max);
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
- handle.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+ DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+ handle.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
}
SnapInternalYTo(mScrollPostPosition.y);
}
mInternalXAnimation = Animation::New(duration);
mInternalXAnimation.FinishedSignal().Connect(this, &ScrollView::OnSnapInternalPositionFinished);
- mInternalXAnimation.AnimateTo(Property(self, mPropertyPrePosition, 0), position);
+ mInternalXAnimation.AnimateTo(Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 0), position);
mInternalXAnimation.Play();
// add internal animation state flag
mInternalYAnimation = Animation::New(duration);
mInternalYAnimation.FinishedSignal().Connect(this, &ScrollView::OnSnapInternalPositionFinished);
- mInternalYAnimation.AnimateTo(Property(self, mPropertyPrePosition, 1), position);
+ mInternalYAnimation.AnimateTo(Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 1), position);
mInternalYAnimation.Play();
// add internal animation state flag
Actor self = Self();
StopTouchDownTimer();
StopAnimation();
- mPanDelta = Vector3::ZERO;
- mLastVelocity = Vector2(0.0f, 0.0f);
+ mPanDelta = Vector2::ZERO;
+ mLastVelocity = Vector2::ZERO;
if( !mScrolling )
{
mLockAxis = LockPossible;
// appears mostly horizontal or mostly vertical respectively.
if(mAxisAutoLock)
{
- mLockAxis = GetLockAxis(mPanDelta.GetVectorXY(), mLockAxis, mAxisAutoLockGradient);
+ mLockAxis = GetLockAxis(mPanDelta, mLockAxis, mAxisAutoLockGradient);
} // end if mAxisAutoLock
}
UpdateLocalScrollProperties();
GestureStarted();
mPanning = true;
- self.SetProperty( mPropertyPanning, true );
- self.SetProperty( mPropertyScrollStartPagePosition, Vector3(gesture.position.x, gesture.position.y, 0.0f) );
+ self.SetProperty( Toolkit::ScrollView::Property::PANNING, true );
+ self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(gesture.position.x, gesture.position.y, 0.0f) );
UpdateMainInternalConstraint();
break;
UpdateLocalScrollProperties();
mLastVelocity = gesture.velocity;
mPanning = false;
- self.SetProperty( mPropertyPanning, false );
+ self.SetProperty( Toolkit::ScrollView::Property::PANNING, false );
if( mScrollMainInternalPrePositionConstraint )
{
- self.RemoveConstraint(mScrollMainInternalPrePositionConstraint);
+ mScrollMainInternalPrePositionConstraint.Remove();
}
if( mOvershootIndicator )
if(state == Gesture::Started)
{
- Vector3 currentScrollPosition = GetCurrentScrollPosition();
- Self().SetProperty(mPropertyScrolling, true);
+ Vector2 currentScrollPosition = GetCurrentScrollPosition();
+ Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
mScrolling = true;
DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollStartedSignal.Emit( currentScrollPosition );
// if not animating, then this pan has completed right now.
SetScrollUpdateNotification(false);
mScrolling = false;
- Self().SetProperty(mPropertyScrolling, false);
+ Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
if( fabs(mScrollPrePosition.x - mScrollTargetPosition.x) > Math::MACHINE_EPSILON_10 )
{
{
SnapInternalYTo(mScrollTargetPosition.y);
}
- Vector3 currentScrollPosition = GetCurrentScrollPosition();
+ Vector2 currentScrollPosition = GetCurrentScrollPosition();
DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 6 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
mScrollCompletedSignal.Emit( currentScrollPosition );
}
}
-Vector3 ScrollView::GetOvershoot(Vector3& position) const
+Vector2 ScrollView::GetOvershoot(Vector2& position) const
{
Vector3 size = Self().GetCurrentSize();
- Vector3 overshoot;
+ Vector2 overshoot;
const RulerDomain rulerDomainX = mRulerX->GetDomain();
const RulerDomain rulerDomainY = mRulerY->GetDomain();
return true;
}
-void ScrollView::ClampPosition(Vector3& position) const
+void ScrollView::ClampPosition(Vector2& position) const
{
- ClampState3D clamped;
+ ClampState2D clamped;
ClampPosition(position, clamped);
}
-void ScrollView::ClampPosition(Vector3& position, ClampState3D &clamped) const
+void ScrollView::ClampPosition(Vector2& position, ClampState2D &clamped) const
{
Vector3 size = Self().GetCurrentSize();
position.x = -mRulerX->Clamp(-position.x, size.width, 1.0f, clamped.x); // NOTE: X & Y rulers think in -ve coordinate system.
position.y = -mRulerY->Clamp(-position.y, size.height, 1.0f, clamped.y); // That is scrolling RIGHT (e.g. 100.0, 0.0) means moving LEFT.
-
- clamped.z = NotClamped;
}
-void ScrollView::WrapPosition(Vector3& position) const
+void ScrollView::WrapPosition(Vector2& position) const
{
if(mWrapMode)
{
if(mScrollMainInternalPositionConstraint)
{
- self.RemoveConstraint(mScrollMainInternalPositionConstraint);
- self.RemoveConstraint(mScrollMainInternalDeltaConstraint);
- self.RemoveConstraint(mScrollMainInternalFinalConstraint);
- self.RemoveConstraint(mScrollMainInternalRelativeConstraint);
+ mScrollMainInternalPositionConstraint.Remove();
+ mScrollMainInternalDeltaConstraint.Remove();
+ mScrollMainInternalFinalConstraint.Remove();
+ mScrollMainInternalRelativeConstraint.Remove();
+ mScrollMainInternalDomainConstraint.Remove();
+ mScrollMainInternalPrePositionMaxConstraint.Remove();
}
if( mScrollMainInternalPrePositionConstraint )
{
- self.RemoveConstraint(mScrollMainInternalPrePositionConstraint);
+ mScrollMainInternalPrePositionConstraint.Remove();
}
// TODO: It's probably better to use a local displacement value as this will give a displacement when scrolling just commences
{
initialPanMask.x = 0.0f;
}
- Constraint constraint;
if( mPanning )
{
- constraint = Constraint::New<Vector3>( mPropertyPrePosition,
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( self, Actor::SIZE ),
- InternalPrePositionConstraint( mPanStartPosition, initialPanMask, mAxisAutoLock, mAxisAutoLockGradient, mLockAxis, mMaxOvershoot, mRulerX->GetDomain(), mRulerY->GetDomain() ) );
- mScrollMainInternalPrePositionConstraint = self.ApplyConstraint( constraint );
+ mScrollMainInternalPrePositionConstraint = Constraint::New<Vector2>( self,
+ Toolkit::ScrollView::Property::SCROLL_PRE_POSITION,
+ InternalPrePositionConstraint( mPanStartPosition,
+ initialPanMask,
+ mAxisAutoLock,
+ mAxisAutoLockGradient,
+ mLockAxis,
+ mMaxOvershoot,
+ mRulerX->GetDomain(),
+ mRulerY->GetDomain() ) );
+ mScrollMainInternalPrePositionConstraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ mScrollMainInternalPrePositionConstraint.AddSource( Source( self, Actor::Property::SIZE ) );
+ mScrollMainInternalPrePositionConstraint.Apply();
}
// 2. Second calculate the clamped position (actual position)
- constraint = Constraint::New<Vector3>( mPropertyPosition,
- LocalSource( mPropertyPrePosition ),
- LocalSource( mPropertyPositionMin ),
- LocalSource( mPropertyPositionMax ),
- Source( self, Actor::SIZE ),
- InternalPositionConstraint( mRulerX->GetDomain(),
- mRulerY->GetDomain(), mWrapMode ) );
- mScrollMainInternalPositionConstraint = self.ApplyConstraint( constraint );
-
- constraint = Constraint::New<Vector3>( mPropertyPositionDelta,
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyDomainOffset ),
- InternalPositionDeltaConstraint );
- mScrollMainInternalDeltaConstraint = self.ApplyConstraint( constraint );
-
- constraint = Constraint::New<Vector3>( mPropertyFinal,
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyOvershootX ),
- LocalSource( mPropertyOvershootY ),
- InternalFinalConstraint( FinalDefaultAlphaFunction,
- FinalDefaultAlphaFunction ) );
- mScrollMainInternalFinalConstraint = self.ApplyConstraint( constraint );
-
- constraint = Constraint::New<Vector3>( mPropertyRelativePosition,
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyPositionMin ),
- LocalSource( mPropertyPositionMax ),
- LocalSource( Actor::SIZE ),
- InternalRelativePositionConstraint );
- mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint );
+ mScrollMainInternalPositionConstraint = Constraint::New<Vector2>( self,
+ Toolkit::ScrollView::Property::SCROLL_POSITION,
+ InternalPositionConstraint( mRulerX->GetDomain(),
+ mRulerY->GetDomain(),
+ mWrapMode ) );
+ mScrollMainInternalPositionConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ) );
+ mScrollMainInternalPositionConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
+ mScrollMainInternalPositionConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+ mScrollMainInternalPositionConstraint.AddSource( Source( self, Actor::Property::SIZE ) );
+ mScrollMainInternalPositionConstraint.Apply();
+
+ mScrollMainInternalDeltaConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_POSITION_DELTA, InternalPositionDeltaConstraint );
+ mScrollMainInternalDeltaConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
+ mScrollMainInternalDeltaConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET ) );
+ mScrollMainInternalDeltaConstraint.Apply();
+
+ mScrollMainInternalFinalConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_FINAL,
+ InternalFinalConstraint( FinalDefaultAlphaFunction,
+ FinalDefaultAlphaFunction ) );
+ mScrollMainInternalFinalConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
+ mScrollMainInternalFinalConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_X ) );
+ mScrollMainInternalFinalConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_Y ) );
+ mScrollMainInternalFinalConstraint.Apply();
+
+ mScrollMainInternalRelativeConstraint = Constraint::New<Vector2>( self, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION, InternalRelativePositionConstraint );
+ mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
+ mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
+ mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+ mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
+ mScrollMainInternalRelativeConstraint.Apply();
+
+ mScrollMainInternalDomainConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_DOMAIN_SIZE, InternalScrollDomainConstraint );
+ mScrollMainInternalDomainConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
+ mScrollMainInternalDomainConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+ mScrollMainInternalDomainConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
+ mScrollMainInternalDomainConstraint.Apply();
+
+ mScrollMainInternalPrePositionMaxConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_MAX, InternalPrePositionMaxConstraint );
+ mScrollMainInternalPrePositionMaxConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+ mScrollMainInternalPrePositionMaxConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
+ mScrollMainInternalPrePositionMaxConstraint.Apply();
// When panning we want to make sure overshoot values are affected by pre position and post position
SetOvershootConstraintsEnabled(!mWrapMode);
// remove and reset, it may now be in wrong order with the main internal constraints
if( mScrollMainInternalOvershootXConstraint )
{
- self.RemoveConstraint(mScrollMainInternalOvershootXConstraint);
+ mScrollMainInternalOvershootXConstraint.Remove();
mScrollMainInternalOvershootXConstraint.Reset();
- self.RemoveConstraint(mScrollMainInternalOvershootYConstraint);
+ mScrollMainInternalOvershootYConstraint.Remove();
mScrollMainInternalOvershootYConstraint.Reset();
}
if( enabled )
{
- Constraint constraint = Constraint::New<float>( mPropertyOvershootX,
- LocalSource( mPropertyPrePosition ),
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyCanScrollHorizontal ),
- OvershootXConstraint(mMaxOvershoot.x) );
- mScrollMainInternalOvershootXConstraint = self.ApplyConstraint( constraint );
+ mScrollMainInternalOvershootXConstraint= Constraint::New<float>( self, Toolkit::ScrollView::Property::OVERSHOOT_X, OvershootXConstraint(mMaxOvershoot.x) );
+ mScrollMainInternalOvershootXConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ) );
+ mScrollMainInternalOvershootXConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
+ mScrollMainInternalOvershootXConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL ) );
+ mScrollMainInternalOvershootXConstraint.Apply();
- constraint = Constraint::New<float>( mPropertyOvershootY,
- LocalSource( mPropertyPrePosition ),
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyCanScrollVertical ),
- OvershootYConstraint(mMaxOvershoot.y) );
- mScrollMainInternalOvershootYConstraint = self.ApplyConstraint( constraint );
+ mScrollMainInternalOvershootYConstraint = Constraint::New<float>( self, Toolkit::ScrollView::Property::OVERSHOOT_Y, OvershootYConstraint(mMaxOvershoot.y) );
+ mScrollMainInternalOvershootYConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ) );
+ mScrollMainInternalOvershootYConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
+ mScrollMainInternalOvershootYConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL ) );
+ mScrollMainInternalOvershootYConstraint.Apply();
}
else
{
- self.SetProperty(mPropertyOvershootX, 0.0f);
- self.SetProperty(mPropertyOvershootY, 0.0f);
+ self.SetProperty(Toolkit::ScrollView::Property::OVERSHOOT_X, 0.0f);
+ self.SetProperty(Toolkit::ScrollView::Property::OVERSHOOT_Y, 0.0f);
}
}
Constraint constraint;
// MoveActor (scrolling)
- constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( self, mPropertyPosition ),
- MoveActorConstraint );
+ constraint = Constraint::New<Vector3>( self, Actor::Property::POSITION, MoveActorConstraint );
+ constraint.AddSource( Source( self, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
constraint.SetRemoveAction(Constraint::Discard);
ApplyConstraintToBoundActors(constraint);
// WrapActor (wrap functionality)
- constraint = Constraint::New<Vector3>( Actor::POSITION,
- LocalSource( Actor::SCALE ),
- LocalSource( Actor::ANCHOR_POINT ),
- LocalSource( Actor::SIZE ),
- Source( self, mPropertyPositionMin ),
- Source( self, mPropertyPositionMax ),
- Source( self, mPropertyWrap ),
- WrapActorConstraint );
+ constraint = Constraint::New<Vector3>( self, Actor::Property::POSITION, WrapActorConstraint );
+ constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
+ constraint.AddSource( LocalSource( Actor::Property::ANCHOR_POINT ) );
+ constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
+ constraint.AddSource( Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
+ constraint.AddSource( Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+ constraint.AddSource( Source( self, Toolkit::ScrollView::Property::WRAP ) );
constraint.SetRemoveAction(Constraint::Discard);
ApplyConstraintToBoundActors(constraint);
}