From 675cbcb5d6def94909eefcd11a9e5de36a4e6655 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 22 Jul 2012 17:39:24 +0000 Subject: [PATCH] 2012-07-22 19:31 UTC+0200 Viktor Szakats (vszakats syenar.net) * contrib/hbgt/doc/en/hbgt.txt * doc/en/gtslang.txt * extras/gfspell/spell.prg * tests/mousetst.prg * tests/testdbf.prg * tests/testrdd2.prg * contrib/hbmisc/numtxthu.prg * contrib/hbqt/tests/wvtqt.prg * contrib/hbxbp/tests/wvtqt.prg * include/hbapigt.h * tests/db_brows.prg * tests/gtchars.prg * tests/tb1.prg * tests/testbrw.prg * tests/wcecon.prg ! fixing high 8-bit chars (using various methods) (finished) ; NOTE: Some sources have been converted to UTF-8, so from now on make sure to use an UTF-8 enabled editor and use only UTF-8 chars when typing non-ASCII (7-bit) characters. --- harbour/ChangeLog | 23 ++++++++++ harbour/contrib/hbgt/doc/en/hbgt.txt | 4 +- harbour/contrib/hbmisc/numtxthu.prg | 20 +++++---- harbour/contrib/hbqt/tests/wvtqt.prg | 6 ++- harbour/contrib/hbxbp/tests/wvtqt.prg | 7 +-- harbour/doc/en/gtslang.txt | 10 ++--- harbour/extras/gfspell/spell.prg | 2 +- harbour/include/hbapigt.h | 30 ++++--------- harbour/tests/db_brows.prg | 24 ++++++----- harbour/tests/gtchars.prg | 22 ++++++---- harbour/tests/mousetst.prg | 61 ++++++++++----------------- harbour/tests/tb1.prg | 27 ++++++------ harbour/tests/testbrw.prg | 10 +++-- harbour/tests/testdbf.prg | 2 +- harbour/tests/testrdd2.prg | 2 +- harbour/tests/wcecon.prg | 12 +++--- 16 files changed, 136 insertions(+), 126 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index df7dc92c69..1b634f5878 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,29 @@ The license applies to all entries newer than 2009-04-28. */ +2012-07-22 19:31 UTC+0200 Viktor Szakats (vszakats syenar.net) + * contrib/hbgt/doc/en/hbgt.txt + * doc/en/gtslang.txt + * extras/gfspell/spell.prg + * tests/mousetst.prg + * tests/testdbf.prg + * tests/testrdd2.prg + * contrib/hbmisc/numtxthu.prg + * contrib/hbqt/tests/wvtqt.prg + * contrib/hbxbp/tests/wvtqt.prg + * include/hbapigt.h + * tests/db_brows.prg + * tests/gtchars.prg + * tests/tb1.prg + * tests/testbrw.prg + * tests/wcecon.prg + ! fixing high 8-bit chars (using various methods) + (finished) + ; NOTE: Some sources have been converted to UTF-8, + so from now on make sure to use an UTF-8 enabled + editor and use only UTF-8 chars when typing + non-ASCII (7-bit) characters. + 2012-07-22 18:46 UTC+0200 Viktor Szakats (vszakats syenar.net) * contrib/hbct/ctnet.c * contrib/hbhpdf/annot.c diff --git a/harbour/contrib/hbgt/doc/en/hbgt.txt b/harbour/contrib/hbgt/doc/en/hbgt.txt index 10196132a3..7c36eab31c 100644 --- a/harbour/contrib/hbgt/doc/en/hbgt.txt +++ b/harbour/contrib/hbgt/doc/en/hbgt.txt @@ -453,7 +453,7 @@ * $EXAMPLES$ * ? gt_strexpand("abc") // prints "a b c" * ? gt_strexpand("abc", 2) // prints "a b c" - * ? gt_strexpand("abc", 2, '') // prints "abc" + * ? gt_strexpand("abc", 2, '|') // prints "a||b||c" * $TESTS$ * $STATUS$ * R @@ -713,5 +713,3 @@ * GT_NEWFLAG() GT_SETFLAG() GT_CLRFLAG() * $END$ */ - - diff --git a/harbour/contrib/hbmisc/numtxthu.prg b/harbour/contrib/hbmisc/numtxthu.prg index 8f89b5ed37..b3da9a6773 100644 --- a/harbour/contrib/hbmisc/numtxthu.prg +++ b/harbour/contrib/hbmisc/numtxthu.prg @@ -50,14 +50,16 @@ * */ +/* UTF-8 */ + FUNCTION NumToTxtHU( nValue ) - LOCAL aTort := { "tized", "szzad", "ezred", "tzezred", "szzezred", "milliomod", "millirdod" } + LOCAL aTort := { "tized", "század", "ezred", "tízezred", "százezred", "milliomod", "milliárdod" } LOCAL cRetVal LOCAL tmp, tmp1, tmp2 IF nValue < 0 nValue := -nValue - cRetVal := "mnusz " + cRetVal := "mínusz " ELSE cRetVal := "" ENDIF @@ -76,16 +78,16 @@ FUNCTION NumToTxtHU( nValue ) tmp1-- ENDDO - cRetVal += " egsz " + NumToTxtRaw( tmp * ( 10 ^ tmp1 ) ) + iif( tmp1 >= 1 .AND. tmp1 <= Len( aTort ), " " + aTort[ tmp1 ], "" ) + cRetVal += " egész " + NumToTxtRaw( tmp * ( 10 ^ tmp1 ) ) + iif( tmp1 >= 1 .AND. tmp1 <= Len( aTort ), " " + aTort[ tmp1 ], "" ) ENDIF - RETURN cRetVal + RETURN hb_UTF8ToStr( cRetVal ) STATIC FUNCTION NumToTxtRaw( nValue ) - LOCAL aEgesz := { "", "ezer" , "milli", "millird", "billi" , "trilli", "kvadrilli", "kvintilli" } // , "szextilli", "szeptilli", "oktilli", "nontilli" } - LOCAL aEgyes := { "", "egy" , "kett" , "hrom" , "ngy" , "t" , "hat" , "ht" , "nyolc" , "kilenc" } - LOCAL aTizes1 := { "", "tz" , "hsz" , "harminc" , "negyven", "tven" , "hatvan" , "hetven" , "nyolcvan" , "kilencven" } - LOCAL aTizes2 := { "", "tizen", "huszon", "harminc" , "negyven", "tven" , "hatvan" , "hetven" , "nyolcvan" , "kilencven" } + LOCAL aEgesz := { "", "ezer" , "millió", "milliárd", "billió" , "trillió", "kvadrillió", "kvintillió" } // , "szextillió", "szeptillió", "oktillió", "nontillió" } + LOCAL aEgyes := { "", "egy" , "kettő" , "három" , "négy" , "öt" , "hat" , "hét" , "nyolc" , "kilenc" } + LOCAL aTizes1 := { "", "tíz" , "húsz" , "harminc" , "negyven", "ötven" , "hatvan" , "hetven" , "nyolcvan" , "kilencven" } + LOCAL aTizes2 := { "", "tizen", "huszon", "harminc" , "negyven", "ötven" , "hatvan" , "hetven" , "nyolcvan" , "kilencven" } LOCAL aDigit LOCAL nLen @@ -108,7 +110,7 @@ STATIC FUNCTION NumToTxtRaw( nValue ) aDigit[ tmp + 2 ] != 0 cValue += iif( Empty( cValue ), "", "-") +; - iif( aDigit[ tmp ] != 0, aEgyes[ aDigit[ tmp ] + 1 ] + "szz", "" ) +; + iif( aDigit[ tmp ] != 0, aEgyes[ aDigit[ tmp ] + 1 ] + "száz", "" ) +; iif( aDigit[ tmp + 2 ] == 0, aTizes1[ aDigit[ tmp + 1 ] + 1 ], aTizes2[ aDigit[ tmp + 1 ] + 1 ] ) +; aEgyes[ aDigit[ tmp + 2 ] + 1 ] +; aEgesz[ ( Int( ( nLen - tmp ) / 3 ) ) + 1 ] diff --git a/harbour/contrib/hbqt/tests/wvtqt.prg b/harbour/contrib/hbqt/tests/wvtqt.prg index e12572dc98..37161cdbc5 100644 --- a/harbour/contrib/hbqt/tests/wvtqt.prg +++ b/harbour/contrib/hbqt/tests/wvtqt.prg @@ -14,6 +14,8 @@ //----------------------------------------------------------------------// //----------------------------------------------------------------------// +/* UTF-8 */ + #include "hbgtinfo.ch" #include "inkey.ch" #include "setcurs.ch" @@ -253,8 +255,8 @@ PROCEDURE thFunc() oBrowse := TBrowse():New( 1, 0, maxrow(), maxcol() ) - oBrowse:ColSep := " " - oBrowse:HeadSep := "" + oBrowse:ColSep := hb_UTF8ToStr( " │ " ) + oBrowse:HeadSep := hb_UTF8ToStr( "─┬─" ) oBrowse:GoTopBlock := {|| dbGoTop() } oBrowse:GoBottomBlock := {|| dbGoBottom() } oBrowse:SkipBlock := {| nSkip | dbSkipBlock( nSkip, oBrowse ) } diff --git a/harbour/contrib/hbxbp/tests/wvtqt.prg b/harbour/contrib/hbxbp/tests/wvtqt.prg index 87f7d993b9..43479b9795 100644 --- a/harbour/contrib/hbxbp/tests/wvtqt.prg +++ b/harbour/contrib/hbxbp/tests/wvtqt.prg @@ -14,6 +14,8 @@ //----------------------------------------------------------------------// //----------------------------------------------------------------------// +/* UTF-8 */ + #include "hbgtinfo.ch" #include "inkey.ch" #include "setcurs.ch" @@ -255,8 +257,8 @@ PROCEDURE thFunc() oBrowse := TBrowse():New( 1, 0, maxrow(), maxcol() ) - oBrowse:ColSep := " " - oBrowse:HeadSep := "" + oBrowse:ColSep := hb_UTF8ToStr( " │ " ) + oBrowse:HeadSep := hb_UTF8ToStr( "─┬─" ) oBrowse:GoTopBlock := { || dbGoTop() } oBrowse:GoBottomBlock := { || dbGoBottom() } oBrowse:SkipBlock := { | nSkip | dbSkipBlock( nSkip, oBrowse ) } @@ -376,4 +378,3 @@ STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd ) RETURN lRet //-------------------------------------------------------------------// - diff --git a/harbour/doc/en/gtslang.txt b/harbour/doc/en/gtslang.txt index 7cb55cd518..b02825e29f 100644 --- a/harbour/doc/en/gtslang.txt +++ b/harbour/doc/en/gtslang.txt @@ -115,16 +115,16 @@ and this can be done from a script which runs a Harbour program. Let's see an example. -Suppose one national language has three national characters : '' which +Suppose one national language has three national characters : 'ĄĆĘ' which correspond to 'ACE' in a lower 128 bytes ASCII table. 'Corresponding' means -that to get a '' nation char one has to press a special keyboard modifier +that to get a 'Ą' nation char one has to press a special keyboard modifier (like ALT+R for example) plus an 'A' char. HRBNATIONCHARS should be defined as : - HRBNATIONCHARS=ACE + HRBNATIONCHARS=AĄCĆEĘ - where A is a first pair, C is a second pair and so on + where AĄ is a first pair, CĆ is a second pair and so on Suppose also we are working on a terminal which does not allow to enter national characters by pressing ALTR+A, ALTR+C, ALTR+E. Because we like @@ -138,7 +138,7 @@ or in other way : HRBNATIONDEADKEY=`echo -ne '\140`' -Now we can enter by pressing ` and then A, by pressing ` and then C, +Now we can enter Ą by pressing ` and then A, Ć by pressing ` and then C, and so on. To get '`' character we need to double press `. diff --git a/harbour/extras/gfspell/spell.prg b/harbour/extras/gfspell/spell.prg index 67b9e4f819..840dd7da41 100644 --- a/harbour/extras/gfspell/spell.prg +++ b/harbour/extras/gfspell/spell.prg @@ -265,7 +265,7 @@ if sp_init() z := fat( cTemp, cBuf,z ) if z < 6 exit - elseif substr(cBuf,z-1,1) < "" + elseif substr(cBuf,z-1,1) < Chr( 128 ) z++ else exit diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 6b25e9acde..199e450895 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -101,28 +101,14 @@ HB_EXTERN_BEGIN #define HB_GT_ATTR_REFRESH 0x80 /* strings for borders (same as box.ch, but defined for use by C) */ - -/* Note. This part will never be used, but is being kept in the source, - so that if you use code page 437, you can see what the line - draw characters are supposed to look like. - 01234567 -#define _B_SINGLE "Ŀ" -#define _B_DOUBLE "ͻȺ" -#define _B_SINGLE_DOUBLE "ķӺ" -#define _B_DOUBLE_SINGLE "͸Գ" -#define HB_B_SINGLE_V '' -#define HB_B_SINGLE_H '' -#define HB_B_DOUBLE_V '' -#define HB_B_DOUBLE_H '' -*/ -#define _B_SINGLE "\xDA\xC4\xBF\xB3\xD9\xC4\xC0\xB3" -#define _B_DOUBLE "\xC9\xCD\xBB\xBA\xBC\xCD\xC8\xBA" -#define _B_SINGLE_DOUBLE "\xD6\xC4\xB7\xBA\xBD\xC4\xD3\xBA" -#define _B_DOUBLE_SINGLE "\xD5\xCD\xB8\xB3\xBE\xCD\xD4\xB3" -#define HB_B_SINGLE_V '\xB3' -#define HB_B_SINGLE_H '\xC4' -#define HB_B_DOUBLE_V '\xBA' -#define HB_B_DOUBLE_H '\xCD' +#define _B_SINGLE "\xDA\xC4\xBF\xB3\xD9\xC4\xC0\xB3" /* "Ŀ" */ +#define _B_DOUBLE "\xC9\xCD\xBB\xBA\xBC\xCD\xC8\xBA" /* "ͻȺ" */ +#define _B_SINGLE_DOUBLE "\xD6\xC4\xB7\xBA\xBD\xC4\xD3\xBA" /* "ķӺ" */ +#define _B_DOUBLE_SINGLE "\xD5\xCD\xB8\xB3\xBE\xCD\xD4\xB3" /* "͸Գ" */ +#define HB_B_SINGLE_V '\xB3' /* '' */ +#define HB_B_SINGLE_H '\xC4' /* '' */ +#define HB_B_DOUBLE_V '\xBA' /* '' */ +#define HB_B_DOUBLE_H '\xCD' /* '' */ #define HB_B_SINGLE_W { 0x250C, 0x2500, 0x2510, 0x2502, 0x2518, 0x2500, 0x2514, 0x2502, 0x0000 } #define HB_B_DOUBLE_W { 0x2554, 0x2550, 0x2557, 0x2551, 0x255D, 0x2550, 0x255A, 0x2551, 0x0000 } diff --git a/harbour/tests/db_brows.prg b/harbour/tests/db_brows.prg index a4e8ff5915..13caf8d5b9 100644 --- a/harbour/tests/db_brows.prg +++ b/harbour/tests/db_brows.prg @@ -30,6 +30,8 @@ //+ //+-------------------------------------------------------------------- +/* UTF-8 */ + #include "fileio.ch" #define LI_LEN 42 @@ -142,7 +144,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) mslist := InitList() ENDIF IF !( Type( "str_bar" ) == "C" ) - PRIVATE str_bar := "-" + PRIVATE str_bar := hb_UTF8ToStr( "-■" ) ENDIF LI_Y1 := y1 LI_X1 := x1 @@ -193,7 +195,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) ENDIF oldcolors := SetColor() SetColor( LI_CLR ) - @ LI_Y1, LI_X1, LI_Y2, LI_X2 BOX "Ŀ " + @ LI_Y1, LI_X1, LI_Y2, LI_X2 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " ) IF title != Nil @ LI_Y1, ( LI_X2 - LI_X1 - 1 - Len( title ) ) / 2 + LI_X1 SAY " " + title + " " ENDIF @@ -231,12 +233,12 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) SetColor( LI_CLR ) Eval( LI_B1, mslist ) // IF predit>1 - // SETCOLOR(LI_CLRV+"*") // 뤥 ப + // SETCOLOR(LI_CLRV+"*") // ELSE SetColor( LI_CLRV ) // ENDIF VIVSTR( mslist, LI_NSTR + LI_Y1, iif( predit > 1, LI_COLPOS, 0 ) ) - SetColor( LI_CLR ) // 뤥 + SetColor( LI_CLR ) // #ifdef RDD_AX @ LI_Y1 + 2, LI_X2, LI_Y2 - 2, LI_X2 BOX Left( str_bar, 1 ) @@ -298,10 +300,10 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) xkey := Inkey( 0 ) #endif ENDIF - VIVSTR( mslist, LI_NSTR + LI_Y1, 0 ) // ப + VIVSTR( mslist, LI_NSTR + LI_Y1, 0 ) IF xkey < 500 DO CASE - CASE xkey == 24 // + CASE xkey == 24 IF ( LI_KOLZ > 0 .OR. predit == 3 ) .AND. ( LI_KOLZ == 0 .OR. ! Eval( LI_BEOF, mslist ) ) Eval( LI_BSKIP, mslist, 1 ) IF Eval( LI_BEOF, mslist ) .AND. ( predit < 3 .OR. LI_PRFLT ) @@ -331,7 +333,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) ENDIF ENDIF ENDIF - CASE xkey == 5 .AND. LI_KOLZ > 0 // + CASE xkey == 5 .AND. LI_KOLZ > 0 Eval( LI_BSKIP, mslist, - 1 ) IF Eval( LI_BBOF, mslist ) Eval( LI_BGTOP, mslist ) @@ -343,7 +345,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) VIVSTR( mslist, LI_Y1 + 1, 0 ) ENDIF ENDIF - CASE xkey == 4 .AND. LI_KOLZ != 0 // ࠢ + CASE xkey == 4 .AND. LI_KOLZ != 0 IF predit > 1 IF LI_COLPOS < LI_NCOLUMNS LI_COLPOS ++ @@ -363,7 +365,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) Eval( LI_BSKIP, mslist, LI_NSTR - 1 ) ENDIF VIVNAMES( mslist, LI_NLEFT ) - CASE xkey == 19 // + CASE xkey == 19 // èπαß«α ó½Ñó« IF predit > 1 IF LI_COLPOS != 1 LI_COLPOS -- @@ -415,7 +417,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) rezproc := xkey CASE ( xkey == 13 .OR. ( xkey > 47 .AND. xkey < 58 ) .OR. ( xkey > 64 .AND. xkey < 91 ) ; .OR. ( xkey > 96 .AND. xkey < 123 ) .OR. ( xkey > 127 .AND. xkey < 176 ) .OR. ( xkey > 223 .AND. xkey < 240 ) ) .AND. predit > 1 // Enter - // ஢ + // ÉÑñá¬Γ¿α«óá¡¿Ñ 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" @@ -779,7 +781,7 @@ FUNCTION InitList LI_CLR := "W+/B" LI_CLRV := "R/W" LI_BSKIP := {| a, x | HB_SYMBOL_UNUSED( a ), dbSkip( x ) } - LI_BGTOP := {|| DBGOTOP() } + LI_BGTOP := {|| dbGoTop() } LI_BGBOT := {|| dbGoBottom() } LI_BEOF := {|| Eof() } LI_BBOF := {|| Bof() } diff --git a/harbour/tests/gtchars.prg b/harbour/tests/gtchars.prg index 6cc66ca164..4a5e63c820 100644 --- a/harbour/tests/gtchars.prg +++ b/harbour/tests/gtchars.prg @@ -12,12 +12,16 @@ * */ +/* UTF-8 */ + #include "hbgtinfo.ch" -#define POL_MAZ "" -#define POL_ISO "ʣӦ󶼿" -#define POL_852 "䢘" -#define POL_WIN "ʣӌ󜟿" +#define POL_MAZ hb_Translate( "ĄĆĘŁŃÓŚŹŻąćęłńóśźż", "UTF8", "PLMAZ" ) +#define POL_ISO hb_Translate( "ĄĆĘŁŃÓŚŹŻąćęłńóśźż", "UTF8", "PLISO" ) +#define POL_852 hb_Translate( "ĄĆĘŁŃÓŚŹŻąćęłńóśźż", "UTF8", "PL852" ) +#define POL_WIN hb_Translate( "ĄĆĘŁŃÓŚŹŻąćęłńóśźż", "UTF8", "PLWIN" ) + +REQUEST HB_CODEPAGE_UTF8 REQUEST HB_CODEPAGE_PLMAZ REQUEST HB_CODEPAGE_PLISO @@ -61,11 +65,11 @@ PROCEDURE Main( cTermCP, cHostCP, lBoxChar ) ? NEXT Inkey( 0 ) - ?; dspboxch( "Ŀ ͻ ͸ ķ " ) - ?; dspboxch( " Ĵ Ķ " ) - ?; dspboxch( "Ĵ ͹ " ) - ?; dspboxch( " ͵ ͹ " ) - ?; dspboxch( " ͼ ; Ľ " ) + ?; dspboxch( hb_UTF8ToStr( "┌─┬─┐ ╔═╦═╗ ╒═╤═╕ ╓─╥─╖ ▄▄▄ ░▒▓█ ░ ▒ ▓ █" ) ) + ?; dspboxch( hb_UTF8ToStr( "│ │ │ ║ ║ ║ ├─┼─┤ ╟─╫─╢ ▌■▐" ) ) + ?; dspboxch( hb_UTF8ToStr( "├─┼─┤ ╠═╬═╣ │ │ │ ║ ║ ║ ▌█▐ █■█" ) ) + ?; dspboxch( hb_UTF8ToStr( "│ │ │ ║ ║ ║ ╞═╪═╡ ╠═╬═╣ ▌■▐" ) ) + ?; dspboxch( hb_UTF8ToStr( "└─┴─┘ ╚═╩═╝ ╘═╧═╛ ╙─╨─╜ ▀▀▀ √ « »" ) ) ? ? "ISO-8859-2: say[ " + POL_ISO + " ]"; dspboxch( ", box[ " + POL_ISO + " ]" ) ? " Mazovia: say[ " + POL_MAZ + " ]"; dspboxch( ", box[ " + POL_MAZ + " ]" ) diff --git a/harbour/tests/mousetst.prg b/harbour/tests/mousetst.prg index 427cc8f48f..414e186fd8 100644 --- a/harbour/tests/mousetst.prg +++ b/harbour/tests/mousetst.prg @@ -27,14 +27,8 @@ PROCEDURE Main() @ MaxRow() - 1, 10 SAY "X:" @ nR , 2 SAY "Mouse Type : " - @ nR + 1, 2 SAY "Buttons number: " - @ nR + 1, 18 SAY NUMBUTTONS() PICT "9" - IF NUMBUTTONS() == 2 - @ nR, 18 SAY "Micros*ft mouse" - ELSE - @ nR, 18 SAY "Mouse System" - ENDIF + @ nR, 18 SAY "Mouse System" @ MaxRow() - 2, 68 TO MaxRow(), MaxCol() DOUBLE @ MaxRow() - 1, 70 SAY "Exit" @@ -77,7 +71,7 @@ FUNCTION MINRECT( nTop, nLeft, nBott, nRight ) // First test: Check the boundaries of the main window -PROCEDURE TEST1 +PROCEDURE TEST1() LOCAL nKey @@ -139,32 +133,23 @@ PROCEDURE TEST1 // Second test: check the button pressing -PROCEDURE TEST2 ( nR, nC ) +PROCEDURE TEST2( nR, nC ) LOCAL cSkip := "", nKey, nPress := 0 - @ nR , nC SAY "Ŀ" - @ nR + 1, nC SAY " ͻ ͻ " - @ nR + 2, nC SAY " " - @ nR + 3, nC SAY " " - @ nR + 4, nC SAY " ͼ ͼ " - @ nR + 5, nC SAY "Ĵ" - @ nR + 6, nC SAY " Up Up " - @ nR + 7, nC SAY " " - @ nR + 8, nC SAY " " - @ nR + 9, nC SAY " Harbour " - @ nR + 10, nC SAY " mouse " - @ nR + 11, nC SAY "" + @ nR , nC SAY "+---------|---------+" + @ nR + 1, nC SAY "| +===+ +===+ +===+ |" + @ nR + 2, nC SAY "| | | | | | | |" + @ nR + 3, nC SAY "| | | | | | | |" + @ nR + 4, nC SAY "| +===+ +===+ +===+ |" + @ nR + 6, nC SAY "| Up Up Up |" + @ nR + 7, nC SAY "| |" + @ nR + 8, nC SAY "| |" + @ nR + 9, nC SAY "| Harbour |" + @ nR + 10, nC SAY "| mouse |" + @ nR + 11, nC SAY "+-------------------+" - IF NUMBUTTONS() == 3 - @ nR + 1, nC SAY " ͻ ͻ ͻ " - @ nR + 2, nC SAY " " - @ nR + 3, nC SAY " " - @ nR + 4, nC SAY " ͼ ͼ ͼ " - @ nR + 6, nC SAY " Up Up Up " - ENDIF - - Set( _Set_EVENTMASK, INKEY_ALL ) + SET( _SET_EVENTMASK, INKEY_ALL ) IF ! Empty( cSkip ) IF Upper( cSkip ) == "BREAK" @@ -191,8 +176,8 @@ PROCEDURE TEST2 ( nR, nC ) CASE nKey == K_LBUTTONDOWN // Left mouse button was pushed - @ nR + 2, nC + 3 SAY "" - @ nR + 3, nC + 3 SAY "" + @ nR + 2, nC + 3 SAY "XXX" + @ nR + 3, nC + 3 SAY "XXX" @ nR + 6, nC + 3 SAY "Down" nPress ++ @@ -204,8 +189,8 @@ PROCEDURE TEST2 ( nR, nC ) CASE nKey == K_MBUTTONDOWN // Middle mouse button was pushed - @ nR + 2, nC + 10 SAY "" - @ nR + 3, nC + 10 SAY "" + @ nR + 2, nC + 10 SAY "XXX" + @ nR + 3, nC + 10 SAY "XXX" @ nR + 6, nC + 10 SAY "Down" nPress ++ @@ -215,8 +200,8 @@ PROCEDURE TEST2 ( nR, nC ) CASE nKey == K_RBUTTONDOWN // Right mouse button was pushed - @ nR + 2, nC + 15 SAY "" - @ nR + 3, nC + 15 SAY "" + @ nR + 2, nC + 15 SAY "XXX" + @ nR + 3, nC + 15 SAY "XXX" @ nR + 6, nC + 15 SAY "Down" nPress ++ @@ -234,11 +219,11 @@ PROCEDURE TEST2 ( nR, nC ) // "The right mouse button was double-clicked." @ 14, 22 SAY "Pass" - OTHERWISE + OTHERWISE @ MaxRow(), 20 SAY "A keyboard key was pressed: " @ MaxRow(), 48 SAY nKey @ MaxRow(), 58 SAY iif( nKey >= 32 .AND. nKey <= 255, Chr( nKey ), "" ) - END CASE + ENDCASE IF nPress > 6 EXIT diff --git a/harbour/tests/tb1.prg b/harbour/tests/tb1.prg index ca5aeabc4d..28791fcccd 100644 --- a/harbour/tests/tb1.prg +++ b/harbour/tests/tb1.prg @@ -11,6 +11,8 @@ * */ +/* UTF-8 */ + #include "inkey.ch" #include "button.ch" #include "setcurs.ch" @@ -33,7 +35,8 @@ PROCEDURE Main() nRight := 70 cColor := "W+/R,G+/BR,RG+/B,BG+/G,N/GR,GR+/BG,B/GR*" - SET DATE FORMAT TO "yyyy/mm/dd" + SET DATE ANSI + SET CENTURY ON // enable mouse events in CL53/Harbour #ifdef _SET_EVENTMASK @@ -45,15 +48,15 @@ PROCEDURE Main() CLS DispBox( nTop, nLeft, nBottom, nRight, B_DOUBLE_SINGLE, cColor ) oBrw := TBRowseNew( nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 ) - DispOutAt( nTop + 3, nLeft, "", cColor ) - DispOutAt( nTop + 3, nRight, "", cColor ) - DispOutAt( nBottom - 2, nLeft, "", cColor ) - DispOutAt( nBottom - 2, nRight, "", cColor ) + DispOutAt( nTop + 3, nLeft, hb_UTF8ToStr( "├" ), cColor ) + DispOutAt( nTop + 3, nRight, hb_UTF8ToStr( "┤" ), cColor ) + DispOutAt( nBottom - 2, nLeft, hb_UTF8ToStr( "├" ), cColor ) + DispOutAt( nBottom - 2, nRight, hb_UTF8ToStr( "┤" ), cColor ) oBrw:colorSpec( cColor ) - oBrw:headSep := " " - oBrw:footSep := " " - oBrw:colSep := " " + oBrw:headSep := hb_UTF8ToStr( "┐ ┌─" ) + oBrw:footSep := hb_UTF8ToStr( "┘ └─" ) + oBrw:colSep := hb_UTF8ToStr( "│ │" ) oBrw:SkipBlock := {| n | hb_idleSleep( 0.2 ), ; n := iif( n < 0, Max( n, 1 - s_nPos ), ; @@ -70,15 +73,15 @@ PROCEDURE Main() oCol2 := TBColumnNew( "COL;2", {|| s_nCount ++ } ) oCol2:defColor := { 3, 4, 5, 6 } oCol2:footing := "counter" - oCol2:headSep := " ĴHIDE" + oCol2:headSep := hb_UTF8ToStr( "┐ ┌─┤HIDE├─" ) oCol3 := TBColumnNew( "COL 3", {|| s_nPos % 3 == 0 } ) oCol3:defColor := { 5, 6, 2, 3 } oCol3:footing := "logical" oCol3:picture := "@YR [Y]" // Clipper wrongly calculate the size here - oCol3:headSep := " ĴHIDE" - oCol3:footSep := " " - oCol3:colSep := " " + oCol3:headSep := hb_UTF8ToStr( "╖ ╓─┤HIDE├─" ) + oCol3:footSep := hb_UTF8ToStr( "╜ ╙─" ) + oCol3:colSep := hb_UTF8ToStr( "║ ║" ) oCol4 := TBColumnNew( " SHOW; ALL", {|| Date() - s_nPos } ) oCol4:defColor := { 6, 3, 4, 2 } diff --git a/harbour/tests/testbrw.prg b/harbour/tests/testbrw.prg index 65193459c9..3d5a125389 100644 --- a/harbour/tests/testbrw.prg +++ b/harbour/tests/testbrw.prg @@ -2,6 +2,8 @@ * $Id$ */ +/* UTF-8 */ + // Harbour Class TBrowse and TBColumn sample #include "inkey.ch" @@ -22,9 +24,9 @@ PROCEDURE Main() LOCAL nTmpRow, nTmpCol oBrowse:colorSpec := "W+/B, N/BG" - oBrowse:ColSep := "" - oBrowse:HeadSep := "" - oBrowse:FootSep := "" + oBrowse:ColSep := hb_UTF8ToStr( "│" ) + oBrowse:HeadSep := hb_UTF8ToStr( "╤═" ) + oBrowse:FootSep := hb_UTF8ToStr( "╧═" ) oBrowse:GoTopBlock := {|| n := 1 } oBrowse:GoBottomBlock := {|| n := Len( aTest0 ) } oBrowse:SkipBlock := {| nSkip, nPos | nPos := n, ; @@ -56,7 +58,7 @@ PROCEDURE Main() cColor := SetColor( "W+/B" ) nRow := Row() nCol := Col() - @ 4, 4, 17, 31 BOX "Ŀ " + @ 4, 4, 17, 31 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " ) #ifdef HB_COMPAT_C53 oBrowse:SetKey( 0, {| ob, nkey | Defproc( ob,nKey ) } ) WHILE .T. diff --git a/harbour/tests/testdbf.prg b/harbour/tests/testdbf.prg index 9e7d927a48..0be38274a1 100644 --- a/harbour/tests/testdbf.prg +++ b/harbour/tests/testdbf.prg @@ -52,7 +52,7 @@ PROCEDURE Main() "string is limited to 256 characters and this string is " + ; "a lot bigger. Do you get my drift ? If there is somebody " + ; "who has read this line upto the very end: Esto es un " + ; - "sombrero grande ridculo." + Chr( 13 ) + Chr( 10 ) + ; + "sombrero grande ridiculo." + Chr( 13 ) + Chr( 10 ) + ; "/" + Chr( 13 ) + Chr( 10 ) + "[;-)" + Chr( 13 ) + Chr( 10 ) + ; "\" NEXT diff --git a/harbour/tests/testrdd2.prg b/harbour/tests/testrdd2.prg index 01916353db..b57e653fa6 100644 --- a/harbour/tests/testrdd2.prg +++ b/harbour/tests/testrdd2.prg @@ -31,7 +31,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) "string is limited to 256 characters and this string is " + ; "a lot bigger. Do you get my drift ? If there is somebody " + ; "who has read this line upto the very end: Esto es un " + ; - "sombrero grande ridculo." + hb_eol() + "/" + hb_eol() + "[;-)" + hb_eol() + "\" } + "sombrero grande ridiculo." + hb_eol() + "/" + hb_eol() + "[;-)" + hb_eol() + "\" } DO CASE diff --git a/harbour/tests/wcecon.prg b/harbour/tests/wcecon.prg index 897451665b..ef5c5b7a49 100644 --- a/harbour/tests/wcecon.prg +++ b/harbour/tests/wcecon.prg @@ -11,6 +11,8 @@ * */ +/* UTF-8 */ + #include "hbgtinfo.ch" request DBFCDX @@ -87,11 +89,11 @@ proc main() inkey( 0 ) /* display boxes */ - ?; devout( "Ŀ ͻ ͸ ķ " ) - ?; devout( " Ĵ Ķ " ) - ?; devout( "Ĵ ͹ " ) - ?; devout( " ͵ ͹ " ) - ?; devout( " ͼ ; Ľ " ) + ?; devout( hb_UTF8ToStr( "┌─┬─┐ ╔═╦═╗ ╒═╤═╕ ╓─╥─╖ ▄▄▄" ) ) + ?; devout( hb_UTF8ToStr( "│ │ │ ║ ║ ║ ├─┼─┤ ╟─╫─╢ ▌■▐" ) ) + ?; devout( hb_UTF8ToStr( "├─┼─┤ ╠═╬═╣ │ │ │ ║ ║ ║ ▌█▐" ) ) + ?; devout( hb_UTF8ToStr( "│ │ │ ║ ║ ║ ╞═╪═╡ ╠═╬═╣ ▌■▐" ) ) + ?; devout( hb_UTF8ToStr( "└─┴─┘ ╚═╩═╝ ╘═╧═╛ ╙─╨─╜ ▀▀▀" ) ) inkey( 0 ) ?