private bool dispatchParentTouchEvents = true;
private bool dispatchHoverEvents = true;
private bool dispatchParentHoverEvents = true;
+ private bool dispatchWheelEvents = true;
+ private bool dispatchParentWheelEvents = true;
private bool dispatchGestureEvents = true;
private bool dispatchParentGestureEvents = true;
return true;
}
+ if (DispatchWheelEvents == false)
+ {
+ NUILog.Debug("If DispatchWheelEvents is false, it can not dispatch.");
+ return true;
+ }
+
WheelEventArgs e = new WheelEventArgs();
e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
+ bool consumed = false;
+
if (wheelEventHandler != null)
{
- return wheelEventHandler(this, e);
+ consumed = wheelEventHandler(this, e);
+ }
+
+ if (DispatchParentWheelEvents == false && consumed == false)
+ {
+ NUILog.Debug("If DispatchParentWheelEvents is false, it can not dispatch to parent.");
+ return true;
}
- return false;
+
+ return consumed;
}
// Callback for View OnWindow signal
return true;
}
+ /// <summary>
+ /// Gets or sets the status of whether wheel events can be dispatched.
+ /// If a View's DispatchWheelEvents is set to false, then it's can not will receive wheel event and parents will not receive a wheel event signal either.
+ /// This works without adding a WheelEvent callback in the View.
+ /// <note>
+ /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit hover event.
+ /// </note>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchWheelEvents
+ {
+ get
+ {
+ return dispatchWheelEvents;
+ }
+ set
+ {
+ if (dispatchWheelEvents != value)
+ {
+ dispatchWheelEvents = value;
+ if (dispatchWheelEvents == false)
+ {
+ WheelEvent += OnDispatchWheelEvent;
+ }
+ else
+ {
+ WheelEvent -= OnDispatchWheelEvent;
+ }
+ }
+ }
+ }
+
+ private bool OnDispatchWheelEvent(object source, View.WheelEventArgs e)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Gets or sets the status of whether wheel events can be dispatched to the parent.
+ /// If a View's DispatchParentWheelEvents is set to false, then parents will not receive a wheel event signal either.
+ /// This works without adding a WheelEvent callback in the View.
+ /// <note>
+ /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit hover event.
+ /// </note>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchParentWheelEvents
+ {
+ get
+ {
+ return dispatchParentWheelEvents;
+ }
+ set
+ {
+ if (dispatchParentWheelEvents != value)
+ {
+ dispatchParentWheelEvents = value;
+ if (dispatchParentWheelEvents == false)
+ {
+ WheelEvent += OnDispatchParentWheelEvent;
+ }
+ else
+ {
+ WheelEvent -= OnDispatchParentWheelEvent;
+ }
+ }
+ }
+ }
+
+ private bool OnDispatchParentWheelEvent(object source, View.WheelEventArgs e)
+ {
+ return true;
+ }
+
/// <summary>
/// Gets or sets the status of whether the view should emit Gesture event signals.
/// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.