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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange popup behavior

Status
Not open for further replies.

andre65

Programmer
Jan 19, 2003
95
NL
I have created a button class when clicking the button a popup menu appears. This worked fine for some time. Quess what, now it doesn't. Maybe you guys can help me out.

When clicking the button, the popup is not displayed like it was before. That's not really a problem, but when moving the mouse over the popup, the focused menu-item should follow the mousecursor. This does not happen.

The button class has three methods m_resetPopup, m_intoPopup, m_exePopup and an array aPopup containing menu information.

procedure click
local lnRow, lnCol
*-- i do some coding here to determine the lnRow, lnCol
set shadow on
activate screen
define popup myPopup from lnRow,lnCol MARGIN RELATIVE SHADOW COLOR SCHEME 4

*-- Define bar with the right context
for i=1 to alen(this.aPopup,1)
lcAction = "define bar "+alltrim(str(i))+" of myPopup prompt '"+f_str(this.aPopup[i,1])+"'"
&lcAction
lcAction = "on selection bar "+alltrim(str(i))+" of myPopup _screen.activeForm.activeControl.m_exePopup(bar())"
&lcAction
endif
next i
*-- Route the action
activate popup myPopup
release popup myPopup

What am i doing wrong.
Thanks for any help.

Gr,
André
 

Have you tried removing the "RELEASE POPUP myPopup" part to see if it makes a difference?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Yes, I tried to remove the "release popup myPopup" line. No difference.
 
I copied the code into a button and tried to run it but there is too much missing. It starts out with and if/else syntax, but the rows are undefined, the array is undefined, the variable f_str is undefined, and there may be more.

Can you out a snippet of code that runs without a lot of cleanup on our part? Then we can test it to see if we are encountering the same behavior.

Jim Osieczonek
Delta Business Group, LLC
 
andre65,

I agree with Jim. You should give a little bit more so others can test it.

But while I'm at it let me try first, because I also played around with popup a little. Hope it works

procedure click
local lnRow, lnCol
*-- i do some coding here to determine the lnRow, lnCol
activate screen
define popup myPopup from lnRow,lnCol MARGIN ;
RELATIVE SHORTCUT && SHADOW COLOR SCHEME 4

*-- Define bar with the right context
for i=1 to alen(this.aPopup,1)
lcAction = "define bar "+alltrim(str(i))+" of myPopup prompt '"+;
f_str(this.aPopup[i,1])+"'"
&lcAction
endif
next i
*-- Route the action
On selection popup of myPopup ;
release popup myPopup

activate popup myPopup
_screen.activeForm.activeControl.m_exePopup(bar())


-- AirCon --
 
Guys,

Thanks for all response.
AirCon, your modification is the soltion:

Change:
DEFINE POPUP myPopup FROM lnRow,lnCol MARGIN RELATIVE SHADOW COLOR SCHEME 4

Into:
DEFINE POPUP myPopup FROM lnRow,lnCol MARGIN RELATIVE SHORTCUT

Now i see the popup the way i like (no black borders anymore) and behaves the i was expecting (menu-item focus follows the mouse cursor).

Thanks!
Regards
André
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top