/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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 <dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
using namespace Dali;
using namespace Toolkit;
ScrollView scrollView = ScrollView::New();
scrollView.SetSize(size);
- scrollView.SetAnchorPoint(AnchorPoint::CENTER);
- scrollView.SetParentOrigin(ParentOrigin::CENTER);
+ scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
constraint = Constraint::New<Dali::Vector3>( scrollView, Dali::Actor::Property::SIZE, Dali::EqualToConstraint() );
constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
Stage::GetCurrent().Add( scrollView );
Actor container = Actor::New();
- container.SetParentOrigin(ParentOrigin::CENTER);
- container.SetAnchorPoint(AnchorPoint::CENTER);
+ container.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ container.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
container.SetSize( size );
scrollView.Add( container );
constraint = Constraint::New<Vector3>( page, Actor::Property::SIZE, EqualToConstraint() );
constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
constraint.Apply();
- page.SetParentOrigin( ParentOrigin::CENTER );
- page.SetAnchorPoint( AnchorPoint::CENTER );
+ page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
page.SetPosition( column * size.x, row * size.y );
container.Add(page);
ResetScrollCallbackResults();
}
-Actor AddActorToPage(Actor page, float x, float y, float cols, float rows)
-{
- Stage stage = Stage::GetCurrent();
- Vector2 stageSize = stage.GetSize();
-
- const float margin = 10.0f;
- const Vector2 actorSize((stageSize.x / cols) - margin, (stageSize.y / rows) - margin);
-
- Actor actor = Actor::New();
- actor.SetParentOrigin( ParentOrigin::CENTER );
- actor.SetAnchorPoint( AnchorPoint::CENTER );
-
- Vector3 position( margin * 0.5f + (actorSize.x + margin) * x - stageSize.width * 0.5f,
- margin * 0.5f + (actorSize.y + margin) * y - stageSize.height * 0.5f,
- 0.0f);
- Vector3 positionEnd( margin * 0.5f + (actorSize.x + margin) * (x + cols) - stageSize.width * 0.5f - margin,
- margin * 0.5f + (actorSize.y + margin) * (y + rows) - stageSize.height * 0.5f - margin,
- 0.0f);
- Vector3 size(positionEnd - position);
- actor.SetPosition( position + size * 0.5f);
- actor.SetSize( positionEnd - position );
- page.Add(actor);
- return actor;
-}
-
} // unnamed namespace
int UtcDaliScrollViewPagePathEffectSetup(void)
{
+ ToolkitTestApplication application;
tet_infoline(" UtcDaliScrollViewPagePathEffectSetup");
ScrollViewPagePathEffect effect;
}
// test that the test page has reached centre of screen
- Vector3 pagePos = testPage.GetCurrentPosition();
+ Vector3 pagePos = testPage.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
CleanupTest();
END_TEST;
}
-