Correct handling of OnMouseWheel events in Ext-GWT

Posted by Kevin Loney on Stack Overflow See other posts from Stack Overflow or by Kevin Loney
Published on 2009-11-30T20:09:08Z Indexed on 2010/03/18 18:01 UTC
Read the original article Hit count: 546

Filed under:
|
|

I'm trying to figure out which property of BoxComponentEvent will tell me if the generated OnMouseWheel event was a scroll-up or scroll-down event. I have output the values of all the properties BoxComponentEvent exposes; and all of them (with the exception of the coordinates at which the event took place) stay the same regardless. Google and the Ext-GWT docs have been pretty useless for providing a concrete example.

public class MyPanel extends ContentPanel {
    // ...
    public MyPanel() {
    	addListener(Events.OnMouseWheel, new Listener<BoxComponentEvent>() {
    		public void handleEvent(BoxComponentEvent be) {
    			// What happens here to distinguish scroll-up and scroll-down?
    		}
    	});
    }

    protected void afterRender() {
    	super.afterRender();
    	el().addEventsSunk(Events.OnMouseWheel.getEventCode());
    }
    // ...
}

© Stack Overflow or respective owner

Related posts about ext-gwt

Related posts about mousewheel