To Antonio: positioning Dialog at bottom right corner.

To Antonio: positioning Dialog at bottom right corner.

Postby HunterEC » Wed Nov 26, 2008 5: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.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Postby JC » Wed Nov 26, 2008 5:24 pm

Hunter,

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

Code: Select all  Expand view
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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby HunterEC » Thu Nov 27, 2008 6:51 am

JC:

Thank you for your help, but what does the ClientToScreen function does ? Can you post it ?
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Postby JC » Mon Dec 01, 2008 6: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests