ScrollView scrollView = ScrollView::New();
Stage::GetCurrent().Add( scrollView );
+ Actor actor = Actor::New();
+ scrollView.Add( actor );
+
// Position rulers. 4x4 grid.
RulerPtr rulerX = new FixedRuler(50.0f);
RulerPtr rulerY = new FixedRuler(50.0f);
scrollView.ScrollTo(Vector2(225.0f, 125.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
Wait(application);
DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 17, TEST_LOCATION );
+
scrollView.SetWrapMode(true);
+ scrollView.ScrollTo(Vector2(230.0f, 130.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
+ Wait(application);
DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 13, TEST_LOCATION );
END_TEST;
}
END_TEST;
}
-int UtcDaliToolkitScrollViewSetMouseWheelScrollDistanceStepP(void)
+int UtcDaliToolkitScrollViewSetWheelScrollDistanceStepP(void)
{
ToolkitTestApplication application;
- tet_infoline(" UtcDaliToolkitScrollViewSetMouseWheelScrollDistanceStepP");
+ tet_infoline(" UtcDaliToolkitScrollViewSetWheelScrollDistanceStepP");
ScrollView scrollView = ScrollView::New();
// Disable Refresh signal (TET environment cannot use adaptor's Timer)
- scrollView.SetMouseWheelScrollDistanceStep(Vector2(30.0f, 15.0f));
- DALI_TEST_EQUALS( scrollView.GetMouseWheelScrollDistanceStep(), Vector2(30.0f, 15.0f), TEST_LOCATION );
- scrollView.SetMouseWheelScrollDistanceStep(Vector2(60.0f, 30.0f));
- DALI_TEST_EQUALS( scrollView.GetMouseWheelScrollDistanceStep(), Vector2(60.0f, 30.0f), TEST_LOCATION);
+ scrollView.SetWheelScrollDistanceStep(Vector2(30.0f, 15.0f));
+ DALI_TEST_EQUALS( scrollView.GetWheelScrollDistanceStep(), Vector2(30.0f, 15.0f), TEST_LOCATION );
+ scrollView.SetWheelScrollDistanceStep(Vector2(60.0f, 30.0f));
+ DALI_TEST_EQUALS( scrollView.GetWheelScrollDistanceStep(), Vector2(60.0f, 30.0f), TEST_LOCATION);
END_TEST;
}
position = rulerNormal->GetPositionFromPage(2, volume, true);
DALI_TEST_EQUALS( position, 60.0f, TEST_LOCATION );
DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
+
+ // Disable the ruler
+ rulerNormal->Disable();
+
+ position = rulerNormal->GetPositionFromPage(1, volume, true);
+ DALI_TEST_EQUALS( position, 10.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( volume, 1u, TEST_LOCATION );
+
+ position = rulerNormal->GetPositionFromPage(2, volume, true);
+ DALI_TEST_EQUALS( position, 10.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( volume, 2u, TEST_LOCATION );
+
END_TEST;
}
DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+ // Set domain size to be smaller than the ruler space
+ fixedRuler->SetDomain( RulerDomain(0.0f, 50.0f, true) );
+
+ fixedRuler->Enable();
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+
+ fixedRuler->Disable();
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+
END_TEST;
}