I noticed a problem using < oCtrl:cVarName >
that returns the object-name.
The function shows all infos of a object on focus
because of the error ( NIL ) I replaced the info with ???
On TRADIO and TDATEPICK ::cVarName exists but returns NIL
All other controls are working.
from :
METHOD cGenPRG( lDlgUnits ) CLASS TDatePick
...
...
cPrg += CRLF + " @ " + cTop + ", " + cLeft + ;
" DTPICKER " + ::cVarName + ' VAR ' + "d" + SubStr( ::cVarName, 2 ) + ' ' + ;
" ;" + CRLF + ' SIZE ' + cWidth + ", " + cHeight + ;
" PIXEL OF " + ::oWnd:cVarName + CRLF
and from :
METHOD cGenPRG( lDlgUnits ) CLASS TRadio
...
...
cPrg += CRLF + " @ " + cTop + ", " + cLeft + ;
" RADIOITEM " + ::cVarName + ' PROMPT "' + ::cCaption + '"' + ;
" ;" + CRLF + ' SIZE ' + cWidth + ", " + cHeight + ;
" PIXEL OF " + ::oWnd:cVarName + " ;" + CRLF + ;
' RADIOMENU ' + ::oRadMenu:cVarName + CRLF
- Code: Select all Expand view
SetKey( VK_F2, { || OBJ_INFO() } )
//--------- on FOCUS -------------------
STATIC FUNCTION OBJ_INFO()
LOCAL oCtrl := oWndFromHwnd( GetFocus() ), aCors[5]
aCors[1] := oCtrl:cVarName
IF aCors[1] = NIL
aCors[1] := "???"
ENDIF
aCors[2] := ALLTRIM(STR(oCtrl:nTop))
aCors[3] := ALLTRIM(STR( oCtrl:nLeft ))
aCors[4] := ALLTRIM(STR( oCtrl:nWidth ))
aCors[5] := ALLTRIM(STR(oCtrl:nHeight))
IF oCtrl:ClassName() = "TRADIO" // to be calculated !
//aCors[1] := oCtrl:oRadMenu:cVarName
aCors[2] := ALLTRIM(STR( oCtrl:nTop - ;
( oCtrl:nHeight / 2 ) ) )
aCors[5] := ALLTRIM(STR(oCtrl:nHeight * ;
LEN( oCtrl:oRadMenu:aItems ) ) )
ENDIF
MsgInfo( "Dialog title : " + oCtrl:oWnd:GetText() + CRLF + ;
"Dialog obj. : " + oCtrl:oWnd:cVarName + CRLF + ;
"Focused object : " + oCtrl:ClassName() + CRLF + ;
"Called from: "+ ProcName( 1 ) + CRLF + ;
"ProcLine : " + ALLTRIM(STR( ProcLine( 1 ) ) ) + CRLF + CRLF + ;
"Obj. name : " + aCors[1] + CRLF + ;
"Top : " + aCors[2] + CRLF + ;
"Left : " + aCors[3] + CRLF + ;
"Width : " + aCors[4] + CRLF + ;
"Hight : " + aCors[5] )
RETURN NIL
regards
Uwe