Page 1 of 1

Whats the best way of using a popup menu?

Posted: Fri Feb 22, 2013 6:51 pm
by 10047857
Hi

I would like to use the popup menu more effectively but as you know it still gets called when either scrolling or zooming a chart.
I've searched the forum for advice about this and not found anything that works.
I tried disabling the auto-popup on the OnZoom event and then re-enabling it on the OnAfterDraw event but that didn't work.

Code: Select all

PopUpMenu.AutoPopup:=False;
Have you a good way of getting round this problem?

Bruce.

Re: Whats the best way of using a popup menu?

Posted: Mon Feb 25, 2013 11:47 am
by narcis
Hi Bruce,

What about disabling it in the OnMouseDown event?

Re: Whats the best way of using a popup menu?

Posted: Mon Feb 25, 2013 12:31 pm
by 10047857
Narcis

I do want it to pop-up on a mouse down but not I have to distinguish when the right button is being used for zooming for example, when I finish rubber-banding an area the menu pop-ups. If I switched the right button to scrolling instead of zooming, every time I finished scrolling a chart the menu would pop-up. What I need to do is to distinguish between a single quick click to activate the pop-up from a prolonged click for zooming or scrolling.

The other thing I thought of doing was assign a short-cut to an action to show the pop-up.

Bruce.

Re: Whats the best way of using a popup menu?

Posted: Mon Feb 25, 2013 1:03 pm
by narcis
Hi Bruce,
I do want it to pop-up on a mouse down but not I have to distinguish when the right button is being used for zooming for example, when I finish rubber-banding an area the menu pop-ups. If I switched the right button to scrolling instead of zooming, every time I finished scrolling a chart the menu would pop-up. What I need to do is to distinguish between a single quick click to activate the pop-up from a prolonged click for zooming or scrolling.
I meant that you could disable pop-up menu at OnMouseDown and only enable it if no zoom or scroll has occurred.
The other thing I thought of doing was assign a short-cut to an action to show the pop-up.
Yes, you could use key related events for that.