by César E. Lozada » Sat Nov 07, 2009 3:07 am
I think this will avoid Copy, although you can still select a text:
1) Yo have to EXTEND CLASS tRichEdit WITH DATA lCanCopy
2) you have to edit and override Method CanCopy, Method Copy and Method KeyDown (to handle CTRL-C) in class tRichEdit.
METHOD CanCopy() INLINE ((ValType(::lCanCopy)<>"L" .or. ::lCanCopy) .and. ::IsSelection()) //This disables Copy option in rigth click menu
METHOD Copy() CLASS TRichEdit
#ifdef __XPP__
#undef New
#endif
DEFAULT ::lCanCopy:=.T.
if ::lCanCopy
::SendMsg( WM_COPY )
endif
return nil
METHOD KeyDown( nKey, nFlags ) CLASS TRichEdit
if (nKey == Asc( "C" ) .and. GetKeyState( VK_CONTROL ) )
::Copy()
return 0
endif
:
:
Regards