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

controlling 'wait windows' positioning 1

Status
Not open for further replies.

arielap

Technical User
Aug 2, 2003
71
GB
This app runs on desktops and notebooks of various brands and a variety of screen sizes.

It has several screens with 'wait windows', positioned just below related fields. These appear only when certain criteria are met; the relevant code is in the objects' valids.

The problem is that when I position the wait windows correctly for the standard desktops, the same 'wait at r,c' code run on the notebooks places the waits well away from their related fields - my Thinkpad is the worst offender.

All the machines we use are set to 1024x768 screens, and screen fonts are all andale mono, 10.
This is VFP v7 and XP sp2

I've tried various calculations involving screen rows and object top/lefts, with no luck.

How can I ensure that wait windows appear in the same place relative to a form regardless of the type of PC the app is running on ?

Thanks

Ariela
 
simply don't give any positioning informations, the wait window will always appear in the upper right corner.

I'd say the position you give for the wait window position is multiplied by Fontmetric(1) for height and Fontmetric(6)for width, but if you want better control the easiest would perhaps be to show a form, which you can position in pixels or show text in the status bar or in a section of the form, eg a label.

Bye, Olaf.

 
Ariela,

How can I ensure that wait windows appear in the same place relative to a form

The co-ordinates that you pass to the AT clause are not relative to a form, but to the physical screen. If you really want to position the window relative to a form, you would first have to adjust the co-ords by the form's Top and Left, and then further adjust it by _SCREEN's Top and Left relative to the physical screen (taking account of the position and visibility of the Windows taskbar).

To complicate matters further, don't forget that the WAIT WINDOW co-ords are in characters, whereas the Top and Left properties are in pixels.

Personally, I'd go with Olaf's advice and create a custom form rather than a WAIT WINDOW.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
>>AT clause are not relative to a form, but to the physical screen<<
Exactly so - but the real problem is that things on desktop monitors appear at a different places on our laptops and 'widescreen' mini-notes, in spite of all having the same nominal resolution and screen font.

It's really a hardware property problem, not a Fox one, but I was hoping there was a formula that could be used to relate screen rows/columns to forms' top/left pixels.

If Messagebox() could be positioned programmatically, that would be better than Wait windows, but I've not seen a way to do so? Have I missed something?

 
I was hoping there was a formula that could be used to relate screen rows/columns to forms' top/left pixels.

Well, SYSMETRIC(1) and SYSMETRIC(2) will give you the physical screen size in pixels. The SystemParametersInfo() API function will give you the size of the physical screen in pixels after allowing for the Windows taskbar.

You can then use FONTMETRIC() to give you the height and width one of character of a given font and style. If you apply that to _SCREEN's font, you should be able to convert pixels to characters, and so find the co-ordinates needed by WAIT WINDOW.

As for MESSAGEBOX(): No, VFP has no way of positioning it programmatically. Again, I'd suggest you create a custom version which can have any behaviour you like.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks - that looks like the information I was looking for.
I'll experiment with it before resorting to a custom box
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top