diff --git a/harbour/ChangeLog b/harbour/ChangeLog index aa2817c93a..ea33ead5c7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +19990812-01:45 EDT Paul Tucker + * source/rtl/gt/gtwin.c + * corrections to window sizing between dispbegin buffers - this part + is now working as it should. There is still the problem of + writing past the visible screen boundry which will gpf. + * source/rtl/gtapi.c + * temporarily limit string length in hb_gtwrite (attempting to avoid + above problem) + 19990811-09:01 GMT+3 Alexander Kresin * source/hbpp/hbpp.c * fixed some bugs diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index 147a3a2235..2b12af4b5b 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -42,6 +42,7 @@ static HANDLE HCursor; /* When DispBegin is in effect, all cursor related refer to the currently _active_ buffer which could be different than the one being written to. */ + #define HB_LOG 0 #if (defined(HB_LOG) && (HB_LOG != 0)) @@ -401,7 +402,6 @@ void hb_gt_DispBegin(void) coDest, /* upper-left cell to write data to */ &srWin); /* screen buffer rectangle to read from */ - /* store current handle */ if( HStealth == INVALID_HANDLE_VALUE ) { HStealth = CreateConsoleScreenBuffer( @@ -410,8 +410,6 @@ void hb_gt_DispBegin(void) NULL, /* Security attribute */ CONSOLE_TEXTMODE_BUFFER, /* Type of buffer */ NULL); /* reserved */ - - hb_gt_SetScreenBuffer( HStealth, HOriginal ); } hb_gt_SetScreenBuffer( HStealth, HOutput ); @@ -458,7 +456,8 @@ static BOOL hb_gt_SetScreenBuffer( HANDLE HNew, HANDLE HOld ) srWin.Right = csbi.dwSize.X - 1; SetConsoleScreenBufferSize(HNew, csbi.dwSize); - SetConsoleWindowInfo(HNew, TRUE, &srWin); + SetConsoleWindowInfo(HNew, FALSE, &srWin); + SetConsoleWindowInfo(HNew, TRUE, &csbi.srWindow); return 0; } @@ -524,3 +523,4 @@ void hb_gt_SetBlink( BOOL bBlink ) { bBlink = FALSE; } + diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 4164bdc10b..b2aacfcb2f 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -628,6 +628,9 @@ int hb_gtWrite(char * fpStr, ULONG length) iCol = s_uiCurrentCol; iMaxRow = s_uiMaxRow; iMaxCol = s_uiMaxCol; + + length = ( length < hb_gtMaxCol()-iCol+1 ) ? length : hb_gtMaxCol()-iCol+1; + size = length; if (iCol + size > iMaxCol) {