How to find coordinates of display area of window

Post Reply
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

How to find coordinates of display area of window

Post by nageswaragunupudi »

Many times I experience difficulty in placing the controls in a window to decide the exact coordinates. What is the simplest and reliable way to find the top,left,bottom and right of the display area of a window, after removing the area occupied by button bar and message bar?

For example if i want to position a control at 0,0 then I need to say something like @ IIF( oWnd:oBar:nMode == 1, oWnd:oBar:nHeight, 0 ), IIF( oWnd:oBar:nMode == 2, oWnd:oBar:nWidth, 0 ) CONTROL .... .

Similarly if I have to set the height of a control to occupy full window heght, I may have to say something like oWnd:GetCliRect():nHeight - oWnd:oBar:nheight - oWnd:oMsgBar:nHeight ....

Is there a better and simpler way to find these coordinates? Can Window class be improved to provide these values like oWnd:ClientTop ,, etc ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

NageswaraRao,

The buttonbar and the messagebar are also controls, in the same way as SAYs, GETs, Buttons, etc.

You just need to use oBar:nHeight and oMsgBar:nHeight to calculate the right coordinates for the other controls

When you do oWnd:oClient = oControl the FWH calculates the remaining client area automatically
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Mr Antonio

Thanks

> When you do oWnd:oClient = oControl the FWH calculates the remaining client area automatically

I am doing that for single controls like browses and also ownd:oleft := ocontrol, etc. if i use two or three controls, like browses, listboxes, etc.
Regards

G. N. Rao.
Hyderabad, India
Post Reply