sizeAnimationCalled(false),
touchEventCalled(false),
hoverEventCalled(false),
- mouseWheelEventCalled(false),
+ wheelEventCalled(false),
keyEventCalled(false),
keyInputFocusGained(false),
keyInputFocusLost(false)
void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; }
bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
-bool DummyControlImplOverride::OnMouseWheelEvent(const MouseWheelEvent& event) { mouseWheelEventCalled = true; return false; }
+bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; }
bool DummyControlImplOverride::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
void DummyControlImplOverride::OnKeyInputFocusGained() { keyInputFocusGained = true; }
void DummyControlImplOverride::OnKeyInputFocusLost() { keyInputFocusLost = true; }
virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
virtual bool OnTouchEvent(const TouchEvent& event);
virtual bool OnHoverEvent(const HoverEvent& event);
- virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
+ virtual bool OnWheelEvent(const WheelEvent& event);
virtual bool OnKeyEvent(const KeyEvent& event);
virtual void OnKeyInputFocusGained();
virtual void OnKeyInputFocusLost();
bool sizeAnimationCalled;
bool touchEventCalled;
bool hoverEventCalled;
- bool mouseWheelEventCalled;
+ bool wheelEventCalled;
bool keyEventCalled;
bool keyInputFocusGained;
bool keyInputFocusLost;
#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/key-event-integ.h>
-#include <dali/integration-api/events/mouse-wheel-event-integ.h>
+#include <dali/integration-api/events/wheel-event-integ.h>
#include <dali/integration-api/events/long-press-gesture-event.h>
#include <dali/integration-api/events/pinch-gesture-event.h>
#include <dali/integration-api/events/pan-gesture-event.h>
///////////////////////////////////////////////////////////////////////////////////////////////////
namespace
{
-static bool MouseWheelEventCallback(Actor actor, const MouseWheelEvent& event)
+static bool WheelEventCallback(Actor actor, const WheelEvent& event)
{
return false;
}
}
-int UtcDaliControlImplMouseWheelEvent(void)
+int UtcDaliControlImplWheelEvent(void)
{
ToolkitTestApplication application;
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(dummy);
- dummy.MouseWheelEventSignal().Connect(&MouseWheelEventCallback);
+ dummy.WheelEventSignal().Connect(&WheelEventCallback);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.mouseWheelEventCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, false, TEST_LOCATION );
- // simulate a mouse wheel event
+ // simulate a wheel event
Vector2 screenCoordinates( 10.0f, 10.0f );
- Integration::MouseWheelEvent event(0, 0u, screenCoordinates, 1, 1000u);
- application.ProcessEvent(event);
- DALI_TEST_EQUALS( dummyImpl.mouseWheelEventCalled, true, TEST_LOCATION );
+ Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
+ application.ProcessEvent( event );
+ DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, true, TEST_LOCATION );
Stage::GetCurrent().Remove(dummy);
}
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(dummy);
- dummy.MouseWheelEventSignal().Connect(&MouseWheelEventCallback);
+ dummy.WheelEventSignal().Connect(&WheelEventCallback);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- // simulate a mouse wheel event
+ // simulate a wheel event
Vector2 screenCoordinates( 20.0f, 20.0f );
- Integration::MouseWheelEvent event(0, 0u, screenCoordinates, 1, 1000u);
- application.ProcessEvent(event);
+ Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
+ application.ProcessEvent( event );
Stage::GetCurrent().Remove(dummy);
}
END_TEST;
}
-int UtcDaliItemViewSetAndGetMouseWheelScrollDistanceStep(void)
+int UtcDaliItemViewSetAndGetWheelScrollDistanceStep(void)
{
ToolkitTestApplication application;
TestItemFactory factory;
ItemView view = ItemView::New(factory);
- // Set the scroll distance step for the mouse wheel event to be 100.0f
- view.SetMouseWheelScrollDistanceStep(100.0f);
+ // Set the scroll distance step for the wheel event to be 100.0f
+ view.SetWheelScrollDistanceStep(100.0f);
// Check the scroll distance step is 100.0f
- DALI_TEST_EQUALS(view.GetMouseWheelScrollDistanceStep(), 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetWheelScrollDistanceStep(), 100.0f, 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;
}
mLayer.Add( mBacking );
mBacking.SetOpacity(0.0f);
mBacking.TouchedSignal().Connect( this, &Popup::OnBackingTouched );
- mBacking.MouseWheelEventSignal().Connect(this, &Popup::OnBackingMouseWheelEvent);
+ mBacking.WheelEventSignal().Connect(this, &Popup::OnBackingWheelEvent);
}
void Popup::CreateDialog()
return true;
}
-bool Popup::OnBackingMouseWheelEvent(Actor actor, const MouseWheelEvent& event)
+bool Popup::OnBackingWheelEvent(Actor actor, const WheelEvent& event)
{
- // consume mouse wheel event in dimmed backing actor
+ // consume wheel event in dimmed backing actor
return true;
}
bool OnBackingTouched(Actor actor, const TouchEvent& event);
/**
- * Signal occurs when the mouse wheel event is occured on dimmed backing for the Popup.
- * @param[in] actor The Actor got mouse wheel
- * @param[in] event The Mouse Wheel Event.
+ * Signal occurs when the wheel event is occured on dimmed backing for the Popup.
+ * @param[in] actor The Actor got wheel
+ * @param[in] event The Wheel Event.
* @return Whether to consume event or not.
*/
- bool OnBackingMouseWheelEvent(Actor actor, const MouseWheelEvent& event);
+ bool OnBackingWheelEvent(Actor actor, const WheelEvent& event);
/**
* Signal occurs when the dialog has been touched.
#include <dali/public-api/animation/constraints.h>
#include <dali/devel-api/common/set-wrapper.h>
#include <dali/public-api/common/stage.h>
-#include <dali/public-api/events/mouse-wheel-event.h>
+#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
const float DEFAULT_MINIMUM_SWIPE_SPEED = 1.0f;
const float DEFAULT_MINIMUM_SWIPE_DISTANCE = 3.0f;
-const float DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION = 0.1f;
+const float DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION = 0.1f;
const float DEFAULT_MINIMUM_SWIPE_DURATION = 0.45f;
const float DEFAULT_MAXIMUM_SWIPE_DURATION = 2.6f;
const float DEFAULT_REFRESH_INTERVAL_LAYOUT_POSITIONS = 20.0f; // 1 updates per 20 items
-const int MOUSE_WHEEL_EVENT_FINISHED_TIME_OUT = 500; // 0.5 second
+const int WHEEL_EVENT_FINISHED_TIME_OUT = 500; // 0.5 second
const float DEFAULT_ANCHORING_DURATION = 1.0f; // 1 second
}
ItemView::ItemView(ItemFactory& factory)
-: Scrollable( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | REQUIRES_MOUSE_WHEEL_EVENTS | REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),
+: Scrollable( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | REQUIRES_WHEEL_EVENTS | REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),
mItemFactory(factory),
mActiveLayout(NULL),
mAnimatingOvershootOn(false),
mRefreshOrderHint(true/*Refresh item 0 first*/),
mMinimumSwipeSpeed(DEFAULT_MINIMUM_SWIPE_SPEED),
mMinimumSwipeDistance(DEFAULT_MINIMUM_SWIPE_DISTANCE),
- mMouseWheelScrollDistanceStep(0.0f),
+ mWheelScrollDistanceStep(0.0f),
mScrollDistance(0.0f),
mScrollSpeed(0.0f),
mTotalPanDisplacement(Vector2::ZERO),
SetOvershootEnabled(true);
Vector2 stageSize = Stage::GetCurrent().GetSize();
- mMouseWheelScrollDistanceStep = stageSize.y * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
+ mWheelScrollDistanceStep = stageSize.y * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
EnableGestureDetection(Gesture::Type(Gesture::Pan));
- mMouseWheelEventFinishedTimer = Timer::New( MOUSE_WHEEL_EVENT_FINISHED_TIME_OUT );
- mMouseWheelEventFinishedTimer.TickSignal().Connect( this, &ItemView::OnMouseWheelEventFinished );
+ mWheelEventFinishedTimer = Timer::New( WHEEL_EVENT_FINISHED_TIME_OUT );
+ mWheelEventFinishedTimer.TickSignal().Connect( this, &ItemView::OnWheelEventFinished );
SetRefreshInterval(DEFAULT_REFRESH_INTERVAL_LAYOUT_POSITIONS);
}
return mMinimumSwipeDistance;
}
-void ItemView::SetMouseWheelScrollDistanceStep(float step)
+void ItemView::SetWheelScrollDistanceStep(float step)
{
- mMouseWheelScrollDistanceStep = step;
+ mWheelScrollDistanceStep = step;
}
-float ItemView::GetMouseWheelScrollDistanceStep() const
+float ItemView::GetWheelScrollDistanceStep() const
{
- return mMouseWheelScrollDistanceStep;
+ return mWheelScrollDistanceStep;
}
void ItemView::SetAnchoring(bool enabled)
return true; // consume since we're potentially scrolling
}
-bool ItemView::OnMouseWheelEvent(const MouseWheelEvent& event)
+bool ItemView::OnWheelEvent(const WheelEvent& event)
{
- // Respond the mouse wheel event to scroll
+ // Respond the wheel event to scroll
if (mActiveLayout)
{
Actor self = Self();
const Vector3 layoutSize = Self().GetCurrentSize();
- float layoutPositionDelta = GetCurrentLayoutPosition(0) - (event.z * mMouseWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor());
+ float layoutPositionDelta = GetCurrentLayoutPosition(0) - (event.z * mWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor());
float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout);
self.SetProperty(Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition );
mRefreshEnabled = true;
}
- if (mMouseWheelEventFinishedTimer.IsRunning())
+ if (mWheelEventFinishedTimer.IsRunning())
{
- mMouseWheelEventFinishedTimer.Stop();
+ mWheelEventFinishedTimer.Stop();
}
- mMouseWheelEventFinishedTimer.Start();
+ mWheelEventFinishedTimer.Start();
return true;
}
-bool ItemView::OnMouseWheelEventFinished()
+bool ItemView::OnWheelEventFinished()
{
if (mActiveLayout)
{
RemoveAnimation(mScrollAnimation);
- // No more mouse wheel events coming. Do the anchoring if enabled.
+ // No more wheel events coming. Do the anchoring if enabled.
mScrollAnimation = DoAnchoring();
if (mScrollAnimation)
{
float GetMinimumSwipeDistance() const;
/**
- * @copydoc Toolkit::ItemView::SetMouseWheelScrollDistanceStep
+ * @copydoc Toolkit::ItemView::SetWheelScrollDistanceStep
*/
- void SetMouseWheelScrollDistanceStep(float step);
+ void SetWheelScrollDistanceStep(float step);
/**
- * @copydoc Toolkit::ItemView::GetMouseWheelScrollDistanceStep
+ * @copydoc Toolkit::ItemView::GetWheelScrollDistanceStep
*/
- float GetMouseWheelScrollDistanceStep() const;
+ float GetWheelScrollDistanceStep() const;
/**
* @copydoc Toolkit::ItemView::SetAnchoring
virtual bool OnTouchEvent(const TouchEvent& event);
/**
- * From CustomActorImpl; called after a mouse-wheel-event is received by the owning actor.
- * @param[in] event The mouse wheel event.
+ * From CustomActorImpl; called after a wheel-event is received by the owning actor.
+ * @param[in] event The wheel event.
* @return True if the event should be consumed.
*/
- virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
+ virtual bool OnWheelEvent(const WheelEvent& event);
private: // From Control
void OnOvershootOnFinished(Animation& animation);
/**
- * This is called after a timeout when no new mouse wheel event is received for a certain period of time.
+ * This is called after a timeout when no new wheel event is received for a certain period of time.
* @return will return false; one-shot timer.
*/
- bool OnMouseWheelEventFinished();
+ bool OnWheelEventFinished();
/**
* Stops and removes animation if exists.
float mMinimumSwipeSpeed;
float mMinimumSwipeDistance;
- float mMouseWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates for each mouse wheel event received.
+ float mWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates for each wheel event received.
float mScrollDistance;
float mScrollSpeed;
float mScrollOvershoot;
bool mIsFlicking;
- Timer mMouseWheelEventFinishedTimer; ///< The timer to determine whether there is no mouse wheel event received for a certain period of time.
+ Timer mWheelEventFinishedTimer; ///< The timer to determine whether there is no wheel event received for a certain period of time.
Dali::Gesture::State mGestureState;
#include <cstring> // for strcmp
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
-#include <dali/public-api/events/mouse-wheel-event.h>
+#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
const float FREE_FLICK_SPEED_THRESHOLD = 200.0f; ///< Free-Flick threshold in pixels/ms
const float AUTOLOCK_AXIS_MINIMUM_DISTANCE2 = 100.0f; ///< Auto-lock axis after minimum distance squared.
const float FLICK_ORTHO_ANGLE_RANGE = 75.0f; ///< degrees. (if >45, then supports diagonal flicking)
-const Vector2 DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION = Vector2(0.17f, 0.1f); ///< The step of horizontal scroll distance in the proportion of stage size for each mouse wheel event received.
+const Vector2 DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION = Vector2(0.17f, 0.1f); ///< The step of horizontal scroll distance in the proportion of stage size for each wheel event received.
const unsigned long MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET( 150u );
const float TOUCH_DOWN_TIMER_INTERVAL = 100.0f;
const float DEFAULT_SCROLL_UPDATE_DISTANCE( 30.0f ); ///< Default distance to travel in pixels for scroll update signal
}
ScrollView::ScrollView()
-: ScrollBase( ControlBehaviour( REQUIRES_MOUSE_WHEEL_EVENTS ) ), // Enable size negotiation
+: ScrollBase( ControlBehaviour( REQUIRES_WHEEL_EVENTS ) ), // Enable size negotiation
mTouchDownTime(0u),
mGestureStackDepth(0),
mScrollStateFlags(0),
mFrictionCoefficient(DEFAULT_FRICTION_COEFFICIENT),
mFlickSpeedCoefficient(DEFAULT_FLICK_SPEED_COEFFICIENT),
mMaxFlickSpeed(DEFAULT_MAX_FLICK_SPEED),
- mMouseWheelScrollDistanceStep(Vector2::ZERO),
+ mWheelScrollDistanceStep(Vector2::ZERO),
mInAccessibilityPan(false),
mInitialized(false),
mScrolling(false),
mScrollPostPosition = mScrollPrePosition = Vector2::ZERO;
- mMouseWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
+ mWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
mInitialized = true;
mMaxFlickSpeed = speed;
}
-void ScrollView::SetMouseWheelScrollDistanceStep(Vector2 step)
+void ScrollView::SetWheelScrollDistanceStep(Vector2 step)
{
- mMouseWheelScrollDistanceStep = step;
+ mWheelScrollDistanceStep = step;
}
-Vector2 ScrollView::GetMouseWheelScrollDistanceStep() const
+Vector2 ScrollView::GetWheelScrollDistanceStep() const
{
- return mMouseWheelScrollDistanceStep;
+ return mWheelScrollDistanceStep;
}
unsigned int ScrollView::GetCurrentPage() const
return true;
}
-bool ScrollView::OnMouseWheelEvent(const MouseWheelEvent& event)
+bool ScrollView::OnWheelEvent(const WheelEvent& event)
{
if(!mSensitive)
{
- // Ignore this mouse wheel event, if scrollview is insensitive.
+ // Ignore this wheel event, if scrollview is insensitive.
return false;
}
if(mRulerX->GetType() == Ruler::Free)
{
// Free panning mode
- targetScrollPosition.x += event.z * mMouseWheelScrollDistanceStep.x;
+ targetScrollPosition.x += event.z * mWheelScrollDistanceStep.x;
ClampPosition(targetScrollPosition);
ScrollTo(-targetScrollPosition);
}
if(mRulerY->GetType() == Ruler::Free)
{
// Free panning mode
- targetScrollPosition.y += event.z * mMouseWheelScrollDistanceStep.y;
+ targetScrollPosition.y += event.z * mWheelScrollDistanceStep.y;
ClampPosition(targetScrollPosition);
ScrollTo(-targetScrollPosition);
}
void SetMaxFlickSpeed(float speed);
/**
- * @copydoc Toolkit::ScrollView::GetMouseWheelScrollDistanceStep
+ * @copydoc Toolkit::ScrollView::GetWheelScrollDistanceStep
*/
- Vector2 GetMouseWheelScrollDistanceStep() const;
+ Vector2 GetWheelScrollDistanceStep() const;
/**
- * @copydoc Toolkit::ScrollView::SetMouseWheelScrollDistanceStep
+ * @copydoc Toolkit::ScrollView::SetWheelScrollDistanceStep
*/
- void SetMouseWheelScrollDistanceStep(Vector2 step);
+ void SetWheelScrollDistanceStep(Vector2 step);
/**
* @copydoc Toolkit::ScrollView::GetCurrentPage
virtual bool OnTouchEvent(const TouchEvent& event);
/**
- * From CustomActorImpl; called after a mouse-wheel-event is received by the owning actor.
- * @param[in] event The mouse wheel event.
+ * From CustomActorImpl; called after a wheel-event is received by the owning actor.
+ * @param[in] event The wheel event.
* @return True if the event should be consumed.
*/
- virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
+ virtual bool OnWheelEvent(const WheelEvent& event);
/**
* @copydoc Toolkit::Control::OnInitialize()
float mFlickSpeedCoefficient; ///< Flick velocity coefficient. Input touch velocity is multiplied by this.
float mMaxFlickSpeed; ///< Maximum flick speed. Maximum speed of flick in stage.lengths/sec.
- Vector2 mMouseWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates in X and Y axes for each mouse wheel event received.
+ Vector2 mWheelScrollDistanceStep; ///< The step of scroll distance in actor coordinates in X and Y axes for each wheel event received.
//ScrollInternalConstraintsPtr mScrollInternalConstraints;
Constraint mScrollMainInternalPrePositionConstraint;
return false; // Do not consume
}
-bool Control::OnMouseWheelEvent(const MouseWheelEvent& event)
+bool Control::OnWheelEvent(const WheelEvent& event)
{
return false; // Do not consume
}
virtual bool OnKeyEvent( const KeyEvent& event );
/**
- * @copydoc CustomActorImpl::OnMouseWheelEvent()
+ * @copydoc CustomActorImpl::OnWheelEvent()
*/
- virtual bool OnMouseWheelEvent( const MouseWheelEvent& event );
+ virtual bool OnWheelEvent( const WheelEvent& event );
/**
* @copydoc CustomActorImpl::OnRelayout()
return GetImpl(*this).GetMinimumSwipeDistance();
}
-void ItemView::SetMouseWheelScrollDistanceStep(float step)
+void ItemView::SetWheelScrollDistanceStep(float step)
{
- GetImpl(*this).SetMouseWheelScrollDistanceStep(step);
+ GetImpl(*this).SetWheelScrollDistanceStep(step);
}
-float ItemView::GetMouseWheelScrollDistanceStep() const
+float ItemView::GetWheelScrollDistanceStep() const
{
- return GetImpl(*this).GetMouseWheelScrollDistanceStep();
+ return GetImpl(*this).GetWheelScrollDistanceStep();
}
void ItemView::SetAnchoring(bool enabled)
float GetMinimumSwipeDistance() const;
/**
- * @brief Set the step of scroll distance in actor coordinates for each mouse wheel event received.
+ * @brief Set the step of scroll distance in actor coordinates for each wheel event received.
*
* @param[in] step The step of scroll distance(pixel).
*/
- void SetMouseWheelScrollDistanceStep(float step);
+ void SetWheelScrollDistanceStep(float step);
/**
- * @brief Get the step of scroll distance in actor coordinates for each mouse wheel event received.
+ * @brief Get the step of scroll distance in actor coordinates for each wheel event received.
*
* @return The step of scroll distance(pixel)
*/
- float GetMouseWheelScrollDistanceStep() const;
+ float GetWheelScrollDistanceStep() const;
/**
* @brief Set whether to enable the animation for the layout to
GetImpl(*this).SetMaxFlickSpeed(speed);
}
-Vector2 ScrollView::GetMouseWheelScrollDistanceStep() const
+Vector2 ScrollView::GetWheelScrollDistanceStep() const
{
- return GetImpl(*this).GetMouseWheelScrollDistanceStep();
+ return GetImpl(*this).GetWheelScrollDistanceStep();
}
-void ScrollView::SetMouseWheelScrollDistanceStep(Vector2 step)
+void ScrollView::SetWheelScrollDistanceStep(Vector2 step)
{
- GetImpl(*this).SetMouseWheelScrollDistanceStep(step);
+ GetImpl(*this).SetWheelScrollDistanceStep(step);
}
Vector2 ScrollView::GetCurrentScrollPosition() const
/**
* @brief Gets the step of scroll distance in actor coordinates for
- * each mouse wheel event received in free panning mode.
+ * each wheel event received in free panning mode.
*
* @return The step of scroll distance(pixel) in X and Y axes.
*/
- Vector2 GetMouseWheelScrollDistanceStep() const;
+ Vector2 GetWheelScrollDistanceStep() const;
/**
* @brief Sets the step of scroll distance in actor coordinates for
- * each mouse wheel event received in free panning mode.
+ * each wheel event received in free panning mode.
*
* @param[in] step The step of scroll distance(pixel) in X and Y axes.
*
* @note: If snap points are defined in the rulers, it will always
* scroll to the next snap point towards the scroll direction while
- * receiving the mouse wheel events.
+ * receiving the wheel events.
*
*/
- void SetMouseWheelScrollDistanceStep(Vector2 step);
+ void SetWheelScrollDistanceStep(Vector2 step);
/**
* @brief Retrieves current scroll position.
return handleScope.Escape( hoverObject );
}
-v8::Handle<v8::Object> EventObjectGenerator::CreateMouseWheelEvent( v8::Isolate* isolate, const MouseWheelEvent& wheelEvent)
+v8::Handle<v8::Object> EventObjectGenerator::CreateWheelEvent( v8::Isolate* isolate, const WheelEvent& wheelEvent)
{
- // we are creating a mouse wheel event object that looks like this
+ // we are creating a wheel event object that looks like this
//
+ // event.type = "mouseWheel" or "customWheel" type of the wheel event
// event.direction = "vertical" or "horizontal" direction the wheel is being rolled
// event.shiftPressed = boolean, shift key is held
// event.ctrlPressed = boolean, ctrl key is held
// event.altPressed = boolean, alt key is held
// event.keyModifiers = bitmask of keys pressed
// event.point {x,y} = The co-ordinates of the mouse cursor relative to the top-left of the screen when the wheel is being rolled.
- // event.rolled = offset of mouse wheel rolling, positive = rolling down, negative = rolling up
+ // event.rolled = offset of wheel rolling, positive = rolling down or clockwise, negative = rolling up or counter-clockwise
// event.timestamp = The time (in ms) that the touch event occurred
v8::EscapableHandleScope handleScope( isolate );
v8::Local<v8::Object> wheelObject = v8::Object::New( isolate );
+ // Set the type
+ std::string type = wheelEvent.type ? "mouseWheel" : "customWheel";
+ wheelObject->Set( v8::String::NewFromUtf8( isolate, "type" ), v8::String::NewFromUtf8( isolate, type.c_str() ) );
+
// Set the direction
std::string direction = wheelEvent.direction ? "vertical" : "horizontal";
wheelObject->Set( v8::String::NewFromUtf8( isolate, "direction" ), v8::String::NewFromUtf8( isolate, direction.c_str() ) );
#include <v8.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/hover-event.h>
-#include <dali/public-api/events/mouse-wheel-event.h>
+#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/pan-gesture.h>
v8::Handle<v8::Object> CreateTouchEvent( v8::Isolate* isolate, const TouchEvent& touchEvent);
v8::Handle<v8::Object> CreateHoverEvent( v8::Isolate* isolate, const HoverEvent& hoverEvent);
- v8::Handle<v8::Object> CreateMouseWheelEvent( v8::Isolate* isolate, const MouseWheelEvent& wheelEvent);
+ v8::Handle<v8::Object> CreateWheelEvent( v8::Isolate* isolate, const WheelEvent& wheelEvent);
v8::Handle<v8::Object> CreateKeyEvent( v8::Isolate* isolate, const KeyEvent& keyEvent);
v8::Handle<v8::Object> CreatePanGesture( v8::Isolate* isolate, const PanGesture& panGesture);
{
returnValue = EventObjectGenerator::CreateHoverEvent( isolate, value.Get<HoverEvent>() );
}
- else if( typeInfo == typeid( Dali::MouseWheelEvent ) )
+ else if( typeInfo == typeid( Dali::WheelEvent ) )
{
- returnValue = EventObjectGenerator::CreateMouseWheelEvent( isolate, value.Get<MouseWheelEvent>() );
+ returnValue = EventObjectGenerator::CreateWheelEvent( isolate, value.Get<WheelEvent>() );
}
else if( typeInfo == typeid( Dali::KeyEvent ) )
{
#include <dali/public-api/images/image.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/hover-event.h>
-#include <dali/public-api/events/mouse-wheel-event.h>
+#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/events/pan-gesture.h>
{
const char* const SIGNAL_TOUCHED = "touched";
const char* const SIGNAL_HOVERED = "hovered";
-const char* const SIGNAL_MOUSE_WHEEL_EVENT = "mouse-wheel-event";
+const char* const SIGNAL_WHEEL_EVENT = "wheel-event";
const char* const SIGNAL_ON_STAGE = "on-stage";
const char* const SIGNAL_OFF_STAGE = "off-stage";
const char* const ANIMATION_SIGNAL_FINISHED = "finished";
returnValue.Get(ret);
return ret;
}
- bool OnMouseWheel( Actor actor, const MouseWheelEvent& event)
+ bool OnWheel( Actor actor, const WheelEvent& event)
{
std::vector< Dali::Any > arguments;
Dali::Any returnValue(false);
{
actor.HoveredSignal().Connect( callback, &ActorCallback::OnHover );
}
- else if ( strcmp( signalName.c_str(), SIGNAL_MOUSE_WHEEL_EVENT ) == 0 )
+ else if ( strcmp( signalName.c_str(), SIGNAL_WHEEL_EVENT ) == 0 )
{
- actor.MouseWheelEventSignal().Connect( callback, &ActorCallback::OnMouseWheel );
+ actor.WheelEventSignal().Connect( callback, &ActorCallback::OnWheel );
}
else if ( strcmp( signalName.c_str(), SIGNAL_ON_STAGE ) == 0 )
{