by Francisco Horta » Thu Aug 02, 2007 8:27 pm
patricio este el metodo keydown que tengo en la clase, probablemente tienes la ver no mas actual de la 17
METHOD KeyDown( nKey, nFlags ) CLASS TWBrowse
local lRefresh
do case
case nKey == VK_UP
::cBuffer:= ""
::GoUp()
case nKey == VK_DOWN
::cBuffer:= ""
::GoDown()
case nKey == VK_LEFT
::cBuffer:= ""
If ::GoLeft()
::Refresh()
EndIf
case nKey == VK_RIGHT
::cBuffer:= ""
If ::GoRight()
::Refresh()
EndIf
case nKey == VK_HOME
::cBuffer:= ""
::GoTop()
case nKey == VK_END
::cBuffer:= ""
::GoBottom()
case nKey == VK_PRIOR
::cBuffer:= ""
if GetKeyState( VK_CONTROL )
::GoTop()
else
::PageUp()
endif
case nKey == VK_NEXT
::cBuffer:= ""
if GetKeyState( VK_CONTROL )
::GoBottom()
else
::PageDown()
endif
case ::bSeek != Nil .and. !::lWorking .and. nKey == VK_BACK
::lWorking:= .T.
::cBuffer := SubStr( ::cBuffer, 1, Len(::cBuffer) - 1 )
if "L" $ ValType( lRefresh:= Eval( ::bSeek ) ) .and. lRefresh
::nRowPos:= Max( Min( ::nLen, ::nRowCount ), 1 )
::Refresh()
endif
::lWorking:= .F.
case ::bSeek != Nil .and. ( nKey == VK_SHIFT .or. nKey >= 32 )
// No Hacer nada !!!, pero respetar el Super.
Super:KeyDown( nKey, nFlags )
otherwise
::cBuffer:= ""
If( ::bSeek != Nil .and. ::bUpdateBuffer != Nil, Eval( ::bUpdateBuffer ), )
// Posibilidad de efectuar acciones con TABs 13/05/04
if nKey == VK_TAB .and. ::bKeyDown != nil
Eval( ::bKeyDown, nKey, nFlags )
endif
return Super:KeyDown( nKey, nFlags )
endcase
If( ::bSeek != Nil .and. ::bUpdateBuffer != Nil, Eval( ::bUpdateBuffer ), )
return 0
salu2
paco