#702 Popup menu shown in wrong position for swt ChartComposite


The right-click menu on a swt chart is displayed in a wrong position: the code that calculates the coordinates manually adjusts the position without taking care of the swt display.
The result is that the menu is shown correctly if the application only shows the chart composite (since display and chart coordinates will be the same), but if you try to use the chart in a more complex interface the menu position calculated will be relative to the whole window (if you right click in the upper left corner in the chart the menu will be displayed in the upper left corner of the WINDOW).

This can be easily fixed by avoiding the manual calculation of offsets and using the standard swt canvas.toDisplay(event.x, event.y) method in ChartComposite.
The attached patch fixes ChartComposite.java, after this change the menu is shown as expected.


  • Henry Proudhon

    Henry Proudhon - 2006-12-11

    Logged In: YES
    Originator: NO

    Thanks for the patch Fabrizio, I just discovered that bug too. I'll commit your patch to cvs later today.

  • Henry Proudhon

    Henry Proudhon - 2007-01-30
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks