How to find coordinates of display area of window

How to find coordinates of display area of window

Postby nageswaragunupudi » Tue Nov 06, 2007 5: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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Antonio Linares » Tue Nov 06, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby nageswaragunupudi » Tue Nov 06, 2007 9: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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 58 guests