Right Mouse Click

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
jhhd
Newbie
Newbie
Posts: 17
Joined: Tue Mar 09, 2004 5:00 am

Right Mouse Click

Post by jhhd » Thu Jul 10, 2008 2:40 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jul 10, 2008 2:45 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply