Files
harbour-core/harbour/tests/tstgtapi.c
Viktor Szakats 6fe841c614 2012-10-23 23:33 UTC+0200 Viktor Szakats (harbour syenar.net)
* config/detect.mk
  * contrib/hbct/print.c
  * contrib/hbnf/fttext.c
  * contrib/hbnf/n2color.c
  * contrib/hbnf/tests/clrsel.prg
  * contrib/hbnf/tests/menu1.prg
  * contrib/hbwin/win_tprn.prg
  * doc/en/browse.txt
  * doc/en/compiler.txt
  * doc/en/file.txt
  * doc/en/garbage.txt
  * doc/en/gtslang.txt
  * doc/en/idle.txt
  * doc/en/memo.txt
  * doc/en/misc.txt
  * doc/en/setmode.txt
  * doc/en/string.txt
  * doc/en/terminal.txt
  * doc/gtapi.txt
  * doc/tracing.txt
  * include/filesys.api
  * include/hbapifs.h
  * include/hbsetup.h
  * package/mpkg_win.nsi
  * package/winuni/RELNOTES
  * src/codepage/*.c
  * src/common/hbffind.c
  * src/rtl/gete.c
  * src/rtl/hbgtcore.c
  * src/rtl/isprint.c
  * src/rtl/net.c
  * src/rtl/run.c
  * src/rtl/tlabel.prg
  * src/rtl/treport.prg
  * src/vm/dynsym.c
  * tests/stripem.prg
  * tests/tstgtapi.c
    * various platform related doc cleanups
2012-10-23 21:42:07 +00:00

75 lines
1.6 KiB
C

/*
* $Id$
*/
#include "hbapigt.h"
int main( void )
{
const char * test = "Testing GT API Functions";
const char * test2 = "This message wraps!";
void * scr;
HB_SIZE size;
/* NOTE: always have to initialze video subsystem */
hb_gtInit( 0, 0, 0 );
/* save screen */
hb_gtRectSize( 1, 1, hb_gtMaxRow(), hb_gtMaxCol(), &size );
scr = hb_xgrab( size );
hb_gtSave( 1, 1, hb_gtMaxRow() - 1, hb_gtMaxCol() - 1, scr );
/* writing text */
hb_gtSetPos( 3, 3 );
hb_gtWrite( test, strlen( test ) );
hb_gtSetPos( 12, 42 );
hb_gtWrite( test, strlen( test ) );
/* wrapping text */
hb_gtSetPos( 7, 70 );
hb_gtWrite( test2, strlen( test2 ) );
/* writing color text */
hb_gtSetColorStr( "W+/B, B/W" );
hb_gtColorSelect( HB_CLR_STANDARD );
hb_gtWrite( "Enhanced color (B/W)", 20 );
hb_gtSetPos( 22, 62 );
hb_gtColorSelect( HB_CLR_ENHANCED );
hb_gtWrite( "Standard Color (W+/B)", 21 );
/* boxes */
hb_gtBoxS( 10, 10, 20, 20 );
hb_gtBoxD( 10, 40, 15, 45 );
/* cursor functions */
hb_gtSetPos( 12, 1 );
/* none */
hb_gtSetCursor( SC_NONE );
hb_inkey( HB_TRUE, 0.0, INKEY_ALL );
/* underline */
hb_gtSetCursor( SC_NORMAL );
hb_inkey( HB_TRUE, 0.0, INKEY_ALL );
/* lower half block */
hb_gtSetCursor( SC_INSERT );
hb_inkey( HB_TRUE, 0.0, INKEY_ALL );
/* full block */
hb_gtSetCursor( SC_SPECIAL1 );
hb_inkey( HB_TRUE, 0.0, INKEY_ALL );
/* upper half block */
hb_gtSetCursor( SC_SPECIAL2 );
hb_inkey( HB_TRUE, 0.0, INKEY_ALL );
/* restore screen */
hb_gtRest( 1, 1, hb_gtMaxRow() - 1, hb_gtMaxCol() - 1, scr );
hb_xfree( scr );
return 0;
}