From 6d900a730a6a1bfef88aab9bacabb9e822475688 Mon Sep 17 00:00:00 2001 From: Walter Negro Date: Wed, 17 Apr 2002 14:21:55 +0000 Subject: [PATCH] * source/rtl/teditor.prg + Add of calls to IdleHook and KeyboardHook for handling of special keys when the mode edition is not used. --- harbour/source/rtl/teditor.prg | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index f323c1a02f..925f5b3a41 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -816,12 +816,32 @@ return Self // if editing isn't allowed we enter this loop which // handles only movement keys and discards all the others -STATIC procedure BrowseText(oSelf) +STATIC procedure BrowseText(oSelf, nPassedKey) LOCAL nKey - while (nKey := InKey(0)) <> K_ESC - oSelf:MoveCursor(nKey) + while ! oSelf:lExitEdit + + // If I haven't been called with a key already preset, evaluate this key and then exit + if nPassedKey == NIL + if NextKey() == 0 + oSelf:IdleHook() + endif + nKey := InKey(0) + else + nKey = nPassedKey + endif + + if nKey == K_ESC + oSelf:lExitEdit := .T. + + else + if !oSelf:MoveCursor(nKey) + oSelf:KeyboardHook(nKey) + endif + + endif + enddo return @@ -837,7 +857,7 @@ METHOD Edit(nPassedKey) CLASS HBEditor LOCAL lSingleKeyProcess := .F. // .T. if I have to process passed key and then exit if ! ::lEditAllow - BrowseText(Self) + BrowseText(Self,nPassedKey) else