OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__)
g_ScrollBar = ScrollBar::New();
DALI_CHECK_FAIL(!g_ScrollBar, "ScrollBar::New() is failed.");
-
- const float F_WIDTH = 20.0f, F_HEIGHT = 800.0f, F_DEPTH = 0.0f, F_PIXEL = -80.0f, F_ANIM_TIME = 0.1f;
- g_ScrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
- g_ScrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- g_ScrollBar.SetSize(F_WIDTH, F_HEIGHT, F_DEPTH);
-
- Stage::GetCurrent().Add( g_ScrollBar );
-
- // Connect to the ScrollPositionIntervalReached signal
- g_ScrollBar.ScrollPositionIntervalReachedSignal().Connect( &CbScrollPositionIntervalReached );
-
- // Create a source actor that owns the scroll properties required by the scroll bar
- Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
-
- // Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 800.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 2000.0f );
- DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-position" ) !=propertyScrollPosition, "Source position is mismathced");
- DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-position-min" ) != propertyMinScrollPosition, "Source min position is mismathced");
- DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-position-max" ) != propertyMaxScrollPosition, "Source max position is mismathced" );
- DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-content-size" ) != propertyScrollContentSize, "Source content size is mismathced ");
+ const float F_WIDTH = 20.0f, F_HEIGHT = 800.0f, F_DEPTH = 0.0f, F_PIXEL = -80.0f, F_ANIM_TIME = 0.1f;
+ g_ScrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
+ g_ScrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ g_ScrollBar.SetSize(F_WIDTH, F_HEIGHT, F_DEPTH);
+
+ Stage::GetCurrent().Add( g_ScrollBar );
+
+ // Connect to the ScrollPositionIntervalReached signal
+ g_ScrollBar.ScrollPositionIntervalReachedSignal().Connect( &CbScrollPositionIntervalReached );
+
+ // Create a source actor that owns the scroll properties required by the scroll bar
+ Actor sourceActor = Actor::New();
+ Stage::GetCurrent().Add( sourceActor );
+
+ // Register the scroll properties
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 800.0f );
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 2000.0f );
+
+ DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-position" ) !=propertyScrollPosition, "Source position is mismathced");
+ DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-position-min" ) != propertyMinScrollPosition, "Source min position is mismathced");
+ DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-position-max" ) != propertyMaxScrollPosition, "Source max position is mismathced" );
+ DALI_CHECK_FAIL( sourceActor.GetPropertyIndex( "source-content-size" ) != propertyScrollContentSize, "Source content size is mismathced ");
+
+ // Set the source of the scroll position properties.
+ g_ScrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+ // Set the values to get notified when the scroll positions of the source actor goes above or below these values
+ Vector<float> fpositionIntervals;
+ for( size_t i = 0; i != 10; ++i )
+ {
+ fpositionIntervals.PushBack( F_PIXEL * i ); // should get notified for each 80 pixels
+ }
+
+ g_ScrollBar.SetScrollPositionIntervals(fpositionIntervals);
+
+ // Get the list of scroll position intervals for notification
+ Vector<float> fresults = g_ScrollBar.GetScrollPositionIntervals();
+
+ // Check that the result is the same as the list previously set.
+ DALI_CHECK_FAIL( fpositionIntervals.Count() != fresults.Count(), "Set and Get total scrollposition count mismatched");
+ DALI_CHECK_FAIL( fpositionIntervals[0] != fresults[0], "Set and Get scrollposition value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[1] != fresults[1], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[2] != fresults[2], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[3] != fresults[3], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[4] != fresults[4], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[5] != fresults[5], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[6] != fresults[6], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[7] != fresults[7], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[8] != fresults[8], "Set and Get value mismatched" );
+ DALI_CHECK_FAIL( fpositionIntervals[9] != fresults[9], "Set and Get value mismatched" );
- // Set the source of the scroll position properties.
- g_ScrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
-
- // Set the values to get notified when the scroll positions of the source actor goes above or below these values
- Vector<float> fpositionIntervals;
- for( size_t i = 0; i != 10; ++i )
- {
- fpositionIntervals.PushBack( F_PIXEL * i ); // should get notified for each 80 pixels
- }
-
- g_ScrollBar.SetScrollPositionIntervals(fpositionIntervals);
-
- // Get the list of scroll position intervals for notification
- Vector<float> fresults = g_ScrollBar.GetScrollPositionIntervals();
-
- // Check that the result is the same as the list previously set.
- DALI_CHECK_FAIL( fpositionIntervals.Count() != fresults.Count(), "Set and Get total scrollposition count mismatched");
- DALI_CHECK_FAIL( fpositionIntervals[0] != fresults[0], "Set and Get scrollposition value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[1] != fresults[1], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[2] != fresults[2], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[3] != fresults[3], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[4] != fresults[4], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[5] != fresults[5], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[6] != fresults[6], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[7] != fresults[7], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[8] != fresults[8], "Set and Get value mismatched" );
- DALI_CHECK_FAIL( fpositionIntervals[9] != fresults[9], "Set and Get value mismatched" );
-
// Reset the flag
- g_bScrollBarPositionIntervalReachedSignalCalled = false;
+ g_bScrollBarPositionIntervalReachedSignalCalled = false;
- // Animate the scroll position to cross the specified value
- Animation animation = Animation::New(F_ANIM_TIME);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), SCROLL_BAR_F_TARGET_POSITION );
- animation.Play();
+ // Animate the scroll position to cross the specified value
+ Animation animation = Animation::New(F_ANIM_TIME);
+ animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), SCROLL_BAR_F_TARGET_POSITION );
+ animation.Play();
}
void VTScrollBarScrollPositionIntervalsReachedSignal001()
{
- // Check that the signal callback is called
- DALI_CHECK_FAIL( !g_bScrollBarPositionIntervalReachedSignalCalled, "Signal callback is not called" );
+ // Check that the signal callback is called
+ DALI_CHECK_FAIL( !g_bScrollBarPositionIntervalReachedSignalCalled, "Signal callback is not called" );
DALI_CHECK_FAIL( !Equals(g_fposition, SCROLL_BAR_F_TARGET_POSITION, SCROLL_BAR_EPSILON),
"Though signal callback is called, the position retrieved inside the callback mismatches with expected position.");
DaliLog::PrintPass();
}
+void ScrollBarSetGetProperty()
+{
+ OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__)
+ g_ScrollBar = ScrollBar::New();
+ DALI_CHECK_FAIL(!g_ScrollBar, "ScrollBar::New() is failed.");
+ Stage::GetCurrent().Add( g_ScrollBar );
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Vertical");
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<string>( ScrollBar::Property::SCROLL_DIRECTION ) != "Vertical" ,"SCROLL_DIRECTION is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Horizontal");
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<string>( ScrollBar::Property::SCROLL_DIRECTION ) != "Horizontal" ,"SCROLL_DIRECTION is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Variable");
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<string>( ScrollBar::Property::INDICATOR_HEIGHT_POLICY ) != "Variable" ,"INDICATOR_HEIGHT_POLICY is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Fixed");
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<string>( ScrollBar::Property::INDICATOR_HEIGHT_POLICY ) != "Fixed" ,"INDICATOR_HEIGHT_POLICY is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 20.0f);
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT) != 20.0f ,"SCROLL_DIRECTION is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_SHOW_DURATION, 0.35f);
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION ) != 0.35f ,"SCROLL_DIRECTION is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_HIDE_DURATION, 0.35f);
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION ) != 0.35f ,"INDICATOR_HIDE_DURATION is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT, 20.0f);
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_MINIMUM_HEIGHT ) != 20.0f ,"INDICATOR_MINIMUM_HEIGHT is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_START_PADDING, 0.5f);
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_START_PADDING ) != 0.5f ,"INDICATOR_START_PADDING is failed");
+
+ g_ScrollBar.SetProperty(ScrollBar::Property::INDICATOR_END_PADDING, 0.5f);
+ DALI_CHECK_FAIL( g_ScrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_END_PADDING ) != 0.5f ,"INDICATOR_END_PADDING is failed");
+
+ DaliLog::PrintPass();
+}
+
/**
* End of TC Logic Implementation Area.
**/