/// <summary> /// Mouse wheel event handler. /// </summary> /// <param name="e">Event args</param> /// <returns>If this widget handled this event</returns> public bool OnMouseWheel(System.Windows.Forms.MouseEventArgs e) { // if we aren't active do nothing. if ((!this.m_visible) || (!this.m_enabled)) { return(false); } int widgetTop = this.Top; int widgetBottom = this.Bottom; int widgetLeft = this.Left; int widgetRight = this.Right; // Handle each child if we're in the client area if (e.X >= widgetLeft && e.X <= widgetRight && e.Y >= widgetTop && e.Y <= widgetBottom) { for (int i = 0; i < this.m_ChildWidgets.Count; i++) { if (this.m_ChildWidgets[i] is IInteractive) { IInteractive currentInteractive = this.m_ChildWidgets[i] as IInteractive; if (currentInteractive.OnMouseWheel(e)) { return(true); } } } } return(false); }
public bool OnMouseWheel(System.Windows.Forms.MouseEventArgs e) { bool handled = false; // if we aren't active do nothing. if ((!m_visible) || (!m_enabled)) { return(false); } for (int index = 0; index < m_ChildWidgets.Count; index++) { IWidget currentWidget = m_ChildWidgets[index] as IWidget; if (currentWidget != null && currentWidget is IInteractive) { IInteractive currentInteractive = m_ChildWidgets[index] as IInteractive; handled = currentInteractive.OnMouseWheel(e); if (handled) { return(handled); } } } return(handled); }