diff --git a/harbour/ChangeLog b/harbour/ChangeLog index affe52e371..82dc894e26 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +19990820-16:25 EDT Paul Tucker + * source/rtl/gtapi.c + * account for nesting of gtPre/PostExt and for calling + DispBegin/End while Pre/Post in effect. + 19990820-14:24 EDT Paul Tucker * source/rdd/dbf1.c * casts on sztext diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 451a04feb3..7a074d1da1 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -229,8 +229,13 @@ int hb_gtColorSelect(USHORT uiColorIndex) int hb_gtDispBegin(void) { /* ptucker */ - ++s_uiDispCount; - hb_gt_DispBegin(); + if( s_uiPreCount == 0 ) + { + ++s_uiDispCount; + hb_gt_DispBegin(); + } + else + ++s_uiPreCount; return(0); } @@ -242,8 +247,13 @@ USHORT hb_gtDispCount(void) int hb_gtDispEnd(void) { /* ptucker */ - hb_gt_DispEnd(); - --s_uiDispCount; + if( s_uiPreCount == 0 ) + { + hb_gt_DispEnd(); + --s_uiDispCount; + } + else + ++s_uiPreCount; return(0); } @@ -253,10 +263,16 @@ int hb_gtPreExt(void) /* an external (printf...) write is about to take place */ USHORT uidc; - uidc = s_uiPreCount = s_uiDispCount; + if( s_uiPreCount != 0 ) + { + uidc = s_uiPreCount = s_uiDispCount; - while( uidc-- ) - hb_gtDispEnd(); + while( uidc-- ) + { + hb_gt_DispEnd(); + --s_uiDispCount; + } + } return 0; @@ -268,7 +284,10 @@ int hb_gtPostExt(void) USHORT uidc = s_uiPreCount; while( uidc-- ) - hb_gtDispBegin(); + { + ++s_uiDispCount; + hb_gt_DispBegin(); + } return 0; }