Files
harbour-core/harbour/tests/boxtst2.prg
Viktor Szakats 90ef3520b2 2012-10-02 01:10 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbmisc/hbedit.prg
  * src/debug/dbghelp.prg
  * src/debug/dbgtmenu.prg
  * src/debug/dbgtwin.prg
  * src/debug/dbgwa.prg
  * src/rtl/browse.prg
  * src/rtl/listbox.prg
  * src/rtl/radiogrp.prg
  * src/rtl/tmenuitm.prg
  * src/rtl/tpopup.prg
  * tests/gtwin.prg
  * tests/box.prg
  * tests/boxtst2.prg
  * tests/scroll.prg
  * tests/vidtest.prg
    ! fixed to use new unicode-compatible box.ch/button.ch macros
      For standalone programs (in tests) in only makes any difference
      when running them as scripts, now they will work (after
      adding hbshell_gtInteracive() call at startup), while
      before the drawing chars were scrambled.

  * src/rtl/browse.prg
  * src/rtl/checkbox.prg
  * src/rtl/dbedit.prg
  * src/rtl/dbedit.prg
  * src/rtl/listbox.prg
  * src/rtl/scrollbr.prg
  * src/rtl/tmenuitm.prg
    ! fixed Chr() calls for drawing chars to unicode strings
      to be compatible with both unicode and non-unicode (and
      any BOXCP) mode.

  * src/rtl/browse.prg
    ! fixed to use '!( hb_keyChar( nKey ) == "" )' instead
      of looking for keycode between 32 and 255 (inclusive)
      making it unicode compatible
    * formatting

  * src/rtl/tpersist.prg
  * src/rtl/memoedit.prg
  * src/debug/debugger.prg
  * src/debug/dbgthsh.prg
  * src/debug/dbgtarr.prg
  * src/debug/tbrwtext.prg
    * formatting

  * src/rtl/tmenuitm.prg
  * src/rtl/tpopup.prg
    + added TOFIXes where drawing chars are used as internal
      flags. This may cause problems if switching CPs while
      using these objects.

  * tests/sbartest.prg
    + unicode compatibility while keeping it Cl*pper compatible
    ! fixed RTE due to using wrong SCROLLBAR method

  * tests/tb1.prg
    * changed to use new unicode-compatible box.ch/button.ch macros
      while keeping Cl*pper compatibility

  * tests/vidtest.prg
    ! fixed remaining drawing chars using Chr() (Cl*pper
      compatibility maintained)

  * tests/testsha2.prg
  * tests/utf8at.prg
    ! fixed to use HB_BCHAR() instead of CHR() for unicode compatibility.

  ; NOTE: After above changes scripts and commands run via hbrun 
          will display drawing chars properly. Unicode apps as 
          well, even with BOXCP set to unicode, too.

  ; TODO: Fix above things also on C level, f.e. DISPBOX() with
          numeric box drawing request.
2012-10-01 23:16:18 +00:00

54 lines
1.9 KiB
Plaintext

/*
* $Id$
*/
// Test program for box and line drawing functions.
/* Harbour Project source code
http://harbour-project.org/
Donated to the public domain on 2001-08-22 by David G. Holm <dholm@jsd-llc.com>
*/
#include "box.ch"
PROCEDURE Main()
LOCAL max_row, max_col, boxColor := "W+/B,N/BG", lineColor := "W+/R, N/BG"
CLS
max_row := MaxRow()
max_col := MaxCol()
// Draw filled boxes centered around the four screen corners.
DispBox( -10, -10, 10, 10, HB_B_SINGLE_UNI + "X", boxColor )
DispBox( -10, max_col - 10, 10, max_col + 10, HB_B_SINGLE_UNI + "X", boxColor )
DispBox( max_row - 10, - 10, max_row + 10, 10, HB_B_SINGLE_UNI + "X", boxColor )
DispBox( max_row - 10, max_col - 10, max_row + 10, max_col + 10, HB_B_SINGLE_UNI + "X", boxColor )
// Draw non-filled boxes around the filled boxes.
DispBox( -15, -15, 15, 15, 1, boxColor )
DispBox( -15, max_col - 15, 15, max_col + 15, 1, boxColor )
DispBox( max_row - 15, - 15, max_row + 15, 15, 1, boxColor )
DispBox( max_row - 15, max_col - 15, max_row + 15, max_col + 15, 1, boxColor )
// Draw a box in the center, then two boxes off screen.
DispBox( 20, 20, 25, 60, 2, boxColor )
DispBox( -10, -10, -1, -1, 2, boxColor )
DispBox( max_row + 1, max_col + 1, max_row + 10, max_col + 10, 2, boxColor )
// Draw horizontal lines from off-screen to on-screen,
// off-screen to off-screen, and on-screen to off-screen.
DispBox( 1, -10, 1, 10, HB_B_SINGLE_UNI, lineColor )
DispBox( 2, -10, 2, max_col + 10, HB_B_DOUBLE_UNI, lineColor )
DispBox( 3, max_col - 10, 3, max_col + 10, HB_B_SINGLE_UNI, lineColor )
// Draw vertical lines from off-screen to on-screen,
// off-screen to off-screen, and on-screen to off-screen.
DispBox( -10, 1, 10, 1, HB_B_SINGLE_UNI, lineColor )
DispBox( -10, 2, max_row + 10, 2, HB_B_DOUBLE_UNI, lineColor )
DispBox( max_row - 10, 3, max_row + 10, 3, HB_B_SINGLE_UNI, lineColor )
Inkey( 5 )
RETURN