2001-04-21 22:59 GMT+2 Maurilio Longo <maurilio.longo@libero.it>

* source/rtl/memoedit.prg
     ! fixed error when UserFunction is a logical value.
This commit is contained in:
Maurilio Longo
2001-04-21 21:03:48 +00:00
parent f6961adc35
commit 2efb402fae
2 changed files with 15 additions and 9 deletions

View File

@@ -1,3 +1,7 @@
2001-04-21 22:59 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
* source/rtl/memoedit.prg
! fixed error when UserFunction is a logical value.
2001-04-20 18:15 UTC-0400 David G. Holm <dholm@jsd-llc.com>
* source/rtl/disksphb.c
@@ -30,7 +34,7 @@
2001-04-20 16:30 CET Martin Vogel <vogel@inttec.de>
+ contrib/libct/charop.c
+ charadd(), charand(), charor(), charxor(), charnot() and
+ charadd(), charand(), charor(), charxor(), charnot() and
(NEW!) charsub(), charshl(), charshr(), charrll() and charrlr() functions
* contrib/libct/Makefile
@@ -41,7 +45,7 @@
* contrib/libct/makefile.vc
+ added contrib/libct/charop.c
* contrib/libct/ctflist.txt
* changed status of functions mentioned above
@@ -58,7 +62,7 @@
+ contrib/libct/tests/charshr.prg
+ contrib/libct/tests/charrll.prg
+ contrib/libct/tests/charrlr.prg
! small test programs for new functions
! small test programs for new functions
* contrib/libct/tests/Makefile
+ added contrib/libct/tests/charadd.prg

View File

@@ -81,7 +81,7 @@ METHOD MemoInit(cUserFunction) CLASS TMemoEditor
// Save/Init object internal representation of user function
::xUserFunction := cUserFunction
if ::xUserFunction <> nil
if ISCHARACTER(::xUserFunction)
// Keep calling user function until it returns 0
while (nKey := Do(::xUserFunction, ME_INIT, ::nRow, ::nCol - 1)) <> ME_DEFAULT
@@ -107,7 +107,7 @@ METHOD Edit() CLASS TMemoEditor
// 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
if ::lEditAllow .AND. ::xUserFunction <> nil
if ::lEditAllow .AND. ISCHARACTER(::xUserFunction)
while ! ::lExitEdit
@@ -147,7 +147,7 @@ METHOD KeyboardHook(nKey) CLASS TMemoEditor
local nUserKey
if ::xUserFunction <> nil
if ISCHARACTER(::xUserFunction)
nUserKey := Do(::xUserFunction, iif(::lDirty, ME_UNKEYX, ME_UNKEY), ::nRow, ::nCol - 1)
::HandleUserKey(nKey, nUserKey)
@@ -159,7 +159,7 @@ return Self
METHOD IdleHook() CLASS TMemoEditor
if ::xUserFunction <> nil
if ISCHARACTER(::xUserFunction)
Do(::xUserFunction, ME_IDLE, ::nRow, ::nCol - 1)
endif
@@ -243,8 +243,10 @@ FUNCTION MemoEdit(cString,;
DEFAULT cUserFunction TO nil
DEFAULT cString TO ""
// Original MemoEdit() converts Tabs into spaces
oEd := TMemoEditor():New(StrTran(cString, Chr(K_TAB), Space(1)), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize)
// Original MemoEdit() converts Tabs into spaces;
// TOFIX: I need to add an EOL char to fix the case where I call MemoEdit() with a string of one line without EOL.
// If I don't add an EOL I lose last char of string
oEd := TMemoEditor():New(StrTran(cString, Chr(K_TAB), Space(1)) + HB_OSNewLine(), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize)
oEd:MemoInit(cUserFunction)
oEd:RefreshWindow()