Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DEACTIVATE POPUP failure
Message
From
10/09/1999 13:45:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
DEACTIVATE POPUP failure
Miscellaneous
Thread ID:
00263441
Message ID:
00263441
Views:
46
I'm trying to get DEACTIVATE POPUP ALL to work, and it sure looks like it's broken.

We've got a menu system created via MODI MENU (with GENMENUX extensions), and while the menu system is active (with a READ EVENTS), we have a timer that occasionally fires an idle loop function.

The thing is this:

Sometimes, the user has a menu popped up when the idle loop function fires. And sometimes, the idle loop function must pop up alerts and/or Important Questions to the user.

The problem is that these alerts (which are in a class-based form with AlwaysOnTop TRUE) come up UNDER the menus when they're popped up.

To make matters worse, while the message form is up, neither the form nor the menu will accept mouse input (there is a BEEP no matter where you click on either).

So, I figured I need to close any open POPUP before running the meat of the idle loop. the problem is, I can't. DEACTIVATE POPUP ALL does nothing, even though the menu system is definitely using POPUPS (e.g., ON PAD _FILE ACTIVATE POPUP FOO).

I'm wondering if the fact that we're in a READ EVENTS state is impacting the ability to use DEACTIVATE POPUP ALL.

(I also tried explicitly naming the popups to be deactivated, but again, they are not affected.)

Any leads on this would be most appreciated.

-- jas

P.S. Some more (simplified) details:

This proc is used to activate the menu bar and wait for a selection:

PROCEDURE GetMenuChoice

* Display the menubar
goApp.lMenusEnabled = .T.
DO MYMENU.MPX
=RePopMenu()

* Turn on idle processing every 45 seconds
goApp.tmrIdle.Interval = 45000

* Wait for a menu selection
READ EVENTS

* Turn off idle processing
goApp.tmrIdle.Interval = 0

* Disable the Menu
IF goApp.cMenuItem # QUIT' THEN
* If cMenuItem is YES, then we're going to exit anyway, so don't
* spend time redrawing the menu bar.
goApp.lMenusEnabled = .F.
DO MYMENU.MPX
ENDIF

ENDPROC

This is the idle loop function run by goApp.tmrIdle.Timer():

PROCEDURE MyIdleLoop()

* Turn off idle processing, so we don't step on ourselves
goApp.tmrIdle.Interval = 0
goApp.tLastIdle = DATETIME()

* Indicate we're processing idle loop
goApp.Inform("Processing Background Tasks...")
SET MESSAGE TO " Processing Background Tasks..."

*JAS 06/17/1999 -- Work-around for form repaint glitch.
WAIT WINDOW '' timeout 0.1

* DO STUFF HERE

* Indicate we're done processing
goApp.HideInformer()
SET MESSAGE TO

&& Turn idle processing back on (every 45 seconds)
goApp.tmrIdle.Interval = 45000

* Re-popup the selected menu, if auto-pop is on.
=RePopMenu()

ENDPROC

And here is RePopMenu:

PROCEDURE RePopMenu(tcMenu)

tcMenu = IIF(EMPTY(tcMenu), goApp.cMenu, UPPER(ALLTRIM(tcMenu)))

* Re-popup the selected menu, if auto-pop is on.
IF goApp.lMenuAutoHighlight THEN
* Make menubar active.
IF !Empty(tcMenu) THEN
* If we have a valid menu item last processed, then activate its menu, making sure to
* close any open menu first (to avoid BEEPing).
ACTIVATE SCREEN
KEYBOARD StrMerge("{ESC}{ESC}{ESC}{ALT+<<1>>}", goMenuKeys.GetValue(goApp.cMenu)) PLAIN CLEAR
ENDIF
ENDIF

RETURN
ENDPROC && RePopMenu
Reply
Map
View

Click here to load this message in the networking platform