: Scrollable(),
mParent(NULL),
mPropertyTime(Property::INVALID_INDEX),
- mPropertyX(Property::INVALID_INDEX),
- mPropertyY(Property::INVALID_INDEX),
mPropertyPrePosition(Property::INVALID_INDEX),
mPropertyPosition(Property::INVALID_INDEX),
mPropertyScale(Property::INVALID_INDEX),
mPropertyOvershootX = self.RegisterProperty(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME, 0.0f);
mPropertyOvershootY = self.RegisterProperty(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME, 0.0f);
mPropertyFinal = self.RegisterProperty(Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME, Vector3::ZERO);
- mPropertyX = self.RegisterProperty(Toolkit::ScrollView::SCROLL_X_PROPERTY_NAME, 0.0f);
- mPropertyY = self.RegisterProperty(Toolkit::ScrollView::SCROLL_Y_PROPERTY_NAME, 0.0f);
mPropertyScale = self.RegisterProperty(Toolkit::ScrollView::SCROLL_SCALE_PROPERTY_NAME, Vector3::ONE);
mPropertyWrap = self.RegisterProperty(Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME, false);
mPropertyPanning = self.RegisterProperty(Toolkit::ScrollView::SCROLL_PANNING_PROPERTY_NAME, false);
};
/**
- * When panning, this constraint updates the X property, otherwise
- * it has no effect on the X property.
- */
-float InternalXConstraint(const float& current,
- const PropertyInput& scrollPosition)
-{
- return scrollPosition.GetVector3().x;
-}
-
-/**
- * When panning, this constraint updates the Y property, otherwise
- * it has no effect on the Y property.
- */
-float InternalYConstraint(const float& current,
- const PropertyInput& scrollPosition)
-{
- return scrollPosition.GetVector3().y;
-}
-
-/**
* Internal Position-Delta Property Constraint.
*
* Generates position-delta property based on scroll-position + scroll-offset properties.
void ScrollView::OnPropertySet( Property::Index index, Property::Value propertyValue )
{
Actor self = Self();
- if( index == mPropertyX )
- {
- self.GetProperty(mPropertyPrePosition).Get(mScrollPrePosition);
- propertyValue.Get(mScrollPrePosition.x);
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
- self.SetProperty(mPropertyPrePosition, mScrollPrePosition);
- }
- else if( index == mPropertyY )
- {
- self.GetProperty(mPropertyPrePosition).Get(mScrollPrePosition);
- propertyValue.Get(mScrollPrePosition.y);
- DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
- self.SetProperty(mPropertyPrePosition, mScrollPrePosition);
- }
- else if( index == mPropertyPrePosition )
+ if( index == mPropertyPrePosition )
{
DALI_LOG_SCROLL_STATE("[0x%X]: mPropertyPrePosition[%.2f, %.2f]", this, propertyValue.Get<Vector3>().x, propertyValue.Get<Vector3>().y);
propertyValue.Get(mScrollPrePosition);
self.RemoveConstraint(mScrollMainInternalDeltaConstraint);
self.RemoveConstraint(mScrollMainInternalFinalConstraint);
self.RemoveConstraint(mScrollMainInternalRelativeConstraint);
- self.RemoveConstraint(mScrollMainInternalXConstraint);
- self.RemoveConstraint(mScrollMainInternalYConstraint);
}
if( mScrollMainInternalPrePositionConstraint )
{
InternalRelativePositionConstraint );
mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint );
- constraint = Constraint::New<float>( mPropertyX,
- LocalSource( mPropertyPrePosition ),
- InternalXConstraint );
- mScrollMainInternalXConstraint = self.ApplyConstraint( constraint );
-
- constraint = Constraint::New<float>( mPropertyY,
- LocalSource( mPropertyPrePosition ),
- InternalYConstraint );
- mScrollMainInternalYConstraint = self.ApplyConstraint( constraint );
-
// When panning we want to make sure overshoot values are affected by pre position and post position
SetOvershootConstraintsEnabled(!mWrapMode);
}
static const std::string SCROLL_OVERSHOOT_X_PROPERTY_NAME; ///< Property, name "scroll-overshoot-x", type float
static const std::string SCROLL_OVERSHOOT_Y_PROPERTY_NAME; ///< Property, name "scroll-overshoot-y", type float
static const std::string SCROLL_FINAL_PROPERTY_NAME; ///< Property, name "scroll-final", type VECTOR3
- static const std::string SCROLL_X_PROPERTY_NAME; ///< Property, name "scroll-x", type FLOAT
- static const std::string SCROLL_Y_PROPERTY_NAME; ///< Property, name "scroll-y", type FLOAT
static const std::string SCROLL_SCALE_PROPERTY_NAME; ///< Property, name "scroll-scale", type VECTOR3
static const std::string SCROLL_WRAP_PROPERTY_NAME; ///< Property, name "scroll-wrap", type BOOLEAN
static const std::string SCROLL_PANNING_PROPERTY_NAME; ///< Property, name "scroll-panning", type BOOLEAN