home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
news
/
770
/
fastgt15
/
fastgtde
/
demo.prg
< prev
next >
Wrap
Text File
|
1994-03-27
|
12KB
|
366 lines
#include "inkey.ch"
#include "fastgt.ch"
//
// FastGT. The New Clipper Graphical Term
//
// (C) 1992-94 Manu Roibal
//
Function main()
Local GetList := {}
Local cData1 := "This's a demo program"
Local cData2 := "More gets "
Local cScr1
Local cScr2
Local cScr3
Local nInd
Local aArray := {}
Local hButtom1
Local hButtom2
Local hIcon1
Local nMode
Local hHandle
Local lMouse
Local nKey := 0
SetCancel( .F. )
// nMode := SearchMode() // search the VESA mode to use
// hHandle := gtInit( nMode ) // installs FastGT system
hHandle := gtInit( 4 ) // installs FastGT system
// You must test with
//
// 0 SVGA 640x400x256
// 1 SVGA 640x480x256
// 2 SVGA 800x600x256
// 3 SVGA 1024x768x256
// 4 VGA 640x480x16
Set ScoreBoard Off
Cls
? "FastGT. The New Technology of Fastware"
?
? "(C) 1992-94 Manu Roibal"
?
? "Now, you can build graphic aplications with Clipper!!!"
?
? "VESA Version : " + VesaVer()
? "VESA OEM : " + VesaOEM()
? "MaxRow : " + Str( MaxRow() )
? "MaxCol : " + Str( MaxCol() )
? "Write BIOS Support : " + If( VesaBIOS(), "Yes", "No" )
?
? "─────────────────────────────────────────────────────────"
?
? "If your SVGA is >256kb you can test gtInit( 0 ) or gtInit( 1 )"
? "And if it's 1Mb Video Card you can test gtInit( 2 ) and gtInit( 3 )"
? "But... if you haven't a SVGA you can test gtInit( 4 ) in VGA standard"
?
? "─────────────────────────────────────────────────────────"
?
? "Push any key to continue"
MyInkey()
MouseCursor( MOUSE_ON )
MousePointer( MOUSE_CLOCK )
Alert( "This's a Standard Alert();;Do you like FastGT?;;" + ;
"(C) 1992-93 Manu Roibal;;" + ;
"Working... The mouse pointer is a clock", { "Ok" } )
MousePointer( MOUSE_POINT )
@ 0, 0, MaxRow(), MaxCol() GTBOX COLOR "w/b*"
ShowMSIco( "whello.ico", 60, 300 )
ShowMSIco( "bc.ico", 60, 340 )
ShowMSIco( "dlldemo.ico", 60, 380 )
ShowMSIco( "ffind.ico", 60, 420 )
ShowMSIco( "hdump.ico", 60, 460 )
ShowMSIco( "msgwnd.ico", 60, 500 )
ShowMSIco( "tstapp.ico", 60, 540 )
ShowMSIco( "rwdemo.ico", 60, 580 )
ShowMSIco( "tstapp.ico", 100, 300 )
ShowMSIco( "critter.ico", 100, 340 )
ShowMSIco( "critter2.ico", 100, 380 )
ShowMSIco( "calc.ico", 100, 420 )
ShowMSIco( "checkers.ico", 100, 460 )
ShowMSIco( "cursor.ico", 100, 500 )
ShowMSIco( "ellipse.ico", 100, 540 )
ShowMSIco( "fellipse.ico", 100, 580 )
ShowMSIco( "fill.ico", 140, 300 )
ShowMSIco( "frect.ico", 140, 340 )
ShowMSIco( "owlpaint.ico", 140, 380 )
ShowMSIco( "pen.ico", 140, 420 )
ShowMSIco( "rect.ico", 140, 460 )
ShowMSIco( "ttt.ico", 140, 500 )
ShowMSIco( "pserror.ico", 140, 540 )
@ 30, 20 GTDRAWICON "Salida.fic"
@ 30, 60 GTDRAWICON "Camara.fic"
@ 30, 100 GTDRAWICON "Msdos.fic"
@ 30, 140 GTDRAWICON "Brocha.fic"
@ 30, 180 GTDRAWICON "Help.fic"
@ 90, 20 GTDRAWICON "Cia001.fic"
@ 90, 60 GTDRAWICON "Hogar.fic"
@ 90, 100 GTDRAWICON "decesos.fic"
@ 90, 140 GTDRAWICON "Vida.fic"
@ 90, 180 GTDRAWICON "Vida1m.fic"
@ 90, 220 GTGIVEICON "Familia.fic" INTO hIcon1
GTDRAWICON hIcon1
SetCursor( 0 )
While MyInkey() != K_ESC
GTPUSHICON hIcon1
End
@ 18, 6, 23, 24 GTWINBOX "Mouse Demo" COLOR "w/b"
@ 20, 10 Say "▓" Color "w/b"
@ 20, 15 Say "▓" Color "w/b"
@ 20, 20 Say "▓" Color "w/b"
While nKey != K_ESC
nKey := Inkey( 0 )
if nKey == K_MOUSE_LEFT
@ 20, 10 Say "▓" Color "gr+/b"
elseif nKey == K_MOUSE_CENTRE
@ 20, 15 Say "▓" Color "gr+/b"
elseif nKey == K_MOUSE_RIGHT
@ 20, 20 Say "▓" Color "gr+/b"
elseif nKey == K_MOUSE_RELEASE
@ 20, 10 Say "▓" Color "w/b"
@ 20, 15 Say "▓" Color "w/b"
@ 20, 20 Say "▓" Color "w/b"
endif
@ 22, 7 Say "Key pressed: " + Str( nKey, 3 ) color "w/b"
end
SetCursor( 1 )
@ 6, 3, 18, 50 GTWINBOX "FastGT Demo" COLOR "R/W"
@ 9, 5 Say "This's a demo of FastGT" Color "B/W"
@ 11, 5 Say "You can draw graphic elements and display" Color "R/W"
@ 12, 5 Say "texts, boxs, shadows... with Clipper code" Color "R/W"
@ 14, 5 Say "Press Esc to exit" Color "B+/W"
@ 15, 62 Say "Bar Demo" Color "B/B*"
DrawBar( 230, 470, 120, 20, 6, 2, 10 )
DrawBar( 230, 510, 160, 20, 6, 3, 11 )
DrawBar( 230, 550, 110, 20, 6, 4, 12 )
lMouse := MouseCursor( MOUSE_OFF )
VesaWriteAt( 352, 480, "Line Demo", 15, 9, 0, 8 )
VesaWriteAt( 368, 480, "Line Demo", 15, 9, 0, 10 )
VesaWriteAt( 384, 480, "Line Demo", 15, 9, 0, 12 )
VesaWriteAt( 400, 480, "Line Demo", 15, 9, 0, 14 )
VesaWriteAt( 416, 480, "Line Demo", 15, 9, 0, 16 )
Vesaline( 300, 450, 350, 450, 10 )
Vesaline( 300, 450, 300, 500, 11 )
Vesaline( 300, 500, 350, 500, 12 )
Vesaline( 350, 500, 350, 450, 13 )
Vesaline( 350, 500, 300, 450, 14 )
Vesaline( 350, 450, 300, 500, 15 )
MouseCursor( lMouse )
SetCursor( 0 )
@ 16, 10 GTDRAWBTN "Cancel" INTO hButtom1
@ 16, 35 GTDRAWBTN " Ok " INTO hButtom2
While MyInkey() != K_ESC
GTPUSHBTN hButtom2
End
GTPUSHBTN hButtom1
SetCursor( 1 )
@ 14, 19, 22, 77 GTWINBOX "MultiFont Demo" COLOR "R/B"
@ 16, 22 Say "System Big Font acdefghijklmnopqrstuvwxyz1234567890" Color "GR+/B"
VesaLoadFont( "Script.fon" )
VesaSetFont( FONT_USER )
@ 17, 22 Say "User Font 1 acdefghijklmnopqrstuvwxyz1234567890" Color "G+/B"
VesaLoadFont( "Antique.fon" )
VesaSetFont( FONT_USER )
@ 18, 22 Say "User Font 2 acdefghijklmnopqrstuvwxyz1234567890" Color "G+/B"
VesaLoadFont( "Roman.fon" )
VesaSetFont( FONT_USER )
@ 19, 22 Say "User Font 3 acdefghijklmnopqrstuvwxyz1234567890" Color "G+/B"
VesaLoadFont( "Italic.fon" )
VesaSetFont( FONT_USER )
@ 20, 22 Say "User Font 4 acdefghijklmnopqrstuvwxyz1234567890" Color "G+/B"
VesaSetFont( FONT_SMALL )
@ 21, 22 Say "System Small Font acdefghijklmnopqrstuvwxyz1234567890" Color "W+/B"
VesaSetFont( FONT_BIG )
MyInkey()
@ 2, 27, 11, 72 GTWINBOX "Program Manager" COLOR "R/W"
@ 5, 30 Say "This's a demo of FastGT Window System" Color "R/W"
@ 7, 30 Say "You have source code of these functions" Color "G+/W"
@ 9, 30 Say "You can add mouse control, scroll..." Color "B+/W"
UserBox( 5, 29, 41, 15, 8 )
UserBox( 7, 29, 41, 8, 15 )
UserBox( 9, 29, 41, 8, 15 )
SetCursor( 0 )
MyInkey()
UserBox( 5, 29, 41, 8, 15 )
UserBox( 7, 29, 41, 15, 8 )
MyInkey()
UserBox( 7, 29, 41, 8, 15 )
UserBox( 9, 29, 41, 15, 8 )
MyInkey()
UserBox( 9, 29, 41, 8, 15 )
SetCursor( 1 )
cScr1 := SaveScreen( 12, 8, 17, 60 ) // goes to disk
@ 12, 8, 17, 60 BOX "╔═╗║╝═╚║ " Color "R/W"
@ 14, 10 Say "Data 1:" Get cData1 Color "B/W"
@ 15, 10 Say "Data 2:" Get cData2 Color "R/W"
Read
RestScreen( 12, 8, 17, 60, cScr1 ) // restores from disk
@ 20, 2, 23, 50 BOX "╔═╗║╝═╚║ " Color "B/W"
@ 21, 4 Say "FastGT, (C) Manu Roibal" Color "G+/W"
@ 22, 4 Say "Welcome to graphics world" Color "R/W"
MyInkey()
SetCursor( 0 )
MyInkey()
SetCursor( 1 )
MyInkey()
SetCursor( 2 )
MyInkey()
SetColor( "GR+/B" )
@ 10, 20, 16, 76 GTWINBOX "MemoEdit Demo"
VesaLoadFont( "Script.fon" )
VesaSetFont( FONT_USER )
MemoEdit( "This's a standard MemoEdit... Default Font is Script", 12, 21, 15, 75 )
VesaSetFont( FONT_BIG )
cScr3 := SaveScreen( 8, 29, 20, 51 )
SetColor( "W/B, GR+/B, , , N+/B" )
@ 8, 29, 20, 51 GTWINBOX "aChoice Demo"
aAdd( aArray, "And this, is a" )
aAdd( aArray, "standard aChoice." )
aAdd( aArray, "***" )
aAdd( aArray, "Default font is" )
aAdd( aArray, "Italic." )
aAdd( aArray, "***" )
aAdd( aArray, "All code is 100%" )
aAdd( aArray, "Clipper Standard" )
aAdd( aArray, "Code" )
aAdd( aArray, "***" )
aAdd( aArray, "New Line" )
VesaLoadFont( "Italic.fon" )
VesaSetFont( FONT_USER )
aChoice( 10, 30, 19, 50, aArray, .T. )
VesaSetFont( FONT_BIG )
cScr2 := SaveScreen( 16, 17, 21, 56 )
@ 16, 17, 21, 56 GTWINBOX "256 colors - Pallete Demo" COLOR "W/R"
lMouse := MouseCursor( MOUSE_OFF )
For nInd := 0 To 255
VesaLine( 18 * 16, 20 * 8 + nInd, 21 * 16, 20 * 8 + nInd, nInd )
Next
MouseCursor( lMouse )
SetCursor( 0 )
MyInkey()
SetCursor( 1 )
RestScreen( 16, 17, 21, 56, cScr2 )
RestScreen( 8, 29, 20, 51, cScr3 )
SetColor( "W/B, GR+/B, , , N+/B" )
USE demo new
@ 6, 10, 22, 56 GTWINBOX "dbEdit Demo"
VesaLoadFont( "UperCase.fon" )
VesaSetFont( FONT_USER )
Keyboard( Chr( K_RETURN ) )
dbEdit( 8, 11, 21, 53, { "Name", "Country" }, "DEMOFUNC" )
CLOSE demo
VesaLoadFont( "Script.fon" )
VesaSetFont( FONT_USER )
Alert( "Bye bye;;Press <─┘ to return to text mode;;" + ;
"For register read the file register.doc", { "Ok", "Register" } )
gtClose( hHandle ) // deinstalls FastGT system
Return( Nil )
Function DemoFunc( nMode, nCol )
Static nPos
Local nIndex := RecNo() / LastRec()
Local nRet := 1
If nPos == Nil
nPos := Int( 10 + 11 * nIndex )
EndIf
WriteChar( nPos, 55, , .F. )
nPos := Int( 10 + 11 * nIndex )
WriteChar( nPos, 55, "G/G", .T. )
If LastKey() == K_MOUSE_RIGHT .Or. LastKey() == K_ESC
nRet := 0
EndIf
Return( nRet )
Static Function WriteChar( nY, nX, cColor, lMode )
@ nY, nX Say " " Color cColor
If lMode
UserBox( nY, nX, 1, 8, 10 )
EndIf
Return( Nil )
static function MyInkey()
local nKey := Inkey( 0 )
if nKey == K_MOUSE_LEFT .or. ;
nKey == K_MOUSE_RIGHT .or. ;
nKey == K_MOUSE_CENTRE
Inkey( 0 ) // when a mouse button is pressed 2 keys are
// introduced to keyboard buffer. One for the
// specified mouse buttons and another when
// mouse button is released.
endif
return( nKey )