From 59de3737823259d7bcdc34b0a8fd9bd5bb0b9bbc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 May 2000 13:34:46 +0000 Subject: [PATCH] 20000501-15:37 GMT+1 Victor Szakats --- harbour/ChangeLog | 25 +++ harbour/makefile.bc | 8 + harbour/makefile.vc | 2 + harbour/source/compiler/hbusage.c | 1 + harbour/source/rtl/Makefile | 273 +++++++++++++++--------------- harbour/source/rtl/dummy.prg | 1 - harbour/source/rtl/memoedit.prg | 75 ++++++++ harbour/source/rtl/teditor.prg | 22 +-- 8 files changed, 254 insertions(+), 153 deletions(-) create mode 100644 harbour/source/rtl/memoedit.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index abca9a5569..dca24fcd07 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,28 @@ +20000501-15:37 GMT+1 Victor Szakats + + * source/rtl/teditor.prg + + source/rtl/memoedit.prg + * source/rtl/Makefile + * makefile.bc + * makefile.vc + ! Added missing CVS header. + * Separated MEMOEDIT() function from the underlying class. + + Added new files to makefile.vc + + Defaults set for the MEMOEDIT() parameters. + + cUserFunction logical value handled. + ! Fixed to compile with 10 character symbol length limit. + + * source/rtl/dummy.prg + - Removed commented line + + * source/compiler/hbusage.c + + Developer list updated. + + * source/rtl/Makefile + ! Fixed back the indentation of the file list from three spaces to + one tab. + + Added memoedit.prg + 20000501 08:10 GMT-3 Luiz Rafael Culik *makefile.bc +added teditor.prg entry to makefile diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 928de60f01..f27d3390ec 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -278,6 +278,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\getlist.obj \ $(OBJ_DIR)\getsys.obj \ $(OBJ_DIR)\input.obj \ + $(OBJ_DIR)\memoedit.obj \ $(OBJ_DIR)\memvarbl.obj \ $(OBJ_DIR)\menuto.obj \ $(OBJ_DIR)\objfunc.obj \ @@ -1198,6 +1199,13 @@ $(OBJ_DIR)\memoline.obj : $(RTL_DIR)\memoline.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\memoedit.c : $(RTL_DIR)\memoedit.prg + $(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@ + +$(OBJ_DIR)\memoedit.obj : $(OBJ_DIR)\memoedit.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(RTL_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\memvarbl.c : $(RTL_DIR)\memvarbl.prg $(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@ diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 6c6a004aac..b410f39fdb 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -307,6 +307,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\getlist.obj \ $(OBJ_DIR)\getsys.obj \ $(OBJ_DIR)\input.obj \ + $(OBJ_DIR)\memoedit.obj \ $(OBJ_DIR)\memvarbl.obj \ $(OBJ_DIR)\menuto.obj \ $(OBJ_DIR)\objfunc.obj \ @@ -318,6 +319,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\tbcolumn.obj \ $(OBJ_DIR)\tbrowse.obj \ $(OBJ_DIR)\tclass.obj \ + $(OBJ_DIR)\teditor.obj \ $(OBJ_DIR)\terror.obj \ $(OBJ_DIR)\text.obj \ $(OBJ_DIR)\tget.obj \ diff --git a/harbour/source/compiler/hbusage.c b/harbour/source/compiler/hbusage.c index 5f1ed5a5d8..39b066d5cc 100644 --- a/harbour/source/compiler/hbusage.c +++ b/harbour/source/compiler/hbusage.c @@ -116,6 +116,7 @@ void hb_compPrintCredits( void ) "Manuel Ruiz \n" "Matteo Baccan \n" "Matthew Hamilton \n" + "Maurilio Longo \n" "Nicolas del Pozo \n" "Patrick Mast \n" "Paul Tucker \n" diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index e8deed3c25..f1ca47deca 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -5,144 +5,145 @@ ROOT = ../../ C_SOURCES=\ - abs.c \ - accept.c \ - ampm.c \ - at.c \ - binnum.c \ - binnumx.c \ - box.c \ - chrasc.c \ - colorind.c \ - console.c \ - copyfile.c \ - datec.c \ - dates.c \ - dateshb.c \ - datesx.c \ - defpath.c \ - descend.c \ - dir.c \ - dirdrive.c \ - diskspac.c \ - do.c \ - empty.c \ - errorapi.c \ - eval.c \ - filesys.c \ - fkmax.c \ - fnsplit.c \ - fssize.c \ - fstemp.c \ - gete.c \ - gt.c \ - gtapi.c \ - gx.c \ - hardcr.c \ - inkey.c \ - is.c \ - isprint.c \ - langapi.c \ - left.c \ - len.c \ - lennum.c \ - math.c \ - maxrow.c \ - memofile.c \ - memoline.c \ - minmax.c \ - mlcount.c \ - mlpos.c \ - mod.c \ - mouseapi.c \ - mousex.c \ - mtran.c \ - natmsg.c \ - net.c \ - oemansi.c \ - oldbox.c \ - oldclear.c \ - pad.c \ - padc.c \ - padl.c \ - padr.c \ - philes.c \ - philes53.c \ - philesx.c \ - rat.c \ - replic.c \ - right.c \ - round.c \ - run.c \ - samples.c \ - saverest.c \ - scroll.c \ - seconds.c \ - set.c \ - setcolor.c \ - setcurs.c \ - setpos.c \ - setposbs.c \ - shadow.c \ - soundex.c \ - space.c \ - str.c \ - strcase.c \ - strings.c \ - strmatch.c \ - strtran.c \ - strzero.c \ - stuff.c \ - substr.c \ - tone.c \ - trace.c \ - transfrm.c \ - trim.c \ - type.c \ - val.c \ - valtostr.c \ - valtype.c \ - version.c \ - word.c \ - xhelp.c \ - xsavescr.c \ + abs.c \ + accept.c \ + ampm.c \ + at.c \ + binnum.c \ + binnumx.c \ + box.c \ + chrasc.c \ + colorind.c \ + console.c \ + copyfile.c \ + datec.c \ + dates.c \ + dateshb.c \ + datesx.c \ + defpath.c \ + descend.c \ + dir.c \ + dirdrive.c \ + diskspac.c \ + do.c \ + empty.c \ + errorapi.c \ + eval.c \ + filesys.c \ + fkmax.c \ + fnsplit.c \ + fssize.c \ + fstemp.c \ + gete.c \ + gt.c \ + gtapi.c \ + gx.c \ + hardcr.c \ + inkey.c \ + is.c \ + isprint.c \ + langapi.c \ + left.c \ + len.c \ + lennum.c \ + math.c \ + maxrow.c \ + memofile.c \ + memoline.c \ + minmax.c \ + mlcount.c \ + mlpos.c \ + mod.c \ + mouseapi.c \ + mousex.c \ + mtran.c \ + natmsg.c \ + net.c \ + oemansi.c \ + oldbox.c \ + oldclear.c \ + pad.c \ + padc.c \ + padl.c \ + padr.c \ + philes.c \ + philes53.c \ + philesx.c \ + rat.c \ + replic.c \ + right.c \ + round.c \ + run.c \ + samples.c \ + saverest.c \ + scroll.c \ + seconds.c \ + set.c \ + setcolor.c \ + setcurs.c \ + setpos.c \ + setposbs.c \ + shadow.c \ + soundex.c \ + space.c \ + str.c \ + strcase.c \ + strings.c \ + strmatch.c \ + strtran.c \ + strzero.c \ + stuff.c \ + substr.c \ + tone.c \ + trace.c \ + transfrm.c \ + trim.c \ + type.c \ + val.c \ + valtostr.c \ + valtype.c \ + version.c \ + word.c \ + xhelp.c \ + xsavescr.c \ PRG_SOURCES=\ - achoice.prg \ - adir.prg \ - alert.prg \ - browdb.prg \ - browdbx.prg \ - browse.prg \ - dbedit.prg \ - devoutp.prg \ - dircmd.prg \ - dummy.prg \ - errorsys.prg \ - fieldbl.prg \ - getlist.prg \ - getsys.prg \ - input.prg \ - memvarbl.prg \ - menuto.prg \ - objfunc.prg \ - readkey.prg \ - readvar.prg \ - setfunc.prg \ - setkey.prg \ - setta.prg \ - tclass.prg \ - tbcolumn.prg \ - tbrowse.prg \ - teditor.prg \ - terror.prg \ - text.prg \ - tget.prg \ - tgetlist.prg \ - tlabel.prg \ - treport.prg \ - typefile.prg \ - wait.prg \ + achoice.prg \ + adir.prg \ + alert.prg \ + browdb.prg \ + browdbx.prg \ + browse.prg \ + dbedit.prg \ + devoutp.prg \ + dircmd.prg \ + dummy.prg \ + errorsys.prg \ + fieldbl.prg \ + getlist.prg \ + getsys.prg \ + input.prg \ + memoedit.prg \ + memvarbl.prg \ + menuto.prg \ + objfunc.prg \ + readkey.prg \ + readvar.prg \ + setfunc.prg \ + setkey.prg \ + setta.prg \ + tclass.prg \ + tbcolumn.prg \ + tbrowse.prg \ + teditor.prg \ + terror.prg \ + text.prg \ + tget.prg \ + tgetlist.prg \ + tlabel.prg \ + treport.prg \ + typefile.prg \ + wait.prg \ LIBNAME=rtl diff --git a/harbour/source/rtl/dummy.prg b/harbour/source/rtl/dummy.prg index a66d8e8225..9cdcb133df 100644 --- a/harbour/source/rtl/dummy.prg +++ b/harbour/source/rtl/dummy.prg @@ -63,7 +63,6 @@ FUNCTION dbFieldInfo() ; RETURN NIL FUNCTION dbSetRelation() ; RETURN NIL FUNCTION dbClearRelation() ; RETURN NIL -//FUNCTION MemoEdit( str ) ; RETURN str FUNCTION MLCToPos() ; RETURN 0 FUNCTION MPosToLC() ; RETURN 0 diff --git a/harbour/source/rtl/memoedit.prg b/harbour/source/rtl/memoedit.prg new file mode 100644 index 0000000000..e9447da88c --- /dev/null +++ b/harbour/source/rtl/memoedit.prg @@ -0,0 +1,75 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * MemoEdit() function + * + * Copyright 2000 Maurilio Longo + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +/* TODO: MemoEdit() is not compatible with clipper one. + Needs a lot more work to become */ + +#include "common.ch" + +FUNCTION MemoEdit( cString,; + nTop, nLeft,; + nBottom, nRight,; + lEditMode,; + cUserFunction,; + nLineLength,; + nTabSize,; + nTextBuffRow,; + nTextBuffColumn,; + nWindowRow,; + nWindowColumn ) + + LOCAL oEd + + DEFAULT nTop TO 0 + DEFAULT nLeft TO 0 + DEFAULT nBottom TO MaxRow() + DEFAULT nRight TO MaxCol() + DEFAULT lEditMode TO .T. + DEFAULT nLineLength TO nRight - nLeft + DEFAULT nTabSize TO 4 + DEFAULT nTextBuffRow TO 1 + DEFAULT nTextBuffColumn TO 0 + DEFAULT nWindowRow TO 0 + DEFAULT nWindowColumn TO nTextBuffColumn + + oEd := TEditor():New( cString, nTop, nLeft, nBottom, nRight, lEditMode ) + oEd:RefreshWindow() + + IF ! ISLOGICAL( cUserFunction ) .OR. cUserFunction == .T. + oEd:Edit() + ENDIF + + RETURN cString + diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index 5781d8c2c7..332247652e 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -1,8 +1,12 @@ +/* + * $Id$ + */ + /* * Harbour Project source code: - * Implements a minimal editor class, could/should be used as a base for Memoedit() and, maybe, debugger. + * Editor Class (base for Memoedit(), debugger, etc.) * - * Copyright 2000 - Maurilio Longo + * Copyright 2000 Maurilio Longo * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -31,7 +35,6 @@ /* TODO: Very minimal and little tested. To finish and refine */ - #include "hbclass.ch" #include "error.ch" #include "fileio.ch" @@ -452,16 +455,3 @@ METHOD Edit() CLASS TEditor enddo return Self - - -/* TODO: MemoEdit() is not compatible with clipper one. Needs a lot more work to become */ -function MemoEdit(cString, nTop, nLeft, nBottom, nRight, lEditMode, cUserFunction, nLineLength, nTabSize, nTextBufferRow, nTextBufferColumn, nWindowRow, nWindowColumn) - - LOCAL oEd - - oEd := TEditor():New(cString, nTop, nLeft, nBottom, nRight, lEditMode) - oEd:RefreshWindow() - oEd:Edit() - -return cString -