mIndicator = indicator;
Self().Add(mIndicator);
- if( !mPanGestureDetector )
- {
- mPanGestureDetector = PanGestureDetector::New();
- mPanGestureDetector.DetectedSignal().Connect(this, &ScrollBar::OnPan);
- }
+ EnableGestureDetection(Gesture::Type(Gesture::Pan));
- mPanGestureDetector.DetachAll();
- mPanGestureDetector.Attach( mIndicator );
+ PanGestureDetector detector( GetPanGestureDetector() );
+ detector.DetachAll();
+ detector.Attach( mIndicator );
unsigned int childCount = mIndicator.GetChildCount();
for ( unsigned int index = 0; index < childCount; index++ )
Actor child = mIndicator.GetChildAt( index );
if ( child )
{
- mPanGestureDetector.Attach( child );
+ detector.Attach( child );
}
}
}
return true;
}
-void ScrollBar::OnPan( Actor source, const PanGesture& gesture )
+void ScrollBar::OnPan( const PanGesture& gesture )
{
if(mScrollableObject)
{
virtual void OnInitialize();
/**
+ * @copydoc Toolkit::Control::OnPan
+ */
+ virtual void OnPan( const PanGesture& gesture );
+
+ /**
* @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
*/
virtual void OnSizeSet( const Vector3& size );
*/
void OnIndicatorHeightPolicyPropertySet(Property::Value propertyValue);
- /**
- * Pan gesture callback
- *
- * @param[in] actor The actor the event is raised for
- * @param[in] gesture The pan event info
- */
- void OnPan(Actor source, const PanGesture& gesture);
-
private:
/**
Toolkit::ScrollBar::IndicatorHeightPolicy mIndicatorHeightPolicy; ///< The height policy of scroll indicator (variable or fixed)
float mIndicatorFixedHeight; ///< The fixed height of scroll indicator
- PanGestureDetector mPanGestureDetector; ///< The pan gesture detector for scroll indicator
-
Timer mContractDelayTimer; ///< Timer guarantee contract delay time.
Timer mPanProcessTimer; ///< The timer to process the pan gesture after the gesture is started.