Adjust this so that when you click on a GET request (type == "C"), the cursor in the GET request is positioned at the end of the typed text.
DATA lLeftClickPosEndText INIT .F.
METHOD LButtonDown( nRow, nCol, nFlags, lTouch ) CLASS TGet
local nLo, nHi, nLenText
if ::lDrag
return ::Super:LButtonDown( nRow, nCol, nFlags, lTouch )
else
CallWindowProc( ::nOldProc, ::hWnd, WM_LBUTTONDOWN, nFlags,;
nMakeLong( nCol, nRow ) )
::GetSelPos( @nLo, @nHi )
::nPos = nHi + 1
if ::oGet:Type != "N" .and. ::nPos == 1
::oGet:Home()
::SetPos( ::oGet:Pos )
else
if ::oGet:type == "N" .and. ::lRightToLeft
::SetPos( ::nNumLen )
::Refresh()
else
if ::lLeftClickPosEndText .and. ::oGet:type == "C"
nLenText := Len( RTrim( ::oGet:VarGet() ) )
if ::nPos > nLenText
//clicou fora do texto ? vai para o final
::oGet:Home()
::oGet:End()
::SetPos( ::oGet:Pos )
else
//clicou no texto ? respeita
::oGet:Pos = ::nPos
endif
else
::oGet:Pos = ::nPos
endif
endif
endif
if ::bLClicked != nil
Eval( ::bLClicked, nRow, nCol, nFlags, Self, lTouch )
endif
if ::oBtn != nil
::oBtn:Refresh()
endif
if ::oBtnLeft != nil
::oBtnLeft:Refresh()
endif
return 1
endif
return nil