FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to find coordinates of display area of window
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
How to find coordinates of display area of window
Posted: Tue Nov 06, 2007 05:34 AM

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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
How to find coordinates of display area of window
Posted: Tue Nov 06, 2007 09:22 AM

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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
How to find coordinates of display area of window
Posted: Tue Nov 06, 2007 09:27 AM

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

Continue the discussion