mIsFlicking(false),
mGestureState(Gesture::Clear),
mAddingItems(false),
- mRefreshEnabled(true)
+ mRefreshEnabled(true),
+ mItemsParentOrigin( ParentOrigin::CENTER),
+ mItemsAnchorPoint( AnchorPoint::CENTER)
{
SetRequiresMouseWheelEvents(true);
SetKeyboardNavigationSupport(true);
void ItemView::SetupActor( Item item, float durationSeconds )
{
- item.second.SetParentOrigin( ParentOrigin::CENTER );
- item.second.SetAnchorPoint( AnchorPoint::CENTER );
+ item.second.SetParentOrigin( mItemsParentOrigin );
+ item.second.SetAnchorPoint( mItemsAnchorPoint );
if( mActiveLayout )
{
mAnimatingOvershootOn = animatingOn;
}
+void ItemView::SetItemsParentOrigin( const Vector3& parentOrigin )
+{
+ if( parentOrigin != mItemsParentOrigin )
+ {
+ mItemsParentOrigin = parentOrigin;
+ for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+ {
+ iter->second.SetParentOrigin(parentOrigin);
+ }
+ }
+}
+
+Vector3 ItemView::GetItemsParentOrigin() const
+{
+ return mItemsParentOrigin;
+}
+
+void ItemView::SetItemsAnchorPoint( const Vector3& anchorPoint )
+{
+ if( anchorPoint != mItemsAnchorPoint )
+ {
+ mItemsAnchorPoint = anchorPoint;
+ for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+ {
+ iter->second.SetAnchorPoint(anchorPoint);
+ }
+ }
+}
+
+Vector3 ItemView::GetItemsAnchorPoint() const
+{
+ return mItemsAnchorPoint;
+}
+
} // namespace Internal
} // namespace Toolkit
*/
void DoRefresh(float currentLayoutPosition, bool cacheExtra);
+
+ /**
+ * @copydoc Toolkit::ItemView::SetItemsParentOrigin
+ */
+ void SetItemsParentOrigin( const Vector3& parentOrigin );
+
+ /**
+ * @copydoc Toolkit::ItemView::GetItemsParentOrigin
+ */
+ Vector3 GetItemsParentOrigin() const;
+
+ /**
+ * @copydoc Toolkit::ItemView::SetItemsAnchorPoint
+ */
+ void SetItemsAnchorPoint( const Vector3& anchorPoint );
+
+ /**
+ * @copydoc Toolkit::ItemView::GetItemsAnchorPoint
+ */
+ Vector3 GetItemsAnchorPoint() const;
+
private:
/**
Property::Index mPropertyScrollSpeed; ///< The current scroll speed of item view
bool mRefreshEnabled; ///< Whether to refresh the cache automatically
+
+ Vector3 mItemsParentOrigin;
+ Vector3 mItemsAnchorPoint;
};
} // namespace Internal
GetImpl(*this).ReplaceItems( replacementItems, durationSeconds );
}
+
+void ItemView::SetItemsParentOrigin( const Vector3& parentOrigin )
+{
+ GetImpl(*this).SetItemsParentOrigin( parentOrigin );
+}
+
+Vector3 ItemView::GetItemsParentOrigin() const
+{
+ return GetImpl(*this).GetItemsParentOrigin();
+}
+
+void ItemView::SetItemsAnchorPoint( const Vector3& anchorPoint )
+{
+ GetImpl(*this).SetItemsAnchorPoint(anchorPoint);
+}
+
+Vector3 ItemView::GetItemsAnchorPoint() const
+{
+ return GetImpl(*this).GetItemsAnchorPoint();
+}
+
} // namespace Toolkit
} // namespace Dali
*/
void ReplaceItems(const ItemContainer& replacementItems, float durationSeconds);
+ /**
+ * @brief Set the parent origin of the items
+ *
+ * A relayout will occur for all the items if the parent origin is different than the current one.
+ * @param[in] parentOrigin New parent origin position vector
+ */
+ void SetItemsParentOrigin( const Vector3& parentOrigin );
+
+ /**
+ * @brief Get the parent origin of the items
+ *
+ * @return The current parent origin of the items
+ */
+ Vector3 GetItemsParentOrigin() const;
+
+ /**
+ * @brief Set the anchor point of the items
+ *
+ * A relayout will occur for all the items if the anchor point is different than the current one.
+ * @param[in] anchorPoint New anchor point position vector
+ */
+ void SetItemsAnchorPoint( const Vector3& anchorPoint );
+
+ /**
+ * @brief Get the anchor point of the items
+ *
+ * @return The current anchor point of the items
+ */
+ Vector3 GetItemsAnchorPoint() const;
+
public: // Not intended for application developers
/**