Page 1 of 1

Question to coordinates.

Posted: Thu Mar 28, 2019 9:13 am
by byte-one
Hello, in which way i become the screen-coordinates from the actual focused control?

Re: Question to coordinates.

Posted: Thu Mar 28, 2019 10:43 am
by cnavarro
Try with ClientToScreen Function

Re: Question to coordinates.

Posted: Thu Mar 28, 2019 11:47 am
by byte-one
Cristobal, ok, but from where i become the actual focused control??

Re: Question to coordinates.

Posted: Thu Mar 28, 2019 2:20 pm
by ukoenig
Günther,

You can use :

@ 185, 810 GET oGet[1] VAR nAge SIZE 30, 22 PICTURE "99" PIXEL UPDATE
oGet[1]:bLClicked := {|| aSize := GET_SIZE( oGet[1] ), ;
MsgAlert( "Top : " + ALLTRIM(STR(aSize[1])) + CRLF + ; // only for test
"Left : " + ALLTRIM(STR(aSize[2])) + CRLF + ;
"Width : " + ALLTRIM(STR(aSize[3])) + CRLF + ;
"Height : " + ALLTRIM(STR(aSize[4])), "Size" ) }

// ------------

STATIC FUNCTION GET_SIZE( oObject )
LOCAL aCors[4]

aCors[1] := oObject:nTop
aCors[2] := oObject:nLeft
aCors[3] := oObject:nWidth
aCors[4] := oObject:nHeight

RETURN aCors

regards
Uwe :D

Re: Question to coordinates.

Posted: Thu Mar 28, 2019 2:46 pm
by byte-one
Hello, Uwe! The problem for me is to determine automatically the actual focused object. Then i can use your function for the coordinats.

Re: Question to coordinates.

Posted: Thu Mar 28, 2019 7:59 pm
by nageswaragunupudi
hWnd := GetFocus()

Re: Question to coordinates.

Posted: Fri Mar 29, 2019 12:39 pm
by ukoenig
Günther,

have a look at this test :

http://forums.fivetechsupport.com/viewt ... =3&t=36956

regards
Uwe :D