*/
static float TestOvershootSnapDuration(ToolkitTestApplication &application, ScrollView scrollView)
{
- Property::Index overshootPropertyX = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
- Property::Index overshootPropertyY = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-
int timeToReachOrigin = -1;
for(int i = 0;i<MAX_FRAMES_TO_TEST_OVERSHOOT;i++)
{
- float overshootXValue = scrollView.GetProperty<float>(overshootPropertyX);
- float overshootYValue = scrollView.GetProperty<float>(overshootPropertyY);
+ float overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ float overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
if(overshootXValue == 0.0f && overshootYValue == 0.0f)
{
break;
a.SetPosition( TEST_ACTOR_POSITION );
Wait(application);
- Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
- Source(scrollView, scrollPositionProperty),
+ Source(scrollView, ScrollView::Property::SCROLL_POSITION),
TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
constraint.SetRemoveAction(Constraint::Discard);
scrollView.ApplyConstraintToChildren(constraint);
a.SetPosition( TEST_ACTOR_POSITION );
Wait(application);
- Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
// apply this constraint to scrollview
Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
- Source(scrollView, scrollPositionProperty),
+ Source(scrollView, ScrollView::Property::SCROLL_POSITION),
TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
constraint.SetRemoveAction(Constraint::Discard);
// 1. Scroll page in NW (-500,-500 pixels), then inspect overshoot. (don't release touch)
Vector2 currentPos = Vector2(100.0f, 100.0f);
currentPos = PerformGestureDiagonalSwipe(application, currentPos, Vector2(5.0f, 5.0f), 100, false);
- Property::Index overshootXProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
- Property::Index overshootYProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
- Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
- float overshootXValue = scrollView.GetProperty<float>(overshootXProperty);
- float overshootYValue = scrollView.GetProperty<float>(overshootYProperty);
- Vector3 positionValue = scrollView.GetProperty<Vector3>(scrollPositionProperty);
+ float overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ float overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+ Vector3 positionValue = scrollView.GetProperty<Vector3>(ScrollView::Property::SCROLL_POSITION);
DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
DALI_TEST_EQUALS(positionValue, Vector3::ZERO, TEST_LOCATION);
*/
// EXTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/actors/renderable-actor.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
*/
// EXTERNAL INCLUDES
-#include <dali.h>
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/matrix3.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/builder/tree-node.h>
#include <sys/stat.h>
#include <boost/function.hpp>
#include <sstream>
-
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/object/type-info.h>
+#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/scripting/scripting.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/builder/json-parser.h>
#include <string>
#include <list>
#include <map>
+#include <dali/public-api/common/stage.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/property-map.h>
+#include <dali/public-api/render-tasks/render-task.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
// EXTERNAL INCLUDES
#include <sstream>
+#include <dali/public-api/adaptor-framework/color-controller.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/builder/builder-impl.h>
*/
// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
#include <boost/function.hpp>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/object/type-info.h>
+#include <dali/public-api/object/property-notification.h>
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/builder/builder-impl.h>
// target the container to observe for scrolling
Actor target = mContainer.Self();
Constraint constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
- Source( target, vertical ? target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL) : target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL)),
+ Source( target, vertical ? Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL : Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL),
ScrollBarInternalVisibilityConstraint );
mSlider.ApplyConstraint( constraint );
mSliderWrap.ApplyConstraint( constraint );
constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( target, Actor::Property::SIZE ),
ScrollBarInternalSizeConstraint( vertical ) );
mSlider.ApplyConstraint( constraint );
mSliderWrap.ApplyConstraint( constraint );
constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
ScrollBarInternalRotationConstraint( vertical ) );
mSlider.ApplyConstraint( constraint );
mSliderWrap.ApplyConstraint( constraint );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source( mSlider, Actor::Property::SIZE),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( target, Actor::Property::SIZE ),
ScrollBarInternalPositionConstraint(vertical) );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source( mSlider, Actor::Property::SIZE),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( target, Actor::Property::SIZE ),
ScrollBarInternalPositionConstraint(vertical, true) );
mSliderWrap.ApplyConstraint( constraint );
mContainer.AddOverlay( mHitArea );
constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
- Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+ Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( target, Actor::Property::SIZE ),
ScrollBarInternalHitSizeConstraint(vertical, BAR_TAB_SIZE.width) );
mHitArea.ApplyConstraint( constraint );
void ItemView::OnInitialize()
{
- RegisterCommonProperties();
-
Actor self = Self();
// Disable size negotiation for item views
EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
- Constraint constraint = Constraint::New<Vector3>(mPropertyRelativePosition,
+ Constraint constraint = Constraint::New<Vector3>(Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION,
LocalSource(mPropertyPosition),
- LocalSource(mPropertyPositionMin),
- LocalSource(mPropertyPositionMax),
+ LocalSource(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN),
+ LocalSource(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX),
LocalSource(Actor::Property::SIZE),
RelativePositionConstraint);
self.ApplyConstraint(constraint);
Radian scrollDirection(mActiveLayout->GetScrollDirection());
float orientation = static_cast<float>(mActiveLayout->GetOrientation());
- self.SetProperty(mPropertyScrollDirection, Vector3(sinf(scrollDirection), cosf(scrollDirection), orientation));
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_DIRECTION, Vector3(sinf(scrollDirection), cosf(scrollDirection), orientation));
self.SetProperty(mPropertyScrollSpeed, mScrollSpeed);
if(IsHorizontal(mActiveLayout->GetOrientation()))
{
- self.SetProperty(mPropertyPositionMin, Vector3(0.0f, firstItemPosition.x, 0.0f));
- self.SetProperty(mPropertyPositionMax, Vector3(0.0f, lastItemPosition.x, 0.0f));
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector3(0.0f, firstItemPosition.x, 0.0f));
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector3(0.0f, lastItemPosition.x, 0.0f));
domainSize = fabs(firstItemPosition.x - lastItemPosition.x);
}
else
{
- self.SetProperty(mPropertyPositionMin, Vector3(0.0f, firstItemPosition.y, 0.0f));
- self.SetProperty(mPropertyPositionMax, Vector3(0.0f, lastItemPosition.y, 0.0f));
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector3(0.0f, firstItemPosition.y, 0.0f));
+ self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector3(0.0f, lastItemPosition.y, 0.0f));
domainSize = fabs(firstItemPosition.y - lastItemPosition.y);
}
mScrollConnector.SetScrollDomain(minLayoutPosition, 0.0f, domainSize);
bool isLayoutScrollable = IsLayoutScrollable(layoutSize);
- self.SetProperty(mPropertyCanScrollVertical, isLayoutScrollable);
- self.SetProperty(mPropertyCanScrollHorizontal, false);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, isLayoutScrollable);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, false);
}
}
{
Actor self = Self();
- float minScrollPosition = self.GetProperty<float>(mPropertyPositionMin);
- float maxScrollPosition = self.GetProperty<float>(mPropertyPositionMax);
+ float minScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN);
+ float maxScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX);
return Vector3(0.0f, fabs(maxScrollPosition - minScrollPosition), 0.0f);
}
self.Add(mOvershootOverlay);
Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
- ParentSource( mPropertyScrollDirection ),
+ ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
ParentSource( Actor::Property::SIZE ),
OvershootOverlaySizeConstraint() );
mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
- ParentSource( mPropertyScrollDirection ),
+ ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
OvershootOverlayRotationConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
ParentSource( Actor::Property::SIZE ),
- ParentSource( mPropertyScrollDirection ),
+ ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
OvershootOverlayPositionConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
- ParentSource( mPropertyCanScrollVertical ),
+ ParentSource( Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL ),
OvershootOverlayVisibilityConstraint() );
mOvershootOverlay.ApplyConstraint(constraint);
// ScrollBase
///////////////////////////////////////////////////////////////////////////////////////////////////
-const char* const ScrollBase::SCROLL_DOMAIN_OFFSET_PROPERTY_NAME = "domain-offset";
-
ScrollBase::ScrollBase()
: Scrollable(),
mParent(NULL),
- mPropertyTime(Property::INVALID_INDEX),
- mPropertyPrePosition(Property::INVALID_INDEX),
- mPropertyPosition(Property::INVALID_INDEX),
- mPropertyOvershootX(Property::INVALID_INDEX),
- mPropertyOvershootY(Property::INVALID_INDEX),
- mPropertyWrap(Property::INVALID_INDEX),
- mPropertyPanning(Property::INVALID_INDEX),
- mPropertyScrolling(Property::INVALID_INDEX),
- mPropertyFinal(Property::INVALID_INDEX),
- mPropertyDomainOffset(Property::INVALID_INDEX),
- mPropertyPositionDelta(Property::INVALID_INDEX),
- mPropertyScrollStartPagePosition(Property::INVALID_INDEX),
mDelay(0.0f)
{
}
mParent = parent;
}
-void ScrollBase::RegisterProperties()
-{
- Actor self = Self();
-
- // Register common properties
- RegisterCommonProperties();
-
- // Register Scroll Properties.
- mPropertyTime = self.RegisterProperty(Toolkit::ScrollView::SCROLL_TIME_PROPERTY_NAME, 0.0f);
- mPropertyPrePosition = self.RegisterProperty(Toolkit::ScrollView::SCROLL_PRE_POSITION_PROPERTY_NAME, Vector3::ZERO);
- mPropertyPosition = self.RegisterProperty(Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME, Vector3::ZERO);
- 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);
- mPropertyWrap = self.RegisterProperty(Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME, false);
- mPropertyPanning = self.RegisterProperty(Toolkit::ScrollView::SCROLL_PANNING_PROPERTY_NAME, false);
- mPropertyScrolling = self.RegisterProperty(Toolkit::ScrollView::SCROLL_SCROLLING_PROPERTY_NAME, false);
- mPropertyDomainOffset = self.RegisterProperty(SCROLL_DOMAIN_OFFSET_PROPERTY_NAME, Vector3::ZERO);
- mPropertyPositionDelta = self.RegisterProperty(Toolkit::ScrollView::SCROLL_POSITION_DELTA_PROPERTY_NAME, Vector3::ZERO);
- mPropertyScrollStartPagePosition = self.RegisterProperty(Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME, Vector3::ZERO);
-}
-
void ScrollBase::BindActor(Actor child)
{
FindAndUnbindActor(child);
*/
ScrollBase();
- /**
- * 2nd-phase initialization.
- */
- void RegisterProperties();
-
protected:
ScrollBase *mParent; ///< Pointer to ScrollBase parent, if exists.
- Property::Index mPropertyTime; ///< Scroll Time (0 to animationDuration while animating, otherwise 0)
- Property::Index mPropertyPrePosition; ///< Scroll Position ("scroll-position") [function of scroll-x, scroll-y]
- Property::Index mPropertyPosition; ///< Scroll Position ("scroll-position") [function of scroll-pre-position]
- Property::Index mPropertyOvershootX; ///< Scroll Overshoot ("scroll-overshoot-x") [function of scroll-pre-position, scroll-position]
- Property::Index mPropertyOvershootY; ///< Scroll Overshoot ("scroll-overshoot-y") [function of scroll-pre-position, scroll-position]
- Property::Index mPropertyWrap; ///< Scroll Wrap ("scroll-wrap")
- Property::Index mPropertyPanning; ///< Whether we are panning
- Property::Index mPropertyScrolling; ///< Whether we are scrolling
- Property::Index mPropertyFinal; ///< Scroll Final Position ("scroll-final") [scroll-position + f(scroll-overshoot)]
- Property::Index mPropertyDomainOffset; ///< Scroll Domain Offset ("scroll-domain-offset") keeps track of scroll position as it wraps domains
- Property::Index mPropertyPositionDelta; ///< Scroll Position Delta ("scroll-position-delta")
- Property::Index mPropertyScrollStartPagePosition; ///< Scroll Start Page Position ("scroll-start-page-position")
private:
void ScrollOvershootEffectRipple::Apply()
{
Actor self = mAttachedScrollView.Self();
- mOvershootProperty = self.GetPropertyIndex(IsVertical() ? Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME : Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
+ mOvershootProperty = IsVertical() ? Toolkit::ScrollView::Property::OVERSHOOT_Y : Toolkit::ScrollView::Property::OVERSHOOT_X;
// make sure height is set, since we only create a constraint for image width
mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
* @param[in] positionProperty The Actor's Position.
* @param[in] scaleProperty The Actor's Scale.
* @param[in] sizeProperty The Actor's Size
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
* @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
* @return The new visibility of this Actor.
*/
* @param[in] positionProperty The Actor's Position.
* @param[in] scaleProperty The Actor's Scale.
* @param[in] sizeProperty The Actor's Size
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
* @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
* @param[in] activateProperty Activation value (0 - normal, 1.0 - full effect)
* @return The new orientation of this Actor.
* @param[in] current The current position of this Actor
* @param[in] scaleProperty The Actor's Scale.
* @param[in] sizeProperty The Actor's Size
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
* @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
* @param[in] activateProperty Activation value (0 - normal, 1.0 - full effect)
* @return The new position of this Actor.
LocalSource( Actor::Property::POSITION ),
LocalSource( Actor::Property::SCALE ),
LocalSource( Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) );
LocalSource( Actor::Property::POSITION ),
LocalSource( Actor::Property::SCALE ),
LocalSource( Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
boost::bind( &ScrollCarouselEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
LocalSource( Actor::Property::SCALE ),
LocalSource( Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
Source(scrollView, Actor::Property::SIZE ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
boost::bind( &ScrollCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6) );
/**
* @param[in] current The current orientation of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new orientation of this Actor.
*/
Quaternion RotationConstraint(const Quaternion& current,
/**
* @param[in] current The current color of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new color of this Actor.
*/
Vector4 ColorConstraint(const Vector4& current,
/**
* @param[in] current The current position
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new position of this Actor.
*/
Vector3 PositionConstraint(const Vector3& current,
Constraint constraint;
constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
Source(parentPage, Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
Source(parentPage, Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
Source(parentPage, Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
/**
* @param[in] current The current scale
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new scale of this Actor.
*/
Vector3 operator()(const Vector3& currentScale,
/**
* @param[in] current The current position
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new position of this Actor.
*/
Vector3 operator()(const Vector3& currentPosition,
Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
LocalSource(Actor::Property::POSITION),
ParentSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) );
constraint.SetRemoveAction( Constraint::Discard );
// Position Constraint (apply last as other constraints use Actor::POSITION as a function input)
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
ParentSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) );
constraint.SetRemoveAction( Constraint::Discard );
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.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/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
// Setup properties, signals and actions using the type-registry.
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-position", VECTOR3, SCROLL_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-pre-position", VECTOR3, SCROLL_PRE_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "overshoot-x", FLOAT, OVERSHOOT_X)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "overshoot-y", FLOAT, OVERSHOOT_Y)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-final", VECTOR3, SCROLL_FINAL)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "wrap", BOOLEAN, WRAP)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "panning", BOOLEAN, PANNING)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scrolling", BOOLEAN, SCROLLING)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-domain-offset", VECTOR3, SCROLL_DOMAIN_OFFSET)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-position-delta", VECTOR3, SCROLL_POSITION_DELTA)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "start-page-position", VECTOR3, START_PAGE_POSITION)
+
DALI_SIGNAL_REGISTRATION( ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
DALI_TYPE_REGISTRATION_END()
/**
* 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
{
/**
* 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
{
mAlterChild = true;
- // Register Scroll Properties.
- RegisterProperties();
-
mScrollPostPosition = mScrollPrePosition = Vector3::ZERO;
mMouseWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, mCanScrollVertical);
+ self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, mCanScrollHorizontal);
+
Vector3 size = GetControlSize();
UpdatePropertyDomain(size);
SetInternalConstraints();
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
this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
Vector3 currentScrollPosition = GetCurrentScrollPosition();
- self.SetProperty( mPropertyScrollStartPagePosition, currentScrollPosition );
+ self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, 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.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);
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.
if(child)
{
- Vector3 position = Self().GetProperty<Vector3>(mPropertyPosition);
+ Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_POSITION);
// Get center-point of the Actor.
Vector3 childPosition = GetPositionOfAnchor(child, AnchorPoint::CENTER);
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<Vector3>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector3>().y, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector3>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector3>().y );
}
SetScrollUpdateNotification(true);
Vector3 ScrollView::GetPropertyPrePosition() const
{
- Vector3 position = Self().GetProperty<Vector3>(mPropertyPrePosition);
+ Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION);
WrapPosition(position);
return position;
}
Vector3 ScrollView::GetPropertyPosition() const
{
- Vector3 position = Self().GetProperty<Vector3>(mPropertyPosition);
+ Vector3 position = Self().GetProperty<Vector3>(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);
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();
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 );
}
}
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);
+ Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector3::ZERO);
UpdateLocalScrollProperties();
Vector3 currentScrollPosition = GetCurrentScrollPosition();
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);
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<Vector3>().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, 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<Vector3>().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<Vector3>().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<Vector3>().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
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 )
{
if(state == Gesture::Started)
{
Vector3 currentScrollPosition = GetCurrentScrollPosition();
- Self().SetProperty(mPropertyScrolling, true);
+ 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 )
{
if( mPanning )
{
- constraint = Constraint::New<Vector3>( mPropertyPrePosition,
+ constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION,
Source( detector, PanGestureDetector::Property::LOCAL_POSITION ),
Source( self, Actor::Property::SIZE ),
InternalPrePositionConstraint( mPanStartPosition, initialPanMask, mAxisAutoLock, mAxisAutoLockGradient, mLockAxis, mMaxOvershoot, mRulerX->GetDomain(), mRulerY->GetDomain() ) );
}
// 2. Second calculate the clamped position (actual position)
- constraint = Constraint::New<Vector3>( mPropertyPosition,
- LocalSource( mPropertyPrePosition ),
- LocalSource( mPropertyPositionMin ),
- LocalSource( mPropertyPositionMax ),
+ constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_POSITION,
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ),
+ LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source( self, Actor::Property::SIZE ),
InternalPositionConstraint( mRulerX->GetDomain(),
mRulerY->GetDomain(), mWrapMode ) );
mScrollMainInternalPositionConstraint = self.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( mPropertyPositionDelta,
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyDomainOffset ),
+ constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_POSITION_DELTA,
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET ),
InternalPositionDeltaConstraint );
mScrollMainInternalDeltaConstraint = self.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( mPropertyFinal,
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyOvershootX ),
- LocalSource( mPropertyOvershootY ),
+ constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_FINAL,
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_X ),
+ LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_Y ),
InternalFinalConstraint( FinalDefaultAlphaFunction,
FinalDefaultAlphaFunction ) );
mScrollMainInternalFinalConstraint = self.ApplyConstraint( constraint );
- constraint = Constraint::New<Vector3>( mPropertyRelativePosition,
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyPositionMin ),
- LocalSource( mPropertyPositionMax ),
+ constraint = Constraint::New<Vector3>( Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION,
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
LocalSource( Actor::Property::SIZE ),
InternalRelativePositionConstraint );
mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint );
}
if( enabled )
{
- Constraint constraint = Constraint::New<float>( mPropertyOvershootX,
- LocalSource( mPropertyPrePosition ),
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyCanScrollHorizontal ),
+ Constraint constraint = Constraint::New<float>( Toolkit::ScrollView::Property::OVERSHOOT_X,
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ),
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ LocalSource( Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL ),
OvershootXConstraint(mMaxOvershoot.x) );
mScrollMainInternalOvershootXConstraint = self.ApplyConstraint( constraint );
- constraint = Constraint::New<float>( mPropertyOvershootY,
- LocalSource( mPropertyPrePosition ),
- LocalSource( mPropertyPosition ),
- LocalSource( mPropertyCanScrollVertical ),
+ constraint = Constraint::New<float>( Toolkit::ScrollView::Property::OVERSHOOT_Y,
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ),
+ LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+ LocalSource( Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL ),
OvershootYConstraint(mMaxOvershoot.y) );
mScrollMainInternalOvershootYConstraint = self.ApplyConstraint( constraint );
}
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);
}
}
// MoveActor (scrolling)
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
- Source( self, mPropertyPosition ),
+ Source( self, Toolkit::ScrollView::Property::SCROLL_POSITION ),
MoveActorConstraint );
constraint.SetRemoveAction(Constraint::Discard);
ApplyConstraintToBoundActors(constraint);
LocalSource( Actor::Property::SCALE ),
LocalSource( Actor::Property::ANCHOR_POINT ),
LocalSource( Actor::Property::SIZE ),
- Source( self, mPropertyPositionMin ),
- Source( self, mPropertyPositionMax ),
- Source( self, mPropertyWrap ),
+ Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+ Source( self, Toolkit::ScrollView::Property::WRAP ),
WrapActorConstraint );
constraint.SetRemoveAction(Constraint::Discard);
ApplyConstraintToBoundActors(constraint);
virtual void OnChildRemove(Actor& child);
/**
- * @copydoc Dali::CustomActorImpl::OnPropertySet( Property::Index index, Property::Value propertyValue )
- */
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
-
- /**
* From CustomActorImpl; called after a touch-signal is received by the owning actor.
*
* We don't listen to these events as content within the contain may consume events.
/**
* Called whenever a snap animation has completed
* @param[in] source the Animation instance that has completed.
- * Resets all scrolling animations and states, leaving current scroll position at mPropertyPosition
+ * Resets all scrolling animations and states, leaving current scroll position at SCROLL_POSITION
*/
void ResetScrolling();
void OnScrollAnimationFinished( Animation& source );
/**
- * Called when either the X or Y internal scroll positions have finished snapping back to mPropertyPrePosition
+ * Called when either the X or Y internal scroll positions have finished snapping back to SCROLL_PRE_POSITION
*
* @param[in] source the Animation instance that has completed.
*/
/**
* @param[in] current The current color of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new color of this Actor.
*/
Vector4 ColorConstraint(const Vector4& current,
/**
* @param[in] current The current position
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new position of this Actor.
*/
Vector3 PositionConstraint(const Vector3& current,
Constraint constraint;
constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollPageCarouselEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollPageCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
/**
* @param[in] current The current orientation of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new orientation of this Actor.
*/
Quaternion RotationConstraint(const Quaternion& current,
/**
* @param[in] current The current color of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new color of this Actor.
*/
Vector4 ColorConstraint(const Vector4& current,
/**
* @param[in] current The current position
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+ * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
* @return The new position of this Actor.
*/
Vector3 PositionConstraint(const Vector3& current,
Constraint constraint;
constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollPageCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollPageCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
boost::bind( &ScrollPageCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
/**
* @param[in] current The current orientation of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION_PROPERTY_NAME)
+ * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (START_PAGE_POSITION)
* @return The new orientation of this Actor.
*/
Quaternion RotationConstraint(const Quaternion& current,
/**
* @param[in] current The current color of this Actor
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION_PROPERTY_NAME)
+ * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (START_PAGE_POSITION)
* @return The new color of this Actor.
*/
Vector4 ColorConstraint(const Vector4& current,
/**
* @param[in] current The current position
* @param[in] pagePositionProperty The page's position.
- * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
- * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
- * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+ * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+ * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+ * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
* @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
- * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION_PROPERTY_NAME)
+ * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (START_PAGE_POSITION)
* @return The new position of this Actor.
*/
Vector3 PositionConstraint(const Vector3& current,
Constraint constraint;
constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ),
boost::bind( &ScrollPageSpiralEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ),
boost::bind( &ScrollPageSpiralEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
LocalSource(Actor::Property::POSITION),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+ Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
Source(scrollView, Actor::Property::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
+ Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ),
boost::bind( &ScrollPageSpiralEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
constraint.SetRemoveAction( Constraint::Discard );
void ScrollViewWobbleEffect::AttachActor(Actor actor)
{
- Property::Index propertyPosition = actor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME);
- Property::Index propertyOvershootX = actor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
- Property::Index propertyOvershootY = actor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-
// Create effect-overshoot property if not already created.
Property::Index propertyEffectOvershoot = actor.GetPropertyIndex(Toolkit::ScrollViewWobbleEffect::EFFECT_OVERSHOOT);
if(propertyEffectOvershoot == Property::INVALID_INDEX)
Constraint constraint = Constraint::New<Vector3>( propertyEffectOvershoot,
Source(scrollView, mPropertyTime),
- Source(actor, propertyPosition),
- Source(actor, propertyOvershootX),
- Source(actor, propertyOvershootY),
+ Source(actor, Toolkit::ScrollView::Property::SCROLL_POSITION),
+ Source(actor, Toolkit::ScrollView::Property::OVERSHOOT_X),
+ Source(actor, Toolkit::ScrollView::Property::OVERSHOOT_Y),
ScrollViewWobbleEffectConstraint(*this) );
actor.ApplyConstraint(constraint);
}
DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-effect-color", VECTOR4, OVERSHOOT_EFFECT_COLOR )
DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-animation-speed", FLOAT, OVERSHOOT_ANIMATION_SPEED )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-relative-position", VECTOR3, SCROLL_RELATIVE_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-position-min", VECTOR3, SCROLL_POSITION_MIN)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-position-max", VECTOR3, SCROLL_POSITION_MAX)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-direction", VECTOR3, SCROLL_DIRECTION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "can-scroll-vertical", BOOLEAN, CAN_SCROLL_VERTICAL)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "can-scroll-horizontal", BOOLEAN, CAN_SCROLL_HORIZONTAL)
+
DALI_SIGNAL_REGISTRATION( Scrollable, "scroll-started", SIGNAL_SCROLL_STARTED )
DALI_SIGNAL_REGISTRATION( Scrollable, "scroll-completed", SIGNAL_SCROLL_COMPLETED )
DALI_SIGNAL_REGISTRATION( Scrollable, "scroll-updated", SIGNAL_SCROLL_UPDATED )
}
-const char* const Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL = "scrollable-can-scroll-vertical";
-const char* const Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL = "scrollable-can-scroll-horizontal";
-
///////////////////////////////////////////////////////////////////////////////////////////////////
// Scrollable
///////////////////////////////////////////////////////////////////////////////////////////////////
: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | NO_SIZE_NEGOTIATION ) ),
mOvershootEffectColor( DEFAULT_OVERSHOOT_COLOUR ),
mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
- mPropertyRelativePosition(Property::INVALID_INDEX),
- mPropertyPositionMin(Property::INVALID_INDEX),
- mPropertyPositionMax(Property::INVALID_INDEX),
- mPropertyScrollDirection(Property::INVALID_INDEX),
- mPropertyCanScrollVertical(Property::INVALID_INDEX),
- mPropertyCanScrollHorizontal(Property::INVALID_INDEX),
mOvershootEnabled(false)
{
}
mComponents.clear();
}
-void Scrollable::RegisterCommonProperties()
-{
- Actor self = Self();
-
- // Register properties.
- mPropertyRelativePosition = self.RegisterProperty(Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME, Vector3::ZERO);
- mPropertyPositionMin = self.RegisterProperty(Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME, Vector3::ZERO);
- mPropertyPositionMax = self.RegisterProperty(Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME, Vector3::ZERO);
- mPropertyScrollDirection = self.RegisterProperty(Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME, Vector3::ZERO);
- mPropertyCanScrollVertical = self.RegisterProperty(SCROLLABLE_CAN_SCROLL_VERTICAL, true);
- mPropertyCanScrollHorizontal = self.RegisterProperty(SCROLLABLE_CAN_SCROLL_HORIZONTAL, true);
-}
-
bool Scrollable::IsScrollComponentEnabled(Toolkit::Scrollable::ScrollComponentType type) const
{
if(type == Toolkit::Scrollable::OvershootIndicator)
class Scrollable : public Control
{
public:
- static const char* const SCROLLABLE_CAN_SCROLL_VERTICAL;
- static const char* const SCROLLABLE_CAN_SCROLL_HORIZONTAL;
-
- /**
- * Create a new Scrollable.
- * @return A public handle to the newly allocated Scrollable.
- */
-// static Dali::Toolkit::Scrollable New();
-
-public:
/**
* @copydoc Dali::Toolkit::Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType type)
*/
virtual ~Scrollable();
- /**
- * Register common properties
- */
- void RegisterCommonProperties();
-
private:
/**
Vector4 mOvershootEffectColor; ///<The color of the overshoot bouncing effect
float mOvershootAnimationSpeed; ///<The speed of the overshoot animation (pixels per second)
- Property::Index mPropertyRelativePosition;///< Scroll Relative Position ("scroll-relative-position") [range from 0.0f - 1.0f in each axes]
- Property::Index mPropertyPositionMin; ///< Scroll Domain Minimum ("position-min")
- Property::Index mPropertyPositionMax; ///< Scroll Domain Maximum ("position-max")
- Property::Index mPropertyScrollDirection; ///< Scroll direction ("scroll-direction")
- Property::Index mPropertyCanScrollVertical; ///< Whether the current scroll domain is large enough to scroll vertically
- Property::Index mPropertyCanScrollHorizontal; ///< Whether the current scroll domain is large enough to scroll horizontally
-
std::map<Toolkit::Scrollable::ScrollComponentType, ScrollComponentPtr> mComponent; ///< ScrollComponent (such as a scrollbar/page indicator/status)
Toolkit::Scrollable::ScrollStartedSignalType mScrollStartedSignal;
* limitations under the License.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/scripting/script.h>
// ScrollView
///////////////////////////////////////////////////////////////////////////////////////////////////
-const std::string ScrollView::SCROLL_TIME_PROPERTY_NAME( "scroll-time" );
-const std::string ScrollView::SCROLL_POSITION_PROPERTY_NAME( "scroll-position" );
-const std::string ScrollView::SCROLL_PRE_POSITION_PROPERTY_NAME( "scroll-pre-position" );
-const std::string ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME( "scroll-overshoot-x" );
-const std::string ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME( "scroll-overshoot-y" );
-const std::string ScrollView::SCROLL_FINAL_PROPERTY_NAME( "scroll-final" );
-const std::string ScrollView::SCROLL_WRAP_PROPERTY_NAME( "scroll-wrap" );
-const std::string ScrollView::SCROLL_PANNING_PROPERTY_NAME( "scroll-panning" );
-const std::string ScrollView::SCROLL_SCROLLING_PROPERTY_NAME( "scroll-scrolling" );
-const std::string ScrollView::SCROLL_POSITION_DELTA_PROPERTY_NAME( "scroll-position-delta" );
-const std::string ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME( "scroll-start-page-position" );
-
const float ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION(0.5f);
const float ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION(0.25f);
const float ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f);
{
public:
- // Custom properties
-
- static const std::string SCROLL_TIME_PROPERTY_NAME; ///< Property, name "scroll-time", type float
- static const std::string SCROLL_POSITION_PROPERTY_NAME; ///< Property, name "scroll-position", type Vector3
- static const std::string SCROLL_PRE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-pre-position", type Vector3
- 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_WRAP_PROPERTY_NAME; ///< Property, name "scroll-wrap", type bool
- static const std::string SCROLL_PANNING_PROPERTY_NAME; ///< Property, name "scroll-panning", type bool
- static const std::string SCROLL_SCROLLING_PROPERTY_NAME; ///< Property, name "scroll-scrolling", type bool
- static const std::string SCROLL_POSITION_DELTA_PROPERTY_NAME; ///< Property, name "scroll-position-delta" type Vector3
- static const std::string SCROLL_START_PAGE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-start-page-position" type Vector3
-
// Default settings
static const float DEFAULT_SLOW_SNAP_ANIMATION_DURATION; ///< Default Drag-Release animation time.
float duration; ///< Duration of snap animation.
};
+ /**
+ * @brief The start and end property ranges for this control.
+ */
+ enum PropertyRange
+ {
+ ANIMATABLE_PROPERTY_START_INDEX = Toolkit::Scrollable::ANIMATABLE_PROPERTY_END_INDEX + 1,
+ ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX + 1000 ///< Reserve animatable property indices
+ };
+
+ /**
+ * @brief An enumeration of properties belonging to the ScrollView class.
+ */
+ struct Property
+ {
+ enum
+ {
+ SCROLL_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-position", type Vector3
+ SCROLL_PRE_POSITION, ///< Property, name "scroll-pre-position", type Vector3
+ OVERSHOOT_X, ///< Property, name "overshoot-x", type float
+ OVERSHOOT_Y, ///< Property, name "overshoot-y", type float
+ SCROLL_FINAL, ///< Property, name "scroll-final", type Vector3
+ WRAP, ///< Property, name "wrap", type bool
+ PANNING, ///< Property, name "panning", type bool
+ SCROLLING, ///< Property, name "scrolling", type bool
+ SCROLL_DOMAIN_OFFSET, ///< Property, name "scroll-domain-offset" type Vector3
+ SCROLL_POSITION_DELTA, ///< Property, name "scroll-position-delta" type Vector3
+ START_PAGE_POSITION ///< Property, name "start-page-position" type Vector3
+ };
+ };
+
typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type
/**
namespace Toolkit
{
-const std::string Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME( "scroll-relative-position" );
-const std::string Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME( "scroll-position-min" );
-const std::string Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME( "scroll-position-max" );
-const std::string Scrollable::SCROLL_DIRECTION_PROPERTY_NAME( "scroll-direction" );
-
Scrollable::Scrollable()
{
}
OvershootIndicator,
};
- // Custom properties
-
- static const std::string SCROLL_RELATIVE_POSITION_PROPERTY_NAME; ///< Property, name "scroll-relative-position", type Vector3
- static const std::string SCROLL_POSITION_MIN_PROPERTY_NAME; ///< Property, name "scroll-position-min", type Vector3
- static const std::string SCROLL_POSITION_MAX_PROPERTY_NAME; ///< Property, name "scroll-position-max", type Vector3
- static const std::string SCROLL_DIRECTION_PROPERTY_NAME; ///< Property, name "scroll-direction", type Vector2
-
/**
* @brief The start and end property ranges for this control.
*/
enum PropertyRange
{
PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
- PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices
+
+ ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
+ ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices
};
/**
{
enum
{
+ // Event side properties
OVERSHOOT_EFFECT_COLOR = PROPERTY_START_INDEX, ///< Property, name "overshoot-effect-color", @see SetOvershootEffectColor(), type Vector4
OVERSHOOT_ANIMATION_SPEED, ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type float
+
+ // Animatable properties
+ SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-relative-position", type Vector3
+ SCROLL_POSITION_MIN, ///< Property, name "scroll-position-min", type Vector3
+ SCROLL_POSITION_MAX, ///< Property, name "scroll-position-max", type Vector3
+ SCROLL_DIRECTION, ///< Property, name "scroll-direction", type Vector2
+ CAN_SCROLL_VERTICAL, ///< Property, name "can-scroll-vertical", type bool
+ CAN_SCROLL_HORIZONTAL ///< Property, name "can-scroll-horizontal", type bool
};
};
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
-#include <dali.h>
+#include <dali/public-api/object/base-handle.h>
namespace Dali
{