Files
harbour-core/harbour/tests/gtchars.prg
Przemyslaw Czerpak 893a870c7f 2007-06-23 15:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbgtcore.h
  * harbour/source/rtl/gtchrmap.c
  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gttrm/gttrm.c
    + added 3-rd parameter BOOL fSetACSC to hb_gt_chrmapinit() function
    * initialize ACSC translation for XTERM like terminals when
      hb_charmap.def file cannot be found or there is no valid
      section for used terminal

  + harbour/tests/gtchars.prg
  + harbour/tests/gtcolors.prg
  + harbour/tests/gtkeys.prg
   + added test ptograms for GT drivers to test all character output and
     automatic CP translation, colors settings and keyboard/mouse input
2007-06-23 13:46:03 +00:00

87 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* $Id$
*/
/*
* Harbour Project source code:
* demonstration/test code for terminal character output and codepage
* translations
*
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*
*/
#include "hbgtinfo.ch"
#define POL_MAZ "<22><EFBFBD>œ¥£˜ ¡†<C2A1>¤¢ž¦§"
#define POL_ISO "¡ÆÊ£ÑÓ¦¬¯±æê³ñ󶼿"
#define POL_852 "¤<>¨<EFBFBD>ãà—<C3A0>½¥†©ˆä¢˜«¾"
#define POL_WIN "¥ÆÊ£ÑÓŒ<C393>¯¹æê³ñ󜟿"
REQUEST HB_CODEPAGE_PLMAZ
REQUEST HB_CODEPAGE_PLISO
REQUEST HB_CODEPAGE_PL852
REQUEST HB_CODEPAGE_PLWIN
function main( cTermCP, cHostCP, lBoxChar )
local i, j, x
if empty( cTermCP )
cTermCP := "PLISO"
else
cTermCP := upper( cTermCP )
endif
if empty( cHostCP )
cHostCP := "PLMAZ"
else
cHostCP := upper( cHostCP )
endif
lBoxChar := !empty( lBoxChar )
HB_GTINFO( GTI_FONTSIZE, 20 )
HB_GTINFO( GTI_FONTWIDTH, 9 )
HB_GTINFO( GTI_FONTNAME, "fixed" )
HB_SETTERMCP( cTermCP, cHostCP, lBoxChar )
? OS(), VERSION(), DATE(), TIME()
? HB_GTVERSION(), HB_GTVERSION(1)
? "Host codpage: " + cHostCP + ", terminal codepage: " + cTermCP
?
//HB_GTINFO(GTI_COMPATBUFFER,.f.)
?
for i := 0 to 15
for j := 0 to 15
x := i * 16 + j
dispout( " " + chr( x ) )
next
?
next
inkey(0)
?; dspboxch( "ÚÄÂÄ¿ ÉÍËÍ» ÕÍÑ͸ ÖÄÒÄ· ÜÜÜ °±²Û ° ± ² Û" )
?; dspboxch( "³ ³ ³ º º º ÃÄÅÄ´ ÇÄ×Ķ ÝþÞ" )
?; dspboxch( "ÃÄÅÄ´ ÌÍÎ͹ ³ ³ ³ º º º ÝÛÞ ÛþÛ" )
?; dspboxch( "³ ³ ³ º º º ÆÍØÍµ ÌÍÎ͹ ÝþÞ" )
?; dspboxch( "ÀÄÁÄÙ ÈÍÊͼ ÔÍÏ; ÓÄÐĽ ßßß û ® ¯" )
?
? "ISO-8859-2: say[ " + POL_ISO + " ]"; dspboxch( ", box[ " + POL_ISO + " ]" )
? " Mazovia: say[ " + POL_MAZ + " ]"; dspboxch( ", box[ " + POL_MAZ + " ]" )
? " CP-1250: say[ " + POL_WIN + " ]"; dspboxch( ", box[ " + POL_WIN + " ]" )
? " CP-852: say[ " + POL_852 + " ]"; dspboxch( ", box[ " + POL_852 + " ]" )
? chr(4)+chr(16)+chr(17)+chr(24)+chr(25)+chr(26)+chr(27)+chr(30)+chr(31)
HB_GTINFO(GTI_ESCDELAY,5)
inkey(0)
alert("ALERT BOX")
return nil
function dspboxch( cStr )
local i, r, c
for i := 1 to len( cStr )
r:=row(); c:=col()
dispbox( r, c, r, c, substr( cStr, i, 1 ) )
setpos(r,c+1)
next
return nil