2012-11-23 19:10 UTC+0300 Pavel Tsarenko (tpe2 at mail.ru)

* contrib/hbct/screen1.c
    * added codepage translation in ScreenMix and SayScreen functions
  * contrib/hbmisc/numtxtru.prg
    * small enhacement
This commit is contained in:
Pavel Tsarenko
2012-11-23 17:11:16 +00:00
parent bd3dbbac9f
commit 6ab095d54a
3 changed files with 31 additions and 14 deletions

View File

@@ -10,6 +10,12 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2012-11-23 19:10 UTC+0300 Pavel Tsarenko (tpe2 at mail.ru)
* contrib/hbct/screen1.c
* added codepage translation in ScreenMix and SayScreen functions
* contrib/hbmisc/numtxtru.prg
* small enhacement
2012-11-23 17:46 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/aredit.prg
* contrib/hbnf/popadder.prg

View File

@@ -109,22 +109,30 @@ HB_FUNC( SCREENMIX )
if( iRow >= 0 && iCol >= 0 &&
iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
HB_WCHAR wc;
PHB_CODEPAGE cdp = hb_gtHostCP();
HB_SIZE nIndex = 0;
hb_gtBeginWrite();
i = iCol;
do
for( ;; )
{
if( hb_gtPutChar( iRow, i++, ( HB_UCHAR ) szAttr[ ul ], 0, ( HB_UCHAR ) *szText++ ) != HB_SUCCESS )
if( hb_gtGetChar( iRow, i, &iColor, &bAttr, &usChar ) != HB_SUCCESS )
{
if( ++iRow > hb_gtMaxRow() )
break;
--szText;
++nLen;
i = iCol;
}
else if( ++ul == nAttr )
else if( HB_CDPCHAR_GET( cdp, szText, nLen, &nIndex, &wc ) )
hb_gtPutChar( iRow, i++, ( HB_UCHAR ) szAttr[ ul ], 0, wc );
else
break;
if( ++ul == nAttr )
ul = 0;
}
while( --nLen );
hb_gtEndWrite();
}
}
@@ -150,24 +158,28 @@ HB_FUNC( SAYSCREEN )
if( iRow >= 0 && iCol >= 0 &&
iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() )
{
PHB_CODEPAGE cdp = hb_gtHostCP();
HB_SIZE nIndex = 0;
hb_gtBeginWrite();
i = iCol;
do
for( ;; )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
HB_WCHAR wc;
if( hb_gtGetChar( iRow, i, &iColor, &bAttr, &usChar ) != HB_SUCCESS )
{
if( ++iRow > hb_gtMaxRow() )
break;
++nLen;
i = iCol;
}
else if( HB_CDPCHAR_GET( cdp, szText, nLen, &nIndex, &wc ) )
hb_gtPutChar( iRow, i++, iColor, bAttr, wc );
else
hb_gtPutChar( iRow, i++, iColor, bAttr, ( HB_UCHAR ) *szText++ );
break;
}
while( --nLen );
hb_gtEndWrite();
}
}

View File

@@ -466,8 +466,8 @@ FUNCTION MnyToTxtRU( nValue, cLang, nMode1, nMode2 )
nCent := Round( ( nValue - Int( nValue ) ) * 100, 0 )
nValue := Int( nValue )
cRetVal := MnyToStrRaw( nValue, cLang, aMsg[ NTSR_CURR ], nMode1 ) + " " + ;
MnyToStrRaw( nCent, cLang, aMsg[ NTSR_CENT ], nMode2 )
cRetVal := MnyToStrRaw( nValue, aMsg, aMsg[ NTSR_CURR ], nMode1 ) + " " + ;
MnyToStrRaw( nCent, aMsg, aMsg[ NTSR_CENT ], nMode2 )
RETURN hb_UTF8ToStr( cRetVal )
@@ -492,9 +492,8 @@ FUNCTION DateToTxtRU( dDate, cLang, lWord )
RETURN hb_UTF8ToStr( cRetVal )
STATIC FUNCTION MnyToStrRaw( nValue, cLang, aCur, nMode )
STATIC FUNCTION MnyToStrRaw( nValue, aMsg, aCur, nMode )
LOCAL aMsg := GetLangMsg( cLang )
LOCAL cRetVal
LOCAL cTemp, nTemp
LOCAL lShort := nMode == 2 .OR. nMode == 4