Ejemplo n.º 1
0
const char * hb_conSetColor( const char * szColor )
{
   char * szOldColor;

   HB_TRACE( HB_TR_DEBUG, ( "hb_conSetColor(%s)", szColor ) );

   szOldColor = hb_setGetColor();
   hb_gtGetColorStr( szOldColor );

   if( szColor != NULL )
      hb_gtSetColorStr( szColor );

   return szOldColor;
}
Ejemplo n.º 2
0
static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
{
   int iCenter = ( ( hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) ) / 2 ) + 1;
   int iRatio = hb_arrayGetNL( pArray, B_RIGHT ) - hb_arrayGetNL( pArray, B_LEFT ) - 1;
   int iRow;
   int iCols;
   int iMax;
   char szOldColor[ CLR_STRLEN ];
   char * szStr = "        ";
   char szPct[ 5 ];

   hb_gtGetColorStr( szOldColor );
   hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BARCOLOR ) );

   fPercent = ( fPercent < 0 ? 0 : ( fPercent > 1 ? 1 : fPercent ) );
   iCols    = (int) (fPercent * iRatio);

   if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
   {
//    hb_snprintf( szPct, sizeof( szPct ), "%3.0f\%", fPercent * 100 );
      hb_snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 );
      hb_gtWriteAt( (USHORT) hb_arrayGetNL( pArray, B_TOP ),
                    (USHORT) iCenter + 2, (BYTE *) szPct, 4 );
   }

   hb_gtBox( (SHORT) hb_arrayGetNL( pArray, B_TOP ) + 1, (SHORT) hb_arrayGetNL( pArray, B_LEFT ) + 1,
             (SHORT) hb_arrayGetNL( pArray, B_BOTTOM ) - 1, (SHORT) hb_arrayGetNL( pArray, B_RIGHT ) - 1,
             ( BYTE * ) szStr );

   iMax = hb_arrayGetNL( pArray, B_BOTTOM ) - hb_arrayGetNL( pArray, B_TOP ) - 1;
   for( iRow = 1; iRow <= iMax; iRow++ )
   {
      hb_gtRepChar( ( USHORT ) (iRow + hb_arrayGetNL( pArray, B_TOP )),
                    ( USHORT ) (hb_arrayGetNL( pArray, B_LEFT ) + 1),
                    ( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ), ( USHORT ) iCols );
   }

   hb_gtSetColorStr( szOldColor );
}