so I have
A Part with : (I will spare you the layout details, it's just to show my setup)
sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
drawingPane = new Composite(sc, SWT.NONE);
drawingPane.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_BLACK));
sc.setContent(drawingPane);
paintCanvas = new Canvas(drawingPane, SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
When I add then a MouseWheelListener
to the Canvas, each Time the event occurs, the vertical Scrollbar of the ScrolledComposite is also reacting to it.
Which is kind of annoying. I tried the Solution of this Question. But the Thing is that the Canvas is the Source of the Event, which is right and I need it to be.
The question is more how can I prohibit the MouseEvent to get passed on to the ScrolledComposite? I also tried to disable the Scrollbar, but this wasn't practical as I have found no place in the Code to re-enable it afterwards. As it seems that the scrolling gets triggered after anything else(like the redraw of my canvas for example).