/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <stdlib.h>
#include <string>
#include <dali-toolkit-test-suite-utils.h>
+#include "dali-toolkit-test-utils/toolkit-timer.h"
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/actors/actor-devel.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
using namespace Dali;
using namespace Toolkit;
for(int i = 0; i < frames; i++)
{
+ Test::EmitGlobalTimerSignal();
+
pos += direction; // Move in this direction
time += RENDER_FRAME_INTERVAL;
TestMovePan( application, pos, time);
DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
float scrollBarHeight = 100.0f;
- scrollBar.SetSize(20.0f, scrollBarHeight, 0.0f);
- Stage::GetCurrent().Add( scrollBar );
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
+ application.GetScene().Add( scrollBar );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
// Create another source actor
Actor newSourceActor = Actor::New();
- Stage::GetCurrent().Add( newSourceActor );
+ application.GetScene().Add( newSourceActor );
// Register the scroll properties
Property::Index newPropertyScrollPosition = newSourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect to the ScrollPositionIntervalReached signal
scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
DALI_TEST_CHECK( scrollBar );
float scrollBarHeight = 100.0f;
- scrollBar.SetSize(20.0f, scrollBarHeight, 0.0f);
- Stage::GetCurrent().Add( scrollBar );
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
+ application.GetScene().Add( scrollBar );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
DALI_TEST_CHECK( scrollBar );
float scrollBarHeight = 100.0f;
- scrollBar.SetSize(20.0f, scrollBarHeight, 0.0f);
- Stage::GetCurrent().Add( scrollBar );
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Set the duration to show the indicator to be 0.75 second
scrollBar.SetIndicatorShowDuration(0.75);
DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is not fully visible yet
- DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) != 1.0f );
+ DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 1.0f );
// Wait for another 0.4 second
Wait(application, 400);
application.Render();
// Check that the indicator is now fully visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Now set the duration to show the indicator to be a negative value (which should be ignored and therefore means instant)
scrollBar.SetIndicatorShowDuration(-0.25f);
DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), -0.25f, TEST_LOCATION );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator becomes instantly visible in the next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Set the duration to hide the indicator to be 0.65 second
scrollBar.SetIndicatorHideDuration(0.65f);
DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is not fully invisible yet
- DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) != 0.0f );
+ DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 0.0f );
// Wait for another 0.5 second
Wait(application, 500);
application.Render();
// Check that the indicator is now fully invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Now set the duration to hide the indicator to be a negative value (which should be ignored and therefore means instant)
scrollBar.SetIndicatorHideDuration(-0.25f);
DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), -0.25f, TEST_LOCATION );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator becomes instantly invisible in the next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
// Make the indicator initially visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is initially visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Get the default duration to show the indicator
float duration = scrollBar.GetIndicatorShowDuration();
application.Render();
// Check that the indicator is still visible in the very next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
// Make the indicator initially invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is initially invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Get the default duration to hide the indicator
float duration = scrollBar.GetIndicatorHideDuration();
application.Render();
// Check that the indicator is still invisible in the very next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Do the "ShowIndicator" action
Property::Map emptyMap;
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Do the "HideIndicator" action
Property::Map emptyMap;
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
// Do the "ShowIndicator" action
Property::Map emptyMap;
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Get the default duration to hide the indicator
float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
// Make the indicator invisible
- indicator.SetProperty( DevelActor::Property::OPACITY,0.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,0.0f);
// Don't use a show animation; the indicator should appear immediately
scrollBar.SetProperty( ScrollBar::Property::INDICATOR_SHOW_DURATION, 0.0f );
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Get the default duration to hide the indicator
float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
ScrollBar scrollBar = ScrollBar::New();
DALI_TEST_CHECK( scrollBar );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
Actor indicator = scrollBar.GetScrollIndicator();
DALI_TEST_CHECK( indicator );
DALI_TEST_CHECK( duration > 0.0f );
// Make the indicator visible
- indicator.SetProperty( DevelActor::Property::OPACITY,1.0f);
+ indicator.SetProperty( Actor::Property::OPACITY,1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now partially hidden
- DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) < 1.0f );
+ DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ) < 1.0f );
// Now interrupt the Hide with a DoAction( "ShowTransientIndicator" )
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
// Get the default duration to hide the indicator
float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
// Set the indicator height to be fixed to 50.0f
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
scrollBar.SetIndicatorFixedHeight(50.0f);
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect the pan finished signal
ConnectionTracker connectionTracker;
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
// Set the indicator height to be fixed to 50.0f
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
scrollBar.SetIndicatorFixedHeight(50.0f);
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect the pan finished signal
ConnectionTracker connectionTracker;
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
ConnectionTracker connectionTracker;
// Connect to the ScrollPositionIntervalReached signal
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+ scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
- Stage::GetCurrent().Add( scrollBar );
+ application.GetScene().Add( scrollBar );
// Connect to the ScrollPositionIntervalReached signal
scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
// Register the scroll properties
Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );