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

Activate window appears underneath Popup

Status
Not open for further replies.

stanbe

Technical User
Dec 25, 2008
7
US
I am converting a VFP 3 program to VFP 5. After a popup is activated I define and activate a window. The window appears under the popup. Any program @ says or user output is directed to the newly activated window but the popup remains on top of the window! Any help would be very much apreciated. Thanks.
Sample program:

Defi Popu TestPop from 10,15 to 20,50
Define Bar 2 of TestPop Prompt " Line 1"
ON SELE POPU TestPop DO TestProcedure
ACTI POPU TestPop

Proc TestProcedure
Do Case
Case Bar() = 2
Defi Wind TestWind from 1,1 to 25,70
Acti Wind TestWind
@ 12,0 Say "Window is underneath, but according to VFP help should be on top!"
Wait " "
Endc
Deac Wind TestWind
Rele Wind TestWind

 
Consider deactivating the popup immediately before (or after) opening the window. Not only will this solve your problem (probably), it's also a better user-interface. The popup is really just a menu, and you don't normally keep a popup menu open after the user has made their selection.

That said, I really must question your reasons for upgrading from VFP 3 to VFP 5. These are both very much out-dated version, with lots of bugs, weaknesses and issues that prevent them from behaving well in current versions of Windows. If you're going to the trouble of upgrading, it would make much more sense to go all the way to 9, which is the current version.

For the same reason, it doesn't make much sense to use DEFINE POPUP, DEFINE WINDOW, @/SAY, etc. These are hang-overs from FoxPro 2.x. Again, if you're going to the trouble of upgrading (even to 5.0), you should be using proper forms and menus.

Final point: I suspect the underlying reason for your problem is to do with theme support in Windows XP. If you were using VFP 9.0, you could probably avoid the problem by turning theme support off.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
I am not a programmer by trade. This application is an old dBase program that I converted over to VFP 3.0. Actually it runs fine in 3.0, but there is a known 3.0 bug where an "insufficent memory" error is generated on machines with more than about 700MB of ram. I therefore want to upgrade the application to 5.0 to be able to run with 2GB of ram. I would like to run the programs written from the dot prompt as-is without going to the trouble of learning how to create forms, etc and doing all of the conversion work. Most all of the programs run and your suggestion regarding deactivating the popup works for open windows. However if BROWSE command is issued, deactivating popup does not work. Placing DEAC command before BROWSE returns control back to calling program. Placing DEAC command after BROWSE allows popup to stay on top. Sample:

Defi Popu TestPop from 10,15 to 20,50
Define Bar 2 of TestPop Prompt " Line 1"
ON SELE Bar 2 of TestPop DO TestProcedure

Clos Data All
Use Customer in 0 orde AcctNumber
Sele Customer
ACTI POPU TestPop

Proc TestProcedure

Do Case
Case Bar() = 2
Brow
Deac POPU TestPop
Endc
Deac Wind TestWind
Rele Wind TestWind

Any help that you can give is very much apreciated.
Stan Berrie
 
Stan,

I understand your reason for keeping with old commands like @/SAY and BROWSE. Learning about forms, etc. can be quite an overhead if you just want to do a quick and dirty converion. Just be aware that it'll be harder to find help and advice about these old techniques.

To answer your specific question:

In this case, you need to change the DEACTIVATE POPUP to HIDE POPUP. Also, it must definitely go before the Browse.

This is slightly different from your earlier example, which used @/SAY, etc. The reason is that the Browse will cause the program to suspend while the user is working in the Browse window, so it won't get to the Deactivate until the Browse is closed.

I think you'll find the following should work:

Code:
Case Bar() = 2
   HIDE  POPUP TestPop
   BROWSE 
  * etc. etc.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
I might add to Mike's comment regarding finding code support.

Even though you are using the VFP3/5 development environment, you are still using old FP DOS or Win code and its methodology.

Therefore the support which would best fit your needs would be for FPD or FPW

I hope that Mike's suggestion works for you, but if not you might want to look at the alternative Tek-Tips forum...

Microsoft: FoxPro (old versions 1 to 2.6) Forum
forum182

Good Luck,
JRB-Bldr


 
I found a different work around:
Activate window cWindowname
mouse clic @ 1,1 && places window on top
Browse && opens browse window on top!!
I will try Mike's suggestion as well.
Thanks for your help.
Stan Berrie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top