+ Image indicatorImage = ResourceImage::New( DEFAULT_INDICATOR_IMAGE_PATH );
+ ImageActor indicator = ImageActor::New( indicatorImage );
+ indicator.SetNinePatchBorder( DEFAULT_INDICATOR_NINE_PATCH_BORDER );
+ indicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
+ indicator.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ indicator.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+ SetScrollIndicator(indicator);
+}
+
+void ScrollBar::SetScrollIndicator( Actor indicator )
+{
+ // Don't allow empty handle
+ if( indicator )
+ {
+ mIndicator = indicator;
+ Self().Add(mIndicator);
+
+ EnableGestureDetection(Gesture::Type(Gesture::Pan));
+
+ 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 )
+ {
+ detector.Attach( child );
+ }
+ }
+ }
+ else
+ {
+ DALI_LOG_ERROR("Empty handle of scroll indicator\n");
+ }