/*
- * Copyright (c) 2017 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.
// EXTERNAL INCLUDES
#include <cstring> // for strcmp
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/events/wheel-event.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/object/property-map.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-mode.h>
SetInternalConstraints();
}
-void ScrollView::OnStageConnection( int depth )
+void ScrollView::OnSceneConnection( int depth )
{
DALI_LOG_SCROLL_STATE("[0x%X]", this);
EnableScrollOvershoot(true);
}
- ScrollBase::OnStageConnection( depth );
+ ScrollBase::OnSceneConnection( depth );
}
-void ScrollView::OnStageDisconnection()
+void ScrollView::OnSceneDisconnection()
{
DALI_LOG_SCROLL_STATE("[0x%X]", this);
StopAnimation();
- ScrollBase::OnStageDisconnection();
+ ScrollBase::OnSceneDisconnection();
}
ScrollView::~ScrollView()
void ScrollView::AddOverlay(Actor actor)
{
- actor.SetDrawMode( DrawMode::OVERLAY_2D );
+ actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
mInternalActor.Add( actor );
}
return false;
}
-bool ScrollView::OnTouch( Actor actor, const TouchData& touch )
+bool ScrollView::OnTouch( Actor actor, const TouchEvent& touch )
{
if(!mSensitive)
{
mScrollInterrupted = false;
}
- return true;
+ return false;
}
bool ScrollView::OnWheelEvent(const WheelEvent& event)
if(mRulerX->GetType() == Ruler::Free)
{
// Free panning mode
- targetScrollPosition.x += event.z * mWheelScrollDistanceStep.x;
+ targetScrollPosition.x += event.GetDelta() * mWheelScrollDistanceStep.x;
ClampPosition(targetScrollPosition);
ScrollTo(-targetScrollPosition);
}
else if(!mScrolling)
{
// Snap mode, only respond to the event when the previous snap animation is finished.
- ScrollTo(GetCurrentPage() - event.z);
+ ScrollTo(GetCurrentPage() - event.GetDelta());
}
}
else
if(mRulerY->GetType() == Ruler::Free)
{
// Free panning mode
- targetScrollPosition.y += event.z * mWheelScrollDistanceStep.y;
+ targetScrollPosition.y += event.GetDelta() * mWheelScrollDistanceStep.y;
ClampPosition(targetScrollPosition);
ScrollTo(-targetScrollPosition);
}
else if(!mScrolling)
{
// Snap mode, only respond to the event when the previous snap animation is finished.
- ScrollTo(GetCurrentPage() - event.z * mRulerX->GetTotalPages());
+ ScrollTo(GetCurrentPage() - event.GetDelta() * mRulerX->GetTotalPages());
}
}