home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-31 | 125.1 KB | 2,944 lines |
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ │
- │ DEMO20.PRG │
- │ │
- │ Source File for TSDWIN.LIB │
- │ Clipper 5.0 Interface Library │
- │ │
- │ Copyright ( C ) 1992 by Trilateral Systems Development Ltd. │
- │ All Rights Reserved * Version 2.00 * Release Date: Aug 1, 1992 │
- │ │
- │ 18 Bond St. South │
- │ Dundas, ON, Canada │
- │ L9H 3H1 │
- │ 416-628-5086 │
- │ │
- │ │
- │ Documented: 08-26-92 at 11:47:41am │
- └──────────────────────────────────────────────────────────────────────────┘
- */
-
- #include "twinkey.ch"
- #include "tsdwin.ch"
- #include "demo20.ch"
- #include "getexit.ch"
-
- #define K_UNDO K_CTRL_U
-
- STATIC lMono := .F., lOKMouse := .F.
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Main Menu for TSDDEMO │
- │ Author: Vic Lewis │
- │ Date created: 08-26-92 │
- │ Time created: 11:49:18am │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ FUNCTION Main( cCmdLine ) │
- │ │
- │ Arguments: cCmdLine (/THIN /M /50 /?) │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION Main( cCmdLine )
- LOCAL nChoice := 1, nStartRow, nStartCol, nX, lExitRequested := .F.
- LOCAL aMenu := {}, nExit, nThickness := 2, cClrTemp, aArea := { 24, 24 }
- LOCAL aPrompts := { " «1.» TSDWIN Highlights ",;
- " «2.» Window Functions ",;
- " «3.» Message Functions ",;
- " «4.» Menu Functions ",;
- " «5.» Browse Systems ",;
- " «6.» Mouse Support ",;
- " «7.» Miscellaneous ",;
- " «8.» Hardware Functions ",;
- " «9.» Placing an Order ",;
- " «Q.» End the Demo " }
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Set Up Environment
- └──────────────────────────────────────────────────────────────────────────
- */
- SET CURSOR OFF
- SET SCOREBOARD OFF
- SET WRAP ON
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Link in the Screen Savers
- └──────────────────────────────────────────────────────────────────────────
- */
- EXTERNAL twSSaveAsc
- EXTERNAL twWSaveAsc
- SET KEY 287 TO twSSaveAsc
- SET KEY 273 TO twWSaveAsc
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Parse the command line
- └──────────────────────────────────────────────────────────────────────────
- */
- lMono := IIF( ISCOLOR(), .F. , .T. )
- IF cCmdLine != NIL
- IF "/THIN" $ UPPER( cCmdLine )
- nThickness := 1
- ENDIF
- IF "/M" $ UPPER( cCmdLine )
- lMono := .T.
- ENDIF
- IF "/50" $ UPPER( cCmdLine )
- aArea := { 49, 49 }
- SETMODE( 50, 80 )
- ENDIF
- IF "/?" $ cCmdLine
- cClrTemp := SETCOLOR( IIF( !lMono, "gr+/n", "w+/n" ))
- QOUT( " Usage: TSDDEMO <options>" )
- QOUT( "" )
- SETCOLOR( IIF( !lMono, "bg+/n", "w+/n" ))
- QOUT( " Options: '/THIN' for Thin Shadows." )
- QOUT( " '/M' for Monochrome" )
- QOUT( " '/50' for VGA Mode" )
- SETCOLOR( IIF( !lMono, "rb+/n", "w+/n" ))
- QOUT( "" )
- QOUT( " TSDWIN.LIB " )
- QOUT( " Clipper 5.01 Interface Library" )
- QOUT( " Trilateral Systems Development Ltd." )
- QOUT( " 416-628-5086" );QOUT( "" );QOUT( "" )
- SETCOLOR( cClrTemp )
- RETURN NIL
- ENDIF
- ENDIF
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Initialize windows to thick or thin shadows
- │ and allow for Monchrome Override if Graphics card installed
- │ Save environment and DOS screen
- └──────────────────────────────────────────────────────────────────────────
- */
- twInit( nThickness )
- twOpen()
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Initialize the Mouse
- └──────────────────────────────────────────────────────────────────────────
- */
- #IFNDEF NOMOUSE
- lOKMouse := twMouseInit()
- #ENDIF
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Initialize TSDWIN 'meta' variables from the header file.
- └──────────────────────────────────────────────────────────────────────────
- */
- INITGLOBALS
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Initialize TSDWIN Message Systems
- └──────────────────────────────────────────────────────────────────────────
- */
- twAlertInit( , { { CBUTTON, CFBUTTON }, ;
- { CCHECK, CFCHECK }, ;
- { CRADIO, CFRADIO } } ) // Alert Initialization
- twAMsgInit( , { COLORW, COLORN }, aArea ) // Area Message Initialization
- twMsgInit( , { { COLORE, TCOLOR },;
- { COLORW, TCOLOR },;
- { COLORM, TCOLOR },;
- { COLORW, TCOLOR },;
- { COLORW, TCOLOR } }) // Messages
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Begin Main Menu
- └──────────────────────────────────────────────────────────────────────────
- */
- SETCOLOR( IIF( ! lMono, "n/bg", "n/w" ))
- twExplode( .T. )
- twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
-
- twExplode( DEXPLODE )
- SETBLINK( DBLINK )
- twInfoLine( -2, "TSDWIN Interface Library for Clipper 5.01", "C", 0 )
- twInfoLine( -2, "«T»rilateral «S»ystems «D»evelopment Ltd.", "C" )
- TSDSetup( lMono )
-
- nStartRow := 2;nStartCol := 2
-
- FOR nX := 1 TO 10
- twCreateButton( nStartRow, nStartCol, SPACE( 21 ), .T.,, DSHADOW );nStartRow += 2
- NEXT
-
- twAttrib( .F., "n/w", 2, 28, 20, 75 )
- twBox( 2, 28, 20, 75, 1, "n/w" )
- twReplicate( 21, 29, "▀", 48, IIF( ! lMono, "n/b", "n/w" ))
- @ twRow( 2 ), twCol( 76 ) SAY "▄" COLOR IIF( ! lMono, "n/b", "n/w" )
- FOR nX = 1 TO 18
- @ twRow( nX + 2 ), twCol( 76 ) SAY "█" COLOR "n/n"
- NEXT
-
- DO WHILE .T.
- nStartRow := 2;nStartCol := 2
- twMenuInit( 2, twRow( 3 ), twCol( 30 ), IIF( ! lMono, "n/w,r/w", "n/w,w+/n" ), .T. )
-
- FOR nX := 1 TO 10
- @ nStartRow, nStartCol WPROMPT aPrompts[ nX ] MESSAGE StoreDesc( nX ) COLOR MENUCLR ;nStartRow += 2
- NEXT
-
- WMENU TO nChoice
-
- DO CASE
- CASE nChoice = 1;TSD10000()
- CASE nChoice = 2;TSD20000()
- CASE nChoice = 3;TSD30000()
- CASE nChoice = 4;TSD40000()
- CASE nChoice = 5;TSD50000()
- CASE nChoice = 6;TSD60000()
- CASE nChoice = 7;TSD70000()
- CASE nChoice = 8;TSD80000()
- CASE nChoice = 9;TSD90000()
- CASE nChoice = 10 .OR. nChoice = 0 .OR. LASTKEY() = K_ESC
- nExit := AskUser({ "Yes, I'm Finished", "No, Resume the Demo" },;
- "Are you sure you've seen enough?" )
- IF nExit != 2
- EXIT
- ELSE
- nChoice := 1
- ENDIF
- ENDCASE
-
- ENDDO
- twAMPop();twAMPop()
- twPop();twPop()
- SETMODE( 25, 80 )
- CLS
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: TSDWIN Highlights (Quick Reference File) │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 12:40:07pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD10000() │
- │ │
- │ Arguments: None. │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD10000()
- twTextFile( FULLSCREEN, "TSWINQRF.DOC", COLORN, ;
- 0, DFRAME, COLORFN,, ;
- {|| twTitle( "TSDWIN Quick Reference", "n/w" )})
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Basic Window Operations │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 12:54:26pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD20000 │
- │ │
- │ Arguments: None. │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD20000()
- LOCAL nWin1, nWin2, nWin3, nWin4, nWin5, nWin6, nKey := 0
- LOCAL nCol := 14, nRow := 4, nHandle, nX, nType, xTemp
- LOCAL aColors := { IIF( ! lMono, "gr+/r" ,"n/w" ),;
- IIF( ! lMono, "w+/g" ,"w/n" ),;
- IIF( ! lMono, "n/*gr" ,"w+/n" ),;
- IIF( ! lMono, "r/w" ,"n/w" ),;
- IIF( ! lMono, "n/bg" ,"w/n" ),;
- IIF( ! lMono, "gr+/*b" ,"w+/n" ),;
- IIF( ! lMono, "w+/r" ,"n/w" ),;
- IIF( ! lMono, "rb+/n" ,"w/n" ),;
- IIF( ! lMono, "n/w" ,"w+/n" ),;
- IIF( ! lMono, "g+/bg" ,"n/w" )}
-
- nWin1 := twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME, "", COLORFN )
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Shadowing
- └──────────────────────────────────────────────────────────────────────────
- */
- twTitle( PADC( "Window Shadows", 30 ), TCOLOR, "T", "C" )
- twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
- twOpen( 4, 5, 10, 34, COLORM, 1, DFRAME )
- twCenter( 3, "Shadow Type 1" )
- twOpen( 4, 45, 10, 74, COLORM, 7, DFRAME )
- twCenter( 3, "Shadow Type 7" )
- twOpen( 14, 5, 20, 34, COLORM, 9, DFRAME )
- twCenter( 3, "Shadow Type 9" )
- twOpen( 14, 45, 20, 74, COLORM, 3, DFRAME )
- twCenter( 3, "Shadow Type 3" )
- DemoWait( 3 )
- BEEPER
- UserMsg( { "Remember, You Can Change Your", ;
- "Shadow Thickness with twInit()",;
- " Try 'TSDDEMO /THIN'" }, 3 )
- FOR nX = 1 TO 4
- twPop()
- NEXT
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Frames
- └──────────────────────────────────────────────────────────────────────────
- */
- twTitle( PADC( "Window and Box Borders", 30 ), TCOLOR, "T", "C" )
- twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
- twCenter( 2, "Windows and Boxes can have 14 different frames." )
- FOR nX = 1 TO 14
- twFrame( nX );DemoWait( .5 )
- NEXT
- twFrame( DFRAME )
- DemoWait( 1 )
- BEEPER
- twCenter( 4, "You can also vary the frame colour." )
- DemoWait( 1 )
- twFrame( 2, IIF( !lMono, "gr+/r", "w/n" ))
- DemoWait( 1 )
- twFrame( 2, IIF( !lMono, "n/bg", "n/w" ))
- DemoWait( 1 )
- twFrame( 2, IIF( !lMono, "w+/*rb", "w+/n" ))
- DemoWait( 1 )
- twFrame( DFRAME, COLORFM )
- BEEPER
- twCenter( 6, "You can also specify separate colours to be used" )
- twCenter( 7, "to identify ACTIVE and INACTIVE windows!" )
- DemoWait( 2 )
- UserMsg( "See What I Mean!!",2, 2, 2 )
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Lines
- └──────────────────────────────────────────────────────────────────────────
- */
- nHandle := _twHandle( nWin1 )
- twTitle( PADC( "Lines and Boxes", 30 ), TCOLOR, "T", "C" )
- _twHandle( nHandle )
-
- twClear( .F. )
- twCenter( 2, "There are a variety of horizontal line options." )
-
- FOR nX = 1 TO 11
- nType := PADL( STRINT( nX ), 2 )
- twLeft( nX + 3, " Type " + nType + ":" )
- twHLine( nX + 3, 23, 24, nX )
- NEXT
- DemoWait( 3 )
- twClear( .F. )
- twCenter( 2, "And vertical lines as well." )
- twCenter( 4, "Types")
- twCenter( 5, " 1 2 3 4 5 6 7 8 9 10 11 12" )
- FOR nX = 1 TO 12
- twVLine( 7, 14 + 3 * ( nX - 1 ), 8, nX )
- NEXT
- DemoWait( 3 )
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Titles
- └──────────────────────────────────────────────────────────────────────────
- */
- nHandle := _twHandle( nWin1 )
- twTitle( PADC( "Window Titles", 30 ), TCOLOR, "T", "C" )
- _twHandle( nHandle )
- twClear( .F.)
- twFrame( DFRAME,,, .F. )
- twLeft( 3, " You can center headers." )
- DemoWait( 1 )
- twTitle( "TSDWIN",, "T", "C" )
- DemoWait( 1 )
- @ twRow( 3 ), twCol( 27 ) SAY "Or right and left justify them!"
- DemoWait( 1 )
- twTitle( "Has",, "T", "L" )
- DemoWait( 1 )
- twTitle( "Windows",, "T", "R" )
- DemoWait( 1 )
- twCenter( 5, " You can do the same with footers." )
- DemoWait( 1 )
- twTitle( "Interface Library",, "B", "C" )
- DemoWait( 1 )
- twTitle( "For",, "B", "L" )
- DemoWait( 1 )
- twTitle( "You",, "B", "R" )
- DemoWait( 1 )
- twCenter( 7, " You can even choose their colour!" )
- twTitle( "TSDWIN", aColors[1], "T", "C" )
- twTitle( "Has", aColors[2], "T", "L" )
- twTitle( "Windows", aColors[3], "T", "R" )
- twTitle( "Interface Library", aColors[4], "B", "C" )
- twTitle( "For", aColors[5], "B", "L" )
- twTitle( "You", aColors[6], "B", "R" )
- DemoWait( 1 )
- FOR nX = 1 TO 5
- twTitle( "Has", aColors[1], "T", "L" )
- twTitle( "TSDWIN", aColors[2], "T", "C" )
- twTitle( "Windows", aColors[3], "T", "R" )
- twTitle( "You", aColors[4], "B", "R" )
- twTitle( "Interface Library", aColors[5], "B", "C" )
- twTitle( "For", aColors[6], "B", "L" )
- xTemp := aColors[1]
- ADEL( aColors, 1 )
- aColors[6] := xTemp
- NEXT
- DemoWait( 2 )
- twCenter( 9, "Delimiters can be inserted." )
- DemoWait( 2 )
- FOR nX = 1 TO 5
- twTitle( "Has", aColors[1], "T", "L", "[]" )
- twTitle( "TSDWIN", aColors[2], "T", "C", "" )
- twTitle( "Windows", aColors[3], "T", "R", "**" )
- twTitle( "You", aColors[4], "B", "R", "╣╠" )
- twTitle( "Interface Library", aColors[5], "B", "C", "││" )
- twTitle( "For", aColors[6], "B", "L", "╡╞" )
- xTemp := aColors[1]
- ADEL( aColors, 1 )
- aColors[6] := xTemp
- NEXT
- DemoWait( 4 )
- twFrame( DFRAME,,, .F. )
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Text Formatting
- └──────────────────────────────────────────────────────────────────────────
- */
- nHandle := _twHandle( nWin1 )
- twTitle( PADC( "Text Formatting", 30 ), TCOLOR, "T", "C" )
- _twHandle( nHandle )
- twClear( .F. )
- twLeft( 2, "It's easy to left justify text." )
- DemoWait( .5 )
- twCenter( 4, "And center it too!" )
- DemoWait( .5 )
- twRight( 6, "You can right justify, of Course." )
- DemoWait( .5 )
- twLeft( 8, " You can replicate any character." )
- DemoWait( .5 )
- twReplicate( 8, 35, "■", 24 )
- DemoWait( .5 )
- twCenter( 10, "You can also:" )
- DemoWait( .5 )
- twSay( 12, 10 + 4, "PUT" )
- DemoWait( .1 )
- twSay( 13, 12 + 4, "TEXT" )
- DemoWait( .1 )
- twSay( 14, 14 + 4, "ANYWHERE" )
- DemoWait( .1 )
- twSay( 15, 12 + 4, "YOU" )
- DemoWait( .1 )
- twSay( 16, 10 + 4, "WANT" )
- DemoWait( 1 )
- twSay( 12, 46 - 5, " In ", aColors[1] )
- DemoWait( .1 )
- twSay( 13, 44 - 5, " Any ", aColors[2] )
- DemoWait( .1 )
- twSay( 14, 42 - 5, " Colour ", aColors[3] )
- DemoWait( .1 )
- twSay( 15, 44 - 5, " You ", aColors[4] )
- DemoWait( .1 )
- twSay( 16, 46 - 5, " Want ", aColors[5] )
- DemoWait( 1 )
- twScroll( 2, .F. )
-
- twType( 16, 10, "You can emulate a typewriter if you want.",, .T. )
- twType( 17, 11, " And you can turn off the sound, too! ", aColors[ 3 ], .F. )
- twScroll( 2, .F. )
- twType( 17, 17, "Scrolling your screen can",, .F. )
- twScroll( 1, .F. )
- twType( 17, 17, "make your application look",, .F. )
- twScroll( 1, .F. )
- twType( 17, 17, "neat. With TSDWIN Ver 2.00",, .F. )
- twScroll( 1, .F. )
- twType( 17, 17, "Library you can scroll all",, .F. )
- twScroll( 1, .F. )
- twType( 17, 17, "or part of a window, with",, .F. )
- twScroll( 1, .F. )
- twType( 17, 17, "or without the border. ",, .F. )
- FOR nX = 1 TO 17
- twScroll( , .F. )
- twInkeyWait( .1 )
- NEXT
- twCenter( 2, "Neat Tricks are Easy to Perform" )
- twBox( 5, 4, 15, 27, 1, BLA_CYH )
- twShadow( 5, 4, 15, 27, 1 )
- twBox( 5, 33, 15, 56, 1, BLA_CYH )
- twShadow( 5, 33, 15, 56, 3 )
- nX := 1
- DO WHILE nX <= 6
- twSay( 6, 05, " Use Your Imagination ", YEL_RDH )
- twSay( 14, 34, " Use Your Imagination ", YEL_RDH )
- twInkeyWait( .1 )
- twScroll( -1, .F., 6, 5, 14, 26 )
- twScroll( 1, .F., 6, 34, 14, 55 )
- twInkeyWait( .1 )
- twSay( 6, 05, " ** Have a Ball ** ", BLA_GNH )
- twSay( 14, 34, " ** Have a Ball ** ", BLA_GNH )
- twInkeyWait( .1 )
- twScroll( -1, .F., 6, 5, 14, 26 )
- twScroll( 1, .F., 6, 34, 14, 55 )
- twInkeyWait( .1 )
- twSay( 6, 05, " CLIPPERING is a joy, ", WHH_BLH )
- twSay( 14, 34, " CLIPPERING is a joy, ", WHH_BLH )
- twInkeyWait( .1 )
- twScroll( -1, .F., 6, 5, 14, 26 )
- twScroll( 1, .F., 6, 34, 14, 55 )
- twInkeyWait( .1 )
- twSay( 6, 05, " with TSD's Windows ", RDH_YLH )
- twSay( 14, 34, " with TSD's Windows ", RDH_YLH )
- twInkeyWait( .1 )
- twScroll( -1, .F., 6, 5, 14, 26 )
- twScroll( 1, .F., 6, 34, 14, 55 )
- twInkeyWait( .1 )
- nX++
- ENDDO
- twSay( 6, 05, " **Happy Clippering** ", WHH_VIH )
- twSay( 14, 34, " **Happy Clippering** ", WHH_VIH )
- DemoWait( 2 )
- twScroll( 22, .T. )
- DemoWait( .5 )
- twPop()
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Boxes
- └──────────────────────────────────────────────────────────────────────────
- */
- twTitle( PADC( "Boxes with Shadows", 30 ), TCOLOR, "T", "C" )
- twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
- twBox( nRow, nCol, nRow + 6, nCol + 20, 1, BLA_CYH, " " )
- twShadow( nRow, nCol, nRow + 6, nCol + 20, 7 )
-
- twSay( nRow + 01, nCol + 3, "████████", RDH_CYH )
- twSay( nRow + 02, nCol + 3, " ██ ", RDH_CYH )
- twSay( nRow + 03, nCol + 3, " ██ ", RDH_CYH )
- twSay( nRow + 04, nCol + 3, " ██ ", RDH_CYH )
- twSay( nRow + 05, nCol + 3, " ██ ", RDH_CYH )
- twSay( nRow + 05, nCol + 9, "RILATERAL", BLU_CYH )
-
- twBox( nRow, nCol + 32, nRow + 6, nCol + 52, 1, BLA_CYH, " " )
- twShadow( nRow, nCol + 32, nRow + 6, nCol + 52, 9 )
-
- twSay( nRow + 01, nCol + 35, "████████", YEL_CYH )
- twSay( nRow + 02, nCol + 35, "██ ", YEL_CYH )
- twSay( nRow + 03, nCol + 35, "████████", YEL_CYH )
- twSay( nRow + 04, nCol + 35, " ██", YEL_CYH )
- twSay( nRow + 05, nCol + 35, "████████", YEL_CYH )
- twSay( nRow + 05, nCol + 44, "YSTEMS", BLU_CYH )
-
- twBox( nRow + 9, nCol, nRow + 15, nCol + 24, 1, BLA_CYH, " " )
- twShadow( nRow + 9, nCol, nRow + 15, nCol + 24, 1 )
-
- twSay( nRow + 10, nCol + 3, "████████", WHI_CYH )
- twSay( nRow + 11, nCol + 3, "██ ▐", WHI_CYH )
- twSay( nRow + 12, nCol + 3, "██ ▐", WHI_CYH )
- twSay( nRow + 13, nCol + 3, "██ ▐", WHI_CYH )
- twSay( nRow + 14, nCol + 3, "████████", WHI_CYH )
- twSay( nRow + 14, nCol + 12, "EVELOPMENT", BLU_CYH )
-
- twBox( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 1, BLA_CYH, " " )
- twShadow( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 3 )
- twSay( nRow + 12, nCol + 39, "Limited", BLU_CYH )
- DemoWait( 1 )
- BEEPER
-
- twTitle( PADC( "You Can Clear a Box", 30 ), TCOLOR, "T", "C" )
- DemoWait( 1 )
- twClear( .F., " ", nRow, nCol, nRow + 6, nCol + 20 )
- DemoWait( 1 )
- BEEPER
-
- twTitle( PADC( "Or Include the Border", 30 ), TCOLOR, "T", "C" )
- DemoWait( 1 )
- twClear( .T., " ", nRow, nCol + 32, nRow + 6, nCol + 52 )
- DemoWait( 1 )
- BEEPER
-
- twTitle( PADC( "And You Can Fill It", 30 ), TCOLOR, "T", "C" )
- DemoWait( 1 )
- twClear( .T., "▒", nRow + 9, nCol, nRow + 15, nCol + 24 )
- DemoWait( 1 )
- twClear( .F., "▒", nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
- DemoWait( 1 )
- BEEPER
-
- twTitle( PADC( "You Can Also Change Colours", 30 ), TCOLOR, "T", "C" )
- DemoWait( 1 )
- twSay( nRow + 11, nCol + 3, "See What" )
- twAttrib( .T., YEL_RED, nRow + 9, nCol, nRow + 15, nCol + 24 )
- DemoWait( 1 )
- twSay( nRow + 11, nCol + 35, "I Mean" )
- twAttrib( .F., IIF( ! lMono, "w+/br*", "w+/n" ), nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
- DemoWait( 1 )
- twAttrib( .F., IIF( ! lMono, "b+/w", "n/w" ))
- DemoWait( 1 )
- twAttrib( .T., IIF( ! lMono, "gr+/rb", "w+/n" ))
- DemoWait( 1 )
- twCenter( 0, "Patterns can Easily be made!" )
- twClearWith( .F., " TSDWIN ",,,,, IIF( ! lMono, "gr+/b", "w+/n" ) )
- DemoWait( 1 )
- twClearWith( .F., "▓▓▒▒▒░░░░",,,,, IIF( ! lMono, "gr+/b", "w+/n" ) )
- DemoWait( 1 )
- twClearWith( .F., "██│█▐▄",,,,, IIF( ! lMono, "gr+/b", "w+/n" ) )
- DemoWait( 1 )
- twClearWith( .F., "│░▒▓█▓▒░│",,,,, IIF( ! lMono, "gr+/b", "w+/n" ) )
- DemoWait( 1 )
- twClearWith( .F., "│▐▄▌█▐▀▌│",,,,, IIF( ! lMono, "gr+/b", "w+/n" ) )
- DemoWait( 1 )
- twClear( .F. )
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Activation
- └──────────────────────────────────────────────────────────────────────────
- */
- twTitle( "Window Activation: USE 'F1', 'F2', 'F3', 'F4', 'ESC to Exit'", TCOLOR, "T", "C" )
- twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
- nWin1 := twOpen( 02, 05, 12, 44, COLORN, 1, DFRAME,, COLORFN )
- twTitle( "Window 1", TCOLOR )
- nWin5 := twOpen( 12, 42, 20, 70, COLORE, 1, DFRAME, "", COLORFE )
- twTitle( "I'm and Extra!!", TCOLOR )
- nWin2 := twOpen( 05, 10, 15, 49, COLORE, 7, DFRAME,, COLORFE )
- twTitle( "Window 2", TCOLOR, "T", "L" )
- nWin3 := twOpen( 08, 15, 18, 54, COLORM, 9, DFRAME,, COLORFM )
- twTitle( "Window 3", TCOLOR, "T", "R" )
- nWin4 := twOpen( 11, 20, 21, 59, COLORW, 3, DFRAME,, COLORFW )
- twTitle( "Window 4", TCOLOR, "B", "L" )
-
- DO WHILE nKey != K_ESC
- nKey := DemoWait( 0 )
- DO CASE
- CASE nKey == K_F1
- Window( nWin1 )
- CASE nKey == K_F2
- Window( nWin2 )
- CASE nKey == K_F3
- Window( nWin3 )
- CASE nKey == K_F4
- Window( nWin4 )
- ENDCASE
- ENDDO
-
- nWin6 := twNew( 2, 2, 21, 76, COLORN, 3, 4, "░", COLORFN, "Complex Windows can be Displayed FAST!!!" )
- twBox( 1, 2, 10, 10, 2, YEL_BLU, " ",, 3, nWin6 )
- twBox( 12, 2, 17, 10, 2, YEL_BLU, " ",, 3, nWin6 )
- twBox( 1, 14, 17, 70, 2, YEL_BLU, " ",, 3, nWin6 )
- twVLine( 2, 35, 15, 2, YEL_BLU, nWin6 )
- twSay( 1, 35, "╦", YEL_BLU,, nWin6 )
- twSay( 17, 35, "╩", YEL_BLU,, nWin6 )
- twHLine( 3, 35, 35, 5, YEL_BLU, nWin6 )
- twSay( 3, 35, "╠", YEL_BLU,, nWin6 )
- twSay( 3, 70, "╣", YEL_BLU,, nWin6 )
- twSay( 2, 38, "Continental Information", YEL_BLU,, nWin6 )
- twHLine( 8, 15, 20, 4, YEL_BLU, nWin6 )
- twSay( 8, 14, "╟", YEL_BLU,, nWin6 )
- twSay( 8, 35, "╢", YEL_BLU,, nWin6 )
- twVLine( 4, 40, 13, 1, YEL_BLU, nWin6 )
- twSay( 3, 40, "╤", YEL_BLU,, nWin6 )
- twSay( 17, 40, "╧", YEL_BLU,, nWin6 )
- FOR nX := 1 TO 13
- twSay( 3 + nX, 37, PADL( STRINT( nX ), 2 ), WHH_BLU,, nWin6 )
- NEXT
- FOR nX := 1 TO 8
- twSay( 1 + nX, 5, PADL( STRINT( nX ), 3, "0" ), WHH_BLU,, nWin6 )
- NEXT
- USE Windemo INDEX Windemo
- FOR nX := 1 TO 13
- twSay( 3 + nX, 42, Windemo->Continent, WHT_BLU,, nWin6 )
- SKIP
- NEXT
- FOR nX := 1 TO 6
- twSay( 1 + nX, 17, Windemo->Codekey, WHT_BLU,, nWin6 )
- SKIP
- twSay( 1 + nX, 23, Windemo->Codekey, WHT_BLU,, nWin6 )
- SKIP
- NEXT
- twSay( 10, 20, "T S D W I N", WHT_BLU,, nWin6 )
- twSay( 12, 20, " IS ", WHT_BLU,, nWin6 )
- twSay( 14, 20, " Beautiful ", WHT_BLU,, nWin6 )
- twSay( 13, 4, "Jack", WHT_BLU,, nWin6 )
- twSay( 14, 4, " 'n ", WHT_BLU,, nWin6 )
- twSay( 15, 4, "Jill", WHT_BLU,, nWin6 )
- twSay( 16, 4, "Went", WHT_BLU,, nWin6 )
- CLOSE Windemo
-
- twShow( nWin6 );DemoWait( 15 );twPop()
-
- UserMsg( { "It's Easy to Hide and", ;
- " Unhide Windows with ",;
- " TSDWIN v2.00 " }, 3 )
-
- twActivate( nWin1 )
- twActivate( nWin2 )
- twActivate( nWin3 )
- twActivate( nWin4 )
-
- twHide( nWin1 );DemoWait( .5 )
- twHide( nWin2 );DemoWait( .5 )
- twHide( nWin3 );DemoWait( .5 )
- twHide( nWin4 );DemoWait( .5 )
- twHide( nWin5 );DemoWait( .5 )
- twUnHide( nWin5 );DemoWait( .5 )
- twUnHide( nWin4 );DemoWait( .5 )
- twUnHide( nWin3 );DemoWait( .5 )
- twUnHide( nWin2 );DemoWait( .5 )
- twUnHide( nWin1 );DemoWait( .5 )
-
- twFrame( DFRAME,,, .F. )
- twTitle( "Moving Windows is Easy!", TCOLOR )
- twMove( -8, -20 )
- DemoWait( 1 )
- twPop()
-
- twFrame( DFRAME,,, .F. )
- twTitle( "I Move Around a Lot!", TCOLOR )
- twMove( 8, -20 )
- DemoWait( 1 )
- twPop()
-
- twFrame( DFRAME,,, .F. )
- twTitle( "Sliding is Fun!", TCOLOR )
- twSlide( "R", 30 );twSlide( "U", 7 );twSlide( "R", 6 );twSlide( "U", 5 )
- twSlide( "L", 50 );twSlide( "D", 10 );twSlide( "R", 15 );twSlide( "U", 2 )
- DemoWait( 1 )
- twPop()
-
- twFrame( DFRAME,,, .F. )
- twTitle( "Watch me go too!", TCOLOR )
- twSlide( "R", 30 );twSlide( "D", 7 );twSlide( "R", 6 );twSlide( "D", 5 )
- twSlide( "L", 50 );twSlide( "U", 10 );twSlide( "R", 15 );twSlide( "D", 2 )
- DemoWait( 1 )
- twPop()
-
- twSlide( "L", 30 )
- twSlide( "U", 10 )
- twTitle( "Try Sizing this window", TCOLOR )
- twTitle( "Use the Cursor Keys", TCOLOR, "B", "C" )
- DO WHILE .T.
-
- nKey := DemoWait(0)
- DO CASE
- CASE nKey == K_UP
- twSize( "V", -1 )
- CASE nKey == K_DOWN
- twSize( "V", 1 )
- CASE nKey == K_LEFT
- twSize( "H", -1 )
- CASE nKey == K_RIGHT
- twSize( "H", 1 )
- OTHERWISE
- EXIT
- ENDCASE
- ENDDO
-
- twPop();twPop()
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Window Activation Routines │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 08:07:18pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Procedure: Window │
- │ │
- │ Arguments: nHandle - Handle of window to activate. │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- PROCEDURE Window( nHandle )
- STATIC nRow1 := 0, nRow2 := 0, nRow3 := 0, nRow4 := 0
- LOCAL nRow, lOk := .T., GetList := {}
- DO CASE
- CASE nHandle = 4
- nRow1 := IIF( nRow1 > 6, 1, nRow1 + 1 ); nRow := nRow1
- CASE nHandle = 6
- nRow2 := IIF( nRow2 > 6, 1, nRow2 + 1 ); nRow := nRow2
- CASE nHandle = 7
- nRow3 := IIF( nRow3 > 6, 1, nRow3 + 1 ); nRow := nRow3
- CASE nHandle = 8
- nRow4 := IIF( nRow4 > 6, 1, nRow4 + 1 ); nRow := nRow4
- ENDCASE
- twActivate( nHandle )
- tw_Say2( twRow( nRow + 1 ), twCol( 1 + nRow ), "Activation «" + ALLTRIM( STR( nRow )) + "»", twVattr( twStdClr( _twColor())), twVattr( twEnhClr( _twColor())))
- @ twRow( nRow ), twCol( 27 ) SAY "OK?" GET lOk PICTURE "Y"
- twReadModal( GetList, .T. )
- RETURN
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Message System Functions │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 09:32:23pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD30000 │
- │ │
- │ Arguments: None. │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD30000()
- LOCAL lExit := .F., nGetExit
- LOCAL nWin1 := twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME, "", COLORFN )
- LOCAL aActionKeys := {{ 1, { || TSD30001() }},;
- { 2, { || TSD30002() }},;
- { 3, { || TSD30003() }},;
- { 4, { || TSD30004() }}}
-
- twTitle( PADC( "TSDWIN Message Systems", 30 ), TCOLOR )
- DO WHILE !lExit
-
- nGetExit := twButtonBox( "V", ;
- "Welcome to «TSDWIN»'s Message Systems. "+ ;
- "With «TSDWIN V2.00» looking after the details, you get "+ ;
- "more time to look after the important part of "+ ;
- "your application... «The Data»!", ;
- { "This is a twButtonBox() Acting Like a Menu", TCOLOR },, ;
- { "Alert Messages", ;
- "Windowed Messages", ;
- "Line/Area Messages", ;
- "Mouse Support", ;
- "Main Menu" },, ;
- 5, 5, 17, 74, DSHADOW, DFRAME,, aActionKeys )
-
- IF nGetExit = 5 .OR. nGetExit = 0
- lExit := .T.
- ENDIF
-
- ENDDO
- twPop()
-
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Alert System │
- │ Author: Vic Lewis │
- │ Date created: 08-26-92 │
- │ Time created: 01:30:48pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ FUNCTION TSD30001() │
- │ │
- │ Arguments: │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD30001()
- LOCAL RetVal, cClrTemp
- LOCAL AText1 := ;
- "One function is used in TSDWIN to create various types of " + ;
- "alert boxes: PushButton Boxes, Radio Boxes and Select Boxes. " + ;
- "Default buttons are created of none are passed, or, if passed " + ;
- "as an array, buttons are created and displayed. In the case of " + ;
- "PushButtons, they are shadowed with a thin shadow of the same " + ;
- "type as the controlling window. The frame type is the same as " + ;
- "that of the controlling window. The colour for each type of box " + ;
- "defaults to an initial value, but is defineable. Shadow and frame " + ;
- "type are defineable with each function call. The Buttons, or other " + ;
- "select devices may be positioned horizontally or vertically."
- LOCAL ATEXT2 := ;
- "The return values are, for twButtonBox() and twRadioBox(), the element " + ;
- "of the array in which the buttons are held. For twCheckBox(), an array " + ;
- "of checked elements is returned. All three of these functions act " + ;
- "like similar constructs in MS-Windows. For the twButtonBox() function, " + ;
- "the default Exit key is the Enter or Escape key. For twCheckBox() and " + ;
- "twRadioBox(), Enter or Space toggles the selection and the Escape key " + ;
- "exits the routine. Only SINGLE choices are allowed with twButtonBox() " + ;
- "and twRadioBox(). Multiple choices are allowed with twCheckBox(). " + ;
- "You may pass either new Exit keys or additonal " + ;
- "Action keys to the function. With this feature, you may use any one " + ;
- "of these functions to present a pop-up menu with very little " + ;
- "code. The menu choice can then be simply the function itself. With " + ;
- "Action keys, you can extend the usefulness of these functions in any " + ;
- "number of ways. More examples will be available on the TSD support " + ;
- "board."
- LOCAL AText3 := ;
- "Watch while we demonstrate the same functions called with a vertical " + ;
- "configuration. Remember, all that need be passed is the message text " + ;
- "and an array of choices! We'll show the RETURN values with another " + ;
- "TSDWIN Messaging function twInfo(), after you make a selection."
-
- twCheckBox( "H", ; // Style
- AText1, ; // Message
- { "twCheckBox() with Custom Features", TCOLOR },, ; // Title ( No Button Number )
- { "Check", "As", "Many", ; // Button
- "As", "You", "Want" }, ; // Array
- 2, 3, 5, 18, 74, DSHADOW, DFRAME ) // Start, Coords, Shadow, Frame
-
- twRadioBox( "H", ; // Style
- AText2, ; // Message
- { "This Uses twRadioBox()", TCOLOR },, ; // Title ( No Button Number )
- { "What's On", "The Radio", ; // Button
- "Tonight", "Dear" }, ; // Array
- 3, 2, 3, 21, 76, DSHADOW, DFRAME ) // Start, Coords, Shadow, Frame
-
- RetVal := twCheckBox( "V", ;
- AText3, ;
- { "Here's twCheckBox() Vertical", TCOLOR },, ;
- { "Who Says", "You Can", "Only Pick", "One??" }, ;
- 1,, 7,, 71, DSHADOW, DFRAME )
- CheckRtn( RetVal )
-
- RetVal := twRadioBox( "V", ;
- AText3, ;
- { "I Know Why These are Called Radio Boxes!", TCOLOR },, ;
- { "WKRP", "CHFI", "WNYC", "CKFM", "C100", "TSDL" }, ;
- 5, 2, 5, 16, 54, DSHADOW, DFRAME )
- CheckRtn( RetVal )
-
- RetVal := twButtonBox( "V", ;
- AText3 + " Have a look at the DEMO to see how easy " + ;
- "it is to do things like this!", ;
- { "LISTEN HERE!", TCOLOR },, ;
- {"Well Now", ;
- "It's About Time", ;
- "We Got", ;
- "A Few Things Straight, Dont' You?", ;
- "TSDWIN Can", ;
- "Make Your Life Easier", ;
- "And Your Applications", ;
- "More Coherent", ;
- "Have No Doubt About That" }, ;
- 5, 2, 5, 22, 73, DSHADOW, DFRAME )
- CheckRtn( RetVal )
-
- twButtonBox( "H", "Now, wasn't that fun? You have seen some of the best Clipper functions"+;
- " ever made. "+;
- " TSD Ltd. will also be the first to provide Clipper users with a pseudo-object which turns lead into"+;
- " gold, with the correct parameters! The parameter list will be supplied on"+;
- " registration. One of the parameters will trigger a previously undocumented DOS"+;
- " interrupt which starts a process rolling which will ultimately set the lead into gold routine into motion."+;
- " After a suitable processing time, thin sheets of pure gold will start issuing"+;
- " from the access door of the floppy drive designated as 'A' on your machine. "+;
- " TSD recommends you advise your customers to have Brinks on hand when using this function."+;
- " Please be warned that this particular routine may fail with some combinations of hardware."+;
- " This routine has been tested on some types of hardware."+;
- " Consult your hardware dealer for details about your BIOS if it doesn't work for you...", "GOLD! GOLD!! GOLD!!!", ;
- 1,,, 2, 5, 22, 75, DSHADOW, DFRAME )
-
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Message System │
- │ Author: Vic Lewis │
- │ Date created: 08-26-92 │
- │ Time created: 01:31:40pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ FUNCTION TSD30002() │
- │ │
- │ Arguments: │
- │ │
- │ Return Value: │
- │ See Also: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD30002()
- LOCAL Var2Read := SPACE( 20 ), Var2 := SPACE( 20 )
-
- twWarn( " Trying a Warning Message ",,,,, DSHADOW, DFRAME )
- twInfo( " Trying an Info Message ",,,,, DSHADOW, DFRAME )
- twTextMsg("Trying a Text Message. With this one we have to have the thing do a word"+;
- "wrap to put it into the box.",,,5,5,15,45,, DSHADOW, DFRAME )
-
- twInquire( {"Trying out an Inquire Message:",;
- "Let's see if more lines will work out OK too?",;
- "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",;
- "";
- },, Var2Read,,, DSHADOW, DFRAME )
-
- twInquire( "Trying out another Inquire Message:","Trying", Var2 )
-
- twInfo( {" Trying an Info Message ",;
- "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6",;
- "Item 7", "Item 8", "Item 9", "Item 10", "Item 11", "Item 12" };
- ,,,,, DSHADOW, DFRAME )
-
- twMsgInit( 1, IIF( !lMono, "gr+/r,w/n,,,w+/n", "n/w,w+/n,,,w/n"))
-
- twInfo( {" You can change colours ",;
- "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7" };
- ,,,,, DSHADOW, DFRAME )
-
- twMsgInit( 1, { COLORE, TCOLOR })
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Area Message System │
- │ Author: Vic Lewis │
- │ Date created: 08-26-92 │
- │ Time created: 01:32:05pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ FUNCTION TSD30003() │
- │ │
- │ Arguments: │
- │ │
- │ Return Value: │
- │ See Also: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD30003()
- BEEPER
- twInfoLine( 5, "twInfoLine() Puts Messages in a Pre-Defined Area. ( «Any Key» or «Button» )" , "L" )
- BEEPER
- twInfoLine( 5, "You Pick the Justification ( «Any Key» or «Button» )" , "C" )
- BEEPER
- twInfoLine( 5, "You can also Change the Area! ( «Any Key» or «Button» )" , "R", 20 )
- BEEPER
- twInfoLine( 5, "You can have «TWO» Colour Attributes too! ( «Any Key» or «Button» )" )
- BEEPER
- twWarnLine( 5, "twWarnLine() is the same «EXCEPT» for the default colour." )
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Messages Mouse Support │
- │ Author: Vic Lewis │
- │ Date created: 08-26-92 │
- │ Time created: 01:32:36pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ FUNCTION TSD30004() │
- │ │
- │ Arguments: │
- │ │
- │ Return Value: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD30004()
- LOCAL aMsg := {}
- AADD( aMsg, "Mouse support for the TSDWIN message systems is automatic." )
- AADD( aMsg, "" )
- AADD( aMsg, "When using twInfo() and twWarn() the right button returns" )
- AADD( aMsg, "the ESC key and the left button, the ENTER key." )
- AADD( aMsg, "" )
- AADD( aMsg, "With the Alert Boxes, the Right Button always enters ESC" )
- AADD( aMsg, "The left will 'Select' in twButtonBox() and 'Tag or Mark'" )
- AADD( aMsg, "in twCheckBox() and twRadioBox()" )
- AADD( aMsg, "" )
- AADD( aMsg, "twInfoLine() and twWarnLine() simply wait for a button or" )
- AADD( aMsg, "key press, IF they are in a waiting state. " )
- AADD( aMsg, "" )
- AADD( aMsg, "The windowed and area messages may be called to:" )
- AADD( aMsg, " Wait for a button or key press" )
- AADD( aMsg, " Leave their display on the screen" )
- AADD( aMsg, " Leave their display then remove it later." )
- UserMsg( aMsg )
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Check a return value and display it. │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 08:32:36am │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: CheckRtn │
- │ │
- │ Arguments: RetVal │
- │ │
- │ Return Value: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION CheckRtn( RetVal )
- LOCAL aTempArray := {}, aLen, Cntr
- IF VALTYPE( RetVal ) == 'N'
- AADD( aTempArray, "Your Return Value Was:" )
- AADD( aTempArray, "Element Number: "+STRINT( RetVal ))
- twInfo( aTempArray,,,,, DSHADOW, DFRAME )
- ELSEIF VALTYPE( RetVal ) == 'A'
- aLen := LEN( RetVal );Cntr:=0
- AADD( aTempArray, "You Picked:" )
- AEVAL( RetVal, {|| Cntr++, AADD( aTempArray, RetVal[ Cntr] ) } )
- twInfo( aTempArray,,,,, DSHADOW, DFRAME )
- ENDIF
- RETURN .T.
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: TSDWIN Menu Systems │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 09:25:16am │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD40000 │
- │ │
- │ Arguments: None. │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD40000()
- LOCAL amArray, nChoice, cHeader, aMsg, wT, wL, nX
- LOCAL nRowSkip, cJustify, cUser, nStartRow, lSBar
- LOCAL aItems := { "one","two","three","four","five","six","seven","eight",;
- "nine","ten","eleven","twelve","thirteen","fourteen",;
- "fifteen","sixteen","seventeen","eighteen","nineteen",;
- "twenty" }
- LOCAL nRow := 5, nStartCol := 1, nEndCol := MAXCOL() - 1
- LOCAL nStart := 0
-
- UserMsg( { "The Main Menu in this demo uses 'twMenuTo().",;
- "This demonstration shows how twPopMenu() and",;
- "twPopChoice() can be used to create menus.", "",;
- "The main differences between the two are the",;
- "automatic handling of HotKeys in twPopMenu()",;
- "and the different mouse confinement when you",;
- "use twPopChoice().", "",;
- "For a more detailed description of the Choice",;
- "functions, see the section on Browses!", "",;
- "twLineMenu() gives you an expandable bar line",;
- "menu with indicators and mouse support." })
-
- twOpen( FULLSCREEN, COLORN, DSHADOW, D2FRAME, "", COLORFN )
- twTitle( PADC( "TSDWIN Menus", 30 ), TCOLOR, "T", "C" )
-
- amArray := { "«1.» Menu Item 1", ;
- "«2.» Menu Item 2", ;
- "«3.» Menu Item 3", ;
- "«4.» Menu Item 4", ;
- "«5.» Menu Item 5", ;
- "«Q.» Quit" }
- nChoice := 1
- DO WHILE nChoice != 0
- cHeader := "twPopMenu()"
- aMsg := NIL
- wT := 7
- wL := 15
- nRowSkip := 1
- nChoice := twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, MENUPCLR, ;
- DSHADOW, D2FRAME, MENUFCLR, MENUTCLR, nRowSkip )
- DO CASE
- CASE nChoice >= 1 .AND. nChoice <= 5
- UserMsg( "You Chose " + STRINT( nChoice ))
- CASE nChoice = 6
- EXIT
- ENDCASE
- ENDDO
-
- nChoice := 1
- SETBLINK( .F. )
- DO WHILE nChoice != 0
- cHeader := "twPopMenu()"
- aMsg := NIL
- wT := 5
- wL := 15
- nRowSkip := 2
- nChoice := twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, MENUPCLR, ;
- DSHADOW, D2FRAME, MENUFCLR, MENUTCLR, nRowSkip )
- DO CASE
- CASE nChoice >= 1 .AND. nChoice <= 5
- UserMsg( "You Chose " + STRINT( nChoice ))
- CASE nChoice = 6
- EXIT
- ENDCASE
- ENDDO
-
- nX := 0
- AEVAL( amArray, {|| nX++, amArray[ nX ] := ;
- STRTRAN( STRTRAN( amArray[ nX ], "»", "" ), "«", "" )})
- nChoice := 1
- DO WHILE nChoice != 0
- cHeader := "twPopChoice()"
- aMsg := NIL
- wT := 8
- wL := 45
- cJustify := "L"
- cUser := NIL
- nStartRow := 3
- lSBar := .F.
- nChoice := twPopChoice( amArray, cHeader, wT, wL, nChoice, MENUPCLR, DSHADOW, ;
- D2FRAME, MENUFCLR, cJustify, cUser, nStartRow, lSbar )
- DO CASE
- CASE nChoice >= 1 .AND. nChoice <= 5
- twInfo( "You Chose " + STRINT( nChoice ))
- CASE nChoice = 6
- EXIT
- ENDCASE
- ENDDO
-
- amArray := {}
- FOR nChoice = 1 TO 30
- AADD( amArray, PADL( STRINT( nChoice ), 2 ) + ". Menu Item " + STRINT( nChoice ))
- NEXT
- nChoice := 1
- SETBLINK( .F. )
- DO WHILE nChoice != 0
- cHeader := "twPopChoice()"
- aMsg := NIL
- wT := 8
- wL := 45
- cJustify := "L"
- cUser := NIL
- nStartRow := 3
- lSBar := .T.
- nChoice := twPopChoice( amArray, cHeader, wT, wL, nChoice, MENUPCLR, DSHADOW, ;
- D2FRAME, MENUFCLR, cJustify, cUser, nStartRow, lSbar )
- IF nChoice >= 1 .AND. nChoice <= 30
- twInfo( "You Chose " + STRINT( nChoice ))
- ELSE
- EXIT
- ENDIF
- ENDDO
-
-
- DO WHILE .T.
-
- nChoice := twLineMenu( nRow, nStartCol, nEndCol, aItems, 2, MENUPCLR )
-
- IF nChoice = 0
- EXIT
- ENDIF
-
- UserMsg( "You Chose " + aItems[ nChoice ] )
-
- ENDDO
-
- aItems := {}
- nRow += 3
- USE Windemo
- DO WHILE !EOF()
- AADD( aItems, " " +TRIM( Windemo->Ice_Cream ) )
- SKIP
- ENDDO
-
- DO WHILE .T.
-
- nChoice := twLineMenu( nRow, nStartCol + 2, nEndCol - 2, aItems,, MENUPCLR;
- ,, .F.,, {|| twTitle( "Windowed twLineMenu() Test", TCOLOR) },;
- , .T., DSHADOW, D2FRAME, MENUFCLR )
-
- IF nChoice = 0
- EXIT
- ENDIF
-
- UserMsg( "You Chose " + aItems[ nChoice ] )
- ENDDO
-
- twPop()
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: TSDWIN Browse Systems │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 10:20:04am │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD50000 │
- │ │
- │ Arguments: None │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD50000()
- LOCAL nTop, nLeft, nBottom, nRight, cUser, nStartItem, nWinRow, aSrch
- LOCAL nTag, cACColor, cBarColor, wT, wL, wB, wR, nChoice, amArray, aLogicals
- LOCAL nButRow, nButCol, aMouseID, f, nParts, nCost, nSell, aHelp, aColumns
- LOCAL cTitle, cTopKey, bScopeBlock, lEditFlag, aActionKeys, wColor, wSType
- LOCAL wFType, wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, bPreRun
- LOCAL bPostRun, nExitKey, aSeparators, lOKAppend, lSound, nCount, aTemp
-
- UserMsg( { "To conserve space, only the new browses in TSDWIN V 2.00",;
- "will be demonstrated here. They automatically invoke mouse",;
- "support if you have called twMouseInit() at the beginning",;
- "of your program.", "",;
- "We shall show you:", "",;
- " twACChoice() - a moused replacement for ACHOICE()",;
- " twABBrowse() - a simple array browser.",;
- " twRABrowse() - a totally configurable array browser.",;
- " twBRBrowse() - a totally configurable DBF browser.", "",;
- "You should consult TSDWIN.NG for more information on these",;
- "functions, as they are very flexible.", "",;
- "During the demo, the line at the bottom of the screen, and",;
- "displayed buttons will be Mouse Hot Spots." })
-
- twOpen( FULLSCREEN, COLORM, DSHADOW, DFRAME, "∙", COLORFM )
- twTitle( PADC( "TSDWIN Browse Systems", 30 ), TCOLOR, "T", "C" )
-
- twOpen( 3, 3, 21, 76, COLORN, DSHADOW, DFRAME,, COLORFN )
-
- nTop := twRow( 3 )
- nLeft := twCol( 4 )
- nBottom := twRow( 10 )
- nRight := twCol( 22 )
- cUser := NIL
- nStartItem := 1
- nWinRow := 1
- lScBar := .T.
- nTag := 0
- cACColor := IIF( ! lMono, "w+/br,gr+/r,n/bg,w+/r,w/br", ;
- "w+/n,n/w,n/w,w/n,w+/n" )
- cBarColor := IIF( ! lMono, "w+/g" , "n/w" )
-
- twClear( .F.)
- twTitle( PADC( "twACChoice() with No Tagging + Logicals", 55 ), "n/w")
- twSay( 12, 3, "Right Button: Exit │ Left Button: Select" )
- twSay( 13, 3, " ENTER: Select │ ESC: Exit" )
- twSay( 14, 3, 'cACColor := "w+/br,gr+/r,n/bg,w+/r,w/br"' )
- twSay( 15, 3, 'cBarColor := "w+/g"' )
- twSay( 16, 3, ' nTag := 0' )
- twBox( 2, 3, 11, 24, 1 )
- nChoice := 1
- DO WHILE nChoice != 0
-
- amArray := {}
- FOR nChoice = 1 TO 30
- AADD( amArray, PADL( STRINT( nChoice ), 2 ) + ". Menu Item " + STRINT( nChoice ))
- NEXT
- aLogicals := ARRAY( 30 )
- AFILL( aLogicals, .T. )
- aLogicals[ 04 ] := .F.
- aLogicals[ 14 ] := .F.
- aLogicals[ 15 ] := .F.
- aLogicals[ 20 ] := .F.
- aLogicals[ 22 ] := .F.
- aLogicals[ 23 ] := .F.
- aLogicals[ 24 ] := .F.
- aLogicals[ 25 ] := .F.
- aLogicals[ 26 ] := .F.
-
- nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
- aLogicals, cUser, nStartItem, nWinRow, ;
- lScBar, nTag, cACColor, cBarColor )
- UserMsg( "You Chose " + STRINT( nChoice ))
-
- ENDDO
-
- twClear( .F.)
- nButRow := _twTop()
- nButCol := 50
- cACColor := IIF( ! lMono, "w+/g,bg+/n,n/bg,w+/r,w/gr", ;
- "w+/n,n/w,n/w,w/n,w+/n" )
- cBarColor := IIF( ! lMono, "n/bg+" , "n/w" )
-
- aMouseID := ARRAY( 7 )
- twCreateButton( nButRow, nButCol, PADC( "Help", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
-
- #IFNDEF NOMOUSE
- aMouseID[ 1 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| SpotDeactivate( aMouseID ),;
- _twKBoard( K_F1 ),;
- SpotActivate( aMouseID ) } , 1, , .T. )
- #ENDIF
- nButRow += 2
- twCreateButton( nButRow, nButCol, PADC( "Tag All", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
-
- #IFNDEF NOMOUSE
- aMouseID[ 2 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| _twKBoard( K_F7 ) } , 1, , .T. )
- #ENDIF
- nButRow += 2
- twCreateButton( nButRow, nButCol, PADC( "UnTag All", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
- #IFNDEF NOMOUSE
- aMouseID[ 3 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| _twKBoard( K_F8 ) } , 1, , .T. )
- #ENDIF
- nButRow += 2
- twCreateButton( nButRow, nButCol, PADC( "Swap Tags", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
- #IFNDEF NOMOUSE
- aMouseID[ 4 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| _twKBoard( K_F9 ) } , 1, , .T. )
- #ENDIF
- nButRow += 2
- twCreateButton( nButRow, nButCol, PADC( "Tag Current", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
- #IFNDEF NOMOUSE
- aMouseID[ 5 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| __keyboard( CHR( 32 ))} , 1, , .T. )
- #ENDIF
- nButRow += 2
- twCreateButton( nButRow, nButCol, PADC( "Select", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
- #IFNDEF NOMOUSE
- aMouseID[ 6 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| __keyboard( CHR( 13 ))} , 1, , .T. )
- #ENDIF
- nButRow += 2
- twCreateButton( nButRow, nButCol, PADC( "Done", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
- #IFNDEF NOMOUSE
- aMouseID[ 7 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
- {|| __keyboard( CHR( 27 ))} , 1, , .T. )
- #ENDIF
-
- SETKEY( K_F1, {|| HelpACChoice() } )
-
- nTag := 1 // Allow Tagging, NOT pretagged
-
- twTitle( PADC( "twACChoice() with Default Tagging + NIL Logicals", 55 ), "n/w")
- twSay( 12, 3, "Right Button: Tag │ Left Button: Select" )
- twSay( 13, 3, " ENTER: Select │ ESC: Exit" )
- twSay( 14, 3, " SPACE: Tag" )
- twSay( 15, 3, 'cACColor := "w+/b,bg+/n,n/bg,w+/r,w/gr"' )
- twSay( 16, 3, 'cBarColor := "n/bg+"' )
- twSay( 17, 3, ' nTag := 1' )
- nChoice := 1
- DO WHILE nChoice != 0
-
- amArray := {}
- FOR nChoice = 1 TO 30
- AADD( amArray, PADL( STRINT( nChoice ), 2 ) + ". Menu Item " + STRINT( nChoice ))
- NEXT
- aLogicals := ARRAY( 30 )
- aLogicals := NIL
-
- nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
- aLogicals, cUser, nStartItem, nWinRow, ;
- lScBar, nTag, cACColor, cBarColor )
- UserMsg( "You Chose " + STRINT( nChoice ))
- ENDDO
-
- nTag := 2 // Allow tagging - PreTagged
-
- nChoice := 1
- cACColor := IIF( ! lMono, "n/bg,gr+/r,r/w,w+/g,w/b", ;
- "w+/n,n/w,n/w,w/n,w+/n" )
- cBarColor := IIF( ! lMono, "w+/b" , "n/w" )
- twTitle( PADC( "twACChoice() with Pre-Tagging + True Logicals", 55 ), "n/w")
- twSay( 12, 3, "Right Button: Tag │ Left Button: Select" )
- twSay( 13, 3, " ENTER: Select │ ESC: Exit" )
- twSay( 14, 3, " SPACE: Tag" )
- twSay( 15, 3, 'cACColor := "n/bg,gr+/r,r/w,w+/g,w/b"' )
- twSay( 16, 3, 'cBarColor := "w+/b"' )
- twSay( 17, 3, ' nTag := 2' )
- DO WHILE nChoice != 0
- amArray := {}
- FOR nChoice = 1 TO 30
- AADD( amArray, PADL( STRINT( nChoice ), 2 ) + ". Menu Item " + STRINT( nChoice ))
- NEXT
- aLogicals := ARRAY( 30 )
- AFILL( aLogicals, .T. )
- FOR f = 1 TO LEN( amArray )
- // Create some tags
- IF f / 2 == INT( f / 2 )
- amArray[ f ] := amArray[ f ] + "√"
- ELSE
- amArray[ f ] := amArray[ f ] + " "
- ENDIF
- NEXT
-
- nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
- aLogicals, cUser, nStartItem, nWinRow, ;
- lScBar, nTag, cACColor, cBarColor )
- UserMsg( "You Chose " + STRINT( nChoice ))
- ENDDO
- twPop()
-
- #IFNDEF NOMOUSE
- FOR nChoice = 1 TO 7
- twACRemHotSpot( aMouseID[ nChoice ] )
- NEXT
- #ENDIF
-
- SET DELETED ON
- SET CONFIRM ON
-
- USE PART INDEX PART1 ALIAS Part NEW
- nParts := 0; nCost := 0; nSell := 0
- DBEVAL( {|| nParts += Part->PonHand, ;
- nCost += ( Part->PonHand * Part->PCost ),;
- nSell += ( Part->PonHand * Part->PSell ) } )
- GO TOP
-
- aHelp := {}
- AADD( aHelp, {|| BRHelp( "GENHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
- AADD( aHelp, {|| BRHelp( "COLHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
- AADD( aHelp, {|| BRHelp( "ACTHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
- AADD( aHelp, {|| BRHelp( "HOTHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
- AADD( aHelp, {|| BRHelp( "MSEHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
- AADD( aHelp, {|| BRHelp( "CARHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
-
- wT := 3
- wL := 11
- wB := 21
- wR := 68
- aColumns := {}
- cTitle := NIL
- cTopKey := NIL
- bScopeBlock := NIL
- lEditFlag := .T.
- aActionKeys := {}
- wColor := IIF( ! lMono, "w+/b,gr+/r,,gr+/b,bg+/b,br+/b,g+/b,n/w", ;
- "w+/n,n/w,,w/n,w+/n,w/n,w+/n,n/w" )
- wSType := 3
- wFType := 10
- wFColor := IIF( !lMono, { "w+/b", "w/b" }, { "w+/n", "w/n"} )
- lScBar := .T.
- lMsgs := .T.
- lAlite := .T.
- nFreeze := 3
- lStabilize := .T.
- bPreRun := {|x,y| twTitle( "Sample Inventory Maintenance", "n/w", "T", "C" ),;
- x := twBRGetBrowse(), y := x:GETCOLUMN( 2 ),;
- y:colorblock := {|| { 5, 2 } },;
- y := x:GETCOLUMN( 3 ),;
- y:colorblock := {|| IIF( Part->POnHand > 500, { 1, 2 }, ;
- IIF( Part->POnHand < 100, { 7, 2 }, { 6, 2 } )) },;
- x:ColPos := 1 }
- bPostRun := NIL
- nExitKey := K_ALT_X
- aSeparators := { "═", " ", "─" }
- lOKAppend := .T.
- lSound := .T.
- /*
- aSrch array structure
-
- { Column Number in which to start key display,
- Hilite Bar Exception Color
- Code block for search access to dbf.
- Prefix for common keys in scoped browses,
- Mask for display bar. }
-
- add columns
- AADD( aColumns, { cHead, bBlk, nWid, cFoot, lEdit, cPic, bWhn, bVld, ;
- bRdr, aClr, bClr, cCsep, cHsep, cFsep })
-
- */
- aColumns := {}
- AADD( aColumns, { "Part;Number", ;
- {|x| IIF( x=NIL, Part->Pnumber, Part->Pnumber := x ) } ;
- ,,, .T., "@! XXX-999999999",,, {|x| BRGetReader(x,,.T.) } })
- AADD( aColumns, { "Part;Description", ;
- {|x| IIF( x=NIL, Part->PDesc, Part->PDesc := x ) } ;
- ,, "Total;Values;", .T., "@X",,, {|x| BRGetReader(x,,.T.) } })
- AADD( aColumns, { "Number;On Hand", ;
- {|x| IIF( x=NIL, Part->POnHand, Part->POnHand := x ) } ;
- ,, TRANSFORM( nParts, "999999" ) + "; $",;
- .T., "9999",, {|x| ShowParts(x, @nParts, @nSell, @nCost ) }, {|x| BRGetReader(x,,.T.) } })
- AADD( aColumns, { "Selling;Price", ;
- {|x| IIF( x=NIL, Part->PSell, Part->PSell := x ) } ;
- ,, " ;" + TRANSFORM( nSell, "9999999.99" ),;
- .T., "9999.99",, {|x| ShowSell(x, @nSell ) }, {|x| BRGetReader(x,,.T.) } })
- AADD( aColumns, { "Cost;Price", ;
- {|x| IIF( x=NIL, Part->PCost, Part->PCost := x ) } ;
- ,, " ;" + TRANSFORM( nCost, "9999999.99" ), .T., "9999.99",, {|x| ShowCost(x, @nCost ) } })
- //,, .T., "9999.99",, {|x| ShowCost(x, @nCost ) }, {|x| BRGetReader(x,.F.) } })
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ add actionkeys
- └──────────────────────────────────────────────────────────────────────────
- */
-
- aActionKeys := {}
- AADD( aActionKeys, { K_F1, aHelp[ 1 ] })
- AADD( aActionKeys, { K_F2, aHelp[ 2 ] })
- AADD( aActionKeys, { K_F3, aHelp[ 3 ] })
- AADD( aActionKeys, { K_F4, aHelp[ 4 ] })
- AADD( aActionKeys, { K_F5, aHelp[ 5 ] })
- AADD( aActionKeys, { K_F6, aHelp[ 6 ] })
-
- #IFNDEF NOMOUSE
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ add hot spots
- └──────────────────────────────────────────────────────────────────────────
- */
-
- aMouseID := ARRAY( 6 )
- aMouseID[ 1 ] := twBRHotSpot( 24, 0, 24, 9, aHelp[ 1 ], ;
- 1,, .T. )
- aMouseID[ 2 ] := twBRHotSpot( 24, 11, 24, 20, aHelp[ 2 ], ;
- 1,, .T. )
- aMouseID[ 3 ] := twBRHotSpot( 24, 22, 24, 34, aHelp[ 3 ], ;
- 1,, .T. )
- aMouseID[ 4 ] := twBRHotSpot( 24, 36, 24, 47, aHelp[ 4 ], ;
- 1,, .T. )
- aMouseID[ 5 ] := twBRHotSpot( 24, 49, 24, 56, aHelp[ 5 ], ;
- 1,, .T. )
- aMouseID[ 6 ] := twBRHotSpot( 24, 58, 24, 65, aHelp[ 6 ], ;
- 1,, .T. )
- aMouseID[ 6 ] := twBRHotSpot( 24, 67, 24, 74, {|| __keyboard( CHR( K_ESC )) } , ;
- 1,, .T. )
- #ENDIF
-
- twInfoLine( -2, "«F1»∙General «F2»∙Columns «F3»∙Actionkeys «F4»∙Hot Spots «F5»∙Mouse «F6»∙Cargo «ESC»∙Exit" )
- DO WHILE .T.
-
- twBRBrowse( wT, wL, wB, wR, aColumns, cTitle, cTopKey, ;
- bScopeBlock, lEditFlag, aActionKeys, wColor, wSType, wFType, ;
- wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, ;
- bPreRun, bPostRun, nExitKey, aSeparators, ;
- lOKAppend, lSound )
-
- IF LASTKEY() == K_ESC
- EXIT
- ENDIF
- ENDDO
-
- lAlite := .F.
- bPreRun := NIL
- cTitle := "Now Try The Speed Searching"
- aSrch := { 1, IIF( ! lMono, "n/*gr" , "w+/n" ) }
-
- DO WHILE .T.
-
- twBRBrowse( wT, wL, wB, wR, aColumns, cTitle, cTopKey, ;
- bScopeBlock, lEditFlag, aActionKeys, wColor, wSType, wFType, ;
- wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, ;
- bPreRun, bPostRun, nExitKey, aSeparators, ;
- lOKAppend, lSound,,, aSrch )
-
- IF LASTKEY() == K_ESC
- EXIT
- ENDIF
- ENDDO
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────
- │ Remove hot spots. MUST release memory
- └──────────────────────────────────────────────────────────────────────────
- */
-
- #IFNDEF NOMOUSE
- FOR nCount = 1 TO LEN( aMouseID )
- twBRRemHotSpot( aMouseID[ nCount ] )
- NEXT
- #ENDIF
-
- twAMPop()
-
- aTemp := {}
- FOR nCount = 1 TO 10
- AADD( aTemp, "Array Element " + STR( nCount, 3 ) )
- NEXT
-
- wT := 3
- wL := 25
- wB := 21
- wR := 54
- wColor := IIF( ! lMono, "bg+/rg,gr+/n,,w+/rg,bg+/b,r/w,w+/b,w+/g,n/w", ;
- "w+/n,n/w,,w+/n,w/n,n/w,w+/n,w/n,n/w" )
- wFColor := IIF( !lMono, { "gr+/g", "w/b" }, { "w+/n", "w/n"} )
- aColumns := {}
- AADD( aColumns, { " Column Header", 1,, " Column Footer", .F.,,,,, ;
- { 5, 2 }, {|| IIF( twRAGetCurrent() % 3 = 0,;
- { 4, 6 }, { 7, 8 } ) },;
- , "═", "■" } )
-
- twInfoLine( -2, "«Single Element» Array «ESC»∙Exit" )
- nChoice := twRABrowse( wT, wL, wB, wR, aTemp, aColumns, ;
- "Single Element Array" , ;
- .T.,, wColor, ;
- 3, 1, wFColor, .T., .T., 1, .T.,;
- ,, K_ALT_X,,, "Array Element New", .T. )
- twAMPop()
-
- wT := 3
- wL := 5
- wB := 21
- wR := 74
- aTemp := twDirectory( "*.*" )
- ASORT( aTemp,,, {|x,y| x[ 1 ] < y[ 1 ] } )
- aColumns := {}
- AADD( aColumns, { "File Name", 1,, "Col1", .T., "@X", {|| 1=1 }, {|| 1=1 }} )
- AADD( aColumns, { "Size", 2,, "Col2", .T., "@X", {|| 1=2 }, {|| 1=1 },, ;
- { 4, 2 }, {|| IIF( twRAGetElement( 2 ) > 2000, ;
- IIF( twRAGetElement( 2 ) > 10000, { 4, 2 },;
- { 7, 2 } ), { 5, 2 } ) },;
- " > ", "═", "═" })
- AADD( aColumns, { "Date", 3,, "Col3", .T., "@X", {|| 1=1 }, {|| 1=1 },,;
- { 5, 2 }, {|| { 8, 2 }}, " < ", "═", "═" } )
- AADD( aColumns, { "Time", 4,, "Col4", .T., "@X", {|| 1=2 }, {|| 1=1 }} )
- AADD( aColumns, { "Attribute", 5,, "Col5", .T., "@X", {|| 1=1 }, {|| 1=1 },,;
- { 7, 2 }} )
-
- twInfoLine( -2, "«Nested» Array with special column display «ESC»∙Exit" )
- nChoice := twRABrowse( wT, wL, wB, wR, aTemp, aColumns, ;
- "Directory of Files in " + CURDIR() , ;
- .T.,, ;
- IIF( ! lMono, "bg+/rg,gr+/n,,g+/rg,gr+/rg,gr+/r,br+/rg,n/w", ;
- "w+/n,n/w,,w/n,w+/n,n/w,w+/n,n/w" ), ;
- 3, 1, IIF( ! lMono, "gr+/g", "w+/n" ), ;
- .T., .T., 1, .T.,,, K_ALT_X )
-
- UserMsg( "You Chose: " + STRINT( nChoice ) + IIF( nChoice = 0, '', aTemp [ nChoice, 1 ]))
- twAMPop()
-
- twPop()
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Disable Mouse Spots in twACChoice() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:39:05pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: SpotDeactivate │
- │ │
- │ Arguments: xSpot - Spots to Disable │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION SpotDeactivate( xSpot )
- LOCAL nX
- #IFNDEF NOMOUSE
- IF VALTYPE( xSpot ) = 'A'
- FOR nX = 1 TO LEN( xSpot )
- twACSpotOff( xSpot[ nX ] )
- NEXT
- ELSE
- twACSpotOff( xSpot )
- ENDIF
- #ENDIF
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Reactivate Mouse Spots in twACChoice() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:37:52pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: SpotActivate │
- │ │
- │ Arguments: xSpot - Spot to reactivate │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION SpotActivate( xSpot )
- LOCAL nX
- #IFNDEF NOMOUSE
- IF VALTYPE( xSpot ) = 'A'
- FOR nX = 1 TO LEN( xSpot )
- twACSpotOn( xSpot[ nX ] )
- NEXT
- ELSE
- twACSpotOn( xSpot )
- ENDIF
- #ENDIF
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Help for twACChoice() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:37:08pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: HelpACChoice │
- │ │
- │ Arguments: None │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION HelpACChoice()
- LOCAL aMsg := {}, bF1 := SETKEY( K_F1, NIL )
- AADD( aMsg, "twACChoice() has different default key and mouse actions" )
- AADD( aMsg, "depending on the setting of the 'tagging' parameter:" )
- AADD( aMsg, "" )
- AADD( aMsg, " nTag = 0 ( No Tagging )" )
- AADD( aMsg, "" )
- AADD( aMsg, "Left Button - Select │ Right Button - Exit w/o choice" )
- AADD( aMsg, " ENTER - Select │ ESC - Exit w/o choice" )
- AADD( aMsg, "" )
- AADD( aMsg, " nTag = 1 ( Start with untagged array )" )
- AADD( aMsg, " nTag = 2 ( Start with Pre-Tagged array )" )
- AADD( aMsg, "" )
- AADD( aMsg, "Left Button - Select │ Right Button - Tag current" )
- AADD( aMsg, " ENTER - Select │ SPACE - Tag Current" )
- AADD( aMsg, " ESC - EXIT w/o choice" )
- AADD( aMsg, "" )
- AADD( aMsg, " F7 - Tag All" )
- AADD( aMsg, " F8 - Untag All" )
- AADD( aMsg, " F9 - Swap tagged with untagged" )
- twInfo( aMsg, "twACChoice() Help",,,, 3, 10 )
- SETKEY( K_F1, bF1 )
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Read Help for twBRBrowse() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:35:35pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: BRHelp │
- │ │
- │ Arguments: cFile - File Name │
- │ cTitle - Title │
- │ aMouseSpots - Mouse Spots to disable │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION BRHelp( cFile, cTitle, aMouseSpots )
- LOCAL aHandles, cMemo, nX
-
- #IFNDEF NOMOUSE
- FOR nX := 1 TO LEN( aMouseSpots )
- twBRSpotOff( aMouseSpots[ nX ] )
- NEXT
- #ENDIF
-
- twInfoLine( -2, "«Up/Dn»∙«Page»∙Scroll Text «ESC»∙Done" )
- twTextFile( 7, 08, 20, 71, cFile, "n/w", ;
- 3, 10, "b+/w", cTitle )
- twAMPop()
-
- #IFNDEF NOMOUSE
- FOR nX := 1 TO LEN( aMouseSpots )
- twBRSpotOn( aMouseSpots[ nX ] )
- NEXT
- #ENDIF
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Footers display for twBRBrowse() Demo VALID clause │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:40:19pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: ShowParts │
- │ │
- │ Arguments: oGet - Active Get │
- │ nParts - Parts on hand │
- │ nSell - Selling price │
- │ nCost - Cost price │
- │ │
- │ Return Value: TRUE for the VALID │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION ShowParts( oGet, nParts, nSell, nCost )
- LOCAL oB := twBRGetBrowse(), oCol
- LOCAL nOldValue := Part->POnHand, nDiff, nNewValue := EVAL( oGet:block )
- LOCAL nNewDollars
- nDiff := nOldValue - nNewValue
- oCol := oB:GETCOLUMN( 3 )
- nParts -= nDiff
- oCol:Footing := TRANSFORM( nParts, "999999" ) + "; $"
- nOldValue := Part->POnHand * Part->PSell
- nNewDollars := nNewValue * Part->PSell
- nDiff := nOldValue - nNewDollars
- nSell -= nDiff
- oCol := oB:GETCOLUMN( 4 )
- oCol:Footing := " ;" + TRANSFORM( nSell, "9999999.99" )
- nOldValue := Part->POnHand * Part->PCost
- nNewDollars := nNewValue * Part->PCost
- nDiff := nOldValue - nNewDollars
- nCost -= nDiff
- oCol := oB:GETCOLUMN( 5 )
- oCol:Footing := " ;" + TRANSFORM( nCost, "9999999.99" )
- oB:Configure()
- RETURN .T.
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: VALID clause for selling price in twBRBrowse() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:43:16pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: ShowSell │
- │ │
- │ Arguments: oGet - Active Get │
- │ nSell - Selling price │
- │ │
- │ Return Value: TRUE for the VALID │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION ShowSell( oGet, nSell )
- LOCAL oB := twBRGetBrowse(), oCol
- LOCAL nOldValue := Part->PSell * Part->POnHand
- LOCAL nDiff := nOldValue - ( Part->POnHand * EVAL( oGet:block ))
- oCol := oB:GETCOLUMN( 4 )
- nSell -= nDiff
- oCol:Footing := " ;" + TRANSFORM( nSell, "9999999.99" )
- oB:Configure()
- RETURN .T.
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: VALID clause for cost price in twBRBrowse() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:44:44pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: ShowCost │
- │ │
- │ Arguments: oGet - Active get │
- │ nCost - Cost price │
- │ │
- │ Return Value: TRUE for the VALID │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION ShowCost( oGet, nCost )
- LOCAL oB := twBRGetBrowse(), oCol
- LOCAL nOldValue := Part->PCost * Part->POnHand
- LOCAL nDiff := nOldValue - ( Part->POnHand * EVAL( oGet:block ))
- oCol := oB:GETCOLUMN( 5 )
- nCost -= nDiff
- oCol:Footing := " ;" + TRANSFORM( nCost, "9999999.99" )
- oB:Configure()
- RETURN .T.
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Mouse Support Display │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:52:57pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD60000 │
- │ │
- │ Arguments: None │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD60000()
- LOCAL nCount := 0, nTime := SECONDS(), lShowPresses := .F.
- LOCAL nMRow, nMCol, nButton := 0
- UserMsg( { "In TSDWIN, Mouse support is almost automatic. A call to twMouseInit()",;
- "at the beginning of a program is all it takes.",;
- "All the message and browse systems have default mouse support which",;
- "you can augment by creating Mouse Hot Spots with the right associated",;
- "tw??HotSpot() or tw??MouseLine() functions. See TSDWIN.NG for more.",;
- "When you use Mouse Hot Spots, be sure to release the memory they use",;
- "with the correct tw??RemHotSpot() or tw??LinePop() function.",;
- "In TSDWIN, the left button usually defaults to a 'Selection' key. For",;
- "instance, in a browse, pressing the left button on the current choice",;
- "will select it. The same holds for Alert Boxes.",;
- "Sometimes the left button is used for tagging, if multiple selections",;
- "are allowed. In browses in Edit mode, double clicking the left button",;
- "initiates an edit.",;
- "The right hand button usually defaults to the ESC key, except in case",;
- "of multiple choice selections again, where it is a selction key.",;
- "Scroll Bar arrows cause a line up or down with the left button and a",;
- "page up or down with the right button. Both buttons take you to the",;
- "top or bottom of the browse. Clicking in the scroll bars themselves",;
- "moves the pointer proportionately." ;
- } )
- #IFNDEF NOMOUSE
- IF AskUser( { "Continue with Demo", "EXIT to Main Menu" }, ;
- "The following demonstrates routines showing you " +;
- "how the low-level mouse functions work.." ) != 1
- RETURN NIL
- ENDIF
-
- twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
- twTitle( PADC( "TSDWIN Low-Level Mouse Support", 30 ), TCOLOR, "T", "C" )
- @ twRow( 03 ), twCol( 2 ) SAY " FUNCTION 0 1 2"
- @ twRow( 04 ), twCol( 2 ) SAY "------------------------------------------------------------------"
- @ twRow( 05 ), twCol( 2 ) SAY " Which Button Pressed :"
- @ twRow( 06 ), twCol( 2 ) SAY " X coordinate of Mouse :"
- @ twRow( 07 ), twCol( 2 ) SAY " Y coordinate of Mouse :"
- @ twRow( 08 ), twCol( 2 ) SAY " Status of Button 0 Pressed ( 0, 1, 2, 3 ) :"
- @ twRow( 09 ), twCol( 2 ) SAY " No. of Presses of Button :"
- @ twRow( 10 ), twCol( 2 ) SAY " Get X coordinate of Last Button Pressed :"
- @ twRow( 11 ), twCol( 2 ) SAY " Get Y coordinate of Last Button Pressed :"
- @ twRow( 12 ), twCol( 2 ) SAY " Status of Button Released ( 0, 1, 2, 3 ) :"
- @ twRow( 13 ), twCol( 2 ) SAY " No. of Releases of Button :"
- @ twRow( 14 ), twCol( 2 ) SAY " X coordinate of Last Button Released :"
- @ twRow( 15 ), twCol( 2 ) SAY " Y coordinate of Last Button Released :"
- @ twRow( 16 ), twCol( 2 ) SAY " Horizontal Direction of Mouse :"
- @ twRow( 17 ), twCol( 2 ) SAY " Vertical Direction of Mouse :"
- @ twRow( 19 ), twCol( 2 ) SAY " Counter for Presses/Releases Display ( 0-400 ):"
- @ twRow( 20 ), twCol( 2 ) SAY " Seconds to Full Display:"
-
- _twM1()
-
- @ twRow( 21 ), twCol( 30 ) SAY "Press ESC or Click Here to QUIT" COLOR twEnhClr( SETCOLOR() )
- DO WHILE INKEY() != 27
- nCount++
- IF SECONDS() - nTime >= 60
- lShowpresses := .T.
- ELSE
- @ twRow( 20 ), twCol( 50 ) SAY STR( 60 - ( SECONDS() - nTime ), 7, 2 )
- ENDIF
- @ twRow( 05 ), twCol( 50 ) SAY STR( _twM3B(), 5 ) // Get Which Button Pressed
- @ twRow( 06 ), twCol( 50 ) SAY STR( _twM3C() , 5 ) // Get X coordinate of Mouse
- @ twRow( 07 ), twCol( 50 ) SAY STR( _twM3D() , 5 ) // Get Y coordinate of Mouse
- @ twRow( 08 ), twCol( 50 ) SAY STR( _twM5A( 0 ), 5 ) + " " + STR( _twM5A( 1 ), 5 ) + " " + STR( _twM5A( 2 ), 5 ) // <int M2> Status of Button Pressed ( 0 = up, 1 = down )
- IF lShowPresses
- @ twRow( 10 ), twCol( 50 ) SAY STR( _twM5C( 0 ), 5 ) + " " + STR( _twM5C( 1 ), 5 ) + " " + STR( _twM5C( 2 ), 5 ) // <int M2> Get X coordinate of Last Button Pressed
- @ twRow( 11 ), twCol( 50 ) SAY STR( _twM5D( 0 ), 5 ) + " " + STR( _twM5D( 1 ), 5 ) + " " + STR( _twM5D( 2 ), 5 ) // <int M2> Get Y coordinate of Last Button Pressed
- @ twRow( 14 ), twCol( 50 ) SAY STR( _twM6C( 0 ) , 5 ) + " " + STR( _twM6C( 1 ) , 5 ) + " " + STR( _twM6C( 2 ) , 5 ) // <int M2> Get X coordinate of Last Button Released
- @ twRow( 15 ), twCol( 50 ) SAY STR( _twM6D( 0 ) , 5 ) + " " + STR( _twM6D( 1 ) , 5 ) + " " + STR( _twM6D( 2 ) , 5 ) // <int M2> Get Y coordinate of Last Button Released
- lShowPresses := .F.
- ENDIF
- @ twRow( 12 ), twCol( 50 ) SAY STR( _twM6A( 0 ), 5 ) + " " + STR( _twM6A( 1 ), 5 ) + " " + STR( _twM6A( 2 ), 5 ) // <int M2> Status of Button Released ( 0 = up, 1 = down )
- @ twRow( 16 ), twCol( 50 ) SAY STR( _twM11C() , 5 ) // Get Horizontal Direction of Mouse
- @ twRow( 17 ), twCol( 50 ) SAY STR( _twM11D() , 5 ) // Get Vertical Direction of Mouse
- IF nCount = 400
- @ twRow( 09 ), twCol( 50 ) SAY STR( _twM5B( 0 ), 5 ) + " " + STR( _twM5B( 1 ), 5 ) + " " + STR( _twM5B( 2 ), 5 ) // <int M2> No. of Presses of Button
- @ twRow( 13 ), twCol( 50 ) SAY STR( _twM6B( 0 ) , 5 ) + " " + STR( _twM6B( 1 ) , 5 ) + " " + STR( _twM6B( 2 ) , 5 ) // <int M2> No. of Releases of Button
- nCount := 0
- lShowPresses := IIF( lShowPresses, .F., .T. )
- ENDIF
- @ twRow( 19 ), twCol( 50 ) SAY STR( nCount, 7 )
- nButton := twMGetPress( @nMRow, @nMCol )
- nMRow := INT( nMRow / 8 );nMCol := INT( nMCol / 8 )
-
- IF nMRow = 22 .AND. ( nMCol >= 30 .AND. nMCol <= 47 ) .AND. ( nButton == 1 )
- EXIT
- ENDIF
- ENDDO
-
- _twM2()
- #ENDIF
- twPop()
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Miscellaneous Functions │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 06:45:03pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD70000 │
- │ │
- │ Arguments: None │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD70000()
- LOCAL nKey, nGetTry := 0, GetList := {}, dGetTry := DATE()
- LOCAL aNtxArray := {}, lMsgs := .F., nStartTime
- LOCAL cFileSpec := "*.PRG,*.DOC "
- LOCAL cDest := "A:", cPath := ".\ "
- LOCAL wT := 3, wL := 10, wB := 15, wR := 70, cTitle := "Title String"
- LOCAL cFooters := "Footer String"
- LOCAL cMemo := "Printer Not Ready! You can try it if you want but it will not work."+;
- " Oh Well... I knew you had to go ahead and see for yourself. That really"+;
- " is a pity. Lack of trust will defeat us all, then that will be it! "+;
- "I wonder where it will all end. Probably at my own crucification!"+;
- " Whatever became of good old deceit and corporate skullduggery?"+;
- " I guess Santa ain't coming to town yet, eh?"
- LOCAL tString
- LOCAL mUdf, ActionKeys
- LOCAL wColor, wSType, wFType, wFColor, lWrap, lEditMode, nLineLength
- LOCAL nTabSize, nTBufRow, nTBufColumn
- LOCAL nWinRow, nWinColumn, lScBar, lWindow
-
- MEMVAR mDest
-
- twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
- twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
- twTitle( PADC( 'TSD twCalculator()', 30 ), TCOLOR, 'T', 'C' )
- twTitle( PADC( 'Shift-F1 to Call Calculator', 30 ), TCOLOR, 'B', 'C' )
- twCalcInit( 2, 3, MAINCLC, 3, 10, .T. )
- SET KEY K_SH_F1 TO twCallCalc()
-
- DO WHILE .T.
- @ twRow( 4 ), twCol( 10 ) SAY "Get a Value:" GET nGetTry PICTURE "##########.####"
- twReadModal( GetList, .T. ); GetList := {}
-
- IF LASTKEY() == K_ESC
- EXIT
- ENDIF
-
- ENDDO
- twPop()
-
- SET KEY K_SH_F1 TO
- twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
- twTitle( PADC( 'TSD twCalendar()', 30 ), TCOLOR, 'T', 'C' )
-
- twDateInit( 2, 3, MAINCYN, 7, 10,, .F. )
-
- DO WHILE .T.
- @ twRow( 6 ), twCol( 10 ) SAY "Get a Date:" GET dGetTry PICTURE "@D" WHEN twCalendar( @dGetTry )
- twReadModal( GetList, .T. ); GetList := {}
-
- IF LASTKEY() == K_ESC
- EXIT
- ENDIF
-
- ENDDO
- twPop()
- twCenter( 02, "The TSDWIN Indexer makes use of the new GaugeBar Class." )
- twCenter( 03, "It gives your users what they want to see... what's" )
- twCenter( 04, "going on... and frees you from the drudgery of creating" )
- twCenter( 05, "needed but complex routines." )
- DemoWait( 1 )
- twCenter( 07, "twIndexMaker Function Description" )
- DemoWait( 1 )
- twSay( 09, 16, "Watch how these two lines of code operate:" )
- twSay( 11, 6, "AADD( aNtxArray, { 'Windemo', 'Windemo', 'C', 'UPPER( CodeKey )' }) " )
- twSay( 13, 6, "twIndexMaker( aNtxArray,,,,, COLORM, DSHADOW, D2FRAME, ; " )
- twSay( 14, 16, "'Handy Index Maker',, .F. ) " )
- DemoWait( 1 )
- twCenter( 22, " Press a Key or Button or Wait!! " )
- DemoWait( 5 )
-
- AADD( aNtxArray, { "Windemo", "Windemo", "C", "UPPER( CodeKey )" } )
-
- twIndexMaker( aNtxArray,,,,, COLORM, DSHADOW, D2FRAME, ;
- "Handy Index Maker",, .F. )
- twCenter( 16, "How was That??" )
- DemoWait( 1 )
- twClear( .F. )
-
- twTitle( PADC( "twBackUp() Demonstration", 30 ), TCOLOR, "T", "C" )
- DO WHILE .T.
- @ twRow( 2 ), twCol( 10 ) SAY " Path:" GET cPath PICTURE "@!@S25"
- @ twRow( 4 ), twCol( 10 ) SAY " FileSpec:" GET cFileSpec PICTURE "@!"
- @ twRow( 6 ), twCol( 10 ) SAY "Destination:" GET cDest PICTURE "@!"
- @ twRow( 8 ), twCol( 10 ) SAY "Messages:" GET lMsgs PICTURE "Y"
- twReadModal( GetList ); GetList := {}
- IF LASTKEY() == K_ESC
- EXIT
- ENDIF
- nStartTime := SECONDS()
- twBackUp( cPath, cFileSpec, cDest, lMsgs, COLORM, DSHADOW, D2FRAME, COLORFM )
- UserMsg( "Backup Took: " + ALLTRIM( STR( (SECONDS() - nStartTime)/60 )) + " Minutes" )
-
- MEMVAR->mDest := cDest + "*.*"
- ERASE &mDest
- ENDDO
- RELEASE mDest
-
- twTitle( PADC( "Memo Handling Demonstration", 30 ), TCOLOR, "T", "C" )
- twClear( .F. )
- lMsgs := .T.
- lEditMode := .T.
- nWinColumn := NIL
- lScBar := .T.
- lWindow := .T.
- nLineLength := 100
- cTitle := "Testing twMemoEdit()"
-
- cMemo := cMemo + cMemo + cMemo + cMemo + cMemo
-
- cMemo := twMemoEdit( wT, wL, wB, wR, cMemo, cTitle, cFooters, mUdf, ActionKeys, ;
- COLORM, DSHADOW, DFRAME, COLORFM, .T., lEditMode, .T., ;
- nLineLength, nTabSize, nTBufRow, nTBufColumn, ;
- nWinRow, nWinColumn, lScBar, lWindow )
-
- twMemoView( wT, wL, wB, wR, cMemo, "Testing twMemoView()", cFooters, ;
- COLORM, DSHADOW, DFRAME, COLORFM )
-
- twPop()
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: TSDWIN Hardware Functions │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 07:39:52pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD80000 │
- │ │
- │ Arguments: None │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD80000()
- LOCAL nKey := 0, aKeyTry := {}, nX := 0, nRow := 3
- LOCAL cDrStat := "0", nDrive := 0, GetList := {}, RetVal
-
- twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
- twTitle( "twIsDrive()Demonstration", TCOLOR )
- twTitle( "Get out a Diskette or Two!!!!!!!!!!!!!",, "B", "C" )
- BEEPER
- DO WHILE .T.
- twSay( 2, 5, "Enter Drive to Check ( 0 for Drive A:, 1 for Drive B: )!" )
- @ twRow( 4 ), twCol( 12 ) GET nDrive PICTURE "#"
- twReadModal( GetList ); GetList := {}
- IF LASTKEY() == K_ESC
- EXIT
- ENDIF
-
- twIsDrive( nDrive, 3, 4 )
-
- ENDDO
- twPop()
-
- twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
- twTitle( "Testing tw_GetKSt() - Try the Keys!!!", TCOLOR )
- AADD( aKeyTry, RSHIFT )
- AADD( aKeyTry, LSHIFT )
- AADD( aKeyTry, CTRL )
- AADD( aKeyTry, ALT )
- AADD( aKeyTry, SCROLLSTAT )
- AADD( aKeyTry, NUMLOCKSTAT )
- AADD( aKeyTry, CAPLOCKSTAT )
- AADD( aKeyTry, INSERTSTAT )
- AADD( aKeyTry, CTRLNUMLKSTAT )
- AADD( aKeyTry, SCROLLOCK )
- AADD( aKeyTry, NUMLOCK )
- AADD( aKeyTry, CAPLOCK )
- AADD( aKeyTry, INSERT )
- twSay( nRow++, 15, " Right Shift:")
- twSay( nRow++, 15, " Left Shift:")
- twSay( nRow++, 15, " Control:")
- twSay( nRow++, 15, " Alternate:")
- twSay( nRow++, 15, " Scroll Lock Status:")
- twSay( nRow++, 15, "Number Lock Status :")
- twSay( nRow++, 15, " Caps Lock Status:")
- twSay( nRow++, 15, " Insert Status:")
- twSay( nRow++, 15, "Ctrl NumLock Status:")
- twSay( nRow++, 15, " Scroll Lock Key:")
- twSay( nRow++, 15, " Number Lock Key:")
- twSay( nRow++, 15, " Caps Lock Key:")
- twSay( nRow++, 15, " Insert Key:")
-
- DO WHILE ( nkey := Inkey()) != 27
- twTitle( "Counter" + STRINT( ++nX ), "", "B", "C" )
- nRow := 3
- twSay( nRow++, 35, STR( tw_GetKSt( RSHIFT )), ;
- IIF( tw_GetKSt( RSHIFT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( LSHIFT )), ;
- IIF( tw_GetKSt( LSHIFT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( CTRL )), ;
- IIF( tw_GetKSt( CTRL )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( ALT )), ;
- IIF( tw_GetKSt( ALT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( SCROLLSTAT )), ;
- IIF( tw_GetKSt( SCROLLSTAT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( NUMLOCKSTAT )), ;
- IIF( tw_GetKSt( NUMLOCKSTAT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( CAPLOCKSTAT )), ;
- IIF( tw_GetKSt( CAPLOCKSTAT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( INSERTSTAT )), ;
- IIF( tw_GetKSt( INSERTSTAT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( CTRLNUMLKSTAT )), ;
- IIF( tw_GetKSt( CTRLNUMLKSTAT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( SCROLLOCK )), ;
- IIF( tw_GetKSt( SCROLLOCK )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( NUMLOCK )), ;
- IIF( tw_GetKSt( NUMLOCK )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( CAPLOCK )), ;
- IIF( tw_GetKSt( CAPLOCK )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- twSay( nRow++, 35, STR( tw_GetKSt( INSERT )), ;
- IIF( tw_GetKSt( INSERT )= 0,;
- twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
- ENDDO
- DemoWait( 3 )
- twPop()
-
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Place an Order │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 07:54:56pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSD9000 │
- │ │
- │ Arguments: None │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSD90000()
- LOCAL nWin1
- nWin1 := twOpen( FULLSCREEN, COLORW, DSHADOW, DFRAME,, COLORFW )
- twOpen( 16, 64, 22, 78, WHH_CYN )
- twSay( 00, 0, " ▄▄▄▄▄▄▄▄▄▄▄▄▄ ", RDH_CYN )
- twSay( 01, 0, " ▀ █ ▀ ", RDH_CYN )
- twSay( 02, 0, " █ ", RDH_CYN )
- twSay( 03, 0, " █ ", RDH_CYN )
- twSay( 04, 0, " █ ", RDH_CYN )
- twSay( 05, 0, " █ ", RDH_CYN )
- twSay( 06, 0, " █ ", RDH_CYN )
- twSay( 07, 0, " ▄█▄ ", RDH_CYN )
- twSlide( "U", 13 )
- twSlide( "L", 61 )
- twOpen( 15, 63, 22, 77, WHH_CYN )
- twSay( 00, 0, "▄▄▄▄▄▄▄▄▄▄▄▄▄▄", YEL_CYN )
- twSay( 01, 0, "█ █", YEL_CYN )
- twSay( 02, 0, "█ █", YEL_CYN )
- twSay( 03, 0, "█ ", YEL_CYN )
- twSay( 04, 0, "▀▀▀▀▀▀▀▀▀▀▀▀▀█", YEL_CYN )
- twSay( 05, 0, " █", YEL_CYN )
- twSay( 06, 0, "█ █", YEL_CYN )
- twSay( 07, 0, "█ █", YEL_CYN )
- twSay( 08, 0, "█▄▄▄▄▄▄▄▄▄▄▄▄█", YEL_CYN )
- twSlide( "U", 7 )
- twSlide( "L", 60 )
- SETCOLOR( YEL_CYN )
- @5 + 3, 3 say "▄▄▄▄▄▄▄█▄▄▄▄▄▄"
- @6 + 3, 3 say "█ ▄█▄ █"
- SETCOLOR( RDH_CYN )
- @5 + 3, 10 say "█"
- @6 + 3, 09 say "▄█▄"
- twOpen( 16, 64, 22, 77, WHH_CYN )
- twSay( 00, 0, " ▄▄▄▄▄▄▄▄▄▄ ", WHH_CYN )
- twSay( 01, 0, " ██ █ ", WHH_CYN )
- twSay( 02, 0, " ██ █ ", WHH_CYN )
- twSay( 03, 0, " ██ █ ", WHH_CYN )
- twSay( 04, 0, " ██ █ ", WHH_CYN )
- twSay( 05, 0, " ██ █ ", WHH_CYN )
- twSay( 06, 0, " ██▄▄▄▄▄▄▄█ ", WHH_CYN )
- twSlide( "U", 02 )
- twSlide( "L", 61 )
- SETCOLOR( YEL_CYN )
- @11 + 3, 3 say "█ ▄▄▄▄▄▄▄▄▄▄ █"
- @12 + 3, 3 say "█▄██▄▄▄▄▄▄▄█▄█"
- SETCOLOR( WHH_CYN )
- @11 + 3, 5 say "▄▄▄▄▄▄▄▄▄▄"
- @12 + 3, 5 say "██"
- @12 + 3, 14 say "█"
- _twHandle( nWin1 )
- twSay( 15 + 2, 20, "█ █ ▀█▀ █▄▄▄" )
- twSay( 16 + 2, 20, "█ █ █ █ █ █" )
- twSay( 17 + 2, 20, "█▄█▄█ ▄█▄ █ █ CLIPPER 5.01 Windowing Library" )
- DemoWait( .5 )
- twCenter( 21, "VISA - MasterCard - American Express - Discover", GNH_CYN )
-
- twHLine( 01, 21, 56, 1, BLH_CYN )
-
- twSay( 02, 21, "TSDWIN.LIB v2.00 is a ShareWare Product. You are free to", RED_CYN )
- twSay( 03, 21, "use it in order to judge its usefulness to you in your", RED_CYN )
- twSay( 04, 21, " situation. If you like and continue to use TSDWIN, ", RED_CYN )
- twSay( 05, 21, " please register: ", RED_CYN )
- twSay( 09, 29, "1. Register Your Version 2.00 $ 95.00 US" )
- twSay( 11, 29, "We include your Disk Format with Manual" )
- twSay( 12, 29, "and NG on disk. Support BBS membership." )
- twSay( 14, 29, "See ORDERFRM.DOC for Details." )
- twSay( 17, 36, "TSDWIN's customers are the most important", BLA_CYN )
- twSay( 18, 36, " factor in its evolving design!", BLA_CYN )
- DemoWait( 30 )
- _twHandle( nWin1 )
- twTitle( "Any Key or Button", TCOLOR, "B", "C" )
- DemoWait( 30 )
- twSay( 17, 36, " ", BLA_CYN )
- twSay( 18, 36, " Here's where you can place your order!", RED_CYN )
- DemoWait( 3 )
- twScroll( 15, .F., 1, 21, 16, 77 )
- DemoWait( 1 )
- twSay( 02, 21, " CANADA U.S.A. - Central/West " , RED_CYN )
- twSay( 03, 21, " TSD Limited FOX Business Systems " , WHH_CYN )
- twSay( 04, 21, " 18 Bond St. South 217 McCall Rd. " , BLA_CYN )
- twSay( 05, 21, " Dundas, ON, Canada Manhattan, KS, 66502 " , BLA_CYN )
- twSay( 06, 21, " L9H 3H1 Voice: 913-776-1452 " , BLA_CYN )
- twSay( 07, 21, " Voice: 416-628-5086 BBS: 913-776-0111 " , BLA_CYN )
- twSay( 08, 21, " BBS: 519-650-0389 " , BLA_CYN )
- twSay( 09, 21, " Toll Free Order Line: 1-800-795-0199 (Can/USA) " , RED_CYN )
-
- twSay( 10, 21, " U.S.A - East EUROPE " , RED_CYN )
- twSay( 11, 21, " Ahlstedt Software Meisal SoftWare Production" , WHH_CYN )
- twSay( 12, 21, " 2212 Wade Hampton Blvd. Torgvegen 17 " , BLA_CYN )
- twSay( 13, 21, "Greenville, SC, 29615-2249 Kleppe, Norway, N4060 " , BLA_CYN )
- twSay( 14, 21, " Voice: 803-292-2249 Voice: +474-425625 " , BLA_CYN )
- twSay( 15, 21, " +474-627555 " , BLA_CYN )
-
- twTitle( "Press a Key or Button to Exit or Wait", TCOLOR, "B", "C" )
- DemoWait( 30 )
- _twHandle( LEN( _twStack()))
- twPop();twPop();twPop();twPop()
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Black Box for twButtonBox() │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 10:02:25am │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: AskUser │
- │ │
- │ Arguments: aChoices - array of prompts │
- │ cQuestion - prompt string │
- │ cTitle - optional title for window │
- │ │
- │ │
- │ Return Value: Choice number or zero on K_ESC. │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION AskUser( aChoices, cQuestion, cTitle )
- LOCAL nRetVal, nRowAdd
- LOCAL nWinWidth := 0, nLeft, nRight, x := 0
- DEFAULT aChoices TO { "Yes", "No" },;
- cQuestion TO "Proceed?",;
- cTitle TO NIL
-
- AEVAL( aChoices, {|x| nWinWidth += ( LEN( x ) + 4 ) } )
-
- nWinWidth += 3
- nLeft := INT( ( MAXCOL() / 2 ) - ( nWinWidth / 2 ))
- nRight := INT( ( MAXCOL() / 2 ) + ( nWinWidth / 2 ))
- nRowAdd := INT( LEN( cQuestion ) / ( nRight - nLeft ))
-
- RETURN ( twButtonBox( "H", cQuestion, cTitle,, aChoices,, 6, nLeft, ;
- 12 + nRowAdd, nRight, DSHADOW, DFRAME ))
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Informative Message Black Box │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 01:01:50pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: UserMsg │
- │ │
- │ Arguments: nT, nB - Coordinates to start the box │
- │ xMessage - Display string or array │
- │ nWait - Wait Time │
- │ │
- │ Return Value: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION UserMsg( xMessage, nWait, nT, nB )
- RETURN twInfo( xMessage,, nWait, nT, nB, DSHADOW, DFRAME )
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Store the menu descriptions. │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 09:59:19am │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: StoreDesc │
- │ │
- │ Arguments: nX - Message to return │
- │ │
- │ Return Value: Message array │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION StoreDesc( nX )
- LOCAL aMessages := {}
-
- AADD( aMessages, {"One of the most powerful features of «TSDWIN»", ;
- "is its ability to operate on any window in", ;
- "the stack. You can «write to either active»", ;
- "«or inactive windows».","", ;
- "All the other features let you design YOUR", ;
- "interface the way YOU want it. «TSDWIN» does", ;
- "not interfere with «your personal style» of", ;
- "interface design.","", ;
- "«TSDWIN» is a granular library. ONLY modules", ;
- "you need are linked. We have respect for a", ;
- "need to conserve memory and have designed", ;
- "«TSDWIN» accordingly!", "", ;
- "Your continued support is appreciated and", ;
- "helps to make this the product YOU want."} )
-
- AADD( aMessages, {"«TSDWIN» lets you configure your windows to", ;
- "match your own personal interface style. We", ;
- "offer:", ;
- " ∙ Multiple «frame» types.", ;
- " ∙ Multiple «shadow» types.", ;
- " ∙ «Lines» and «Boxes».", ;
- " ∙ Various «title» schemes.", ;
- " ∙ Window «reactivation».", ;
- " ∙ Varied «text formatting».", ;
- " ∙ «Hiding» and «Unhiding».", ;
- " ∙ «Create» before «Display».", ;
- " ∙ Easy «Mouse Support».", ;
- " ∙ Mouse Support is «Optional».", ;
- " ∙ Comprehensive «documentation».", ;
- " ∙ «Moving», «Sizing» and «Sliding»",;
- " ∙ «BBS» and voice «support»." ;
- } )
-
- AADD( aMessages, {"«TSDWIN» offers three message systems:", ;
- "", ;
- " ∙ Windowed informative and warning", ;
- " messages with automatic formatting.", ;
- " ∙ «Line» or «Area» messages with the", ;
- " option to use embedded colours.", ;
- " ∙ Three types of «Alert» boxes using", ;
- "", ;
- " «Pushbutton»", ;
- " «Checkmark»", ;
- " and «Radio» selection.", ;
- "", ;
- " ∙ Optional «ActionKeys».", ;
- " ∙ Automatic «Mouse Support».", ;
- " ∙ Initialization schemes to ensure", ;
- " consistency.", ;
- " ∙ On-the-Fly control of defaults." ;
- } )
-
- AADD( aMessages, {"«TSDWIN»'s MENU TO replacement gives you the", ;
- "option to «control colours». It also includes", ;
- "automatic «hot keys» and «Mouse Support».", ;
- "", ;
- "There are three types of «message systems»", ;
- "including multi-line messages with direct", ;
- "screen writes for speed. This menu is using", ;
- "multi-line messages.", ;
- "", ;
- "Menus may include «security» and also «action", ;
- "blocks» to execute external code.", ;
- "", ;
- "Windowed «PopUp» menus are available in both", ;
- "the MENU TO and ACHOICE() format.", ;
- "", ;
- "An expandable «Line Menu» accepts a varying", ;
- "number of prompts." } )
-
- AADD( aMessages, {"«TSDWIN» offers a choice of fast «DBF» and «Array»", ;
- "browsers, with or without «Mouse Support».", ;
- "", ;
- "The new browses in «TSDWIN» 2.00 give you the", ;
- "most complete control of column definitions", ;
- "and on-the-fly modification methods you will", ;
- "find available.", ;
- "", ;
- "«Append» and «Edit» modes are availables in both", ;
- "DBF and Array browses.", ;
- "", ;
- "«ActionKeys» and «Mouse Hot Spots» make it very", ;
- "easy to construct comprehensive mouse driven",;
- "modules.", ;
- "", ;
- "You can build whole applications around the", ;
- "new browses in «TSDWIN» V2.00." ;
- } )
-
- AADD( aMessages, {"Mouse support in «TSDWIN» is almost automatic.", ;
- "", ;
- "With the exception of «Mouse Hot Spots», one", ;
- "call to «twMouseInit()» at the beginning of a", ;
- "program provides you with «automatic» mouse", ;
- "operations.", ;
- "", ;
- "There are «High and Level» mouse functions to", ;
- "allow you to extend and customize the mouse", ;
- "operations already available in «TSDWIN».", ;
- "", ;
- "Two methods of handling «Mouse Hot Spots» are", ;
- "included: one based on information held in", ;
- "the calling routine and another managed by", ;
- "«TSDWIN».", ;
- "", ;
- "Mousing is «Optional» with «TSDWIN v2.00»."} )
-
- AADD( aMessages, {"«TSDWIN» offers many functions which allow you", ;
- "to provide your «clients» with little extras", ;
- "to keep them «coming back».", ;
- "", ;
- "We provide a comprehensive «Calculator» with", ;
- "memory and a «Calendar» system to use either", ;
- "for data entry or as a driver for other date", ;
- "operations.", ;
- "", ;
- "Creating «indexes» is easy and informative for", ;
- "your clients when you use twIndexMaker().", ;
- "", ;
- "«File Backup» is available with this version,", ;
- "with or without the interface we provide.", ;
- "", ;
- "You will find replacements for MEMOEDIT()." ;
- } )
-
- AADD( aMessages, {"«TSDWIN» offers some functions which directly", ;
- "affect the computer hardware.", ;
- "", ;
- "We believe this area to be well-supported in",;
- "other third party products and so our thrust",;
- "is to provide only functions which directly",;
- "affect the «user interface».",;
- "",;
- "We offer easy and complete disk «Drive Status»",;
- "checks which you can call Low-Level or use",;
- "our windowed interface.", ;
- "", ;
- "There is the ability to check and/or set the", ;
- "status of 'dead' keys (CTRL ALT DEL etc.).", ;
- "", ;
- "An on-screen «Clock» can be called directly or", ;
- "fitted into your window scheme by «TSDWIN»." ;
- } )
-
- AADD( aMessages, {"", ;
- " «TSDWIN Version 2.00» is a «Major» Upgrade!", ;
- "", ;
- "You can order «TSDWIN» V2.00 on our «Toll Free»",;
- "order line. «Next day» shipment can now", ;
- "be guaranteed. For surface mail allow 2 to 4", ;
- "weeks for delivery.", ;
- "", ;
- "Current registered users should inquire about", ;
- "«upgrading» to TSDWIN V2.00.", "",;
- "«Only» MAXI source is available for 2.00 but", ;
- "you can now get printed documentation." ;
- } )
-
- AADD( aMessages, {"", ;
- "", ;
- "", ;
- "",;
- " Trilateral Systems Development Ltd.",;
- "",;
- "has enjoyed bringing you this demonstration.";
- } )
-
- RETURN aMessages[ nX ]
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Display Corporate Colours │
- │ Author: Vic Lewis │
- │ Date created: 04-18-92 │
- │ Time created: 02:00:01pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Function: TSDSetup │
- │ │
- │ Arguments: lMono │
- │ │
- │ Return Value: NIL │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION TSDSetup( lMono )
- IF ! lMono
- @ 0, 19 SAY "T" COLOR "r+/bg"
- @ 0, 20 SAY "S" COLOR "gr+/bg"
- @ 0, 21 SAY "D" COLOR "w+/bg"
- ENDIF
- IF ! lMono
- @ MAXROW(), 22 SAY "T" COLOR "r+/bg"
- @ MAXROW(), 33 SAY "S" COLOR "gr+/bg"
- @ MAXROW(), 41 SAY "D" COLOR "w+/bg"
- ENDIF
-
- RETURN NIL
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: GetReader for twBRBrowse() Demo │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:46:50pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Procedure: BRGetReader │
- │ │
- │ Arguments: get - Get Object │
- │ lGoRight - stuff a oDB:Right() │
- │ lRightOnEnter - stuff a oDB:Right() and write get │
- │ See Also: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- PROCEDURE BRGetReader( get, lGoRight, lRightOnEnter )
- DEFAULT lGoRight TO .T., ;
- lRightOnEnter TO .F.
- // read the GET IF the WHEN condition is satisfied
- IF ( GetPreValidate( get ))
- // activate the GET for reading
- get:SetFocus()
- DO WHILE ( get:exitState == GE_NOEXIT )
-
- // check for initial typeout ( no editable positions )
- IF ( get:typeOut )
- get:exitState := GE_ENTER
- ENDIF
-
- // apply keystrokes until exit
- DO WHILE ( get:exitState == GE_NOEXIT )
- BRGetApplyKey( get, INKEY( 0 ), lGoRight, lRightOnEnter )
- ENDDO
-
- // disallow exit IF the VALID condition is not satisfied
- IF ( !GetPostValidate( get ))
- get:exitState := GE_NOEXIT
- ENDIF
- ENDDO
- // de-activate the GET
- get:KillFocus()
- ENDIF
- RETURN
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Custom GET Key Handler for Parts Browse (twBRBrowse() ) │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:49:33pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Procedure: BRGetApplyKey │
- │ │
- │ Arguments: get - Get Object │
- │ key - key passed from get reader │
- │ lGoRight - stuff a oDB:Right() │
- │ lRightOnEnter - stuff a oDB:Right() and write get │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- PROCEDURE BRGetApplyKey( get, key, lGoRight, lRightOnEnter )
- LOCAL cKey
- LOCAL bKeyBlock
- // check for SET KEY first
- IF (( bKeyBlock := SETKEY( key )) <> NIL )
- GetDoSetKey( bKeyBlock, get )
- RETURN // NOTE
- ENDIF
-
- DO CASE
- CASE ( key == K_UP )
- get:exitState := GE_UP
-
- CASE ( key == K_SH_TAB )
- get:exitState := GE_UP
-
- CASE ( key == K_DOWN )
- get:exitState := GE_DOWN
-
- CASE ( key == K_TAB )
- get:exitState := GE_DOWN
-
- CASE ( key == K_ENTER )
- IF lGoRight
- get:exitState := GE_ENTER
- IF lRightOnEnter
- __keyboard( CHR( K_RIGHT ))
- ENDIF
- ELSE
- IF lRightOnEnter
- get:exitState := GE_WRITE
- __keyboard( CHR( K_RIGHT ))
- ELSE
- get:exitState := GE_WRITE
- __keyboard( CHR( K_CTRL_HOME ) + IIF( !( RECNO() = LASTREC() + 1 ), CHR( K_DOWN ), "" ))
- ENDIF
- ENDIF
-
- CASE ( key == K_ESC )
- IF ( SET( _SET_ESCAPE ))
- get:undo()
- get:exitState := GE_ESCAPE
- ENDIF
-
- CASE ( key == K_PGUP )
- get:exitState := GE_WRITE
-
- CASE ( key == K_PGDN )
- get:exitState := GE_WRITE
-
- CASE ( key == K_CTRL_HOME )
- get:exitState := GE_TOP
-
- #ifdef CTRL_END_SPECIAL
- // both ^W and ^End go to the last GET
- CASE ( key == K_CTRL_END )
- get:exitState := GE_BOTTOM
-
- #ELSE
- // both ^W and ^End terminate the READ ( the default )
- CASE ( key == K_CTRL_W )
- get:exitState := GE_WRITE
- #ENDIF
-
- CASE ( key == K_INS )
- SET( _SET_INSERT, !SET( _SET_INSERT ))
- BRShowScoreboard()
-
- CASE ( key == K_UNDO )
- get:Undo()
-
- CASE ( key == K_HOME )
- get:Home()
-
- CASE ( key == K_END )
- get:End()
-
- CASE ( key == K_RIGHT )
- get:exitState := GE_WRITE
- IF lGoRight
- __keyboard( CHR( K_RIGHT ))
- ELSE
- __keyboard( CHR( K_CTRL_HOME ) + IIF( !( RECNO() = LASTREC() + 1 ), CHR( K_DOWN ), "" ))
- ENDIF
-
- CASE ( key == K_LEFT )
- get:exitState := GE_WRITE
- __keyboard( CHR( K_LEFT ))
-
- CASE ( key == K_CTRL_RIGHT )
- get:Right()
-
- CASE ( key == K_CTRL_LEFT )
- get:Left()
-
- CASE ( key == K_BS )
- get:BackSpace()
-
- CASE ( key == K_DEL )
- get:Delete()
-
- CASE ( key == K_CTRL_T )
- get:DelWordRight()
-
- CASE ( key == K_CTRL_Y )
- get:DelEnd()
-
- CASE ( key == K_CTRL_BS )
- get:DelWordLeft()
-
- OTHERWISE
-
- IF ( key >= 32 .AND. key <= 255 )
- cKey := CHR( key )
- IF ( get:type == "N" .AND. ( cKey == "." .OR. cKey == ", " ))
- get:ToDecPos()
- ELSE
- IF ( SET( _SET_INSERT ))
- get:Insert( cKey )
- ELSE
- get:Overstrike( cKey )
- ENDIF
- IF ( get:typeOut .AND. !SET( _SET_CONFIRM ))
- IF ( SET( _SET_BELL ))
- ?? CHR( 7 )
- ENDIF
- IF lGoRight
- get:exitState := GE_ENTER
- IF lRightOnEnter
- __keyboard( CHR( K_RIGHT ))
- ENDIF
- ELSE
- get:exitState := GE_WRITE
- __keyboard( CHR( K_CTRL_HOME ) + IIF( !( RECNO() = LASTREC() + 1 ), CHR( K_DOWN ), "" ))
- ENDIF
- ENDIF
- ENDIF
- ENDIF
- ENDCASE
- RETURN
-
- /**********************************
- *
- * wacky compatibility services
- *
- */
- // display coordinates for SCOREBOARD
- #define SCORE_ROW 0
- #define SCORE_COL 60
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Compatibility PROC for get reader │
- │ Author: Vic Lewis │
- │ Date created: 04-19-92 │
- │ Time created: 05:51:35pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ Procedure: BRShowScoreBoard │
- │ │
- │ Arguments: None │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- STATIC PROCEDURE BRShowScoreboard()
- LOCAL nRow, nCol
- IF ( SET( _SET_SCOREBOARD ))
- nRow := ROW()
- nCol := COL()
- SETPOS( SCORE_ROW, SCORE_COL )
- DISPOUT( IIF( SET( _SET_INSERT ), "Ins", " " ))
- SETPOS( nRow, nCol )
- ENDIF
- RETURN
-
- /*
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ Description: Wait State │
- │ Author: Vic Lewis │
- │ Date created: 08-26-92 │
- │ Time created: 02:56:09pm │
- │ Copyright: Trilateral Systems Development Ltd. │
- ├──────────────────────────────────────────────────────────────────────────┤
- │ FUNCTION DemoWait( nWait ) │
- │ │
- │ Arguments: │
- │ │
- │ Return Value: │
- │ See Also: │
- │ │
- └──────────────────────────────────────────────────────────────────────────┘
- */
- FUNCTION DemoWait( nWait )
- LOCAL nKey
- #IFNDEF NOMOUSE
- nKey := twMInkeyWait( nWait, .T., .T. )
- #ELSE
- nKey := twInkeyWait( nWait )
- #ENDIF
- RETURN nKey
-