*/
float VectorInDomain(float a, float b, float start, float end, Dali::Toolkit::DirectionBias bias)
{
- if(bias == Dali::Toolkit::DirectionBiasNone)
+ if(bias == Dali::Toolkit::DIRECTION_BIAS_NONE)
{
return ShortestDistanceInDomain( a, b, start, end );
}
if(vect > 0)
{
// +ve vector
- if(bias == Dali::Toolkit::DirectionBiasRight) // going right, take the vector.
+ if(bias == Dali::Toolkit::DIRECTION_BIAS_RIGHT) // going right, take the vector.
{
return vect;
}
else
{
// -ve vector
- if(bias == Dali::Toolkit::DirectionBiasLeft) // going left, take the vector.
+ if(bias == Dali::Toolkit::DIRECTION_BIAS_LEFT) // going left, take the vector.
{
return vect;
}
mDomainMax = Vector2( -rulerDomainX.max, -rulerDomainY.max );
mClampX = rulerDomainX.enabled;
mClampY = rulerDomainY.enabled;
- mFixedRulerX = rulerX->GetType() == Ruler::Fixed;
- mFixedRulerY = rulerY->GetType() == Ruler::Fixed;
+ mFixedRulerX = rulerX->GetType() == Ruler::FIXED;
+ mFixedRulerY = rulerY->GetType() == Ruler::FIXED;
}
void operator()( Vector2& scrollPostPosition, const PropertyInputContainer& inputs )
true,
horizontalBias,
verticalBias,
- Snap);
+ SNAP);
if(!animating)
{
void ScrollView::ScrollTo(const Vector2& position, float duration)
{
- ScrollTo(position, duration, DirectionBiasNone, DirectionBiasNone);
+ ScrollTo(position, duration, DIRECTION_BIAS_NONE, DIRECTION_BIAS_NONE);
}
void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
{
- ScrollTo(position, duration, alpha, DirectionBiasNone, DirectionBiasNone);
+ ScrollTo(position, duration, alpha, DIRECTION_BIAS_NONE, DIRECTION_BIAS_NONE);
}
void ScrollView::ScrollTo(const Vector2& position, float duration,
Vector2 clampDelta(Vector2::ZERO);
ClampPosition(positionSnap);
- if( (mRulerX->GetType() == Ruler::Free || mRulerY->GetType() == Ruler::Free)
+ if( (mRulerX->GetType() == Ruler::FREE || mRulerY->GetType() == Ruler::FREE)
&& isFreeFlick && !mActorAutoSnapEnabled)
{
// Calculate target position based on velocity of flick.
float t = speed / a;
- if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::Free)
+ if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::FREE)
{
positionSnap.x += t*u.x*0.5f;
}
- if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::Free)
+ if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::FREE)
{
positionSnap.y += t*u.y*0.5f;
}
// If Axis is Free and has velocity, then calculate time taken
// to reach target based on velocity in axis.
- if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::Free)
+ if(mRulerX->IsEnabled() && mRulerX->GetType() == Ruler::FREE)
{
float deltaX = fabsf(startPosition.x - positionSnap.x);
}
}
- if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::Free)
+ if(mRulerY->IsEnabled() && mRulerY->GetType() == Ruler::FREE)
{
float deltaY = fabsf(startPosition.y - positionSnap.y);
bool animating = AnimateTo(positionSnap, positionDuration,
alphaFunction, false,
- DirectionBiasNone, DirectionBiasNone,
- isFlick || isFreeFlick ? Flick : Snap);
+ DIRECTION_BIAS_NONE, DIRECTION_BIAS_NONE,
+ isFlick || isFreeFlick ? FLICK : SNAP);
return animating;
}
scrollBar.SetProperty( Dali::Actor::Property::NAME,"ScrollBar");
mInternalActor.Add( scrollBar );
- if( scrollBar.GetScrollDirection() == Toolkit::ScrollBar::Horizontal )
+ if( scrollBar.GetScrollDirection() == Toolkit::ScrollBar::HORIZONTAL )
{
scrollBar.SetScrollPropertySource( Self(),
Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_X,
if(mRulerX->IsEnabled() && !mRulerY->IsEnabled())
{
// If only the ruler in the X axis is enabled, scroll in the X axis.
- if(mRulerX->GetType() == Ruler::Free)
+ if(mRulerX->GetType() == Ruler::FREE)
{
// Free panning mode
targetScrollPosition.x += event.GetDelta() * mWheelScrollDistanceStep.x;
else
{
// If the ruler in the Y axis is enabled, scroll in the Y axis.
- if(mRulerY->GetType() == Ruler::Free)
+ if(mRulerY->GetType() == Ruler::FREE)
{
// Free panning mode
targetScrollPosition.y += event.GetDelta() * mWheelScrollDistanceStep.y;
// MoveActor (scrolling)
constraint = Constraint::New<Vector3>( self, Actor::Property::POSITION, MoveActorConstraint );
constraint.AddSource( Source( self, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
- constraint.SetRemoveAction(Constraint::Discard);
+ constraint.SetRemoveAction(Constraint::DISCARD);
ApplyConstraintToBoundActors(constraint);
// WrapActor (wrap functionality)
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);
+ constraint.SetRemoveAction(Constraint::DISCARD);
ApplyConstraintToBoundActors(constraint);
}