+ 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;
+
+ Actor self = Self();
+ self.Add(mIndicator);
+ self.SetDrawMode(DrawMode::OVERLAY);
+
+ if( !mPanGestureDetector )
+ {
+ mPanGestureDetector = PanGestureDetector::New();
+ mPanGestureDetector.DetectedSignal().Connect(this, &ScrollBar::OnPan);
+ }
+
+ mPanGestureDetector.DetachAll();
+ mPanGestureDetector.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 );
+ }
+ }
+ }
+ else
+ {
+ DALI_LOG_ERROR("Empty handle of scroll indicator\n");
+ }