2012-11-25 16:40 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/hbgt/*.c
    * comment cleanup

  * src/rtl/menuto.prg
    + avoided one macro usage when dealing with colors
    ! fixed handling of color specified in __ATPROMPT()
    ! fixed to not mess up default color in certain cases
    * changed misleading color variable names

  * tests/menutest.prg
    * modified to test __ATPROMPT() color

  * src/rtl/tclass.prg
  * src/rtl/tobject.prg
    * avoid using "&" in comments
This commit is contained in:
Viktor Szakats
2012-11-25 15:42:32 +00:00
parent 97ddb8476f
commit 9fe99a603c
23 changed files with 86 additions and 129 deletions

View File

@@ -10,6 +10,23 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2012-11-25 16:40 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbgt/*.c
* comment cleanup
* src/rtl/menuto.prg
+ avoided one macro usage when dealing with colors
! fixed handling of color specified in __ATPROMPT()
! fixed to not mess up default color in certain cases
* changed misleading color variable names
* tests/menutest.prg
* modified to test __ATPROMPT() color
* src/rtl/tclass.prg
* src/rtl/tobject.prg
* avoid using "&" in comments
2012-11-25 01:29 UTC+0100 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/pkg_dynl.hbm
% do not override workdir for 3rd party projects.

View File

@@ -7,8 +7,6 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
*
* This is an original work by Andy Leighton and is placed in the
* public domain.

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -35,5 +32,5 @@ HB_FUNC( GT_ASCPOS )
/* character in string */
}
else
hb_retni( -1 ); /* parameter mismatch - error -1 */
hb_retni( -1 );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -37,11 +34,11 @@ HB_FUNC( GT_ATDIFF )
for( pos = 1; ( pos <= len ) && ( *s1 == *s2 ); s2++, s1++ )
pos++;
if( pos > len ) /* strings match exactly!!! */
if( pos > len ) /* strings match exactly!!! */
hb_retns( 0 );
else
hb_retns( pos );
}
else
hb_retns( -1 ); /* parameter mismatch - error -1 */
hb_retns( -1 );
}

View File

@@ -5,10 +5,7 @@
/*
* Author....: Dave Pearson
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Dave Pearson
* Date......: 31/03/93
* Revision..: 1.0
* Date......: 1993.03.31
*
* This is an original work by Dave Pearson and is placed in the public
* domain.
@@ -138,5 +135,6 @@ HB_FUNC( GT_ISFLAG )
FlagStatus = FlagString[ BytePointer ] & ( 1 << ( BitPointer - 1 ) );
}
}
hb_retl( FlagStatus );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 24/05/93
* Revision..: 1.00
* Date......: 1993.05.24
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -27,7 +24,7 @@ HB_FUNC( GT_CHAREVEN )
HB_ISIZ len = hb_parclen( 1 );
HB_ISIZ i;
s2 = ( char * ) hb_xgrab( len / 2 + 1 ); /* grab us some mem to work with */
s2 = ( char * ) hb_xgrab( len / 2 + 1 ); /* grab us some mem to work with */
for( i = 1; i <= len; i += 2 )
s2[ ( i - 1 ) / 2 ] = s1[ i ] & 0x7f;
@@ -35,5 +32,5 @@ HB_FUNC( GT_CHAREVEN )
hb_retclen_buffer( s2, len / 2 );
}
else
hb_retc_null(); /* parameter mismatch - error NullStr */
hb_retc_null();
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 24/05/93
* Revision..: 1.00
* Date......: 1993.05.24
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -29,7 +26,7 @@ HB_FUNC( GT_CHARMIX )
char * s3;
HB_ISIZ i, pos3 = 0;
s3 = ( char * ) hb_xgrab( l1 + l2 + 1 ); /* grab us some mem to work with */
s3 = ( char * ) hb_xgrab( l1 + l2 + 1 ); /* grab us some mem to work with */
for( i = 0; i < l1; i++ )
{
@@ -47,5 +44,5 @@ HB_FUNC( GT_CHARMIX )
hb_retclen_buffer( s3, l1 + l2 );
}
else
hb_retc_null(); /* parameter mismatch - error NullStr */
hb_retc_null();
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 24/05/93
* Revision..: 1.00
* Date......: 1993.05.24
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -27,7 +24,7 @@ HB_FUNC( GT_CHARODD )
HB_ISIZ len = hb_parclen( 1 );
HB_ISIZ i;
s2 = ( char * ) hb_xgrab( len / 2 + 1 ); /* grab us some mem to work with */
s2 = ( char * ) hb_xgrab( len / 2 + 1 ); /* grab us some mem to work with */
for( i = 0; i <= len; i += 2 )
s2[ i / 2 ] = s1[ i ] & 0x7f;
@@ -35,5 +32,5 @@ HB_FUNC( GT_CHARODD )
hb_retclen_buffer( s2, len / 2 );
}
else
hb_retc_null(); /* parameter mismatch - error NullStr */
hb_retc_null();
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -34,8 +31,8 @@ HB_FUNC( GT_CHRCOUNT )
count++;
/* increment counter */
hb_retns( count ); /* return result */
hb_retns( count );
}
else
hb_retns( -1 ); /* parameter mismatch - error -1 */
hb_retns( -1 );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -34,6 +31,7 @@ HB_FUNC( GT_CHRFIRST )
{
for( p2 = 0; ( p2 < l2 ) && ( cset[ p2 ] != string[ p1 ] ); ++p2 )
;
if( p2 < l2 )
{
hb_retni( string[ p1 ] );
@@ -46,5 +44,5 @@ HB_FUNC( GT_CHRFIRST )
hb_retni( 0 );
}
else
hb_retni( -1 ); /* parameter mismatch - error NullStr */
hb_retni( -1 );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -31,11 +28,10 @@ HB_FUNC( GT_CHRTOTAL )
for( count = 0, p2 = 0; p2 < l2; p2++ )
for( p1 = 0; p1 < l1; p1++ )
if( s1[ p1 ] == s2[ p2 ] )
count++;
/* increment counter */
count++; /* increment counter */
hb_retns( count ); /* return result */
hb_retns( count );
}
else
hb_retns( -1 ); /* parameter mismatch - error -1 */
hb_retns( -1 );
}

View File

@@ -2,12 +2,12 @@
* $Id$
*/
/*****************************************************************************
* Function: _GT_Internal_StringAsInt() *
* Syntax..: int _GT_Internal_StringAsInt(char *String, int Start, int End) *
* Usage...: Convert a numeric value in a string to an int value. *
* By......: David A Pearson *
*****************************************************************************/
/***
* Function: _GT_Internal_StringAsInt()
* Syntax..: int _GT_Internal_StringAsInt(char *String, int Start, int End)
* Usage...: Convert a numeric value in a string to an int value.
* By......: David A Pearson
*/
#include "hbapi.h"
@@ -23,8 +23,8 @@ int _GT_Internal_StringAsInt( char * String, HB_ISIZ Start, HB_ISIZ End )
{
if( HB_ISDIGIT( String[ Digit ] ) )
{
Value += ( String[ Digit ] - 0x30 ) * Decimal;
Decimal *= 0xA;
Value += ( String[ Digit ] - '0' ) * Decimal;
Decimal *= 10;
}
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -46,8 +43,8 @@ HB_FUNC( GT_STRCOUNT )
count++;
}
hb_retns( count ); /* return result */
hb_retns( count );
}
else
hb_retns( -1 ); /* parameter mismatch - error -1 */
hb_retns( -1 );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -39,5 +36,5 @@ HB_FUNC( GT_STRCSPN )
hb_retns( p1 );
}
else
hb_retns( -1 ); /* parameter mismatch - error -1 */
hb_retns( -1 );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 24/05/93
* Revision..: 1.00
* Date......: 1993.05.24
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -37,11 +34,11 @@ HB_FUNC( GT_STRDIFF )
for( pos = 1; ( pos <= len ) && ( *s1 == *s2 ); s2++, s1++ )
pos++;
if( pos > len ) /* strings match exactly!!! */
if( pos > len ) /* strings match exactly!!! */
hb_retc_null();
else
hb_retc( s2 );
}
else
hb_ret(); /* parameter mismatch - error return NIL */
hb_ret();
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 24/05/93
* Revision..: 1.00
* Date......: 1993.05.24
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -33,7 +30,7 @@ HB_FUNC( GT_STREXPAND )
if( HB_ISCHAR( 3 ) )
insert = hb_parc( 3 );
out = ( char * ) hb_xgrab( len * ( nIns + 1 ) ); /* alloc us some memory */
out = ( char * ) hb_xgrab( len * ( nIns + 1 ) ); /* grab us some mem to work with */
for( i = 0, p = 0; i < len; i++ ) /* loop thru input */
{
@@ -45,10 +42,10 @@ HB_FUNC( GT_STREXPAND )
out[ p++ ] = insert[ 0 ];
}
}
out[ p ] = '\0'; /* Add terminating NUL */
out[ p ] = '\0'; /* Add terminating NUL */
hb_retc_buffer( out );
}
else
hb_retc_null(); /* parameter mismatch - error NullStr */
hb_retc_null();
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -39,5 +36,5 @@ HB_FUNC( GT_STRLEFT )
hb_retns( p1 );
}
else
hb_retns( -1 ); /* parameter mismatch - error NullStr */
hb_retns( -1 );
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -34,6 +31,7 @@ HB_FUNC( GT_STRPBRK )
{
for( p2 = 0; ( p2 < l2 ) && ( cset[ p2 ] != string[ p1 ] ); ++p2 )
;
if( p2 < l2 )
{
hb_retc( string + p1 );
@@ -46,5 +44,5 @@ HB_FUNC( GT_STRPBRK )
hb_retc_null();
}
else
hb_retc_null(); /* parameter mismatch - error NullStr */
hb_retc_null();
}

View File

@@ -7,10 +7,7 @@
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Net/Node..: 050/069
* User Name.: Andy Leighton
* Date......: 23/05/93
* Revision..: 1.00
* Date......: 1993.05.23
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
@@ -39,5 +36,5 @@ HB_FUNC( GT_STRRIGHT )
hb_retns( l1 - p1 - 1 );
}
else
hb_retns( -1 ); /* parameter mismatch - error NullStr */
hb_retns( -1 );
}

View File

@@ -18,8 +18,6 @@
#include "hbmemvar.ch"
#include "setcurs.ch"
#xtranslate COLORARRAY( <x> ) => &( '{"' + StrTran( <x>, ',', '","' ) + '"}' )
THREAD STATIC t_aLevel := {}
THREAD STATIC t_nPointer := 1
@@ -67,9 +65,9 @@ FUNCTION __MenuTo( bBlock, cVariable )
#endif
LOCAL nPointer
LOCAL aColor
LOCAL cBackColor
LOCAL cFrontColor
LOCAL cColor
LOCAL cColorSelect
LOCAL cColorNormal
// Detect if a memvar was passed
lDeclared := ! __mvExist( cVariable )
@@ -113,7 +111,6 @@ FUNCTION __MenuTo( bBlock, cVariable )
lMsgCenter := Set( _SET_MCENTER )
lExit := .F.
DO WHILE n != 0
// should we display messages?
@@ -143,29 +140,20 @@ FUNCTION __MenuTo( bBlock, cVariable )
// save the current row
q := n
IF t_aLevel[ t_nPointer - 1, n, 5 ] != NIL
aColor := COLORARRAY( t_aLevel[ t_nPointer - 1, n, 5 ] )
cFrontColor := iif( Empty( aColor[ 1 ] ), NIL, aColor[ 1 ] )
cBackColor := iif( Len( aColor ) > 1, aColor[ 2 ], NIL )
ENDIF
cColor := t_aLevel[ t_nPointer - 1, n, 5 ]
cColorNormal := hb_ColorIndex( iif( Empty( hb_ColorIndex( cColor, CLR_STANDARD ) ), SetColor(), cColor ), CLR_STANDARD )
IF Set( _SET_INTENSITY )
IF cBackColor == NIL // Only select Color Enhace if no color was passed
ColorSelect( CLR_ENHANCED )
ENDIF
cColorSelect := hb_ColorIndex( iif( Empty( hb_ColorIndex( cColor, CLR_ENHANCED ) ), SetColor(), cColor ), CLR_ENHANCED )
ELSE
cColorSelect := cColorNormal
ENDIF
// highlight the prompt
DispOutAt( t_aLevel[ nPointer - 1, n, 1 ], ;
DispOutAt( ;
t_aLevel[ nPointer - 1, n, 1 ], ;
t_aLevel[ nPointer - 1, n, 2 ], ;
t_aLevel[ nPointer - 1, n, 3 ], ;
cBackColor )
IF Set( _SET_INTENSITY )
IF cFrontColor == NIL // Only select Color Enhace if no color was passed
ColorSelect( CLR_STANDARD )
ENDIF
ENDIF
cColorSelect )
IF lExit
EXIT
@@ -254,7 +242,7 @@ FUNCTION __MenuTo( bBlock, cVariable )
t_aLevel[ nPointer - 1, q, 1 ], ;
t_aLevel[ nPointer - 1, q, 2 ], ;
t_aLevel[ nPointer - 1, q, 3 ], ;
cFrontColor )
cColorNormal )
ENDIF
ENDDO
@@ -263,7 +251,7 @@ FUNCTION __MenuTo( bBlock, cVariable )
SetCursor( nSaveCursor )
t_nPointer := nPointer
t_nPointer --
t_nPointer--
ASize( t_aLevel, t_nPointer - 1 )
ENDIF

View File

@@ -54,7 +54,7 @@
* The following parts are Copyright of the individual authors.
* www - http://harbour-project.org
*
* Copyright 2000 J. Lefebvre <jfl@mafact.com> & RA. Cuylen <rac@mafact.com>
* Copyright 2000 J. Lefebvre <jfl@mafact.com> and RA. Cuylen <rac@mafact.com>
* Multiple inheritance
* Support shared class DATA
* scoping (hidden, protected, readOnly)

View File

@@ -6,7 +6,7 @@
* Harbour Project source code:
* Base Object from which all object finally inherit
*
* Copyright 2000 J. Lefebvre <jfl@mafact.com> & RA. Cuylen <rac@mafact.com>
* Copyright 2000 J. Lefebvre <jfl@mafact.com> and RA. Cuylen <rac@mafact.com>
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -19,7 +19,7 @@ PROCEDURE Main()
CLS
@ 1, 10 PROMPT "Menu Item 1" MESSAGE "Menu Message 1"
@ 2, 10 PROMPT "Menu Item 2" MESSAGE "Menu Message 2"
__AtPrompt( 2, 10, "Menu Item 2", "Menu Message 2", "R+/GR, GR+/N" )
@ 3, 10 PROMPT "Menu Item 3" MESSAGE "Menu Message 3"
@ 4, 10 PROMPT "Menu Item 4" MESSAGE "Menu Message 4"