* source/rtl/memoedit.prg

! Add support for Set Key defined Keys.
      From xHarbour by Luiz Culik
    ! Fix minor bug related with this.
This commit is contained in:
Walter Negro
2002-04-30 03:56:21 +00:00
parent 1eb4ed2559
commit 0deaf110dd

View File

@@ -104,6 +104,7 @@ METHOD Edit() CLASS TMemoEditor
// NOTE: K_ALT_W is not compatible with clipper exit memo and save key, but I cannot discriminate
// K_CTRL_W and K_CTRL_END from harbour code.
local aConfigurableKeys := {K_CTRL_Y, K_CTRL_T, K_CTRL_B, K_CTRL_V, K_ALT_W, K_ESC }
local bKeyBlock
// If I have an user function I need to trap configurable keys and ask to
// user function if handle them the standard way or not
@@ -119,6 +120,11 @@ METHOD Edit() CLASS TMemoEditor
nKey := Inkey(0)
if ! ( ( bKeyBlock := Setkey( nKey ) ) == NIL )
eval( bKeyBlock )
loop
endif
// Is it a configurable key ?
if AScan(aConfigurableKeys, nKey) > 0
nUserKey := Do(::xUserFunction, iif(::lDirty, ME_UNKEYX, ME_UNKEY), ::nRow, ::nCol - 1)