[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] ScrolledComposite bug

Hi,

I created a composite for drawing and added it into ScrolledComposite. The size of the drawing composite is set to (500, 90000) and I added some listeners (MouseDown, DragDetech) when I initalized it. My problem is that the y-coordinate of the mouse cannot be returned the correct value when I scrolled to the last page. The return value of y is 32213. The interesting thing is that only MouseEvent to return the wrong value. DragDetech is returned the accurate value of the y-coordinate when I started to drag. For example,

Composite drawComp = new Composite(sc, SWT.NONE);
drawComp.addListener(SWT.MouseDown, myListener);
drawComp.addListener(SWT.DragDetect, myListener);
Listener myListener = new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.MouseDown:
System.out.println("Down: " + e.y);
break;
case SWT.DragDetect:
System.out.println("Drag: " + e.y);
break;
}
}
};



The output is as follows: Up: 32213 Drag: 86570

I tried to add other mouse listeners(MouseUp, MouseHover, etc). They still got the same error as above. Anyone have the same the problem?

Clement