From ed4886737a308e0575857f586cbc7c8d95ca8769 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 26 Jul 1999 11:56:37 +0000 Subject: [PATCH] *** empty log message *** --- harbour/ChangeLog | 4 ++++ harbour/source/rtl/gtapi.c | 31 +++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b3ff678f79..5853fa27df 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +19990726-13:20 CET Victor Szel + + source/rtl/gtapi.c + Some minor fixes and corrections mainly to gtBox() + 19990726-12:50 CET Victor Szel + source/rtl/natmsg/msghu.c Error descriptions translated. diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index bbc5b1fd80..1bf0f3b388 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -6,6 +6,11 @@ * GTAPI.C: Generic Terminal for Harbour * * Latest mods: + * 1.40 19990726 vszel Allowing Top > Bottom and Right > Left + * cases again. Clipper allows these, too. + * Cursor positioning fixed to support these cases. + * uMRow renamed to uiMRow + * uMCol renamed to uiMCol * 1.39 19990726 ptucker Position cursor inside top-left corner * after drawing box - compatibility * 1.35 19990726 ptucker Much improved box drawing speed @@ -86,12 +91,18 @@ int hb_gtBox (USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char USHORT uiCol = uiLeft; USHORT height, width, tmp; - USHORT uMRow = hb_gtMaxRow(); - USHORT uMCol = hb_gtMaxCol(); + USHORT uiTopBak = uiTop; + USHORT uiLeftBak = uiLeft; - if (uiTop > uMRow || uiBottom > uMRow || - uiLeft > uMCol || uiRight > uMCol || - uiTop > uiBottom || uiLeft > uiRight) + USHORT uiMRow = hb_gtMaxRow(); + USHORT uiMCol = hb_gtMaxCol(); + + /* TODO: Would be better to support these cases, Clipper implementation */ + /* was quite messy for these cases, which can be considered as */ + /* a bug there. */ + + if ( uiTop > uiMRow || uiBottom > uiMRow || + uiLeft > uiMCol || uiRight > uiMCol ) { return 1; } @@ -161,7 +172,7 @@ int hb_gtBox (USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char hb_gtDispEnd(); - hb_gtSetPos(uiTop + 1, uiLeft + 1); + hb_gtSetPos(uiTopBak + 1, uiLeftBak + 1); return 0; } @@ -469,11 +480,11 @@ int hb_gtPreExt(void) int hb_gtRectSize(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, USHORT * uipBuffSize) { - USHORT uMRow = hb_gtMaxRow(); - USHORT uMCol = hb_gtMaxCol(); + USHORT uiMRow = hb_gtMaxRow(); + USHORT uiMCol = hb_gtMaxCol(); - if( uiTop > uMRow || uiBottom > uMRow || - uiLeft > uMCol || uiRight > uMCol || + if( uiTop > uiMRow || uiBottom > uiMRow || + uiLeft > uiMCol || uiRight > uiMCol || uiTop > uiBottom || uiLeft > uiRight ) { return(1);