Page 1 of 1

Right Mouse Click

Posted: Thu Jul 10, 2008 2:40 pm
by 9231211
We were trying to use a right mouse click to display a popup menu. Our first attempt was done by:

1) In OnMouseDown, remember the X and Y coordinates.
2) In OnMouseUp, check that the mouse hasn't moved (as it would for zoom/scroll/etc), check that the button is the right button, if so, popup the menu.

This was OK, except it appears that there is a huge delay (a few seconds) between the OnMouseDown and the OnMouseUp events when the right button is clicked. This isn't always the case, and having created a new blank project to try and find the source of the problem, it appears that the more nested in panels and page controls etc the chart is, the longer the delay between the mousedown and the mouseup.

Oddly, this delay only exists for the right mouse button, there is no delay for the right mouse button.

I then tried a second approach, which was to set the PopupMenu property thing to point to my popup menu, except this appears all the time, as in if I scroll it'll scroll and then popup the menu.

I was wondering whether there was a) any reason for the large delay between OnMouseDown and OnMouseUp for heavily nested TCharts, b) whether there was a way to do this with the PopupMenu property, so that it only pops up if I haven't scrolled.

Regards

Posted: Thu Jul 10, 2008 2:45 pm
by narcis
Hi jhhd,

You could try disabling the PopupMenu or set it to null in the OnZoom, OnUndoZoom and OnScroll events and assign it again, maybe in chart's OnAfterDraw event.