There's a couple of things different between GET..ACTION and BTNGET. With BTNGET, I can assign the color for the get field with focus and F2 will invoke :bAction with no additional coding on my part.
However the showstopper for me is I use a version of Shuming's AutoResize() to resize my controls depending on screen resolution and with GET..ACTION it simply doesn't work. You could see this in the image above. It works fine all this while with BTNGET.
I may have to modify AutoResize() to acommodate GET..ACTION but I dont know how. This is the version of AutoResize() that I use.
function AutoResize(nTop,nLeft, oDlg, oFold)
local i,nRatioX,nRatioY, nLen := len(oDlg:aControls), oCtrl, aRect
local cClass, aRes_
default nTop := 0
default nLeft := 0
aRes_ := ClosestRes(GetSysMetrics(SM_CYSCREEN))
nRatioX := aRes_[1]/800 //GetSysmetrics(0)
if nRatioX <= 1
//<=800*600, not needed
return nil
end
nRatioY := aRes_[2]/600 //GetSysmetrics(1)
for i := 1 to nLen
oCtrl = oDlg:aControls[i]
cClass := oCtrl:classname()
aRect = GetCoors( oCtrl:hWnd )
if cClass == "TCOMBOBOX"
oCtrl:Move( aRect[1]*nRatioX, aRect[2]*nRatioY)
elseif cClass $ "TWBROSE,TCBROWSE,TSBROWSE"
aeval(oCtrl:aColSizes, {|val, pos| oCtrl:aColSizes[pos] *= nRatioX })
oCtrl:Move( aRect[1]*nRatioX, aRect[2]*nRatioY, (aRect[4] - aRect[2])*nRatioX, (aRect[3] - aRect[1])*nRatioY, .t. )
else
oCtrl:Move( aRect[1]*nRatioX, aRect[2]*nRatioY, (aRect[4] - aRect[2])*nRatioX, (aRect[3] - aRect[1])*nRatioY, .t. )
if cClass == "TFOLDER"
aeval(oCtrl:aDialogs, {|oTDlg| Autoresize(oCtrl:nFdHeight-1,1, oTDlg, oCtrl)})
endif
endif
next
aRect = GetWndRect( oDlg:hWnd )
oDlg:Move( nTop,nLeft,oDlg:nWidth*nRatioX, oDlg:nHeight*nRatioY, .T. )
if !empty(oFold)
oDlg:SetSize(oFold:nWidth()-5, oFold:nHeight()-oFold:nFdHeight-4)
endif
if oDlg:lCentered
WndCenter( oDlg:hWnd )
else
if Empty( oDlg:cResName )
oDlg:Move( oDlg:nTop, oDlg:nLeft )
endif
endif
return nil
//-----------------------------------------------------------------------------------------
function ClosestRes(nHgt)
// find a value that can maintain the ratio 800:600 (4:3), so the screen
// won't look too odd on a widescreen monitor
local x, nWid
do while nHgt % 3 != 0
nHgt--
enddo
x := nHgt/3
nWid := x*4
return {nWid, nHgt}