2012-10-01 19:13 UTC+0200 Viktor Szakats (harbour syenar.net)

* include/harbour.hbx
  * src/rtl/Makefile
  + src/rtl/cdpbox.prg
    + added HB_UTF8TOSTRBOX( <cUTF8String> ) -> <cStringEncodedIn_GT_BOXCP>
      It's needed because HB_UTF8TOSTR() will convert to main CP,
      but box drawing CP can be setup differently with HB_GTI_BOXCP,
      that function call will take that into account.

  * contrib/hbnf/aredit.prg
  * contrib/hbnf/clrsel.prg
  * contrib/hbnf/dispmsg.prg
  * contrib/hbnf/menu1.prg
  * contrib/hbnf/pegs.prg
  * contrib/hbnf/pickday.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/hbnf/vertmenu.prg
  * tests/db_brows.prg
  * tests/gtchars.prg
  * tests/testbrw.prg
  * extras/gtwvw/tests/prog0.prg
  * extras/gtwvw/tests/prog1.prg
  * extras/gtwvw/tests/prog2.prg
    ! fixed drawing chars to display properly regardless of HB_GTI_BOXCP
      setting.
    ! some related minor fixes

  * tests/tb1.prg
    ! fixed to compile and build using Clipper after recent 
      UTF8 compatibility updates (not tested though)

  ; TOFIX: Pad*() function handle 3rd parameter as binary string,
           so it doesn't work properly in UTF8 mode.
This commit is contained in:
Viktor Szakats
2012-10-01 17:15:48 +00:00
parent 66ab139841
commit fca19513ca
20 changed files with 191 additions and 73 deletions

View File

@@ -16,6 +16,41 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-01 19:13 UTC+0200 Viktor Szakats (harbour syenar.net)
* include/harbour.hbx
* src/rtl/Makefile
+ src/rtl/cdpbox.prg
+ added HB_UTF8TOSTRBOX( <cUTF8String> ) -> <cStringEncodedIn_GT_BOXCP>
It's needed because HB_UTF8TOSTR() will convert to main CP,
but box drawing CP can be setup differently with HB_GTI_BOXCP,
that function call will take that into account.
* contrib/hbnf/aredit.prg
* contrib/hbnf/clrsel.prg
* contrib/hbnf/dispmsg.prg
* contrib/hbnf/menu1.prg
* contrib/hbnf/pegs.prg
* contrib/hbnf/pickday.prg
* contrib/hbnf/popadder.prg
* contrib/hbnf/tbwhile.prg
* contrib/hbnf/vertmenu.prg
* tests/db_brows.prg
* tests/gtchars.prg
* tests/testbrw.prg
* extras/gtwvw/tests/prog0.prg
* extras/gtwvw/tests/prog1.prg
* extras/gtwvw/tests/prog2.prg
! fixed drawing chars to display properly regardless of HB_GTI_BOXCP
setting.
! some related minor fixes
* tests/tb1.prg
! fixed to compile and build using Clipper after recent
UTF8 compatibility updates (not tested though)
; TOFIX: Pad*() function handle 3rd parameter as binary string,
so it doesn't work properly in UTF8 mode.
2012-10-01 11:33 UTC+0200 Viktor Szakats (harbour syenar.net)
! ChangeLog
! deleted UTF-8 char. (Maybe its time to switch to

View File

@@ -42,25 +42,25 @@
#include "inkey.ch"
// Default heading, column, footer separators
#define DEF_HSEP hb_UTF8ToStr( "═╤═" )
#define DEF_CSEP hb_UTF8ToStr( " │ " )
#define DEF_FSEP hb_UTF8ToStr( "═╧═" )
#define DEF_HSEP hb_UTF8ToStrBox( "═╤═" )
#define DEF_CSEP hb_UTF8ToStrBox( " │ " )
#define DEF_FSEP hb_UTF8ToStrBox( "═╧═" )
// Default info for tb_methods section
#define KEY_ELEM 1
#define BLK_ELEM 2
// ANYTYPE[] ar - Array to browse
// NUMERIC nElem - Element In Array
// CHARACTER[] aHeadings - Array of Headings for each column
// BLOCK[] aBlocks - Array containing code block for each column.
// CODE BLOCK bGetFunc - Code Block For Special Get Processing
// NOTE: When evaluated a code block is passed the array element to
// be edited
FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ;
ar, nElem, aHeadings, aBlocks, bGetFunc )
// ANYTYPE[] ar - Array to browse
// NUMERIC nElem - Element In Array
// CHARACTER[] aHeadings - Array of Headings for each column
// BLOCK[] aBlocks - Array containing code block for each column.
// CODE BLOCK bGetFunc - Code Block For Special Get Processing
// NOTE: When evaluated a code block is passed the array element to
// be edited
LOCAL exit_requested, nKey, meth_no
LOCAL cSaveWin, i, b, column
LOCAL nDim, cType, cVal

View File

@@ -63,11 +63,11 @@
#define C_CHAR 4
#translate Single( <t>, <l>, <b>, <r> ) =>;
@ <t>, <l>, <b>, <r> BOX hb_UTF8ToStr( "┌─┐│┘─└│" )
@ <t>, <l>, <b>, <r> BOX hb_UTF8ToStrBox( "┌─┐│┘─└│" )
#translate Double( <t>, <l>, <b>, <r> ) =>;
@ <t>, <l>, <b>, <r> BOX hb_UTF8ToStr( "╔═╗║╝═╚║" )
@ <t>, <l>, <b>, <r> BOX hb_UTF8ToStrBox( "╔═╗║╝═╚║" )
#translate ClearS( <t>, <l>, <b>, <r> ) =>;
@ <t>, <l> CLEAR TO <b>, <r>
@@ -281,7 +281,7 @@ STATIC FUNCTION _ftColours( aOpt, aClrPal, lColour )
//.... allow change to specific part of colour string
IF !( aOpt[ C_TYPE ] == "T" )
Single( nT, nL + 1, nB, nR - 1 )
@ nT, nL + 2 SAY PadC( " " + aOpt[C_NAME] + " ", nR - nL - 3, hb_UTF8ToStr( "─" ) )
@ nT, nL + 2 SAY PadC( " " + aOpt[ C_NAME ] + " ", nR - nL - 3, hb_UTF8ToStr( "─" ) )
ENDIF
cClr := _ftClrSel( aClrPal, cClr, nChoice, aOpt ) // selection routine
aClrs[ nChoice ] := cClr // put colour back in array
@@ -317,7 +317,7 @@ STATIC FUNCTION _ftShowIt( aOpt )
CASE aOpt[ C_TYPE ] == "D" // Desktop Background
SetColor( aClr[ 1 ] )
BkGrnd( 19, 43, 22, 64, aOpt[ C_CHAR ] )
BkGrnd( 19, 43, 22, 64, hb_UTF8ToStrBox( aOpt[ C_CHAR ] ) )
CASE aOpt[ C_TYPE ] == "T" // Title
SetColor( aClr[ 1 ] )
@@ -325,7 +325,7 @@ STATIC FUNCTION _ftShowIt( aOpt )
CASE aOpt[ C_TYPE ] == "M" // Menus
SetColor( "W/N" )
BkGrnd( 19, 41, 23, 66, hb_UTF8ToStr( "▒" ) )
BkGrnd( 19, 41, 23, 66, hb_UTF8ToStrBox( "▒" ) )
SetColor( aClr[ 1 ] )
Single( 19, 43, 22, 60 )
@ 18, 41 SAY " Report Inquiry Quit "
@@ -429,10 +429,13 @@ STATIC FUNCTION _ftClrSel( aClrPal, cClr, nElem, aOpt )
FOR nR := 1 TO nDim
FOR nC := 1 TO nDim
IF aClrPal[ nR, nC ] == AllTrim( cClr )
lFound := .T. ; EXIT
lFound := .T.
EXIT
ENDIF
NEXT
IF lFound ; EXIT ; ENDIF
IF lFound
EXIT
ENDIF
NEXT
IF ! lFound
@@ -497,7 +500,7 @@ STATIC FUNCTION _ftClrPut( cClrStr, nElem, cClr )
STATIC FUNCTION _ftDeskChar( aOpt )
LOCAL aChar := { " ", hb_UTF8ToStr( "░" ), hb_UTF8ToStr( "▒" ), hb_UTF8ToStr( "▓" ) }
LOCAL aChar := { " ", "░", "▒", "▓" }
LOCAL cChar := aOpt[ C_CHAR ]
LOCAL cClr := aOpt[ C_CLR ]
LOCAL nElem := AScan( aChar, cChar )
@@ -511,7 +514,7 @@ STATIC FUNCTION _ftDeskChar( aOpt )
//.... draw the choices on the screen
SetColor( cClr )
FOR n := 1 TO Len( aChar )
@ n + 18, 29 SAY REPLICATE( aChar[ n ], 10 )
@ n + 18, 29 SAY Replicate( hb_UTF8ToStr( aChar[ n ] ), 10 )
NEXT
n := nElem + 18

View File

@@ -93,9 +93,9 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
// consistent with DISPBOX()
IF cnBoxString == NIL .OR. cnBoxString == 2
cnBoxString := hb_UTF8ToStr( "╔═╗║╝═╚║ " )
cnBoxString := hb_UTF8ToStrBox( "╔═╗║╝═╚║ " )
ELSEIF cnBoxString == 1
cnBoxString := hb_UTF8ToStr( "┌─┐│┘─└│ " )
cnBoxString := hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
ENDIF
lShadow := iif( lShadow == NIL, .T. , lShadow )

View File

@@ -139,7 +139,7 @@ FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow )
hb_Shadow( nTopRow + 1, aBoxLoc[ t_nHPos ], Len( t_aChoices[ t_nHPos, 1 ] ) + nTopRow + 2, aBarWidth[ t_nHPos ] + 3 + aBoxLoc[ t_nHPos ] )
ENDIF
SetColor( cBorder )
@ nTopRow + 1, aBoxLoc[ t_nHPos ], Len( t_aChoices[ t_nHPos, 1 ] ) + nTopRow + 2, aBarWidth[ t_nHPos ] + 3 + aBoxLoc[ t_nHPos ] BOX hb_UTF8ToStr( "╔═╗║╝═╚║ " )
@ nTopRow + 1, aBoxLoc[ t_nHPos ], Len( t_aChoices[ t_nHPos, 1 ] ) + nTopRow + 2, aBarWidth[ t_nHPos ] + 3 + aBoxLoc[ t_nHPos ] BOX hb_UTF8ToStrBox( "╔═╗║╝═╚║ " )
SetColor( cBox + "," + cCurrent + ",,," + cUnselec )
t_nVPos := AChoice( nTopRow + 2, aBoxLoc[ t_nHPos ] + 2, Len( t_aChoices[ t_nHPos, 1 ] ) + nTopRow + 2, aBarWidth[ t_nHPos ] + 1 + aBoxLoc[ t_nHPos ], t_aChoices[ t_nHPos, 1 ], t_aChoices[ t_nHPos, 3 ], "__ftAcUdf", aLastSel[ t_nHPos ] )
DO CASE
@@ -216,7 +216,7 @@ STATIC FUNCTION _ftBailOut( cBorder, cBox )
sOldScreen := SaveScreen( t_nMaxRow / 2 - 1, 24, t_nMaxRow / 2 + 2, 55 )
cOldColor := SetColor( cBorder )
hb_Shadow( t_nMaxRow / 2 - 1, 24, t_nMaxRow / 2 + 2, 55 )
@ t_nMaxRow / 2 - 1, 24, t_nMaxRow/2 + 2, 55 BOX hb_UTF8ToStr( "╔═╗║╝═╚║ " )
@ t_nMaxRow / 2 - 1, 24, t_nMaxRow/2 + 2, 55 BOX hb_UTF8ToStrBox( "╔═╗║╝═╚║ " )
SetColor( cBox )
@ t_nMaxRow / 2, 26 SAY "Press ESCape To Confirm Exit"
@ t_nMaxRow / 2 + 1, 27 SAY "Or Any Other Key To Resume"

View File

@@ -32,9 +32,9 @@
#include "setcurs.ch"
#translate SINGLEBOX( <top>, <left>, <bottom>, <right> ) => ;
@ <top>, <left>, <bottom>, <right> BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
@ <top>, <left>, <bottom>, <right> BOX hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
#translate DOUBLEBOX( <top>, <left>, <bottom>, <right> ) => ;
@ <top>, <left>, <bottom>, <right> BOX hb_UTF8ToStr( "╔═╗║╝═╚║ " )
@ <top>, <left>, <bottom>, <right> BOX hb_UTF8ToStrBox( "╔═╗║╝═╚║ " )
MEMVAR GetList
/*
@@ -164,7 +164,7 @@ STATIC FUNCTION DrawBox( nelement )
SetColor( iif( t_board_[ nelement ][ 4 ], "+w/rb", "w/n" ) )
@ t_board_[ nelement ][ 1, 1 ], t_board_[ nelement ][ 1, 2 ], t_board_[ nelement ][ 1, 3 ], ;
t_board_[ nelement ][ 1, 4 ] BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
t_board_[ nelement ][ 1, 4 ] BOX hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
DevPos( t_board_[ nelement ][ 1, 1 ] + 1, t_board_[ nelement ][ 1, 2 ] + 2 )
DevOut( hb_ntos( nelement ) )

View File

@@ -31,7 +31,7 @@ FUNCTION FT_PICKDAY()
LOCAL sel := 0
LOCAL oldscrn := SaveScreen( 8, 35, 16, 45 ), oldcolor := SetColor( "+w/r" )
@ 8, 35, 16, 45 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
@ 8, 35, 16, 45 BOX hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
/* do not allow user to Esc out, which would cause array access error */
DO WHILE sel == 0
sel := AChoice( 9, 36, 15, 44, days )

View File

@@ -54,8 +54,8 @@
#define STD_VARIABLE 6
#define STD_BORDER 7
#define B_DOUBLE hb_UTF8ToStr( "╔═╗║╝═╚║ " )
#define B_SINGLE "+-+|+-+| "
#define B_DOUBLE hb_UTF8ToStrBox( "╔═╗║╝═╚║ " )
#define B_SINGLE "+-+|+-+| "
#define nTotTran Len( aTrans )
@@ -358,7 +358,7 @@ STATIC FUNCTION _ftAddScreen( aAdder )
@ 8 + nTopOS, nCol SAY "-"
@ 13 + nTopOS, nCol SAY "+"
@ 18 + nTopOS, nCol SAY "="
@ 19 + nTopOS, nCol SAY ""
@ 19 + nTopOS, nCol SAY hb_UTF8ToStr( "♦" )
_ftSetWinColor( W_CURR, W_PROMPT )
@ 3 + nTopOS, 6 + nAddSpace, 5 + nTopOS, 27 + nAddSpace BOX B_DOUBLE

View File

@@ -89,9 +89,9 @@ FUNCTION FT_BRWSWHL( aFields, bWhileCond, cKey, nFreeze, lSaveScrn, ;
b := TBRowseDb( nTop, nLeft, nBottom, nRight )
/* default heading and column separators */
b:headSep := hb_UTF8ToStr( "═╤═" )
b:colSep := hb_UTF8ToStr( " │ " )
b:footSep := hb_UTF8ToStr( "═╧═" )
b:headSep := hb_UTF8ToStrBox( "═╤═" )
b:colSep := hb_UTF8ToStrBox( " │ " )
b:footSep := hb_UTF8ToStrBox( "═╧═" )
/* add custom 'TbSkipWhil' (to handle passed condition) */
b:skipBlock := {| x | TbSkipWhil( x, bWhileCond ) }

View File

@@ -58,7 +58,7 @@ FUNCTION ft_menu2( aMenuInfo, cColors )
cOldscreen := SaveScreen( nTop, nLeft - 1, nTop + nOptions + 1, nLeft + nMaxwidth )
@ nTop, nLeft - 1, nTop + nOptions + 1, nLeft + nMaxwidth BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
@ nTop, nLeft - 1, nTop + nOptions + 1, nLeft + nMaxwidth BOX hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
DevPos( nTop, nLeft )
FOR x := 1 TO Len( aMenuInfo )
IF Len( aMenuInfo[ x ] ) > 1 .AND. aMenuInfo[ x, 2 ] != NIL

View File

@@ -64,7 +64,7 @@ local lDone := .f.
local getlist := {}
local oldCurs := setcursor(SC_NORMAL)
nWin := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ),10,20,22,59,"Some Window")
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ),10,20,22,59,"Some Window")
//@ 21,21 say "Inside the window" color "R/W"
//@ 23,0 say "Outside the window" color "R/W"
@@ -107,8 +107,8 @@ FUNCTION xBrowse1()
SetColor( 'N/W*,N/GR*,,,N/W* ' )
oBrowse := TBrowseNew( nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 )
oBrowse:ColSep := hb_UTF8ToStr( "│" )
oBrowse:HeadSep := hb_UTF8ToStr( "─" )
oBrowse:ColSep := hb_UTF8ToStrBox( "│" )
oBrowse:HeadSep := hb_UTF8ToStrBox( "─" )
oBrowse:GoTopBlock := { || dbGoTop() }
oBrowse:GoBottomBlock := { || dbGoBottom() }
oBrowse:SkipBlock := { | nSkip | dbSkipBlock( nSkip,oBrowse ) }
@@ -120,7 +120,7 @@ FUNCTION xBrowse1()
oBrowse:configure()
nWin := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ),nTop,nLeft,nBottom,nRight, "test.dbf")
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ),nTop,nLeft,nBottom,nRight, "test.dbf")
While !lEnd
oBrowse:ForceStable()
@@ -246,7 +246,7 @@ local oldColor := setcolor(s_cStdColor)
nRight := nLeft + nWidth + 1
* open window
nWinNum := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg)
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg)
@ nTopLine+1, nLeft+1 PROMPT padr("Yes", nWidth)
@ nTopLine+2, nLeft+1 PROMPT padr("No", nWidth)
@@ -288,7 +288,7 @@ local oldColor := setcolor(s_cStdColor)
nRight := nLeft + nMaxWidth + 1
* open window
nWinNum := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle)
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle)
DISPBEGIN()
for i := 1 to nNumLines
cAline := MEMOLINE(cMsg, nWidth, i)

View File

@@ -88,7 +88,7 @@ local lDone := .f.
local getlist := {}
local oldCurs := setcursor(SC_NORMAL)
nWin := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ),10,20,22,59,"Some Window")
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ),10,20,22,59,"Some Window")
//@ 21,21 say "Inside the window" color "R/W"
//@ 23,0 say "Outside the window" color "R/W"
@@ -144,7 +144,7 @@ FUNCTION xBrowse1()
oBrowse:configure()
nWin := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ),nTop,nLeft,nBottom,nRight, "test.dbf")
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ),nTop,nLeft,nBottom,nRight, "test.dbf")
While !lEnd
oBrowse:ForceStable()
@@ -270,7 +270,7 @@ local oldColor := setcolor(s_cStdColor)
nRight := nLeft + nWidth + 1
* open window
nWinNum := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg)
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg)
@ nTopLine+1, nLeft+1 PROMPT padr("Yes", nWidth)
@ nTopLine+2, nLeft+1 PROMPT padr("No", nWidth)
@@ -312,7 +312,7 @@ local oldColor := setcolor(s_cStdColor)
nRight := nLeft + nMaxWidth + 1
* open window
nWinNum := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle)
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle)
DISPBEGIN()
for i := 1 to nNumLines
cAline := MEMOLINE(cMsg, nWidth, i)

View File

@@ -92,7 +92,7 @@ local oldCurs := setcursor(SC_NORMAL)
MEMVAR __temp__
#ENDIF
nWin := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ),10,20,22,59,"Some Window")
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ),10,20,22,59,"Some Window")
#IFDEF __GTWVW__
AddMiscObjects( nWin, {|nWindow| __temp__:= nWindow, aEval( GetList, {|oGet| WVW_DrawBoxGet( __temp__, oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
@@ -161,7 +161,7 @@ FUNCTION xBrowse1()
oBrowse:configure()
nWin := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ),nTop,nLeft,nBottom,nRight, "test.dbf")
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ),nTop,nLeft,nBottom,nRight, "test.dbf")
#IFDEF __GTWVW__
Wvw_SetPen( 0, 0, rgb( 210,1210,210 ) )
@@ -311,7 +311,7 @@ local oldColor := setcolor(s_cStdColor)
nRight := nLeft + nWidth + 1
* open window
nWinNum := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg)
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg)
@ nTopLine+1, nLeft+1 PROMPT padr("Yes", nWidth)
@ nTopLine+2, nLeft+1 PROMPT padr("No", nWidth)
@@ -353,7 +353,7 @@ local oldColor := setcolor(s_cStdColor)
nRight := nLeft + nMaxWidth + 1
* open window
nWinNum := znewwindow( hb_UTF8ToStr( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle)
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle)
DISPBEGIN()
for i := 1 to nNumLines
cAline := MEMOLINE(cMsg, nWidth, i)

View File

@@ -868,6 +868,7 @@ DYNAMIC hb_utf8StrTran
DYNAMIC hb_utf8Stuff
DYNAMIC hb_utf8SubStr
DYNAMIC hb_UTF8ToStr
DYNAMIC hb_UTF8ToStrBox
DYNAMIC hb_ValToExp
DYNAMIC hb_ValToStr
DYNAMIC hb_Version

View File

@@ -218,6 +218,7 @@ PRG_SOURCES := \
altd.prg \
browdb.prg \
browse.prg \
cdpbox.prg \
cdpdet.prg \
checkbox.prg \
color53.prg \

View File

@@ -0,0 +1,56 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* Internal support for CP agnostic box drawing chars
*
* Copyright 2012 Viktor Szakats (harbour syenar.net)
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbgtinfo.ch"
FUNCTION hb_UTF8ToStrBox( cString )
RETURN hb_Translate( cString, "UTF8", hb_gtInfo( HB_GTI_BOXCP ) )

View File

@@ -144,7 +144,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey )
mslist := InitList()
ENDIF
IF !( Type( "str_bar" ) == "C" )
PRIVATE str_bar := hb_UTF8ToStr( "-■" )
PRIVATE str_bar := "-v^o"
ENDIF
LI_Y1 := y1
LI_X1 := x1
@@ -195,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 hb_UTF8ToStr( "┌─┐│┘─└│ " )
@ LI_Y1, LI_X1, LI_Y2, LI_X2 BOX hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
IF title != Nil
@ LI_Y1, ( LI_X2 - LI_X1 - 1 - Len( title ) ) / 2 + LI_X1 SAY " " + title + " "
ENDIF
@@ -242,8 +242,8 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey )
//
#ifdef RDD_AX
@ LI_Y1 + 2, LI_X2, LI_Y2 - 2, LI_X2 BOX Left( str_bar, 1 )
@ LI_Y1 + 1, LI_X2 SAY SubStr( str_bar, 2, 1 )
@ LI_Y2 - 1, LI_X2 SAY SubStr( str_bar, 2, 1 )
@ LI_Y1 + 1, LI_X2 SAY SubStr( str_bar, 2, 1 )
@ LI_Y2 - 1, LI_X2 SAY SubStr( str_bar, 2, 1 )
@ LI_Y1 + 2 + Int( iif( LI_PRFLT, LI_TEKZP, Ax_Keyno() ) * ( LI_Y2 - LI_Y1 - 4 ) / iif( LI_PRFLT, LI_KOLZ, Ax_KeyCount() ) ), LI_X2 SAY Right( str_bar, 1 )
#else
IF ! ( Type( "Sx_Keyno()" ) == "U" )

View File

@@ -65,11 +65,11 @@ PROCEDURE Main( cTermCP, cHostCP, lBoxChar )
?
NEXT
Inkey( 0 )
?; dspboxch( hb_UTF8ToStr( "┌─┬─┐ ╔═╦═╗ ╒═╤═╕ ╓─╥─╖ ▄▄▄ ░▒▓█ ░ ▒ ▓ █" ) )
?; dspboxch( hb_UTF8ToStr( "│ │ │ ║ ║ ║ ├─┼─┤ ╟─╫─╢ ▌■▐" ) )
?; dspboxch( hb_UTF8ToStr( "├─┼─┤ ╠═╬═╣ │ │ │ ║ ║ ║ ▌█▐ █■█" ) )
?; dspboxch( hb_UTF8ToStr( "│ │ │ ║ ║ ║ ╞═╪═╡ ╠═╬═╣ ▌■▐" ) )
?; dspboxch( hb_UTF8ToStr( "└─┴─┘ ╚═╩═╝ ╘═╧═╛ ╙─╨─╜ ▀▀▀ √ « »" ) )
?; dspboxch( hb_UTF8ToStrBox( "┌─┬─┐ ╔═╦═╗ ╒═╤═╕ ╓─╥─╖ ▄▄▄ ░▒▓█ ░ ▒ ▓ █" ) )
?; dspboxch( hb_UTF8ToStrBox( "│ │ │ ║ ║ ║ ├─┼─┤ ╟─╫─╢ ▌■▐" ) )
?; dspboxch( hb_UTF8ToStrBox( "├─┼─┤ ╠═╬═╣ │ │ │ ║ ║ ║ ▌█▐ █■█" ) )
?; dspboxch( hb_UTF8ToStrBox( "│ │ │ ║ ║ ║ ╞═╪═╡ ╠═╬═╣ ▌■▐" ) )
?; dspboxch( hb_UTF8ToStrBox( "└─┴─┘ ╚═╩═╝ ╘═╧═╛ ╙─╨─╜ ▀▀▀ √ « »" ) )
?
? "ISO-8859-2: say[ " + POL_ISO + " ]"; dspboxch( ", box[ " + POL_ISO + " ]" )
? " Mazovia: say[ " + POL_MAZ + " ]"; dspboxch( ", box[ " + POL_MAZ + " ]" )

View File

@@ -18,6 +18,28 @@
#include "setcurs.ch"
#include "box.ch"
#ifdef __HARBOUR__
#define _DRAW_1 hb_UTF8ToStr( "├" )
#define _DRAW_2 hb_UTF8ToStr( "┤" )
#define _DRAW_3 hb_UTF8ToStr( "┐ ┌─" )
#define _DRAW_4 hb_UTF8ToStr( "┘ └─" )
#define _DRAW_5 hb_UTF8ToStr( "│ │" )
#define _DRAW_6 hb_UTF8ToStr( "┐ ┌─┤HIDE├─" )
#define _DRAW_7 hb_UTF8ToStr( "╖ ╓─┤HIDE├─" )
#define _DRAW_8 hb_UTF8ToStr( "╜ ╙─" )
#define _DRAW_9 hb_UTF8ToStr( "║ ║" )
#else
#define _DRAW_1 Chr( 195 )
#define _DRAW_2 Chr( 180 )
#define _DRAW_3 Chr( 191 ) + " " + Chr( 218 ) + Chr( 196 )
#define _DRAW_4 Chr( 217 ) + " " + Chr( 192 ) + Chr( 196 )
#define _DRAW_5 Chr( 179 ) + " " + Chr( 179 )
#define _DRAW_6 Chr( 191 ) + " " + Chr( 218 ) + Chr( 196 ) + "HIDE" + Chr( 195 ) + Chr( 196 )
#define _DRAW_7 Chr( 183 ) + " " + Chr( 214 ) + Chr( 196 ) + "HIDE" + Chr( 195 ) + Chr( 196 )
#define _DRAW_8 Chr( 189 ) + " " + Chr( 211 ) + Chr( 196 )
#define _DRAW_9 Chr( 186 ) + " " + Chr( 186 )
#endif
PROCEDURE Main()
STATIC s_nCount := 0
@@ -48,15 +70,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, hb_UTF8ToStr( "├" ), cColor )
DispOutAt( nTop + 3, nRight, hb_UTF8ToStr( "┤" ), cColor )
DispOutAt( nBottom - 2, nLeft, hb_UTF8ToStr( "├" ), cColor )
DispOutAt( nBottom - 2, nRight, hb_UTF8ToStr( "┤" ), cColor )
DispOutAt( nTop + 3, nLeft, _DRAW_1, cColor )
DispOutAt( nTop + 3, nRight, _DRAW_2, cColor )
DispOutAt( nBottom - 2, nLeft, _DRAW_1, cColor )
DispOutAt( nBottom - 2, nRight, _DRAW_2, cColor )
oBrw:colorSpec( cColor )
oBrw:headSep := hb_UTF8ToStr( "┐ ┌─" )
oBrw:footSep := hb_UTF8ToStr( "┘ └─" )
oBrw:colSep := hb_UTF8ToStr( "│ │" )
oBrw:headSep := _DRAW_3
oBrw:footSep := _DRAW_4
oBrw:colSep := _DRAW_5
oBrw:SkipBlock := {| n | hb_idleSleep( 0.2 ), ;
n := iif( n < 0, Max( n, 1 - s_nPos ), ;
@@ -73,15 +95,15 @@ PROCEDURE Main()
oCol2 := TBColumnNew( "COL;2", {|| s_nCount++ } )
oCol2:defColor := { 3, 4, 5, 6 }
oCol2:footing := "counter"
oCol2:headSep := hb_UTF8ToStr( "┐ ┌─┤HIDE├─" )
oCol2:headSep := _DRAW_6
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 := hb_UTF8ToStr( "╖ ╓─┤HIDE├─" )
oCol3:footSep := hb_UTF8ToStr( "╜ ╙─" )
oCol3:colSep := hb_UTF8ToStr( "║ ║" )
oCol3:headSep := _DRAW_7
oCol3:footSep := _DRAW_8
oCol3:colSep := _DRAW_9
oCol4 := TBColumnNew( " SHOW; ALL", {|| Date() - s_nPos } )
oCol4:defColor := { 6, 3, 4, 2 }

View File

@@ -26,9 +26,9 @@ PROCEDURE Main()
#endif
oBrowse:colorSpec := "W+/B, N/BG"
oBrowse:ColSep := hb_UTF8ToStr( "│" )
oBrowse:HeadSep := hb_UTF8ToStr( "╤═" )
oBrowse:FootSep := hb_UTF8ToStr( "╧═" )
oBrowse:ColSep := hb_UTF8ToStrBox( "│" )
oBrowse:HeadSep := hb_UTF8ToStrBox( "╤═" )
oBrowse:FootSep := hb_UTF8ToStrBox( "╧═" )
oBrowse:GoTopBlock := {|| n := 1 }
oBrowse:GoBottomBlock := {|| n := Len( aTest0 ) }
oBrowse:SkipBlock := {| nSkip, nPos | nPos := n, ;
@@ -60,7 +60,7 @@ PROCEDURE Main()
cColor := SetColor( "W+/B" )
nRow := Row()
nCol := Col()
@ 4, 4, 17, 31 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
@ 4, 4, 17, 31 BOX hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
#ifdef HB_COMPAT_C53
oBrowse:SetKey( 0, {| ob, nkey | Defproc( ob, nKey ) } )
WHILE .T.