diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c05f278f0a..6c5ccc9776 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,33 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-07 18:06 UTC+0200 Viktor Szakats (harbour syenar.net) + * src/debug/dbgtinp.prg + * src/debug/dbghelp.prg + * src/debug/dbgtmenu.prg + * src/debug/dbgtmitm.prg + * src/debug/dbgtwin.prg + * src/debug/dbgwa.prg + * contrib/hbtip/tests/tiptest.prg + ! fixed drawing and keyboard handling to be unicode compatible + + * contrib/hbxpp/hbxpp.ch + + added unicode compatible box drawing macros + + * contrib/hbmxml/tests/custom.prg + ! use Chr() instead of using keyboard macro + + * contrib/hbnf/doc/en/setkeys.txt + * contrib/hbnf/doc/en/setlastk.txt + ! use unicode compatible code + + * contrib/hbtip/smtpcli.prg + * contrib/hbtip/thtml.prg + * use string literal instead of chr() call + + * tests/db_brows.prg + ! fixed mistake in a recently added hb_keyChar() check + 2012-10-07 17:25 UTC+0200 Viktor Szakats (harbour syenar.net) * src/debug/debugger.prg ! replaced KEYBOARD cmd unicode compatible call diff --git a/harbour/contrib/hbmxml/tests/custom.prg b/harbour/contrib/hbmxml/tests/custom.prg index 7d6ccfd2ff..226c4950d0 100644 --- a/harbour/contrib/hbmxml/tests/custom.prg +++ b/harbour/contrib/hbmxml/tests/custom.prg @@ -5,7 +5,6 @@ #xtranslate _ENCODE( ) => ( hb_base64encode( hb_serialize( mxmlGetCustom( ) ) ) ) #include "hbmxml.ch" -#include "hbinkey.ch" PROCEDURE main() @@ -116,7 +115,7 @@ FUNCTION whitespace_cb( node, where ) nLevel := 0 ENDIF - RETURN Replicate( Chr( HB_K_TAB ), nLevel ) + RETURN Replicate( Chr( 9 ), nLevel ) ELSEIF where == MXML_WS_AFTER_CLOSE .OR. ; ( ( name == "group".OR. name == "option" .OR. name == "choice" ) .AND. ; diff --git a/harbour/contrib/hbnf/doc/en/setkeys.txt b/harbour/contrib/hbnf/doc/en/setkeys.txt index 3fa6eff8f8..fe9a49bd86 100644 --- a/harbour/contrib/hbnf/doc/en/setkeys.txt +++ b/harbour/contrib/hbnf/doc/en/setkeys.txt @@ -29,12 +29,12 @@ * work. If this makes you uncomfortable, then don't use this function, * you worthless crybaby. * $EXAMPLES$ - * keyboard chr( K_ESC ) + * hb_keyPut( K_ESC ) * - * ? lastkey() // returns 27 + * ? LastKey() // returns 27 * * FT_LastKey( K_F1 ) * - * ? lastkey() // now returns 28 + * ? LastKey() // now returns 28 * $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/setlastk.txt b/harbour/contrib/hbnf/doc/en/setlastk.txt index 3fa6eff8f8..fe9a49bd86 100644 --- a/harbour/contrib/hbnf/doc/en/setlastk.txt +++ b/harbour/contrib/hbnf/doc/en/setlastk.txt @@ -29,12 +29,12 @@ * work. If this makes you uncomfortable, then don't use this function, * you worthless crybaby. * $EXAMPLES$ - * keyboard chr( K_ESC ) + * hb_keyPut( K_ESC ) * - * ? lastkey() // returns 27 + * ? LastKey() // returns 27 * * FT_LastKey( K_F1 ) * - * ? lastkey() // now returns 28 + * ? LastKey() // now returns 28 * $END$ */ diff --git a/harbour/contrib/hbtip/smtpcli.prg b/harbour/contrib/hbtip/smtpcli.prg index 0e3aa07690..c25eec7871 100644 --- a/harbour/contrib/hbtip/smtpcli.prg +++ b/harbour/contrib/hbtip/smtpcli.prg @@ -277,7 +277,7 @@ METHOD SendMail( oTIpMail ) CLASS TIpClientSmtp cTo := oTIpMail:getFieldPart( "To" ) cTo := StrTran( cTo, tip_CRLF() ) cTo := StrTran( cTo, Chr( 9 ) ) - cTo := StrTran( cTo, Chr( 32 ) ) + cTo := StrTran( cTo, " " ) FOR EACH cTo IN hb_regexSplit( ",", cTo ) ::rcpt( cTo ) diff --git a/harbour/contrib/hbtip/tests/tiptest.prg b/harbour/contrib/hbtip/tests/tiptest.prg index 351694f5bf..347af5475d 100644 --- a/harbour/contrib/hbtip/tests/tiptest.prg +++ b/harbour/contrib/hbtip/tests/tiptest.prg @@ -165,10 +165,10 @@ PROCEDURE Terminate() PROCEDURE ShowGauge( nSent, nSize ) - @ 6, 5 SAY "Sending: " + Replicate( Chr( 176 ), 60 ) + @ 6, 5 SAY "Sending: " + Replicate( hb_UTF8ToStr( "░" ), 60 ) /* nSent may be zero */ IF nSent > 0 - @ 6, 14 SAY Replicate( Chr( 219 ), 60 * nSent / nSize ) + @ 6, 14 SAY Replicate( hb_UTF8ToStr( "█" ), 60 * nSent / nSize ) ENDIF RETURN diff --git a/harbour/contrib/hbtip/thtml.prg b/harbour/contrib/hbtip/thtml.prg index 31ca737b3c..162bbd633f 100644 --- a/harbour/contrib/hbtip/thtml.prg +++ b/harbour/contrib/hbtip/thtml.prg @@ -645,7 +645,7 @@ METHOD new( oParent, cTagName, cAttrib, cContent ) CLASS THtmlNode IF HB_ISSTRING( oParent ) // a HTML string is passed -> build new tree of objects IF Chr( 9 ) $ oParent - oParent := StrTran( oParent, Chr( 9 ), Chr( 32 ) ) + oParent := StrTran( oParent, Chr( 9 ), " " ) ENDIF ::root := Self ::htmlTagName := "_root_" diff --git a/harbour/contrib/hbxpp/hbxpp.ch b/harbour/contrib/hbxpp/hbxpp.ch index 20623c82ff..5a47205f7b 100644 --- a/harbour/contrib/hbxpp/hbxpp.ch +++ b/harbour/contrib/hbxpp/hbxpp.ch @@ -87,6 +87,8 @@ #define B_FAT ( Chr( 219 ) + Chr( 219 ) + Chr( 219 ) + Chr( 219 ) + ; Chr( 219 ) + Chr( 219 ) + Chr( 219 ) + Chr( 219 ) ) +#define HB_B_THIN_UNI hb_UTF8ToStrBox( "█▀███▄██" ) +#define HB_B_FAT_UNI hb_UTF8ToStrBox( "████████" ) /* TEXT INTO [WRAP []] [TRIMMED] */ #xcommand TEXT INTO [] [] => ; diff --git a/harbour/src/debug/dbghelp.prg b/harbour/src/debug/dbghelp.prg index b5dc6d110b..2fbe555ce1 100644 --- a/harbour/src/debug/dbghelp.prg +++ b/harbour/src/debug/dbghelp.prg @@ -99,8 +99,8 @@ PROCEDURE __dbgHelp( nTopic ) STATIC PROCEDURE PaintWindow( oDlg, oBrw, aTopics ) hb_dispBox( oDlg:nTop + 1, oDlg:nLeft + 13, oDlg:nBottom - 1, oDlg:nLeft + 13, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAt( oDlg:nTop , oDlg:nLeft + 13 , Chr( 194 ), oDlg:cColor ) - hb_dispOutAt( oDlg:nBottom , oDlg:nLeft + 13 , Chr( 193 ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nTop , oDlg:nLeft + 13, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nBottom , oDlg:nLeft + 13, hb_UTF8ToStrBox( "┴" ), oDlg:cColor ) oBrw:ForceStable() ShowTopic( oDlg, aTopics, oBrw:Cargo, 0 ) // Start on page 1 @@ -259,7 +259,8 @@ STATIC FUNCTION GetTopics() { "Script files", } } aTopics[ 1 ][ 2 ] := ; - { " " + Chr( 24 ) + Chr( 25 ) + " Select help topic.",; + { " " + Chr( 24 ) /* LOW-ASCII "↑" */ + Chr( 25 ) /* LOW-ASCII "↓" */ +; + " Select help topic.",; " PageUp Page help text down.",; " PageDn Page help text down.",; " Esc Returns to debugger." } diff --git a/harbour/src/debug/dbgtinp.prg b/harbour/src/debug/dbgtinp.prg index 7571ea500b..68f6bbc7a8 100644 --- a/harbour/src/debug/dbgtinp.prg +++ b/harbour/src/debug/dbgtinp.prg @@ -196,11 +196,11 @@ METHOD applyKey( nKey ) CLASS HbDbInput Set( _SET_INSERT, !Set( _SET_INSERT ) ) EXIT OTHERWISE - IF nKey >= 32 .AND. nKey <= 255 + IF !( hb_keyChar( nKey ) == "" ) IF Set( _SET_INSERT ) - ::cValue := Left( Stuff( ::cValue, ::nPos, 0, Chr( nKey ) ), ::nSize ) + ::cValue := Left( Stuff( ::cValue, ::nPos, 0, hb_keyChar( nKey ) ), ::nSize ) ELSE - ::cValue := Stuff( ::cValue, ::nPos, 1, Chr( nKey ) ) + ::cValue := Stuff( ::cValue, ::nPos, 1, hb_keyChar( nKey ) ) ENDIF IF ::nPos < ::nSize ::nPos++ diff --git a/harbour/src/debug/dbgtmenu.prg b/harbour/src/debug/dbgtmenu.prg index d29f7f4211..06fde1298c 100644 --- a/harbour/src/debug/dbgtmenu.prg +++ b/harbour/src/debug/dbgtmenu.prg @@ -237,8 +237,8 @@ METHOD Display() CLASS HBDbMenu FOR n := 1 TO Len( ::aItems ) IF ::aItems[ n ]:cPrompt == "-" // Separator - hb_dispOutAt( ::aItems[ n ]:nRow, ::nLeft,; - Chr( 195 ) + Replicate( Chr( 196 ), ::nRight - ::nLeft - 1 ) + Chr( 180 ) ) + hb_dispOutAtBox( ::aItems[ n ]:nRow, ::nLeft,; + hb_UTF8ToStrBox( "├" + Replicate( "─", ::nRight - ::nLeft - 1 ) + "┤" ) ) ELSE ::aItems[ n ]:Display( ::cClrPopup, ::cClrHotKey ) ENDIF @@ -481,9 +481,9 @@ METHOD ProcessKey( nKey ) CLASS HBDbMenu OTHERWISE IF ::nOpenPopup > 0 - IF IsAlpha( Chr( nKey ) ) + IF IsAlpha( hb_keyChar( nKey ) ) oPopup := ::aItems[ ::nOpenPopup ]:bAction - nPopup := oPopup:GetHotKeyPos( Upper( Chr( nKey ) ) ) + nPopup := oPopup:GetHotKeyPos( Upper( hb_keyChar( nKey ) ) ) IF nPopup > 0 .AND. oPopup:nOpenPopup != nPopup oPopup:DeHilite() oPopup:ShowPopup( nPopup ) diff --git a/harbour/src/debug/dbgtmitm.prg b/harbour/src/debug/dbgtmitm.prg index b93c616066..b1a65c2c10 100644 --- a/harbour/src/debug/dbgtmitm.prg +++ b/harbour/src/debug/dbgtmitm.prg @@ -98,6 +98,6 @@ METHOD Display( cClrText, cClrHotKey ) CLASS HBDbMenuItem ( nAt := At( "~", ::cPrompt ) ) - 1,; SubStr( ::cPrompt, nAt + 1, 1 ), cClrHotKey ) - hb_dispOutAt( ::nRow, ::nCol, iif( ::lChecked, Chr( 251 ), "" ), cClrText ) + hb_dispOutAtBox( ::nRow, ::nCol, iif( ::lChecked, hb_UTF8ToStrBox( "√" ), "" ), cClrText ) RETURN Self diff --git a/harbour/src/debug/dbgtwin.prg b/harbour/src/debug/dbgtwin.prg index a75bc355c5..8429095861 100644 --- a/harbour/src/debug/dbgtwin.prg +++ b/harbour/src/debug/dbgtwin.prg @@ -198,7 +198,7 @@ METHOD Refresh() CLASS HBDbWindow DispBegin() hb_dispBox( ::nTop, ::nLeft, ::nBottom, ::nRight, iif( ::lFocused, HB_B_DOUBLE_UNI, HB_B_SINGLE_UNI ), ::cColor ) - hb_dispOutAt( ::nTop, ::nLeft + 1, "[" + Chr( 254 ) + "]", ::cColor ) + hb_dispOutAtBox( ::nTop, ::nLeft + 1, hb_UTF8ToStrBox( "[■]" ), ::cColor ) ::ShowCaption( ::cCaption ) @@ -290,7 +290,7 @@ METHOD Move() Class HBDbWindow DO WHILE .T. RestScreen( ,,,, ::cBackImage ) - hb_dispBox( ::nTop, ::nLeft, ::nRight, ::nBottom, Replicate( Chr( 176 ), 8 ) + " " ) + hb_dispBox( ::nTop, ::nLeft, ::nRight, ::nBottom, Replicate( hb_UTF8ToStrBox( "░" ), 8 ) + " " ) nKey := Inkey( 0 ) @@ -337,7 +337,7 @@ METHOD Move() Class HBDbWindow ENDIF ENDDO - // __Keyboard( Chr( 0 ) ), Inkey() ) + // hb_keyPut( 0 ); Inkey() RETURN NIL diff --git a/harbour/src/debug/dbgwa.prg b/harbour/src/debug/dbgwa.prg index e30842d58f..382c3c3f91 100644 --- a/harbour/src/debug/dbgwa.prg +++ b/harbour/src/debug/dbgwa.prg @@ -177,16 +177,16 @@ STATIC PROCEDURE DlgWorkAreaPaint( oDlg, aBrw ) /* Display separator lines */ hb_dispBox( oDlg:nTop + 1, oDlg:nLeft + 12, oDlg:nBottom - 1, oDlg:nLeft + 12, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAt( oDlg:nTop, oDlg:nLeft + 12, Chr( 194 ), oDlg:cColor ) - hb_dispOutAt( oDlg:nBottom, oDlg:nLeft + 12, Chr( 193 ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nTop, oDlg:nLeft + 12, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nBottom, oDlg:nLeft + 12, hb_UTF8ToStrBox( "┴" ), oDlg:cColor ) hb_dispBox( oDlg:nTop + 1, oDlg:nLeft + 51, oDlg:nBottom - 1, oDlg:nLeft + 51, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAt( oDlg:nTop, oDlg:nLeft + 51, Chr( 194 ), oDlg:cColor ) - hb_dispOutAt( oDlg:nBottom, oDlg:nLeft + 51, Chr( 193 ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nTop, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┬" ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nBottom, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┴" ), oDlg:cColor ) hb_dispBox( oDlg:nTop + 6, oDlg:nLeft + 13, oDlg:nTop + 6, oDlg:nLeft + 50, HB_B_SINGLE_UNI, oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 6, oDlg:nLeft + 12, Chr( 195 ), oDlg:cColor ) - hb_dispOutAt( oDlg:nTop + 6, oDlg:nLeft + 51, Chr( 180 ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nTop + 6, oDlg:nLeft + 12, hb_UTF8ToStrBox( "├" ), oDlg:cColor ) + hb_dispOutAtBox( oDlg:nTop + 6, oDlg:nLeft + 51, hb_UTF8ToStrBox( "┤" ), oDlg:cColor ) /* Display labels */ diff --git a/harbour/tests/db_brows.prg b/harbour/tests/db_brows.prg index 15793e1353..b431810796 100644 --- a/harbour/tests/db_brows.prg +++ b/harbour/tests/db_brows.prg @@ -371,7 +371,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) CASE xkey == K_ENTER .AND. predit < 2 rez := .F. rezproc := xkey - CASE ( xkey == K_ENTER .OR. ! Empty( hb_keyChar( xkey ) ) ) .AND. predit > 1 + CASE ( xkey == K_ENTER .OR. !( hb_keyChar( xkey ) == "" ) ) .AND. predit > 1 fipos := LI_COLPOS + LI_NLEFT - 1 - LI_FREEZE IF LI_WHEN == NIL .OR. Len( LI_WHEN ) < fipos .OR. LI_WHEN[ fipos ] == NIL .OR. Eval( LI_WHEN[ fipos ] ) IF !( ValType( LI_MSED ) == "N" )