diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cad9c5b669..6854e82608 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,20 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-02-13 21:56 UTC+0100 Viktor Szakats + + * souce/rtl/gtapi.c + ! hb_gtSetColorStr() removed one suspicious assigment which + showed incompatible with CA-Cl*pper, whete CLR_UNSELECTED + was made equal to CLR_ENHANCED if missing from the color string. + * Using CLR_ constants instead of literals. + + * source/rtl/tget.prg + ! :ColorSpec() method unselected color defaulting fixed. + + * source/compiler/hbusage.c + * Bumped year to 2004. + 2004-02-12 13:42 UTC-0800 Luis Krause Mantilla * hrbdll.bc + added missing references diff --git a/harbour/source/compiler/hbusage.c b/harbour/source/compiler/hbusage.c index 8545b93586..a65ba44cac 100644 --- a/harbour/source/compiler/hbusage.c +++ b/harbour/source/compiler/hbusage.c @@ -187,5 +187,5 @@ void hb_compPrintLogo( void ) { printf( "Harbour Compiler Alpha build %d.%d (%s)\n", HB_VER_MINOR, HB_VER_REVISION, HB_VER_LEX ); - printf( "Copyright 1999-2003, http://www.harbour-project.org/\n" ); + printf( "Copyright 1999-2004, http://www.harbour-project.org/\n" ); } diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 82ce7aabba..0f384cb079 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -179,13 +179,15 @@ USHORT hb_gtBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, BYTE * pbyFra short [vszakats] */ cPadChar = ' '; - if( pbyFrame ) - { - for( tmp = 0; *pbyFrame && tmp < 9; tmp++ ) - cPadChar = szBox[ tmp ] = *pbyFrame++; - } - else - tmp = 0; + + if( pbyFrame ) + { + for( tmp = 0; *pbyFrame && tmp < 9; tmp++ ) + cPadChar = szBox[ tmp ] = *pbyFrame++; + } + else + tmp = 0; + while( tmp < 8 ) szBox[ tmp++ ] = cPadChar; szBox[ tmp ] = '\0'; @@ -506,11 +508,11 @@ USHORT hb_gtSetColorStr( char * szColorString ) if( *szColorString == '\0' ) { - s_pColor[ 0 ] = 0x07; - s_pColor[ 1 ] = 0x70; - s_pColor[ 2 ] = 0; - s_pColor[ 3 ] = 0; - s_pColor[ 4 ] = 0x07; + s_pColor[ HB_CLR_STANDARD ] = 0x07; + s_pColor[ HB_CLR_ENHANCED ] = 0x70; + s_pColor[ HB_CLR_BORDER ] = 0; + s_pColor[ HB_CLR_BACKGROUND ] = 0; + s_pColor[ HB_CLR_UNSELECTED ] = 0x07; } do @@ -600,14 +602,18 @@ USHORT hb_gtSetColorStr( char * szColorString ) break; case ',': case '\0': - if( ! nCount ) + + if( nCount == 0 ) nFore = s_pColor[ nPos ]; + nCount = -1; + if( nPos == s_uiColorCount ) { s_pColor = ( int * ) hb_xrealloc( s_pColor, sizeof( int ) * ( nPos + 1 ) ); ++s_uiColorCount; } + if( bHasX ) nFore &= 0x88F8; @@ -643,8 +649,18 @@ USHORT hb_gtSetColorStr( char * szColorString ) } while( c ); - if( nPos > 0 && nPos < 4 ) - s_pColor[ 4 ] = s_pColor[ 1 ]; + /* NOTE: Commented out because no test could reveal that + CA-Clipper is actually doing such assignment. + Moreover this feature sometimes caused + incompatibilies in color usage (discovered when + using incompletely specified color strings with + GETs. [vszakats] + Originally added by ptucker at version 1.31 */ + + /* + if( nPos >= 1 && nPos <= 3 ) + s_pColor[ HB_CLR_UNSELECTED ] = s_pColor[ HB_CLR_ENHANCED ]; + */ s_uiColorIndex = HB_CLR_STANDARD; /* hb_gtColorSelect( HB_CLR_STANDARD ); */ diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 2b5fa76347..b18afe36fb 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -121,9 +121,9 @@ CLASS Get MESSAGE _Assign METHOD Assign() #endif METHOD HitTest(mrow,mcol) - METHOD Block( bBlock ) SETGET // Replace to DATA Block - METHOD ColorSpec( cColorSpec ) SETGET // Replace to DATA ColorSpec - METHOD Picture( cPicture ) SETGET // Replace to DATA Picture + METHOD Block( bBlock ) SETGET // Replace to DATA bBlock + METHOD ColorSpec( cColorSpec ) SETGET // Replace to DATA cColorSpec + METHOD Picture( cPicture ) SETGET // Replace to DATA cPicture METHOD Display( lForced ) METHOD ColorDisp( cColorSpec ) INLINE ::ColorSpec := cColorSpec, ::Display(), Self METHOD KillFocus() @@ -387,10 +387,10 @@ METHOD Display( lForced ) CLASS Get if xBuffer != NIL .and. ( lForced .or. ( ::nDispPos != ::nOldPos ) ) DispOutAt( ::Row, ::Col + if( ::cDelimit == NIL, 0, 1 ),; Substr( xBuffer, ::nDispPos, ::nDispLen ), ; - hb_ColorIndex( ::ColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) + hb_ColorIndex( ::cColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) if ! ( ::cDelimit == NIL ) - DispOutAt( ::Row, ::Col, Substr( ::cDelimit, 1, 1), hb_ColorIndex( ::ColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) - DispOutAt( ::Row, ::Col + ::nDispLen + 1, Substr( ::cDelimit, 2, 1), hb_ColorIndex( ::ColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) + DispOutAt( ::Row, ::Col, Left( ::cDelimit, 1 ), hb_ColorIndex( ::cColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) + DispOutAt( ::Row, ::Col + ::nDispLen + 1, Substr( ::cDelimit, 2, 1 ), hb_ColorIndex( ::cColorSpec, iif( ::HasFocus, GET_CLR_ENHANCED, GET_CLR_UNSELECTED ) ) ) endif endif @@ -1480,13 +1480,13 @@ METHOD ColorSpec( cColorSpec ) CLASS Get cClrUnSel := iif( !Empty( hb_ColorIndex( cColorSpec, GET_CLR_UNSELECTED ) ),; hb_ColorIndex( cColorSpec, GET_CLR_UNSELECTED ),; - hb_ColorIndex( SetColor(), GET_CLR_UNSELECTED ) ) + hb_ColorIndex( SetColor(), CLR_UNSELECTED ) ) cClrEnh := iif( !Empty( hb_ColorIndex( cColorSpec, GET_CLR_ENHANCED ) ),; hb_ColorIndex( cColorSpec, GET_CLR_ENHANCED ),; cClrUnSel ) - ::cColorSpec := cClrUnSel + " , " + cClrEnh + ::cColorSpec := cClrUnSel + ", " + cClrEnh endif @@ -1549,13 +1549,16 @@ return ::bBlock //---------------------------------------------------------------------------// METHOD HitTest(mrow,mcol) CLASS GET - if ::row != mrow - return HTNOWHERE - endif - if mcol >= ::col .and. mcol <= ::col+::ndispLen+if( ::cDelimit == NIL, 0, 2 ) - return HTCLIENT - endif -return HTNOWHERE + + if ::row != mrow + return HTNOWHERE + endif + + if mcol >= ::col .and. mcol <= ::col+::ndispLen+if( ::cDelimit == NIL, 0, 2 ) + return HTCLIENT + endif + + return HTNOWHERE //---------------------------------------------------------------------------// @@ -1579,7 +1582,7 @@ METHOD FirstEditable( ) CLASS GET ::TypeOut := .t. - Return 0 + Return 0 //---------------------------------------------------------------------------// @@ -1599,7 +1602,7 @@ METHOD LastEditable( ) CLASS GET ::TypeOut := .t. - Return 0 + Return 0 //---------------------------------------------------------------------------// @@ -1623,6 +1626,6 @@ STATIC FUNCTION IsBadDate( cBuffer, cPicFunc ) Endif Next - return .f. + return .f. //---------------------------------------------------------------------------//