Buscando una solución he hecho unas modificaciones a la clase que puede que vengan bien a alguien o incluso se puedan incorporar .
He creado una CLASSDATA nueva lWinCaret iniciada a .f. que marca si queremos o no que nuestro programa se comporte como siempre o justo al reves.
Dejo los cambios ( pequeños ) a la clase :
- Code: Select all Expand view
.....
CLASSDATA lWinCaret INIT .F.
......
en :
METHOD KeyDown( nKey, nFlags ) CLASS TGet
.....
case nKey == VK_INSERT .and. ! GetKeyState( VK_SHIFT ) ;
.and. ! GetKeyState( VK_CONTROL ) // to copy to the clipboard
Set( _SET_INSERT, ! Set( _SET_INSERT ) )
DestroyCaret()
IF ::lWinCaret
if Set( _SET_INSERT )
CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )
else
CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight()-1 )
endif
else
if Set( _SET_INSERT )
CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() - 1 )
else
CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )
endif
endif
ShowCaret( ::hWnd )
return 0
.......
En METHOD GotFocus( hCtlLost ) CLASS TGet
.....
if ::oGet:Type $ "DN" .or. ::oGet:Pos != 1 // 28/06/05 AL
::nPos := ::oGet:Pos // 1 28/06/05 AL
endif
::oGet:Pos := ::nPos
::SetPos( ::nPos )
CallWindowProc( ::nOldProc, ::hWnd, WM_SETFOCUS )
IF ::lwinCaret
DestroyCaret()
if Set( _SET_INSERT )
CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )
ELSE
CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight()-1 )
ENDIF
ShowCaret( ::hWnd )
ELSE
if Set( _SET_INSERT )
DestroyCaret()
CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight()-1 )
endif
ShowCaret( ::hWnd )
ENDIF
else
HideCaret( ::hWnd )
endif
.....