*** empty log message ***

This commit is contained in:
Paul Tucker
1999-09-08 09:26:44 +00:00
parent 92fbc28a10
commit 87990232c8
5 changed files with 79 additions and 67 deletions

View File

@@ -1,3 +1,19 @@
19990908-05:05 EDT Paul Tucker <ptucker@sympatico.ca>
* source/rtl/inkey.c
- remove extra #define INCL_DOSPROCESS
+ add #define INCL_NOPMAPI
* source/rtl/gtapi.c
simplified hb_gtScroll() to a function call.
The code from this function was moved to gt/gtdos.c hb_gt_scroll()
I currently can't compile a dos version so need a tester!
* source/rtl/gt/gtos2.c
- remove #define INCL_KBD since no keyboard functions are used
+ add #define INCL_NOPMAPI since PMAPI is not needed.
* source/rtl/gt/gtdos.c
* active hb_gt_scroll source.
needs test.
* most of this reported by Chen Kedem <niki@actcom.co.il>
19990908-03:05 EDT Paul Tucker <ptucker@sympatico.ca>
* source/rtl/gt/gtos2.c
+ hb_gt_scroll by Chen Kedem <niki@actcom.co.il>

View File

@@ -455,6 +455,62 @@ char hb_gt_Row(void)
#endif
}
void hb_gt_Scroll( char cTop, char cLeft, char cBottom, char cRight, char attribute, char vert, char horiz )
{
USHORT uiRow, uiCol, uiSize;
int iLength = ( uiRight - uiLeft ) + 1;
int iCount, iColOld, iColNew, iColSize;
hb_gtGetPos( &uiRow, &uiCol );
if( hb_gtRectSize( uiTop, uiLeft, uiBottom, uiRight, &uiSize ) == 0 )
{
char * fpBlank = ( char * ) hb_xgrab( iLength );
char * fpBuff = ( char * ) hb_xgrab( iLength * 2 );
if( fpBlank && fpBuff )
{
memset( fpBlank, ' ', iLength );
iColOld = iColNew = uiLeft;
if( iCols >= 0 )
{
iColOld += iCols;
iColSize = uiRight - uiLeft;
iColSize -= iCols;
}
else
{
iColNew -= iCols;
iColSize = uiRight - uiLeft;
iColSize += iCols;
}
for( iCount = ( iRows >= 0 ? uiTop : uiBottom );
( iRows >= 0 ? iCount <= uiBottom : iCount >= uiTop );
( iRows >= 0 ? iCount++ : iCount-- ) )
{
int iRowPos = iCount + iRows;
/* Blank the scroll region in the current row */
hb_gt_Puts( iCount, uiLeft, attr, fpBlank, iLength );
if( ( iRows || iCols ) && iRowPos <= uiBottom && iRowPos >= uiTop )
{
/* Read the text to be scrolled into the current row */
hb_gt_GetText( iRowPos, iColOld, iRowPos, iColOld + iColSize, fpBuff );
/* Write the scrolled text to the current row */
hb_gt_PutText ( iCount, iColNew, iCount, iColNew + iColSize, fpBuff );
}
}
}
if( fpBlank ) hb_xfree( fpBlank );
if( fpBuff ) hb_xfree( fpBuff );
}
hb_gtSetPos( uiRow, uiCol );
}
void hb_gt_DispBegin(void)
{
/* ptucker */

View File

@@ -11,9 +11,8 @@
* User programs should never call this layer directly!
*/
#define INCL_KBD
#define INCL_VIO
#define INCL_DOSPROCESS
#define INCL_NOPMAPI
#include <string.h>
#include <os2.h>

View File

@@ -691,6 +691,8 @@ int hb_gtWrite( char * fpStr, ULONG length )
char attr = s_Color[ s_uiColorIndex ] & 0xff,
*fpPointer = fpStr;
/* TODO: this is doing more work than needed */
/* Determine where the cursor is going to end up */
iRow = s_uiCurrentRow;
iCol = s_uiCurrentCol;
@@ -700,7 +702,7 @@ int hb_gtWrite( char * fpStr, ULONG length )
length = ( length < iMaxCol-iCol+1 ) ? length : iMaxCol - iCol + 1;
size = length;
#ifndef HARBOUR_USE_WIN_GTAPI
if( iCol + size > iMaxCol )
{
/* Calculate eventual row position and the remainder size for the column adjust */
@@ -741,17 +743,13 @@ int hb_gtWrite( char * fpStr, ULONG length )
iRow = iMaxRow;
}
else size = length;
#endif
/* Now the text string can be displayed */
hb_gt_Puts( s_uiCurrentRow, s_uiCurrentCol, attr, fpPointer, size );
#ifdef HARBOUR_USE_WIN_GTAPI
/* yeah yeah, looks weird */
hb_gtSetPos( iRow, iCol + size );
#else
/* Finally, save the new cursor position */
hb_gtSetPos( iRow, iCol );
#endif
return 0;
}
@@ -855,64 +853,7 @@ 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
hb_gt_Scroll( uiTop, uiLeft, uiBottom, uiRight, s_Color[ s_uiColorIndex ], iRows, iCols );
#else
USHORT uiRow = s_uiCurrentRow, uiCol = s_uiCurrentCol, uiSize;
int iLength = ( uiRight - uiLeft ) + 1;
int iCount, iColOld, iColNew, iColSize;
if( hb_gtRectSize( uiTop, uiLeft, uiBottom, uiRight, &uiSize ) == 0 )
{
char * fpBlank = ( char * ) hb_xgrab( iLength );
char * fpBuff = ( char * ) hb_xgrab( iLength * 2 );
if( fpBlank && fpBuff )
{
char attr = s_Color[ s_uiColorIndex ] & 0xff;
memset( fpBlank, ' ', iLength );
iColOld = iColNew = uiLeft;
if( iCols >= 0 )
{
iColOld += iCols;
iColSize = uiRight - uiLeft;
iColSize -= iCols;
}
else
{
iColNew -= iCols;
iColSize = uiRight - uiLeft;
iColSize += iCols;
}
for( iCount = ( iRows >= 0 ? uiTop : uiBottom );
( iRows >= 0 ? iCount <= uiBottom : iCount >= uiTop );
( iRows >= 0 ? iCount++ : iCount-- ) )
{
int iRowPos = iCount + iRows;
/* Blank the scroll region in the current row */
hb_gt_Puts( iCount, uiLeft, attr, fpBlank, iLength );
if( ( iRows || iCols ) && iRowPos <= uiBottom && iRowPos >= uiTop )
{
/* Read the text to be scrolled into the current row */
hb_gt_GetText( iRowPos, iColOld, iRowPos, iColOld + iColSize, fpBuff );
/* Write the scrolled text to the current row */
hb_gt_PutText ( iCount, iColNew, iCount, iColNew + iColSize, fpBuff );
}
}
}
if( fpBlank ) hb_xfree( fpBlank );
if( fpBuff ) hb_xfree( fpBuff );
}
s_uiCurrentRow = uiRow;
s_uiCurrentCol = uiCol;
#endif
return 0;
}

View File

@@ -52,6 +52,7 @@
*/
#ifdef __IBMCPP__
#define INCL_DOSPROCESS
#define INCL_NOPMAPI
#endif
#include "extend.h"
@@ -70,7 +71,6 @@
#elif defined(HARBOUR_GCC_OS2)
#include <stdlib.h>
#elif defined(__IBMCPP__)
#define INCL_DOSPROCESS
#include <bsedos.h>
#include <conio.h>
#elif defined(__CYGWIN__)