From ba5297a73784dd537a2288577a22ccb0a3d4d4d4 Mon Sep 17 00:00:00 2001 From: Paul Tucker Date: Sun, 1 Aug 1999 04:28:55 +0000 Subject: [PATCH] *** empty log message *** --- harbour/ChangeLog | 6 ++++++ harbour/source/rtl/gt/gtwin.c | 30 ++++++++++++++++++++++++++++++ harbour/source/rtl/gtapi.c | 15 ++++++++++----- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 38e5297cd7..594b9c4c5b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +19990801-00:15 EDT Paul Tucker + * source/rtl/gtapi.c + * hb_gtScroll() - call gtScroll if WIN_GTAPI + * source\rtl\gt\gtapi.c + + gtScroll() Much improved scroll speed -not up to Clipper yet though. + 19990731-23:20 GMT+1 Bruno Cantero * source/rdd/dbcmd.c Forced to link rddsys.prg diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index d2e5e47948..498aa15e7d 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -326,3 +326,33 @@ char gtRow(void) GetConsoleScreenBufferInfo(HOutput, &csbi); return csbi.dwCursorPosition.Y; } + +void gtScroll( char cTop, char cLeft, char cBottom, char cRight, char attribute, char vert, char horiz ) +{ +/* ptucker */ + SMALL_RECT Source, Clip; + COORD Target; + CHAR_INFO FillChar; + + Source.Top = cTop; + Source.Left = cLeft; + Source.Bottom = cBottom; + Source.Right = cRight; + + memcpy( &Clip, &Source, sizeof(Clip) ); + + if( (horiz | vert) == 0 ) + { + Target.Y = cBottom+1; /* set outside the clipping region */ + Target.X = cRight+1; + } + else + { + Target.Y = cTop-vert; + Target.X = cLeft-horiz; + } + FillChar.Char.AsciiChar = ' '; + FillChar.Attributes = (WORD)attribute; + + ScrollConsoleScreenBuffer(HOutput, &Source, &Clip, Target, &FillChar); +} diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 139357e80a..ef612052a4 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -6,6 +6,7 @@ * GTAPI.C: Generic Terminal for Harbour * * Latest mods: + * 1.46 19990801 ptucker simplified hb_gtScroll if WIN_GTAPI * 1.44 19990730 ptucker simplified gtputs and gtSetAttribute * corrected gtGetCursorStyle for !cci.bVisible * return SC_NONE - other cases should be handled @@ -66,8 +67,8 @@ static USHORT s_uiCurrentRow = 0; static USHORT s_uiCurrentCol = 0; static USHORT s_uiDispCount = 0; static USHORT s_uiColorIndex = 0; -static USHORT s_uiMaxCol; -static USHORT s_uiMaxRow; +static USHORT s_uiMaxCol=80; +static USHORT s_uiMaxRow=24; int *_Color; /* masks: 0x0007 Background 0x0070 Foreground @@ -85,8 +86,7 @@ void hb_gtInit(void) _Color = (int *)hb_xgrab(5*sizeof(int)); _ColorCount = 5; gtInit(); - s_uiMaxCol = hb_gtMaxCol(); - s_uiMaxRow = hb_gtMaxRow(); + hb_gtSetMode( 80,50 ); /* though semi-inactive, should be called for now */ hb_gtSetPos( gtRow(), gtCol() ); hb_gtSetColorStr( hb_set.HB_SET_COLOR ); } @@ -563,8 +563,8 @@ int hb_gtSetMode(USHORT uiRows, USHORT uiCols) { HB_SYMBOL_UNUSED( uiRows ); HB_SYMBOL_UNUSED( uiCols ); - s_uiMaxCol = hb_gtMaxCol(); s_uiMaxRow = hb_gtMaxRow(); + s_uiMaxCol = hb_gtMaxCol(); return(0); } @@ -714,6 +714,10 @@ int hb_gtWriteCon(char * fpStr, ULONG length) int hb_gtScroll(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHORT iRows, SHORT iCols) { +#ifdef HARBOUR_USE_WIN_GTAPI + gtScroll( uiTop, uiLeft, uiBottom, uiRight, _Color[s_uiColorIndex], iRows, iCols ); +#else + USHORT uiRow = s_uiCurrentRow, uiCol = s_uiCurrentCol, uiSize; int iLength = (uiRight - uiLeft) + 1; int iCount, iColOld, iColNew, iColSize; @@ -766,6 +770,7 @@ int hb_gtScroll(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SH } s_uiCurrentRow = uiRow; s_uiCurrentCol = uiCol; +#endif return(0); }