From eefc0c4c51a76eefeea0386e3cd52d64a22d6ece Mon Sep 17 00:00:00 2001 From: Luiz Rafael Culik Date: Sun, 28 Apr 2002 02:54:45 +0000 Subject: [PATCH] See changelog 2002-04-27 23:50 UTC-0300 --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/teditor.prg | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6645716e05..ca22716e1a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,11 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + ! Add support for Set Key defined Keys. + From xHarbour by Luiz Culik + ! Fix minor bug related with this. + * source/rtl/teditor.prg + ! Add support for Set Key defined Keys on Edit() and BrowseText() method From xHarbour by Luiz Culik ! Fix minor bug related with this * source/rtl/tget.prg diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index 925f5b3a41..504a734b94 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -818,7 +818,7 @@ return Self // handles only movement keys and discards all the others STATIC procedure BrowseText(oSelf, nPassedKey) - LOCAL nKey + LOCAL nKey,bKeyBlock while ! oSelf:lExitEdit @@ -832,6 +832,11 @@ STATIC procedure BrowseText(oSelf, nPassedKey) nKey = nPassedKey endif + IF !( ( bKeyBlock := setkey( nKey ) ) == NIL ) + eval( bKeyBlock ) + return + endif + if nKey == K_ESC oSelf:lExitEdit := .T. @@ -854,6 +859,7 @@ METHOD Edit(nPassedKey) CLASS HBEditor LOCAL nKey LOCAL lOldInsert LOCAL lDelAppend + LOCAL bKeyBlock LOCAL lSingleKeyProcess := .F. // .T. if I have to process passed key and then exit if ! ::lEditAllow @@ -874,6 +880,10 @@ METHOD Edit(nPassedKey) CLASS HBEditor lSingleKeyProcess := .T. nKey := nPassedKey endif + IF !( ( bKeyBlock := setkey( nKey ) ) == NIL ) + eval( bKeyBlock ) + return Self + endif do case case nKey >= K_SPACE .AND. nKey < 256