Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to solve this popup problem?

Status
Not open for further replies.

pcwc66

IS-IT--Management
Dec 14, 2001
163
US
I have coding similar to the coding below. I expect that when the popup popLevel2 is displayed, pressing 3 will return "Main 06 Sub 03". However, it is returning "Main 03". So, it seems like even the popup popLevel2 is activated, the popup popSetup is still the active one. I hope someone can help me to resolve this problem.

Thank you.

local lnPos1, lnPos2, lcPrompt

lnPos1 = mrow()
lnPos2 = mcol()
lcPrompt = ""

define popup popSetup shortcut from lnPos1, lnPos2 relative

define bar 1 of popSetup prompt &quot;Main 0\<1&quot;
define bar 2 of popSetup prompt &quot;Main 0\<2&quot;
define bar 3 of popSetup prompt &quot;Main 0\<3&quot;
define bar 4 of popSetup prompt &quot;\-&quot;
define bar 5 of popSetup prompt &quot;Main 0\<4&quot;
define bar 6 of popSetup prompt &quot;Main 0\<5&quot;
define bar 7 of popSetup prompt &quot;\-&quot;

define bar 8 of popSetup prompt &quot;Main 0\<6&quot;
on bar 8 of popSetup activate popup popLevel2
define popup popLevel2 shortcut margin relative
define bar 1 of popLevel2 prompt &quot;Main 06 Sub 0\<1&quot;
define bar 2 of popLevel2 prompt &quot;Main 06 Sub 0\<2&quot;
define bar 3 of popLevel2 prompt &quot;Main 06 Sub 0\<3&quot;
define bar 4 of popLevel2 prompt &quot;Main 06 Sub 0\<4&quot;
define bar 5 of popLevel2 prompt &quot;Main 06 Sub 0\<5&quot;
on selection popup popLevel2 lcPrompt = prompt()

define bar 9 of popSetup prompt &quot;\-&quot;
define bar 10 of popSetup prompt &quot;Main 0\<7&quot;
define bar 11 of popSetup prompt &quot;Main 0\<8&quot;
define bar 12 of popSetup prompt &quot;Main 0\<9&quot;

on selection popup popSetup lcPrompt = prompt()
activate popup popSetup

wait window &quot;Selected Item is [&quot; + lcPrompt + &quot;]&quot;
deactivate popup popSetup
deactivate popup popLevel2
release popups popSetup, popLevel2
 

I'm VFp7.0 and I am not seeing this behavior, every selection is returning a correct value. What version of VFP are you using?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike,

I'm using VFP 8 SP1. I assume that you have tried my coding. I believe it is uncommon to create popups without using menu.

When the mouse is on &quot;Main 0\<6&quot;, the popup popLevel2 shows up. If I press the key 3, the wait window will return &quot;Main 03&quot;. However, if I use the mouse to click on
&quot;Main 06 Sub 03&quot;, the wait window will return &quot;Main 06 Sub 03&quot;. Can you duplicate these?

Thank you.
 
pcwc66

Sorry, I don't understand the problem at first, Yes I can duplicate this behavior and yes I did try your code. This is a normal behavior, you have two shortcuts with the same value (you have more then that). You will see the same behavior if you put you mouse on Main 06 and press &quot;1&quot;, it will return the first instance of that shortcut which is Main 01. You have to make sure none of your shortcuts have the same values.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I expected the issue would be where the Focus is...
notice that when you Hover on &quot;Main 06&quot;, that bar is highlighted (blue on my computer) and Nothing is highlighted in the sub-menu... so the sub-menu doesn't have focus.

I expected that as soon as the sub-menu gets focus (say, by hovering on a choice in it...) the hotkey &quot;3&quot; would have the effect you expect, however, in testing, doing so doesn't give the expected results: The only way to use the shortcut in the sub-menu is by also using the shortcut (&quot;6&quot;) in the main pop-up menu.

Testing in straight Windows (using right-clicking in a folder and hovering on &quot;New&quot;) it works as you expect.. just hovering on the &quot;New&quot; choice in the &quot;main&quot; popup menu makes the sub-menu keyboard shortcuts take precedent over the main popup.

The standard main menu in VFP works like Windows does: Click the &quot;Tools&quot; menu, hover on Wizards, press &quot;B&quot; and &quot;Database&quot; gets picked (in the Wizards sub-menu) instead of &quot;Debugger&quot; in the &quot;Tools&quot; menu.

So, it seems that it's a quirk in VFP with popups: The sub-popup keyboard shortcut's never take precedent over the main popup's.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top