FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour To Antonio: positioning Dialog at bottom right corner.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
To Antonio: positioning Dialog at bottom right corner.
Posted: Wed Nov 26, 2008 05:16 PM

Antonio:

To position a dialog (419 x 287) at the right edge of the screen, are these formulas correct ?

oDlg:nTop := GetSysMetrics(0) - 287
oDlg:nLeft := GetSysMetrics(1) - 419
oDlg:nBottom := GetSysMetrics(1)
oDlg:nRight := GetSysMetrics(0)

Thank you.

Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
To Antonio: positioning Dialog at bottom right corner.
Posted: Wed Nov 26, 2008 05:24 PM
Hunter,

I have tried this implementation to make this into my application... maybe this help you!

STATIC PROCEDURE adjustDialog( oDlg, oWnd, nTopCorrection )

LOCAL aCoorsWnd := { 0, 0 }
LOCAL nTopWnd   := 0
LOCAL nLeftWnd  := 0

DEFAULT nTopCorrection := 0


// Gettering informations
aCoorsWnd := clientToScreen( oWnd:hWnd, aCoorsWnd )
nTopWnd   := ( ( aCoorsWnd[1] + oWnd:nHeight ) - oDlg:nHeight ) - 29

// Positioning dialog
oDlg:center( oWnd )
oDlg:move( iif( !isEmpty( nTopCorrection ), nTopWnd - nTopCorrection, nTopWnd ), ( clientToScreen( oDlg:hWnd, { 0, 0 } ) )[2],,, TRUE )

RETURN( NIL )
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
To Antonio: positioning Dialog at bottom right corner.
Posted: Thu Nov 27, 2008 06:51 AM

JC:

Thank you for your help, but what does the ClientToScreen function does ? Can you post it ?

Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
To Antonio: positioning Dialog at bottom right corner.
Posted: Mon Dec 01, 2008 06:28 PM
Hunter,

The function clientToScreen() gets the coordinates of a :hWnd in relativity of a
client area!


HunterEC wrote:JC:

Thank you for your help, but what does the ClientToScreen function does ? Can you post it ?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9

Continue the discussion