Example #1
0
		/// <summary>Called when a scrollwheel changes by the given delta amount.</summary>
		public static void OnScrollWheel(Vector2 delta){
			
			// Create the event:
			WheelEvent e=new WheelEvent();
			e.deltaX=delta.x * ScrollWheelMultiplier;
			e.deltaY=delta.y * ScrollWheelMultiplier;
			e.SetTrusted();
			
			EventTarget target=ActiveReceiver;
			
			if(target == Unhandled){
				// It's going to be wasted, so let's try the moused over element first.
				if(SystemMouse!=null && SystemMouse.ActiveOverTarget!=null){
					// Send it there instead:
					target = SystemMouse.ActiveOverTarget;
				}
			}
			
			// Dispatch the event to the focused element:
			if(target.dispatchEvent(e)){
				
				HtmlElement htmlTarget = (target as HtmlElement);
				
				if(htmlTarget!=null){
					// Run the default:
					htmlTarget.OnWheelEvent(e);
				}
				
			}
			
		}
Example #2
0
        /// <summary>Called when a scrollwheel changes by the given delta amount.</summary>
        public static void OnScrollWheel(Vector2 delta)
        {
            // Create the event:
            WheelEvent e = new WheelEvent();

            e.deltaX = delta.x * ScrollWheelMultiplier;
            e.deltaY = delta.y * ScrollWheelMultiplier;
            e.SetTrusted();

            EventTarget target = ActiveReceiver;

            // Dispatch the event to the focused element:
            if (target.dispatchEvent(e))
            {
                if (target is HtmlElement)
                {
                    // Run the default:
                    (target as HtmlElement).OnWheelEvent(e);
                }
            }
        }
Example #3
0
 /// <summary>Called when a default scrollwheel event occurs (focused element).</summary>
 /// <param name="clickEvent">The event that represents the wheel scroll.</param>
 public virtual void OnWheelEvent(WheelEvent e)
 {
 }