public override bool MouseWheelMove(MouseInputEventArgs e)
        {
            var modArgs = new MouseInputEventArgs
                              (e.Buttons,
                              e.ShiftButtons,
                              new Vector2D(e.Position.X - Position.X + scrollbarH.Value, e.Position.Y - Position.Y + scrollbarV.Value),
                              e.WheelPosition,
                              e.RelativePosition,
                              e.WheelDelta,
                              e.ClickCount);

            if (inner_focus != null)
            {
                if (inner_focus.MouseWheelMove(modArgs))
                {
                    return(true);
                }
                else if (scrollbarV.IsVisible() && ClientArea.Contains(new Point((int)e.Position.X, (int)e.Position.Y)))
                {
                    scrollbarV.MouseWheelMove(e);
                    return(true);
                }
            }
            else if (scrollbarV.IsVisible() && ClientArea.Contains(new Point((int)e.Position.X, (int)e.Position.Y)))
            {
                scrollbarV.MouseWheelMove(e);
                return(true);
            }
            return(false);
        }
        /// <summary>
        ///  Handles MouseWheelMove event. Sent to Focused component.  Returns true if component accepted and handled the event.
        /// </summary>
        public virtual void MouseWheelMove(MouseWheelEventArgs e)
        {
            if (_console.IsVisible())
            {
                _console.MouseWheelMove(e);
            }

            IGuiComponent inputTo = (from IGuiComponent comp in _components
                                     where comp.RecieveInput
                                     where comp.Focus
                                     select comp).FirstOrDefault();

            if (inputTo != null)
            {
                inputTo.MouseWheelMove(e);
            }
        }
Esempio n. 3
0
 public override bool MouseWheelMove(MouseWheelEventArgs e)
 {
     if (inner_focus != null)
     {
         if (inner_focus.MouseWheelMove(e))
         {
             return(true);
         }
         else if (scrollbarV.IsVisible() && ClientArea.Contains(e.X, e.Y))
         {
             scrollbarV.MouseWheelMove(e);
             return(true);
         }
     }
     else if (scrollbarV.IsVisible() && ClientArea.Contains(e.X, e.Y))
     {
         scrollbarV.MouseWheelMove(e);
         return(true);
     }
     return(false);
 }