Files
harbour-core/harbour/tests/setmode.prg
Viktor Szakats 1c0374484c 2013-03-10 14:14 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbtest/core.prg
    + use octal notation for all non-displayable bytes.
      It fixes few issues with previous escaping logic
      and avoids non-displayable chars in RTE test sources
      and results.
    + use more space for test results, less for line numbers

  * contrib/hbtest/tests/test.prg
    * adapted to above change
    + added more tests

  * contrib/hbamf/tests/test.prg
    * use octal notation in expected results

  * contrib/hbct/charone.c
    ! WordOne(): fixed when second parameter is not passed
      (previously it was a noop in this case)

  * contrib/hbct/tests/test.prg
    ! typos in comments

  * utils/hbtest/hbtest.prg
    + force switch to cp437 ("EN") under Harbour
    * runtime configuration moved right to startup

  * contrib/hbnf/popadder.prg
  * extras/gtwvw/docs/gtwvw.txt
  * utils/hbtest/rt_misc.prg
  * utils/hbtest/rt_str.prg
  * tests/setmode.prg
    ! avoid remaining non-ASCII, non-UTF8 chars in source

  * contrib/hbmisc/nconvert.prg
  * contrib/hbnf/netpv.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/round.prg
  * contrib/hbnf/sqzn.prg
  * tests/money.prg
  * tests/str.prg
    * use '^' operator instead of '**'

  * contrib/hbmisc/stringp.prg
  * contrib/hbwin/tests/prn2.prg
    * cleanups
2013-03-10 13:17:07 +00:00

80 lines
1.7 KiB
Plaintext

/*
* $Id$
*/
// Copyright 2000 Alejandro de Garate <alex_degarate hotmail com>
// Test SetMode() for Harbour
#define HB_NOT_SUPPORTED "Video mode not supported on this system.."
#define HB_VROW 1
#define HB_VCOL 2
#define HB_PROMPT 3
PROCEDURE Main()
LOCAL nMode := 1, nRow
LOCAL aVModes := { ;
{ 12, 40, " 12 x 40 " }, ;
{ 25, 40, " 25 x 40 " }, ;
{ 28, 40, " 28 x 40 " }, ;
{ 50, 40, " 50 x 40 " }, ;
{ 12, 80, " 12 x 80 " }, ;
{ 25, 80, " 25 x 80 " }, ;
{ 28, 80, " 28 x 80 " }, ;
{ 43, 80, " 43 x 80 " }, ;
{ 50, 80, " 50 x 80 " }, ;
{ 60, 80, " 60 x 80 " } }
DO WHILE nMode != 0
CLS
@ 0, 0 SAY "Select the video mode you want to test.."
FOR nRow := 1 TO 5
@ 2 + nRow, 10 PROMPT aVModes[ nRow ][ HB_PROMPT ]
NEXT
FOR nRow := 6 TO 10
@ 2 + nRow - 5, 25 PROMPT aVModes[ nRow ][ HB_PROMPT ]
NEXT
MENU TO nMode
IF nMode > 0
IF SetMode( aVModes[ nMode ][ HB_VROW ], aVModes[ nMode ][ HB_VCOL ] )
TESTBOX( aVModes[ nMode ][ HB_PROMPT ] )
ELSE
@ MaxRow(), 0 SAY HB_NOT_SUPPORTED
Inkey( 0 )
ENDIF
ENDIF
ENDDO
RETURN
// Simple testing screen.
PROCEDURE TESTBOX( cMode )
LOCAL nRow
CLS
@ 0, 0 TO MaxRow(), MaxCol() DOUBLE
@ 0, 3 SAY cMode
@ MaxRow(), 3 SAY " Press a key "
@ 8, 0 SAY Replicate( Chr( 25 ) /* LOW-ASCII "↓" */ + " ", 20 )
@ 9, 0 SAY Replicate( "0123456789", 20 )
FOR nRow := 0 TO MaxRow()
@ nRow, 18 SAY Str( nRow, 2 )
NEXT
@ 4, 2 SAY "MaxRow() = " + Str( MaxRow(), 3 )
@ 5, 2 SAY "MaxCol() = " + Str( MaxCol(), 3 )
Inkey( 0 )
RETURN