ScrolledComposite bug [message #457965] |
Fri, 08 July 2005 08:20 |
Eclipse User |
|
|
|
Originally posted by: clement.chu.csse.monash.edu.au
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
|
|
|
Powered by
FUDForum. Page generated in 0.01593 seconds