//********************************************************************* // // WINDEMO.PRG // // Demonstration Program for TSDWIN.LIB // Clipper 5.0 Window Library // // Copyright (C) 1991 Trilateral Systems Development Ltd. // All Rights Reserved * Version 1.30 * Release Date: 05-12-91 // // 43B Metcalfe Crescent // Brantford, ON, Canada // N3R 2L7 // 519-758-0867 // //********************************************************************* //********************************************************************* // Preprocessor Directives //********************************************************************* #include "achoice.ch" #include "inkey.ch" #define YC ( .024 * xc * xc ) - ( 1.44 * xc ) + 24.6 #define FULLSCREEN 0, 0, MAXROW(), MAXCOL() #define MAINBLU IIF( ISCOLOR(), "w/b,gr+/r,,,n/w", "w+/n,n/w,,,w/n") #define MAINRED IIF( ISCOLOR(), "w+/r,gr+/r,,,n/w", "w+/n,n/w,,,w/n") #define WHI_BLA "w/n" #define WHH_BLA "w+/n" #define GRH_BAH IIF( ISCOLOR(), "g+/*n", "w+/n") #define YEL_BLU IIF( ISCOLOR(), "gr+/b", "w+/n") #define CYH_BLU IIF( ISCOLOR(), "bg+/b", "w+/n") #define WHH_BLU IIF( ISCOLOR(), "w+ /b", "w+/n") #define GNH_BLU IIF( ISCOLOR(), "g+ /b", "w+/b") #define RDH_BLU IIF( ISCOLOR(), "r+ /b", "w/n") #define WHH_BLH IIF( ISCOLOR(), "w+ /*b", "w+/n") #define RED_BLH IIF( ISCOLOR(), "r /*b", "w+/n") #define REH_BLH IIF( ISCOLOR(), "r+ /*b", "w+/n") #define BLA_BLH IIF( ISCOLOR(), "n /*b", "w+/n") #define BLU_WHI IIF( ISCOLOR(), "b /w", "n/w") #define BLA_WHI "n/w" #define BLU_WHH IIF( ISCOLOR(), "b /*w", "w+/n") #define BLH_WHH IIF( ISCOLOR(), "b+ /*w", "w+/n") #define GRN_WHH IIF( ISCOLOR(), "g /*w", "w/n") #define YEL_WHH IIF( ISCOLOR(), "gr+/*w", "w+/n") #define BLA_WHH IIF( ISCOLOR(), "n /*w", "n/w") #define YEL_CYN IIF( ISCOLOR(), "gr+/bg", "w+/n") #define RED_CYN IIF( ISCOLOR(), "r /bg", "n/w") #define BLU_CYN IIF( ISCOLOR(), "b /bg", "w+/n") #define RDH_CYN IIF( ISCOLOR(), "r+ /bg", "w+/n") #define WHI_CYN IIF( ISCOLOR(), "w /bg", "w+/n") #define WHH_CYN IIF( ISCOLOR(), "w+ /bg", "w+/n") #define BLA_CYN IIF( ISCOLOR(), "n /bg", "w/n") #define BLH_CYN IIF( ISCOLOR(), "b+ /bg", "w+/n") #define RDH_CYH IIF( ISCOLOR(), "r+ /*bg", "w/n") #define BLU_CYH IIF( ISCOLOR(), "b /*bg", "w+/n") #define BLA_CYH IIF( ISCOLOR(), "n /*bg", "w+/n") #define YEL_CYH IIF( ISCOLOR(), "gr+/*bg", "w+/n") #define WHI_CYH IIF( ISCOLOR(), "w /*bg", "w+/n") #define YEL_RED IIF( ISCOLOR(), "gr+/r", "n/w") #define CYH_RED IIF( ISCOLOR(), "bg+/r", "w+/n") #define WHI_RED IIF( ISCOLOR(), "w/r", "w+/n") #define WHH_RED IIF( ISCOLOR(), "w+/r", "w+/n") #define BLH_RED IIF( ISCOLOR(), "b+/r", "w+/n") #define YEL_RDH IIF( ISCOLOR(), "gr+/*r", "w+/n") #define CYH_RDH IIF( ISCOLOR(), "bg+/*r", "w/n") #define WHH_RDH IIF( ISCOLOR(), "w+ /*r", "w/n") #define WHH_GRN IIF( ISCOLOR(), "w+ /g", "w+/n") #define YEL_GRN IIF( ISCOLOR(), "gr+/g", "w+/n") #define CYH_GRN IIF( ISCOLOR(), "bg+/g" , "w/n") #define BLA_GNH IIF( ISCOLOR(), "n /*g", "w/n") #define RDH_GNH IIF( ISCOLOR(), "r+ /*g", "w+/n") #define VIO_GNH IIF( ISCOLOR(), "br+/*g", "w+/n") #define GNH_VIO IIF( ISCOLOR(), "g+ /rb", "w/n") #define WHI_VIO IIF( ISCOLOR(), "w /rb", "w/n") #define WHH_VIO IIF( ISCOLOR(), "w+ /rb", "w/n") #define YEL_VIO IIF( ISCOLOR(), "gr+/rb", "w/n") #define WHH_VIH IIF( ISCOLOR(), "w+ /*rb", "n/w") #define WHI_BRN IIF( ISCOLOR(), "w /gr", "n/w") #define RDH_YLH IIF( ISCOLOR(), "r+ /*gr", "w+/n") #define RED_YLH IIF( ISCOLOR(), "r /*gr", "w+/n") #define BLA_YLH IIF( ISCOLOR(), "n /*gr", "w+/n") #define BLU_YLH IIF( ISCOLOR(), "b /*gr", "w+/n") #define BLH_YLH IIF( ISCOLOR(), "b+ /*gr", "w+/n") #translate BEEPER => TONE( 350, 0 ) #translate STRINT() => LTRIM(STR()) #translate CLRCHK(,) => IIF(ISCOLOR(),,) #command CBLINK => SETBLINK(IIF(ISCOLOR(),.F.,.T.)) //********************************************************************* // File Wide Variable Declarations //********************************************************************* STATIC win1, win2, win3, win4, win5, win6 STATIC f, g, tArray := { "", "", "", "", "", "" } STATIC MainChoice, MenuLen //******************************************************************* // // FUNCTION Main( SThickness ) // // Parameters: Shadow Thickness // // Return: Nothing // // Purpose: TSDWIN.LIB Demonstration // //***** Documented: 04-11-91 at 09:28:48am ************************** FUNCTION Main( SThickness ) //********************************************************************* // Define LOCAL Variables for Main() //********************************************************************* LOCAL mPrompts:={" A TSDWIN.LIB Features ",; " B Shadow Types ",; " C Border Types ",; " D Line Drawing ",; " E Box Drawing ",; " F Area Operations ",; " G Headers/Footers ",; " H Text Management ",; " I GETs and PROMPTs ",; " J Redisplaying ",; " K Reactivating ",; " L Moving/Sliding/Sizing ",; " M Picklists ",; " N Instance Variables. ",; " O TSDWIN Function List ",; " P TSDWIN Revision Hist. ",; " Q Run the Whole Demo!!! "} LOCAL f, MenuAction:='' MEMVAR mNum, mRow //********************************************************************* // Initialize Memvars // // We do not use these in regular programming practice. // They are here to keep things in one place. // And that's the truth! // //********************************************************************* mNum := 1; mRow := 0 //********************************************************************* // Initialize Global Statics //********************************************************************* MainChoice := 0; MenuLen := LEN( mPrompts ) //********************************************************************* // Set Up Environment //********************************************************************* CBLINK SET CURSOR OFF SET SCOREBOARD OFF SET WRAP ON //********************************************************************* // Link in the Screen Savers //********************************************************************* EXTERNAL wSsaveAsc EXTERNAL wWsaveAsc SET KEY 287 TO wSsaveAsc SET KEY 273 TO wWsaveAsc //********************************************************************* // Initialze window stack to thick or thin //********************************************************************* IF PCOUNT() == 0 wInit( 2 ) ELSE IF VAL( SThickness ) < 1 .OR. VAL( SThickness ) > 2 wInit( 2 ) ELSE wInit( VAL( SThickness )) ENDIF ENDIF //********************************************************************* // Open Main Display Window //********************************************************************* wOpen( FULLSCREEN, MAINBLU, 5, 10 ) wTitle( "TSD Window Library Demonstration", BLU_WHI, "T", "C" ) InkeyWait( 1 ) wCenter( 2, " * TSDWIN Organizes Your Clipper Screens *", YEL_BLU ) InkeyWait( 2 ) wCenter( 4, "Windows are Stored in a Dynamically Allocated Stack!", CYH_BLU ) InkeyWait( 1 ) wCenter( 5, "Memory is Released When the Windows are Popped.", CYH_BLU ) InkeyWait( 2 ) BEEPER wCenter( 6, "You Can Now Write to Active or Inactive Windows!!", WHH_BLU ) InkeyWait( 2 ) wCenter( 8, "During the demo, ALT-W and ALT-S may", CYH_BLU ) wCenter( 9, "be pressed to save Windows and Screens.", CYH_BLU ) InkeyWait( 2 ) wCenter( 11, "We Know You May Want Shadows Either One", YEL_BLU ) wCenter( 12, "or Two Characters Wide on the Side.", YEL_BLU ) InkeyWait( 1 ) wCenter( 14, "Run WINDEMO Again Using a Command Line Parameter:", CYH_BLU ) wCenter( 16, "WINDEMO 1 for Thin Shadows.", CYH_BLU ) wCenter( 17, "WINDEMO 2 for Thick Shadows.", CYH_BLU ) InkeyWait( 1 ) wCenter( 19, "Press a Key to Start the Demonstration.", WHH_BLU ) InkeyWait( 0 ) PopaFew() InkeyWait( 1 ) wScroll( 22, .F. ) wOpen( 2, 3, 23, 75, MAINBLU ) wTitle( "TSDWIN Demo Menu", CYH_BLU, "T", "C" ) wTitle( "Pick One and Be Amazed!", CYH_BLU, "B", "C" ) wCenter( 20, "Cursor Keys to Select : ENTER to View : ESC when Done", GNH_BLU ) KEYBOARD CHR( 32 ) Do While .T. MainChoice := ACHOICE( wRow( 2 ), wCol( 0 ), ; wRow( 1 + LEN( mPrompts )), ; wCol( LEN( mPrompts[1] ) - 1 ), ; mPrompts, .T., "Menu_Udf", mNum, mRow ) IF MainChoice = MenuLen FOR f = 1 TO MenuLen - 1 MenuAction := &("{|| wProc"+PADL(STRINT(f),2,'0')+"() }") EVAL( MenuAction ) InkeyWait( 1 ) NEXT ELSEIF ( MainChoice > 0 ) .AND. ( MainChoice <= MenuLen ) MenuAction := &("{|| wProc"+PADL(STRINT(MainChoice),2,'0')+"() }") EVAL( MenuAction ) ELSEIF MainChoice = 0 EXIT ENDIF ENDDO wPop() //********************************************************************* // End The Demonstration //********************************************************************* wScroll( 22, .F. ) SignOff() SET COLOR TO SET CURSOR ON CLS QUIT //********************************************************************* // End of Windemo.prg //********************************************************************* //******************************************************************* // // PROCEDURE wProc01() // // Purpose: TSDWIN.LIB Features // //***** Documented: 04-10-91 at 09:08:50pm ************************** PROCEDURE wProc01() wOpen( FULLSCREEN, MAINBLU, 5, 9 ) CBLINK wTitle( "TSDWIN.LIB Features", YEL_BLU, "T", "C" ) wCenter( 2, "Some of TSDWIN.LIB 's Many Features...", CYH_BLU ) InkeyWait( 2 ) wSay( 04, 16, " Select from Four Shadow Positions or None.", YEL_BLU ) InkeyWait( 2 ) wSay( 05, 16, " Choose A Border Type for Your Window.", YEL_BLU ) InkeyWait( 2 ) wSay( 06, 16, " You Can Draw Horizontal and Vertical Lines,", YEL_BLU ) InkeyWait( 2 ) wSay( 07, 16, " And 14 Types of Boxes.", YEL_BLU ) InkeyWait( 2 ) wSay( 08, 16, " And You Can Shadow, Clear and Colour Your Boxes.", YEL_BLU ) InkeyWait( 2 ) wSay( 09, 16, " You Can Position Titles Effortlessly.", YEL_BLU ) InkeyWait( 2 ) wSay( 10, 16, " Elegant Text Management is Easy.", YEL_BLU ) InkeyWait( 2 ) wSay( 11, 16, " You Can Display GETs and PROMPTs.", YEL_BLU ) InkeyWait( 2 ) wSay( 12, 16, " Screens Can Be Redisplayed From the Stack.", YEL_BLU ) InkeyWait( 2 ) wSay( 13, 16, " You Can Reactivate Previous Windows!", YEL_BLU ) InkeyWait( 2 ) wSay( 14, 16, " You Can MOVE or SLIDE a Window!", YEL_BLU ) InkeyWait( 2 ) wSay( 15, 16, " You Can Create picklists with ease!", YEL_BLU ) InkeyWait( 2 ) wSay( 16, 16, " You Can Retrieve A Window's Instance Variables.", YEL_BLU ) InkeyWait( 2 ) wSay( 17, 16, " Save Screens or Windows to MEM or ASCII Files.", GNH_BLU ) InkeyWait( 2 ) wSay( 18, 16, " Choose Shadow Thickness.", GNH_BLU ) InkeyWait( 2 ) wSay( 19, 16, " SMALL Kernel (24K) Small is Beautiful!!", WHH_BLU ) InkeyWait( 2 ) wSay( 20, 16, " Optimized for Speed.", WHH_BLU ) InkeyWait( 2 ) wSay( 21, 16, " More Features Yet to Come", YEL_BLU ) InkeyWait( 1 ) wScroll( 1, .F. ) wSay( 21, 16, " More MAXI Functions:", WHH_BLU ) InkeyWait( 1 ) wScroll( 1, .F. ) wSay( 21, 16, " ACHOICES... TBROWSES...", WHH_BLU ) InkeyWait( 1 ) wScroll( 1, .F. ) wSay( 21, 16, " Dialog Boxes, Alert Boxes...", WHH_BLU ) InkeyWait( 1 ) wScroll( 1, .F. ) wSay( 21, 16, " Radio Boxes, Buttons...", WHH_BLU ) wScroll( 1, .F. ) InkeyWait( 1 ) wSay( 21, 16, " And you STILL WON'T HAVE TO link them!", YEL_BLU ) wScroll( 3, .F. ) InkeyWait( 1 ) wSay( 20, 16, " YOU help us decide what goes into TSDWIN.", GNH_BLU ) wSay( 21, 16, " SO YOU benefit from EVERYONE'S ideas!.", GNH_BLU ) InkeyWait( 1 ) wTitle( "Press a Key or Wait...",, "B", "C" ) InkeyWait( 3 ) wOpen( 3, 10, 13, 71, IIF( ISCOLOR(), "n/*bg", "n/w" ), 1, 13 ) wCenter( 2, "TSDWIN.LIB" ) wCenter( 4, "Looks After the Details" ) wCenter( 6, "While YOU Use YOUR Expertise" ) wCenter( 8, "Where It COUNTS!" ) wTitle( "Press a Key or Wait...",, "B", "C" ) InkeyWait( 3 ) wPop();wPop() RETURN //******************************************************************* // // PROCEDURE wProc02() // // Purpose: Show Shadow Types // //***** Documented: 04-10-91 at 09:08:35pm ************************** PROCEDURE wProc02() LOCAL win1, tHandle win1 := wOpen( FULLSCREEN, WHH_BLU, 5, 9, "" ) wTitle( "Window Shadows", BLU_WHH, "T", "C" ) wTitle( "Press a Key or Wait", BLU_WHH, "B", "C" ) wOpen( 3, 5, 9, 34, RDH_CYH, 1, 2 ) wCenter( 3, "Shadow Type 1" ) wOpen( 3, 45, 9, 74, RDH_CYH, 7, 2 ) wCenter( 3, "Shadow Type 7" ) wOpen( 13, 5, 19, 34, RDH_CYH, 9, 2 ) wCenter( 3, "Shadow Type 9" ) wOpen( 13, 45, 19, 74, RDH_CYH, 3, 2 ) wCenter( 3, "Shadow Type 3" ) InkeyWait( 3 ) tHandle := _wHandle( win1 ) BEEPER wCenter( 22," Remember, You can Change the Thickness with wInit() ",; YEL_BLU ) InkeyWait( 3 ) FOR f = 1 TO 5 wPop() NEXT RETURN //******************************************************************* // // PROCEDURE wProc03() // // Purpose: Show Border Types // //***** Documented: 04-10-91 at 09:08:14pm ************************** PROCEDURE wProc03() LOCAL rPos, cPos, tHandle, aTitle, mainwin LOCAL win01, win02, win03, win04, win05, win06, win07, win08, win09 LOCAL win10, win11, win12, win13, win14, winnum:={} LOCAL tArray := { CYH_GRN, GNH_VIO, WHH_VIH, YEL_RDH, BLA_GNH, WHH_BLH, ; RDH_YLH, RED_YLH, GRN_WHH, BLH_CYN, BLA_YLH, RDH_GNH, ; YEL_WHH, CYH_RDH, MAINRED } mainwin := wOpen( FULLSCREEN, IIF( ISCOLOR(), ; "b+/b", "w+/n" ), 5, 12, "±" ) wTitle( "Window Borders", BLU_WHH, "T", "C" ) wTitle( "Press a Key or Wait", BLU_WHH, "B", "C" ) cPos:=-4 FOR f = 1 TO 14 rPos := IIF( f > 7, 9, 2 ) cPos := cPos + 10 AADD( winnum, "win" + PADL( STRINT(f), 2, "0" )) winnum[f] := wOpen( rPos, cPos, rPos + 5, cPos + 7, RDH_CYH, 5, f ) wCenter( 2, "Type" );wCenter( 3, STRINT( f ) ) cPos := IIF( f == 7, -4, cPos ) NEXT InkeyWait( 3 ) BEEPER tHandle := _wHandle( mainwin ) aTitle := _wTitle() wCenter( 16, " You can change the frame Type of any window! ", YEL_BLU ) InkeyWait( 1 ) FOR f = 1 TO 14 wFrame( f, YEL_BLU);wPutTitles( aTitle );InkeyWait( .5 ) NEXT BEEPER _wHandle( mainwin ) wCenter( 18, " Or the Colour! ", YEL_BLU ) InkeyWait( 1 ) FOR f = 1 to 14 _wHandle( winnum[f] ) wFrame( _wFrame(), tArray[ f ] ) InkeyWait( .1 ) NEXT InkeyWait( 1 ) BEEPER _wHandle( mainwin ) wCenter( 20, " The Frame Colour can be a Two Element Array ", CYH_BLU ) wCenter( 21, " To Allow Active/Inactive Windows to have ", CYH_BLU ) wSay( 22, 21, " Separate Colours.", CYH_BLU ) InkeyWait( 1 ) wType( 22, 39, " (Like MS-Windows) ",WHH_BLU, .F. ) InkeyWait( 1 ) _wHandle( tHandle ) InkeyWait( 6 ) FOR f = 1 TO 15 wPop() NEXT RETURN //******************************************************************* // // PROCEDURE wProc04() // // Purpose: Show Line Types // //***** Documented: 04-10-91 at 09:08:01pm ************************** PROCEDURE wProc04() LOCAL tType wOpen( 7, 8, 21, 73, YEL_CYN, 1, 9 ) wTitle( "Line Types",, "T", "C" ) wTitle( "Key or Wait",, "B", "C" ) wTitle( "Horizontal", RED_CYN, "B", "L" ) FOR f = 1 TO 11 tType := PADL( STRINT( f ), 2 ) wLeft( f + 1, " Type " + tType + ":" ) wHline( f + 1, 15, 09, f, RED_CYN ) NEXT wTitle( "Vertical", BLU_CYN, "B", "R" ) @ wRow( 2 ), wCol( 44 ) say "Types" @ wRow( 3 ), wCol( 26 ) say " 1 2 3 4 5 6 7 8 9 10 11 12" FOR f = 1 TO 12 wVline( 5, 28 + 3 * ( f - 1 ), 8, f, BLU_CYN ) NEXT InkeyWait( 6 ) wPop() RETURN //******************************************************************* // // PROCEDURE wProc05() // // Purpose: Show Box Types // //***** Documented: 04-10-91 at 09:07:47pm ************************** PROCEDURE wProc05() LOCAL Fill_Chrs := "* °±²Û" LOCAL rPos, cPos LOCAL ClrStrs := { YEL_CYN, YEL_RED, GRN_WHH, WHH_VIH, RED_YLH, BLA_YLH,; MAINRED, BLU_CYN, RDH_CYH, WHH_VIH, YEL_CYH, YEL_BLU,; YEL_GRN, WHH_BLA } //************************* // Demonstrate Boxes //************************* wOpen( FULLSCREEN, RDH_BLU, 1, 9 ) FOR g = 1 TO 3 IF g == 1 wTitle( "Box Types",, "T", "C" ) ELSEIF g == 2 wTitle( "Box Types in Colours",, "T", "C" ) ELSEIF g == 3 wTitle( "Filled Box Types in Colour",, "T", "C" ) ENDIF cPos := -5 FOR f = 1 TO 14 rPos := IIF( f > 7, 13, 4 ) cPos := cPos + 10 IF g == 1 wBox( rPos, cPos, rPos + 5, cPos + 7, f, YEL_BLU ) ELSEIF g == 2 wBox( rPos, cPos, rPos + 5, cPos + 7, f, ClrStrs[f] ) ELSEIF g == 3 wBox( rPos, cPos, rPos + 5, cPos + 7, f, ClrStrs[f],; SUBSTR( Fill_Chrs, f, 1 )) ENDIF cPos := IIF( f == 7, -5, cPos ) NEXT InkeyWait( 2 ) IF g == 1 BEEPER wTitle( "Draw Them In Different Colours",, "B", "C" ) InkeyWait( 2 ) ELSEIF g == 2 BEEPER wTitle( "And Fill Them While You Make Them!",, "B", "C" ) InkeyWait( 2 ) ENDIF NEXT wPop() RETURN //******************************************************************* // // PROCEDURE wProc06() // // Purpose: Shadow, Clear, Fill and Colour Boxes // //***** Documented: 04-10-91 at 09:07:17pm ************************** PROCEDURE wProc06() LOCAL ColLeft := 14, RowTop := 4 //*************************** // Shadow the Boxes //*************************** wOpen( FULLSCREEN, WHH_BLU, 5, 9, "" ) wTitle( "Boxes with Shadows",, "T", "C" ) wTitle( "Press a Key or Wait",, "B", "C" ) wBox( RowTop, ColLeft, RowTop + 6, ColLeft + 20, 1, BLA_CYH, " " ) wShadow( RowTop, ColLeft, RowTop + 6, ColLeft + 20, 7 ) wSay( RowTop + 01, ColLeft + 3, "ÛÛÛÛÛÛÛÛ", RDH_CYH ) wSay( RowTop + 02, ColLeft + 3, " ÛÛ ", RDH_CYH ) wSay( RowTop + 03, ColLeft + 3, " ÛÛ ", RDH_CYH ) wSay( RowTop + 04, ColLeft + 3, " ÛÛ ", RDH_CYH ) wSay( RowTop + 05, ColLeft + 3, " ÛÛ ", RDH_CYH ) wSay( RowTop + 05, ColLeft + 9, "RILATERAL", BLU_CYH ) wBox( RowTop, ColLeft + 32, RowTop + 6, ColLeft + 52, 1, BLA_CYH, " " ) wShadow( RowTop, ColLeft + 32, RowTop + 6, ColLeft + 52, 9 ) wSay( RowTop + 01, ColLeft + 35, "ÛÛÛÛÛÛÛÛ", YEL_CYH ) wSay( RowTop + 02, ColLeft + 35, "ÛÛ ", YEL_CYH ) wSay( RowTop + 03, ColLeft + 35, "ÛÛÛÛÛÛÛÛ", YEL_CYH ) wSay( RowTop + 04, ColLeft + 35, " ÛÛ", YEL_CYH ) wSay( RowTop + 05, ColLeft + 35, "ÛÛÛÛÛÛÛÛ", YEL_CYH ) wSay( RowTop + 05, ColLeft + 44, "YSTEMS", BLU_CYH ) wBox( RowTop + 9, ColLeft, RowTop + 15, ColLeft + 24, 1, BLA_CYH, " " ) wShadow( RowTop + 9, ColLeft, RowTop + 15, ColLeft + 24, 1 ) wSay( RowTop + 10, ColLeft + 3, "ÛÛÛÛÛÛÛÛ", WHI_CYH ) wSay( RowTop + 11, ColLeft + 3, "ÛÛ Þ", WHI_CYH ) wSay( RowTop + 12, ColLeft + 3, "ÛÛ Þ", WHI_CYH ) wSay( RowTop + 13, ColLeft + 3, "ÛÛ Þ", WHI_CYH ) wSay( RowTop + 14, ColLeft + 3, "ÛÛÛÛÛÛÛÛ", WHI_CYH ) wSay( RowTop + 14, ColLeft + 12, "EVELOPMENT", BLU_CYH ) wBox( RowTop + 9, ColLeft + 32, RowTop + 15, ColLeft + 52, 1, BLA_CYH, " " ) wShadow( RowTop + 9, ColLeft + 32, RowTop + 15, ColLeft + 52, 3 ) wSay( RowTop + 12, ColLeft + 39, "Limited", BLU_CYH ) InkeyWait( 2 ) BEEPER //*************************** // Demonstrate Box Clearing //*************************** wTitle( "You Can Clear a Box", YEL_BLU, "B", "C" ) InkeyWait( 2 ) wClear( .F., " ", RowTop, ColLeft, RowTop + 6, ColLeft + 20 ) InkeyWait( 2 ) BEEPER wTitle( "Or Include the Border", YEL_BLU, "B", "C" ) InkeyWait( 2 ) wClear( .T., " ", RowTop, ColLeft + 32, RowTop + 6, ColLeft + 52 ) InkeyWait( 2 ) BEEPER wTitle( "And You Can Fill It While Clearing", YEL_BLU, "B", "C" ) InkeyWait( 2 ) wClear( .T., "±", RowTop + 9, ColLeft, RowTop + 15, ColLeft + 24 ) InkeyWait( 2 ) wClear( .F., "±", RowTop + 9, ColLeft + 32, RowTop + 15, ColLeft + 52 ) InkeyWait( 2 ) BEEPER //**************************************** // Demonstrate Colour Attribute Changing //**************************************** wTitle( "You Can Also Change the Colour Attribute of any Region.", YEL_BLU, "B", "C" ) InkeyWait( 2 ) wSay( RowTop + 11, ColLeft + 3, "See What" ) wAttrib( .T., YEL_RED, RowTop + 9, ColLeft, RowTop + 15, ColLeft + 24 ) InkeyWait( 2 ) wSay( RowTop + 11, ColLeft + 35, "I Mean" ) wAttrib( .F., IIF( ISCOLOR(), "w+/br*", "w+/n" ), RowTop + 9, ColLeft + 32, RowTop + 15, ColLeft + 52 ) InkeyWait( 1 ) wAttrib( .F., IIF( ISCOLOR(), "b+/w", "n/w" )) InkeyWait( 1 ) wAttrib( .T., IIF( ISCOLOR(), "gr+/rb", "w+/n" )) InkeyWait( 2 ) wPop() RETURN //******************************************************************* // // PROCEDURE wProc07() // // Purpose: Display Headers and Footer for Windows // Justification, Colour and Delimiters // //***** Documented: 04-10-91 at 09:06:19pm ************************** PROCEDURE wProc07() LOCAL temp LOCAL ClrStrs := { YEL_CYN, YEL_RED, GRN_WHH, WHH_VIH, RED_YLH, BLA_YLH,; MAINRED, BLU_CYN, RDH_CYH, WHH_VIH, YEL_CYH, YEL_BLU,; YEL_GRN, WHH_BLA } wOpen( 7, 10, 17, 70, RDH_CYH, 1, 2 ) wLeft( 3, " You can center headers." ) InkeyWait( 1 ) wTitle( "Trilateral Systems",, "T", "C" ) InkeyWait( 1 ) @ wRow( 3 ), wCol( 27 ) SAY "Or right and left justify them!" InkeyWait( 1 ) wTitle( "LEFT",, "T", "L" ) InkeyWait( 1 ) wTitle( "RIGHT",, "T", "R" ) InkeyWait( 1 ) wCenter( 5, " You can do the same with footers." ) InkeyWait( 1 ) wTitle( "Window Library",, "B", "C" ) InkeyWait( 1 ) wTitle( "LEFT",, "B", "L" ) InkeyWait( 1 ) wTitle( "RIGHT",, "B", "R" ) InkeyWait( 1 ) wCenter( 7, " You can even choose their colour!" ) InkeyWait( 1 ) ACOPY( ClrStrs, tArray, 1, 6 ) wTitle( "Trilateral Systems", tArray[1], "T", "C" ) InkeyWait( 1 ) wTitle( "LEFT", tArray[2], "T", "L" ) InkeyWait( 1 ) wTitle( "RIGHT", tArray[3], "T", "R" ) InkeyWait( 1 ) wTitle( "Window Library", tArray[4], "B", "C" ) InkeyWait( 1 ) wTitle( "LEFT", tArray[5], "B", "L" ) InkeyWait( 1 ) wTitle( "RIGHT", tArray[6], "B", "R" ) InkeyWait( 1 ) FOR f = 1 TO 5 wTitle( "LEFT", tArray[1], "T", "L" ) InkeyWait( .01 ) wTitle( "Trilateral Systems", tArray[2], "T", "C" ) InkeyWait( .01 ) wTitle( "RIGHT", tArray[3], "T", "R" ) InkeyWait( .01 ) wTitle( "RIGHT", tArray[4], "B", "R" ) InkeyWait( .01 ) wTitle( "Window Library", tArray[5], "B", "C" ) InkeyWait( .01 ) wTitle( "LEFT", tArray[6], "B", "L" ) //******************** // rotate the array //******************** temp := tArray[1] ADEL( tArray, 1 ) tArray[6] := temp NEXT InkeyWait( 2 ) wCenter( 6, "Delimiters can be inserted.", RDH_CYH ) InkeyWait( 2 ) ACOPY( ClrStrs, tArray, 7, 6 ) FOR f = 1 TO 5 wTitle( "LEFT", tArray[1], "T", "L", "[]" ) InkeyWait( .01 ) wTitle( "Trilateral Systems", tArray[2], "T", "C", "" ) InkeyWait( .01 ) wTitle( "RIGHT", tArray[3], "T", "R", "**" ) InkeyWait( .01 ) wTitle( "RIGHT", tArray[4], "B", "R", "¹Ì" ) InkeyWait( .01 ) wTitle( "Window Library", tArray[5], "B", "C", "³³" ) InkeyWait( .01 ) wTitle( "LEFT", tArray[6], "B", "L", "µÆ" ) //******************************* // swap first and last elements //******************************* temp := tArray[1] ADEL( tArray, 1 ) tArray[6] := temp NEXT InkeyWait( 4 ) wPop() RETURN //******************************************************************* // // PROCEDURE wProc08() // // Purpose: Demonstrate Text Positioning in a Window // Justification // Replication // Positioning // Colours // Typing // Scrolling // //***** Documented: 04-10-91 at 09:04:58pm ************************** PROCEDURE wProc08() LOCAL ClrStrs := { YEL_CYN, YEL_RED, GRN_WHH, WHH_VIH, RED_YLH, BLA_YLH,; MAINRED, BLU_CYN, RDH_CYH, WHH_VIH, YEL_CYH, YEL_BLU,; YEL_GRN, WHH_BLA } ACOPY( ClrStrs, tArray, 1, 6 ) wOpen( 1, 10, 22, 70, WHH_GRN, 3, 9 ) wTitle( "Text Management",, "T", "C" ) InkeyWait( 1 ) wLeft( 2, "It's easy to left justify text." ) InkeyWait( 1 ) wCenter( 4, "And center it too!" ) InkeyWait( 1 ) wRight( 6, "You can right justify, of Course." ) InkeyWait( 1 ) wLeft( 8, " You can replicate any character." ) InkeyWait( 1 ) wReplicate( 8, 35, "þ", 24 ) InkeyWait( 1 ) wCenter( 10, "You can also:" ) InkeyWait( 1 ) wSay( 12, 10 + 4, "PUT" ) InkeyWait( .1 ) wSay( 13, 12 + 4, "TEXT" ) InkeyWait( .1 ) wSay( 14, 14 + 4, "ANYWHERE" ) InkeyWait( .1 ) wSay( 15, 12 + 4, "YOU" ) InkeyWait( .1 ) wSay( 16, 10 + 4, "WANT" ) InkeyWait( 1 ) wSay( 12, 46 - 5, " In ", tArray[6] ) InkeyWait( .1 ) wSay( 13, 44 - 5, " Any ", tArray[2] ) InkeyWait( .1 ) wSay( 14, 42 - 5, " Colour ", tArray[3] ) InkeyWait( .1 ) wSay( 15, 44 - 5, " You ", tArray[4] ) InkeyWait( .1 ) wSay( 16, 46 - 5, " Want ", tArray[5] ) InkeyWait( 1 ) //*********************************** // Demonstrate Typing and Scrolling //*********************************** wType( 18, 10, "You can emulate a typewriter if you want.", YEL_GRN, .T. ) wType( 19, 11, " And you can turn off the sound, too! ", YEL_BLU, .F. ) wScroll( 2, .F. ) wType( 19, 17, "Scrolling your screen can",, .F. ) wScroll( 1, .F. ) wType( 19, 17, "make your application look",, .F. ) wScroll( 1, .F. ) wType( 19, 17, "neat. With the TSD Window",, .F. ) wScroll( 1, .F. ) wType( 19, 17, "Library you can scroll all",, .F. ) wScroll( 1, .F. ) wType( 19, 17, "or part of a window, with",, .F. ) wScroll( 1, .F. ) wType( 19, 17, "or without the border. ",, .F. ) FOR f = 1 TO 12 wScroll( 1, .F. ) InkeyWait( .2 ) NEXT wBox( 9, 4, 19, 27, 1, BLA_CYH ) wShadow( 9, 4, 19, 27, 1 ) wBox( 9, 33, 19, 56, 1, BLA_CYH ) wShadow( 9, 33, 19, 56, 3 ) f := 1 DO WHILE f <= 6 wSay( 10, 5, " Use Your Imagination ", YEL_RDH ) wSay( 18, 34, " Use Your Imagination ", YEL_RDH ) InkeyWait( .1 ) wScroll( -1, .F., 10, 5, 18, 26 ) wScroll( 1, .F., 10, 34, 18, 55 ) InkeyWait( .1 ) wSay( 10, 5, " ** Have a Ball ** ", BLA_GNH ) wSay( 18, 34, " ** Have a Ball ** ", BLA_GNH ) InkeyWait( .1 ) wScroll( -1, .F., 10, 5, 18, 26 ) wScroll( 1, .F., 10, 34, 18, 55 ) InkeyWait( .1 ) wSay( 10, 5, " CLIPPERING is a joy, ", WHH_BLH ) wSay( 18, 34, " CLIPPERING is a joy, ", WHH_BLH ) InkeyWait( .1 ) wScroll( -1, .F., 10, 5, 18, 26 ) wScroll( 1, .F., 10, 34, 18, 55 ) InkeyWait( .1 ) wSay( 10, 5, " with TSD's Windows ", RDH_YLH ) wSay( 18, 34, " with TSD's Windows ", RDH_YLH ) InkeyWait( .1 ) wScroll( -1, .F., 10, 5, 18, 26 ) wScroll( 1, .F., 10, 34, 18, 55 ) InkeyWait( .1 ) f++ ENDDO wSay( 10, 05, " **Happy Clippering** ", WHH_VIH ) wSay( 18, 34, " **Happy Clippering** ", WHH_VIH ) InkeyWait( 2 ) wScroll( 22, .T. ) InkeyWait( .5 ) wPop() RETURN //******************************************************************* // // PROCEDURE wProc09() // // Purpose: Display and Process GETs and PROMPTs // //***** Documented: 04-10-91 at 09:05:50pm ************************** PROCEDURE wProc09() LOCAL GetTry1 := SPACE( 10 ), GetTry2 := SPACE( 15 ) LOCAL GetTry3 := SPACE( 10 ), GetTry4 := SPACE( 20 ) LOCAL Getlist := {}, mChoice, tCursor wOpen( FULLSCREEN, MAINRED, 5, 6, "ù" ) wTitle( "Get Processing",, "T", "C" ) wSay( 21, 5, " First Get Allows Digits Except '9' ", CYH_RED ) wSay( 22, 5, " Second Get is in Uppercase : ESC When Done ", CYH_RED ) InkeyWait( 1 ) KEYBOARD CHR( 32 ) + CHR( 32 ) + CHR( 32 ) + CHR( 32 ) FourWin() wTitle( "Using wGet()",, "T", "C" ) wClear( .F., " " ) wCenter( 1, "Try entering data here:" ) wSay( 3, 8, "Get #1:" ) wSay( 5, 8, "Get #2:" ) tCursor := SET( _SET_CURSOR, 1 ) wGet( 4, 9, {| cVal | IIF( cVal == NIL, GetTry1, GetTry1 := cVal )},; "GetTry1", Getlist, REPL( "9", LEN( GetTry1 )),,,; {| cVal | !( "9" $ cVal )} ) wGet( 6, 9, {| cVal | IIF( cVal == NIL, GetTry2, GetTry2 := cVal )},; "GetTry2", Getlist, "@!" ) IF MainChoice == MenuLen KEYBOARD "12345" + CHR( 13 ) + "hello" + CHR( 13 ) ENDIF READMODAL( Getlist );Getlist := {} IF MainChoice == MenuLen InkeyWait( 2 ) ENDIF wActivate( win3 ) wTitle( "Using wSayGet()",, "T", "C" ) wClear( .F., " " ) wCenter( 6, "Same Gets, Same Rules!" ) wCenter( 8, "You can define the GET" ) wCenter( 9, "However you want!" ) wSayGet( 3, 3, "Get Number 1:", {| cVal | IIF( cVal == NIL, ; GetTry3, GetTry3 := cVal )}, "GetTry3", Getlist, ; REPL( "9", LEN( GetTry3 )),,, {| cVal | !( "9" $ cVal )} ) wSayGet( 4, 3, "Get Number 2:", {| cVal | IIF( cVal == NIL, GetTry4,; GetTry4 := cVal )}, "GetTry4", Getlist, "@!" ) IF MainChoice == MenuLen KEYBOARD "12345" + CHR( 13 ) + "hello" + CHR( 13 ) ENDIF READMODAL( Getlist );Getlist := {} IF MainChoice == MenuLen InkeyWait( 2 ) ENDIF SET( _SET_CURSOR, tCursor ) wActivate( win2 ) wTitle( "Using wPrompt() for Menus", BLA_WHI, "T", "C" ) wTitle( " - Move : Ù - Select", BLA_WHI, "B", "C" ) wPrompt( 02, 11, "This is Choice 1" ) wPrompt( 04, 11, "This is Choice 2" ) wPrompt( 06, 11, "This is Choice 3" ) IF MainChoice == MenuLen KEYBOARD CHR( 24 ) + CHR( 13 ) ENDIF MENU TO mChoice wCenter( 09, "You Picked " + STRINT( mChoice ), WHH_VIH ) InkeyWait( 3 ) wActivate( win4 ) // To Look after the stack FOR f = 1 TO 5 wPop() InkeyWait( .1 ) NEXT RETURN //******************************************************************* // // PROCEDURE wProc10() // // Purpose: Demonstrate Redisplay Feature // Pop up from the Stack // //***** Documented: 04-10-91 at 09:04:09pm ************************** PROCEDURE wProc10() SET SCOREBOARD OFF wOpen( FULLSCREEN, WHH_BLU, 5, 9, "" ) wTitle( "Redisplay from the Stack",, "T", "C" ) FourWin2() wDisplay( win1 );InkeyWait( .2 ) wDisplay( win3 );InkeyWait( .2 ) wDisplay( win2 );InkeyWait( .2 ) wDisplay( win4 );InkeyWait( .2 ) wDisplay( win1 );InkeyWait( .2 ) wDisplay( win3 );InkeyWait( .2 ) wDisplay( win4 );InkeyWait( .2 ) IF MainChoice != MenuLen @ wRow( 04 ), wCol( 2 ) SAY " Shadows" @ wRow( 05 ), wCol( 2 ) SAY "Information" @ wRow( 06 ), wCol( 2 ) SAY " Is Also" @ wRow( 07 ), wCol( 2 ) SAY " Updated" @ wRow( 08 ), wCol( 2 ) SAY " ---------" @ wRow( 09 ), wCol( 2 ) SAY " Try it" @ wRow( 10 ), wCol( 2 ) SAY " Yourself!" @ wRow( 11 ), wCol( 2 ) SAY " ---------" @ wRow( 12 ), wCol( 2 ) SAY " With F1" @ wRow( 13 ), wCol( 2 ) SAY " F2, F3" @ wRow( 14 ), wCol( 2 ) SAY " and F4" @ wRow( 15 ), wCol( 2 ) SAY " ---------" @ wRow( 16 ), wCol( 2 ) SAY " ESC " @ wRow( 17 ), wCol( 2 ) SAY " to go on " SET KEY 28 TO Dwin1 SET KEY -1 TO Dwin2 SET KEY -2 TO Dwin3 SET KEY -3 TO Dwin4 InkeyWait( 60 ) SET KEY 28 to SET KEY -1 to SET KEY -2 to SET KEY -3 to ELSE InkeyWait( 2 ) ENDIF FOR f = 1 TO 5 wPop() NEXT RETURN //******************************************************************* // // PROCEDURE wProc11() // // Purpose: Demonstrate Window Activation Feature // //***** Documented: 04-10-91 at 09:03:48pm ************************** PROCEDURE wProc11() LOCAL h, xc, yc, xc1, wp, dCounter := 0, tString := '' LOCAL wCounter := 0, fCounter := 0, hArray := {} wOpen( FULLSCREEN, MAINRED, 5, 9, "" ) wTitle( "Window Activation Features",, "T", "C" ) FourWin() wActivate( win1 ) Scroller() wSave() wp := 0 FOR xc = 5 TO 55 yc := INT( YC ) IF yc != wp .AND. yc != 3 AADD( hArray, wOpen( yc, xc, yc + 5, xc + 20, WHH_BLU, 6, 3 )) fCounter++ fCounter := IIF( fCounter > 14, 1, fCounter ) wFrame( fCounter ) wCounter++ tString := "Window " + STRINT( wCounter ) wTitle( tString, BLU_CYH, "T", "C" ) tString := "Frame " + STRINT( fCounter ) wTitle( tString,, "B", "C" ) ELSEIF yc = 3 dCounter++ IF dCounter = 6 AADD( hArray, wOpen( yc, xc, yc + 5, xc + 20, WHH_BLU, 6, 3 )) fCounter++ fCounter := IIF( fCounter > 14, 1, fCounter ) wFrame( fCounter ) wCounter++ tString := "Window " + STRINT( wCounter ) wTitle( tString, BLU_CYH, "T", "C" ) tString := "Frame " + STRINT( fCounter ) wTitle( tString,, "B", "C" ) ENDIF ENDIF wp := yc NEXT InkeyWait( .1 ) FOR f = 1 TO LEN( hArray ) wActivate( hArray[f] );wCenter( 1, "Active!" );InkeyWait( .1 ) IF f = 8 wActivate( win1 );Scroller() ELSEIF f = 12 wActivate( win2 );InkeyWait( .1 ) wCenter( 4, "My Turn!!" );InkeyWait( 2 ) ELSEIF f = 23 wActivate( win3 );InkeyWait( .1 ) wCenter( 4, "Butt out! My Turn!!" );InkeyWait( 2 ) ELSEIF f = 26 wActivate( win4 );InkeyWait( .1 ) wCenter( 4, "I'm Moving!!" );InkeyWait( 2 ) wMove( -10, -40 );InkeyWait( .1 ) ENDIF NEXT InkeyWait( .1 ) FOR f = LEN( hArray ) TO 1 STEP -1 wActivate( hArray[f]);wCenter( 2, "And Again!!" );InkeyWait( .1 ) IF f = 18 wActivate( win1 );Scroller() ELSEIF f = 12 wActivate( win2 );InkeyWait( .1 ) wCenter( 6, "Stop Pushing!!" );InkeyWait( 1 ) ELSEIF f = 10 wActivate( win3 );InkeyWait( .1 ) wCenter( 6, "Quiet You!!" );InkeyWait( 1 ) ELSEIF f = 5 wActivate( win4 );InkeyWait( .1 ) wCenter( 6, "Ahhrrrghhh!!" );InkeyWait( 1 ) FOR h = 1 TO 14 wFrame( h, YEL_CYN );InkeyWait( .1 ) NEXT ENDIF NEXT InkeyWait( 1 ) FOR f = 1 TO LEN( hArray ) wActivate( hArray[f] ) wTitle( "How's That??", YEL_RED, "B", "C" ) Inkey() NEXT InkeyWait( 2 ) FOR f = 1 TO 5 + LEN( hArray ) wPop() Inkey() NEXT //********************************* // frame testing //********************************* wOpen( FULLSCREEN, MAINBLU, 3, 3 ) wTitle( "Frames in Window Activation",, "T", "C" ) InkeyWait( 1 ) wCenter( 2, "The Frame Colour may be passed as a two element array.", YEL_BLU ) InkeyWait( 1 ) wCenter( 4, "This feature enables you define one colour for active", YEL_BLU ) wCenter( 5, "and another for inactive ones, much like Microsoft Windows!", YEL_BLU ) InkeyWait( 1 ) wCenter( 7, "Try it and See!!", GNH_BLU ) InkeyWait( 1 ) wLeft( 20, " ACTIVE KEYS ", WHH_VIH ) wLeft( 21, " 1, 2, 3, 4 ", BLA_CYH ) wLeft( 22, " To Reactivate ", BLA_CYH ) wLeft( 23, " ESC to Exit ", BLA_CYH ) InkeyWait( 1 ) win1 := wOpen( 3, 12, 10, 34, WHI_RED, 3, 3,, { WHH_RED, WHI_RED } ) wTitle( "Win 1",, "T", "C" ) wCenter( 2, "Window 1" ) win2 := wOpen( 10, 50, 22, 67, BLA_CYN, 3, 3,, { WHH_CYN, WHI_CYN } ) wTitle( "Win 2",, "T", "C" ) wCenter( 2, "Window 2" ) win3 := wOpen( 9, 20, 18, 35, WHI_BLA, 3, 3,, { WHH_BLA, WHI_BLA } ) wTitle( "Win 3",, "T", "C" ) wCenter( 2, "Window 3" ) win4 := wOpen( 6, 31, 15, 57, WHI_VIO, 3, 3,, { WHH_VIO, WHI_VIO } ) wTitle( "Win 4",, "T", "C" ) wCenter( 2, "Window 4" ) IF MainChoice != MenuLen SET KEY 49 TO Awin1 SET KEY 50 TO Awin2 SET KEY 51 TO Awin3 SET KEY 52 TO Awin4 DO WHILE .T. InkeyWait( 600 ) IF LASTKEY() == 27 EXIT ENDIF ENDDO SET KEY 49 to SET KEY 50 to SET KEY 51 to SET KEY 52 to ELSE Inkey( 1 );Awin1() Inkey( 1 );Awin3() Inkey( 1 );Awin4() Inkey( 1 );Awin2() Inkey( 2 ) ENDIF FOR f = 1 TO 5 wPop() NEXT RETURN //******************************************************************* // // PROCEDURE wProc12() // // Purpose: Demonstrate Moving and Sliding a Window // //***** Documented: 04-10-91 at 09:03:26pm ************************** PROCEDURE wProc12() LOCAL MainWindow, tHandle MainWindow := wOpen( FULLSCREEN, WHH_BLU, 5, 9, "" ) wTitle( "Moving and Sliding Windows",, "T", "C" ) FourWin2() win5 := wOpen( 2, 40, 12, 59, RED_YLH, 9, 2 );wTitle( "Win 5",, "T", "C" ) wSay( 2, 3, "Watch me move!" );InkeyWait( 2 ) wSay( 2, 3, "38 Left ");InkeyWait( .3 ) wMove( 0, -38 );InkeyWait( .3 ) wSay( 3, 3, "10 Down" );InkeyWait( .3 ) wMove( 10, 0 );InkeyWait( .3 ) wSay( 5, 3, "7 Up" );wSay( 6, 3, "30 Right" );InkeyWait( .3 ) wMove( -7, 30 );InkeyWait( 1 ) wPop() win6 := wOpen( 8, 36, 15, 53, BLU_CYH, 1, 3 );wTitle( "Win 6",, "T", "C" ) wCenter( 2, "Watch me go!" );InkeyWait( 2 ) wSlide( "L", 30 );wSlide( "D", 7 );wSlide( "R", 50 );wSlide( "U", 13 ) wSlide( "L", 5 );wSlide( "D", 7 );wSlide( "L", 45 );wSlide( "D", 4 ) wSlide( "R", 20 );wSlide( "U", 10 );wSlide( "R", 8 );wSlide( "D", 13 ) wSlide( "U", 8 );wSlide(" L", 30 );wSlide( "D", 5 );wSlide( "R", 55 ) wSlide( "D", 3 );wSlide( "L", 15 );wSlide( "U", 10 );wSlide( "L", 15 ) wSlide( "D", 8 ); wSlide( "U", 10 ) wCenter( 4, "How's That!" ) InkeyWait( 1 ) IF MainChoice != MenuLen wClear( .F., " " ) wCenter( 2, "Now, Try" ) wCenter( 3, "Yourself" ) wCenter( 4, "with the" ) wCenter( 5, "Cursor Keys!" ) SET KEY 5 TO Wup SET KEY 24 TO Wdn SET KEY 19 TO Wlt SET KEY 4 TO Wrt SET KEY 1 TO Uplt SET KEY 18 TO Uprt SET KEY 6 TO Dnlt SET KEY 3 TO Dnrt InkeyWait( 60 ) SET KEY 5 to SET KEY 24 to SET KEY 19 to SET KEY 4 to SET KEY 1 to SET KEY 18 to SET KEY 6 to SET KEY 3 to ENDIF wPop() wOpen( 3, 3, 21, 75, CYH_RED, 3, 3 ) wTitle( "Window Sizing 1", , "T", "C") FOR f = 1 TO 15 wCenter( f + 1, PADL( ALLTRIM( STR( f )), 2, "0" ) +; "This is a test of the window re-sizing routine: Line " +; PADL( ALLTRIM( STR( f )), 2, "0" )) NEXT wTitle( "Watch us Resize this Window!",, "B", "L" ) InkeyWait( 1 ) wSize( "H", -50 ) wSize( "V", -10 ) wSize( "H", 30 ) wSize( "V", 7 ) InkeyWait( 1 ) wPop() tHandle := _wHandle( MainWindow ) wLeft( 20, " ACTIVE KEYS ", WHH_VIH ) wLeft( 21, " Up,Dn,Lt,Rt to Move Window ", BLA_CYH ) wLeft( 22, " PgUp,PgDn,Home,End to Size ", BLA_CYH ) wLeft( 23, " ESC to Exit ", BLA_CYH ) InkeyWait( 1 ) _wHandle( tHandle ) win6 := wOpen( 3, 13, 20, 35, BLU_CYN, 7, 7 ) wTitle( "Window Sizing 2",, "T", "C" ) wTitle( "Left",, "B", "L" ) FOR f = 1 TO 14 wCenter( f + 1, "This is a test" + STRINT( f )) NEXT IF MainChoice != MenuLen SET KEY K_PGDN TO vplus SET KEY K_PGUP TO vminus SET KEY K_END TO hplus SET KEY K_HOME TO hminus SET KEY K_UP TO Wup SET KEY K_DOWN TO Wdn SET KEY K_LEFT TO Wlt SET KEY K_RIGHT TO Wrt DO WHILE .T. InkeyWait( 60 ) IF LASTKEY() == 27 wPop() EXIT ENDIF ENDDO SET KEY K_PGDN TO SET KEY K_PGUP TO SET KEY K_END TO SET KEY K_HOME TO SET KEY K_UP TO SET KEY K_DOWN TO SET KEY K_LEFT TO SET KEY K_RIGHT TO ELSE Inkey( 1 ); FOR f = 1 TO 6; vminus(); NEXT Inkey( 1 ); FOR f = 1 TO 6; hminus(); NEXT Inkey( 1 ); FOR f = 1 TO 6; wlt(); NEXT Inkey( 1 ); FOR f = 1 TO 3; wup(); NEXT Inkey( 1 ); FOR f = 1 TO 6; vplus(); NEXT Inkey( 1 ); FOR f = 1 TO 6; hplus(); NEXT INKEY( 1 );wPop() ENDIF FOR f = 1 TO 5 wPop() NEXT RETURN //******************************************************************* // // PROCEDURE wProc13() // // Purpose: Demonstrate wARPick and wDBPick // //***** Documented: 04-10-91 at 09:03:03pm ************************** PROCEDURE wProc13() LOCAL MaCode, pColor, Ret_Val, x, r, c, Getlist := {} LOCAL GetTry1, GetTry2, OneCheck := .T. wOpen( FULLSCREEN, WHH_BLU, 5, 9 ) wTitle( "User Definable Picklists",, "T", "C" ) InkeyWait( 1 ) IF MainChoice == MenuLen wCenter( 1, "This Module Requires User Input.", YEL_BLU ) Inkey( 2 ) ENDIF wCenter( 2, "Watch how we get a picklist in a", CYH_BLU ) wCenter( 4, "CLIPPER WHEN condition.", CYH_BLU ) InkeyWait( 1 ) wLeft( 16, " Alpha to Search" ) wLeft( 17, " Cursor keys Move Bar" ) wLeft( 18, " ALT U,J,N,H Move Box" ) InkeyWait( 1 ) USE windemo INDEX windemo.ntx ALIAS codes NEW SELECT codes GetTry1 := SPACE( LEN( codes->codeshort )) GetTry2 := SPACE( LEN( codes->codeshort )) @ wRow( 10 ), wCol( 10 ) SAY "Getting.." GET GetTry1 PICTURE "@X" WHEN ; CheckList( "codes", "codeshort", "Code;Description" ) @ wRow( 12 ), wCol( 10 ) SAY "Next One " GET GetTry2 PICTURE "@X" WHEN ; CheckList( "codes", "codeshort", "Code Description" ) InkeyWait( 1 ) READMODAL( Getlist ) Getlist := {} InkeyWait( 1 ) wCenter( 6, "An array may be processed in the same way.", CYH_BLU ) InkeyWait( 1 ) MaCode := {} pColor := { WHH_CYN, YEL_RED, BLA_WHI, YEL_RED, YEL_RED, YEL_CYN } Ret_Val := 0 wLeft( 19, " SPACE to Tag/Untag" ) wLeft( 20, " F7 Tag All" ) wLeft( 21, " F8 Untag All" ) wLeft( 22, " F9 Swap Tagged/Untagged" ) //************** // Fill Array //************** DBEVAL( { || AADD( MaCode, codes->codekey + "³" + codes->codeshort )}) //*************** // Call Function //*************** Ret_Val := wARPick( MaCode, "Code", ; 5, 25, pColor, 3, 6, LEN( MaCode ), .T. ) IF LASTKEY() != 27 x := 0; r := 1 //******************************* // Process Return from wARPick() //******************************* wOpen( 8, 10, 20, 50, GNH_VIO, 5, 9 ) wTitle( "Selections",, "T", "C" ) FOR x = 1 TO LEN( MaCode ) IF "û" $ MaCode[x] OneCheck := .F. @ wRow( r ), wCol( 2 ) SAY SUBSTR( MaCode[x], 1, LEN( MaCode[x] ) - 1 ) r++ IF r > 10 r := 1 @ ROW() + 1, wCol( 3 ) SAY "Press a key for more." InkeyWait( 10 ) wClear( .F., " " ) ENDIF ENDIF NEXT IF OneCheck .AND. Ret_Val != 0 @ wRow( r + 1 ), wCol( 2 ) SAY "You Picked only One:" @ wRow( r + 3 ), wCol( 2 ) SAY maCode[ Ret_Val ] ENDIF InkeyWait( 2 ) wPop() ENDIF wPop() CLOSE DATA RETURN //******************************************************************* // // PROCEDURE wProc14() // // Purpose: Instance Variables Demo // //***** Documented: 04-10-91 at 09:01:49pm ************************** PROCEDURE wProc14() STATIC wNum LOCAL KeyPress := 0 wOpen( FULLSCREEN, MAINRED, 5, 9, "+" ) wTitle( "Window Class Instance Variables",, "T", "C" ) wCenter( 22, PADC( "Press 1, 2, 3 or 4 to View Instance Variables", 70 ), CYH_RED ) wCenter( 23, PADC( "For Windows 1 to 4 : ESC When Done.", 70 ), CYH_RED ) KEYBOARD CHR( 32 ) + CHR( 32 ) + CHR( 32 ) + CHR( 32 ) FourWin() IF MainChoice != MenuLen DO WHILE KeyPress != 27 KeyPress:=InkeyWait( 0 ) IF KeyPress == 27 EXIT ENDIF IF ( KeyPress >= 49 ) .AND. ( KeyPress <= 52 ) IF KeyPress == 49 wActivate( win1 ) ELSEIF KeyPress == 50 wActivate( win2 ) ELSEIF KeyPress == 51 wActivate( win3 ) ELSEIF KeyPress == 52 wActivate( win4 ) ENDIF InkeyWait(1) KeyPress := ChkInst() IF ( KeyPress >= 49 ) .AND. ( KeyPress <= 52 ) KEYBOARD CHR( KeyPress ) ENDIF ENDIF ENDDO ELSE Inkey( 1 ); wActivate( win1 ); Inkey( 1 ); ChkInst() Inkey( 1 ); wActivate( win3 ); Inkey( 1 ); ChkInst() Inkey( 1 ); wActivate( win2 ); Inkey( 1 ); ChkInst() Inkey( 1 ); wActivate( win4 ); Inkey( 1 ); ChkInst() ENDIF FOR f = 1 to 5 wPop() NEXT RETURN //******************************************************************* // // PROCEDURE wProc15() // // Purpose: Display the Quick Reference .DOC File // //***** Documented: 05-02-91 at 08:15:45pm ************************** PROCEDURE wProc15() LOCAL f IF MainChoice = MenuLen KEYBOARD REPL( CHR( 24 ), 25 ) + REPL( CHR( 19 ), 5 )+CHR( 27 ) ENDIF wTextFile( FULLSCREEN, "TSWINQRF.doc", MAINBLU, ; 0, 9, YEL_BLU, "TSDWIN Quick Reference" ) RETURN //******************************************************************* // // PROCEDURE wProc16() // // Purpose: Display the WHATSNEW.DOC File // //***** Documented: 05-02-91 at 08:15:45pm ************************** PROCEDURE wProc16() LOCAL f IF MainChoice = MenuLen KEYBOARD REPL( CHR( 24 ), 25 ) + REPL( CHR( 19 ), 5 ) + CHR( 27 ) ENDIF wTextFile( FULLSCREEN, "WHATSNEW.doc", MAINBLU, ; 0, 9, YEL_BLU, "TSDWIN Revision History" ) RETURN //******************************************************************* // // PROCEDURE PopaFew() // // Purpose: Display and Pop 20 Windows to Open // the Demoonstration // //***** Documented: 04-10-91 at 09:01:14pm ************************** PROCEDURE PopaFew() wOpen( 05, 10, 10, 67, RED_BLH, 1, 06) ; InkeyWait( .2 ) wOpen( 08, 45, 22, 55, BLU_CYH, 3, 05, "±" ); InkeyWait( .2 ) wOpen( 15, 23, 20, 79, GRN_WHH, 7, 04, "." ); InkeyWait( .2 ) wOpen( 02, 02, 12, 44, BLA_YLH, 9, 03, "°" ); InkeyWait( .2 ) wOpen( 18, 05, 22, 75, CYH_RED, 5, 02, "²" ); InkeyWait( .2 ) wOpen( 11, 60, 17, 77, BLU_YLH, 3, 01, "Û" ); InkeyWait( .2 ) wOpen( 09, 34, 18, 57, WHH_BLU, 7, 07, "" ); InkeyWait( .2 ) wOpen( 03, 50, 09, 70, BLA_GNH, 1, 08, "" ); InkeyWait( .2 ) wOpen( 12, 03, 17, 57, WHH_VIH, 9, 09, "" ); InkeyWait( .2 ) wOpen( 18, 14, 21, 38, YEL_VIO, 7, 10, "" ); InkeyWait( .2 ) wOpen( 05, 48, 17, 67, GRH_BAH, 1, 11, "" ); InkeyWait( .2 ) wOpen( 01, 70, 18, 76, WHI_BRN, 9, 12, "" ); InkeyWait( .2 ) wOpen( 02, 34, 17, 42, BLH_RED, 3, 13, "" ); InkeyWait( .2 ) wOpen( 03, 06, 09, 18, REH_BLH, 1, 14, "" ); InkeyWait( .2 ) wOpen( 10, 20, 13, 50, WHH_RDH, 1, 06, "0" ) //********************************************************************* // There is sometimes a problem with ';' in Clipper 5.0 //********************************************************************* InkeyWait( .2 ) wOpen( 08, 12, 20, 39, BLH_YLH, 3, 05, ""); InkeyWait( .2 ) wOpen( 01, 45, 07, 69, BLH_WHH, 9, 08, "*"); InkeyWait( .2 ) wOpen( 14, 71, 22, 77, BLA_BLH, 7, 07, ""); InkeyWait( .2 ) wOpen( 04, 30, 11, 47, VIO_GNH, 3, 10, ""); InkeyWait( .2 ) wOpen( 18, 09, 20, 73, BLU_CYH, 1, 04, "") wCenter( 1, " Trilateral Systems Development Ltd. ", RDH_CYH, ) InkeyWait( .2 ) wOpen( 07, 51, 15, 68, WHH_BLH, 1, 08 ); InkeyWait( 1 ) wCenter( 3, "Let's" ); wCenter( 4, "Pop 'Em" ); InkeyWait( .5 ) SETBLINK( .T. ); InkeyWait( 2 ); CBLINK FOR f = 1 TO 21 wPop(); InkeyWait( .1 ) NEXT RETURN //******************************************************************* // // PROCEDURE SignOff() // // Purpose: End of Demonstration Display // //***** Documented: 04-10-91 at 09:00:56pm ************************** PROCEDURE SignOff() LOCAL f, win1 //****************** // Thank You Screen //****************** wOpen( 5, 5, 19, 74, CYH_RDH, 3, 10, "±" ) wReplicate( 1, 1, "ß", 68, YEL_WHH ) wReplicate( 13, 1, "Ü", 68, YEL_WHH ) wOpen( 9, 27, 14, 50, BLU_CYN, 3 ) wSay( 1, 4, "Trilateral" ) wSay( 1, 4, "T", RDH_CYN ) wSay( 2, 4, "Systems" ) wSay( 2, 4, "S", YEL_CYN ) wSay( 3, 4, "Development Ltd." ) wSay( 3, 4, "D", WHH_CYN ) wSay( 4, 4, "(519)-758-0867" ) InkeyWait( 2 ) wSay( 00, 0, " says ", BLU_CYN ) wSay( 00, 9, "T", RDH_CYN ) wSay( 00, 10, "S", YEL_CYN ) wSay( 00, 11, "D", WHH_CYN ) InkeyWait( 1 ) wSay( 01, 0, " Thank You for Watching ", YEL_RDH ) InkeyWait( 1 ) wSay( 02, 0, " Registered Versions ", WHH_BLH ) InkeyWait( 1 ) wSay( 03, 0, " Are Available ", BLA_YLH ) InkeyWait( 1 ) wSay( 04, 0, " At Low Cost ", RDH_GNH ) InkeyWait( 2 ) wSay( 05, 0, " ..Please Contact.. ", WHH_VIH ) InkeyWait( 5 ) wPop() wPop() wClear( .F., "°" ) //************************ // Copyright Screen //************************ win1 := wOpen(0,0,maxrow(),maxcol(),BLU_CYN,5) wOpen(17,65,22,78,WHH_CYN) wSay(00,0,"ÜÜÜÜÜÜÜÜÜÜÜÜÜ ",RDH_CYN) wSay(01,0,"ß Û ß ",RDH_CYN) wSay(02,0," Û ",RDH_CYN) wSay(03,0," Û ",RDH_CYN) wSay(04,0," Û ",RDH_CYN) wSay(05,0," ÜÛÜ ",RDH_CYN) //inkey(1) wSlide("U",16) wSlide("L",61) //inkey(1) wOpen(16,64,22,77,WHH_CYN) wSay(00,0,"ÜÜÜÜÜÜÜÜÜÜÜÜÜÜ",YEL_CYN) wSay(01,0,"Û Û",YEL_CYN) wSay(02,0,"Û ",YEL_CYN) wSay(03,0,"ßßßßßßßßßßßßßÛ",YEL_CYN) wSay(04,0," Û",YEL_CYN) wSay(05,0,"Û Û",YEL_CYN) wSay(06,0,"ÛÜÜÜÜÜÜÜÜÜÜÜÜÛ",YEL_CYN) //inkey(1) wSlide("U",11) wSlide("L",60) setcolor(YEL_CYN) @5,4 say "ÜÜÜÜÜÜÛÜÜÜÜÜÜÜ" @6,4 say "Û ÜÛÜ Û" setcolor(RDH_CYN) @5,10 say "Û" @6,9 say "ÜÛÜ" //inkey(1) wOpen(16,65,22,78,WHH_CYN) wSay(00,0," ÜÜÜÜÜÜÜÜÜÜ ",WHH_CYN) wSay(01,0," ÛÛ Û ",WHH_CYN) wSay(02,0," ÛÛ Û ",WHH_CYN) wSay(03,0," ÛÛ Û ",WHH_CYN) wSay(04,0," ÛÛ Û ",WHH_CYN) wSay(05,0," ÛÛ Û ",WHH_CYN) wSay(06,0," ÛÛÜÜÜÜÜÜÜÛ ",WHH_CYN) //inkey(1) wSlide("U",06) wSlide("L",61) setcolor(YEL_CYN) @10,4 say "Û ÜÜÜÜÜÜÜÜÜÜ Û" @11,4 say "ÛÜÛÛÜÜÜÜÜÜÜÛÜÛ" setcolor(WHH_CYN) @10,6 say "ÜÜÜÜÜÜÜÜÜÜ" @11,6 say "ÛÛ" @11,15 say "Û" _wHandle( win1 ) FOR f = 1 TO 45 wSay(06,64 - f,"RILATERAL ") wSay(11,64 - f,"YSTEMS ") wSay(16,64 - f,"EVELOPMENT Ltd. ") NEXT wSay( 18, 05, "43B Metcalfe Crescent", BLA_CYN ) wSay( 19, 05, "Brantford, ON, Canada", BLA_CYN ) wSay( 20, 05, "N3R 2L7", BLA_CYN ) wCenter( 22, "(519)650-0389 : On-Line Registration (AMEX Only) and Support", RED_CYN ) wSay( 22, 47, "(AMEX Only)", WHH_CYN ) wCenter( 23, "Please specify format! American Express Welcome", YEL_CYN ) wHline( 01, 36, 40, 1, BLH_CYN ) wSay( 02, 36, "TSDWIN.LIB v1.30 is a ShareWare Product.", RED_CYN ) wSay( 03, 36, "You are free to use it in order to judge", RED_CYN ) wSay( 04, 36, "its usefulness to you in your situation.", RED_CYN ) wSay( 05, 36, "If you like and continue to use TSDWIN,", RED_CYN ) wSay( 06, 36, "please register one of these options:", RED_CYN ) wSay( 08, 36, "1. Register Your Version 1.30 $ 45.00 US" ) wSay( 10, 36, "2. Latest Version/Part Source $ 65.00 US" ) wSay( 12, 36, "3. Latest Version/Full Source $120.00 US" ) wSay( 14, 36, "All include your Disk Format with Manual" ) wSay( 15, 36, "and NG on disk. Support BBS membership." ) wSay( 16, 36, "See ORDERFRM.DOC for Details." ) wSay( 17, 32, "³" , BLA_CYN ) wSay( 18, 32, "ÀÄÄÄÄÄÄÄÄ thanks its customers for their", BLA_CYN ) wSay( 19, 36, " support in bringing you Tools for", BLA_CYN ) wSay( 20, 36, "Clipper designed the way YOU want them!", BLA_CYN ) wTitle( "Press a Key to End Demo",, "B", "C" ) inkey(0) wPop() RETURN //******************************************************************* // // PROCEDURE Scroller() // // Purpose: Scroll Display in Activate Demonstration // //***** Documented: 04-10-91 at 09:00:33pm ************************** PROCEDURE Scroller() g := 1 DO WHILE g <= 2 wSay( 1, 1, " Use Your Imagination ", YEL_RDH ); InkeyWait( .1 ) wScroll( -1, .F. ); InkeyWait( .1 ) wSay( 1, 1, " ** Have a Ball ** ", BLA_GNH ); InkeyWait( .1 ) wScroll( -1, .F. ); InkeyWait( .1 ) wSay( 1, 1, " CLIPPERING is a joy, ", WHH_BLH ); InkeyWait( .1 ) wScroll( -1, .F. ); InkeyWait( .1 ) wSay( 1, 1, " with TSD's Windows ", RDH_YLH ); InkeyWait( .1 ) wScroll( -1, .F. ); InkeyWait( .1 ) g++ ENDDO wSay( 1, 1, " **Happy Clippering** ", WHH_VIH ) RETURN //******************************************************************* // // PROCEDURE FourWin() // // Purpose: Opens Four Windows // That we use a few times // //***** Documented: 04-10-91 at 09:00:20pm ************************** PROCEDURE FourWin() win1 := wOpen( 9, 4, 19, 27, CYH_GRN, 7, 7 ) wTitle( "I'm Happy!!",, "T", "C" ); InkeyWait( 2 ) win2 := wOpen( 3, 34, 14, 72, GNH_VIO, 9, 9 ) wTitle( "I AM the Greatest",, "T", "C" ); wCenter(2,"Here's One") InkeyWait( 2 ) win3 := wOpen( 7, 12, 17, 49, RED_YLH, 1, 2 ) wTitle( "I Shall Prevail",, "T", "C" ); wCenter( 2, "Here's Another" ) InkeyWait( 2 ) win4 := wOpen( 12, 47, 20, 75, GRN_WHH, 3, 4 ) wTitle( "Hard Rock",, "T", "C" ); wCenter( 2, "And Another" ) RETURN //******************************************************************* // // PROCEDURE FourWin2() // // Purpose: Opens Four Windows // //***** Documented: 04-10-91 at 09:00:04pm ************************** PROCEDURE FourWin2() win1 := wOpen( 8, 10, 18, 70, RDH_CYH, 1, 2 ); wTitle( "Win 1",, "T", "C" ) wCenter( 3, "First Window" ); InkeyWait( 1 ) win2 := wOpen( 5, 5, 20, 45, YEL_RED, 3, 2 ); wTitle( "Win 2",, "T", "C" ) wCenter( 5, "Second Window" ); InkeyWait( 1 ) win3 := wOpen( 12, 24, 16, 68, WHH_BLU, 7, 2 ); wTitle( "Win 3",, "T"," C" ) wCenter( 2, "Third Window" );InkeyWait( 1 ) win4 := wOpen( 2, 49, 22, 63, YEL_GRN, 9, 2 ); wTitle( "Win 4",, "T", "C" ) wCenter( 6, "Fourth" ); wCenter( 7, "Window" ) InkeyWait( 2 ) RETURN //********************************************************************* // SET KEY Procedures for User Sliding //********************************************************************* PROCEDURE Wup wSlide( "U", 1 ); RETURN PROCEDURE Wdn wSlide( "D", 1 ); RETURN PROCEDURE Wlt wSlide( "L", 1 ); RETURN PROCEDURE Wrt wSlide( "R", 1 ); RETURN PROCEDURE Uplt wSlide( "U", 1 ); wSlide( "L", 2 ) RETURN PROCEDURE Uprt wSlide( "U", 1 ); wSlide( "R", 2 ) RETURN PROCEDURE Dnlt wSlide( "D", 1 ); wSlide(" L", 2 ) RETURN PROCEDURE Dnrt wSlide( "D", 1 ); wSlide( "R", 2 ) RETURN //********************************************************************* // Set Key Procedures for Redisplay from Stack //********************************************************************* PROCEDURE Dwin1() wDisplay( win1 ); RETURN PROCEDURE Dwin2() wDisplay( win2 ); RETURN PROCEDURE Dwin3() wDisplay( win3 ); RETURN PROCEDURE Dwin4() wDisplay( win4 ); RETURN //********************************************************************* // Set Key Procedures for Window Activation //********************************************************************* PROCEDURE Awin1() STATIC num := 0 wActivate( win1 ) wCenter( 4, "Try#: " + PADL(STRINT( ++num ), 2 )) RETURN PROCEDURE Awin2() STATIC num := 0 wActivate( win2 ) wCenter( 4, "Try#: " + PADL(STRINT( ++num ), 2 )) RETURN PROCEDURE Awin3() STATIC num := 0 wActivate( win3 ) wCenter( 4, "Try#: " + PADL(STRINT( ++num ), 2 )) RETURN PROCEDURE Awin4() STATIC num := 0 wActivate( win4 ) wCenter( 4, "Try#: " + PADL(STRINT( ++num ), 2 )) RETURN //********************************************************************* // Set Key Procedures for Window Sizing //********************************************************************* PROCEDURE vplus wSize( "V", 1 ); RETURN PROCEDURE vminus wSize( "V", -1 ); RETURN PROCEDURE hplus wSize( "H", 1 ); RETURN PROCEDURE hminus wSize( "H", -1 ); RETURN //******************************************************************* // // FUNCTION CheckList( In_Alias, In_Field, ColHead ) // // Parameters: // // Return: // // Purpose: Executes in the WHEN condition in wDBPick() // Demonstration/ // //***** Documented: 04-10-91 at 08:59:29pm ************************** FUNCTION CheckList( In_Alias, In_Field, ColHead ) LOCAL bColor := IIF( ISCOLOR(), { "w+/g, gr+/br", "n/w" },; { "w+/n,n/w", "n/w" }) LOCAL SelField, TcRecord1 := RECNO() LOCAL TcSelect := SELECT() LOCAL TcRecord2, t t := wdbPick( In_Alias, In_Field, ColHead, 2, 45, bColor, 1, 9 ) IF LASTKEY() <> 27 SELECT &In_Alias; TcRecord2 := RECNO(); GOTO t SelField := In_Alias + "->" + In_Field KEYBOARD &SelField GO TcRecord2 SELECT( TcSelect ); GO TcRecord1 RETURN .T. ELSEIF LASTKEY() == 3 // page down RETURN .T. ELSE RETURN .F. ENDIF //******************************************************************* // // FUNCTION ChkInst() // // Parameters: // // Return: // // Purpose: // //***** Documented: 05-06-91 at 03:12:16pm ************************** FUNCTION ChkInst() LOCAL tScr, iHandle, iTop, iLeft, iBottom, iRight, iHidden LOCAL tClr, iColor, iShadow, iFrame, iFcolor, iCurrent LOCAL isTop, isLeft, isBottom, isRight, iwLength, iwWidth LOCAL lKey := 0 iHandle := STRINT( _wHandle() ) iTop := STRINT( _wTop() ) iLeft := STRINT( _wLeft() ) iBottom := STRINT( _wBottom() ) iRight := STRINT( _wRight() ) isTop := STRINT( _wsTop() ) isLeft := STRINT( _wsLeft() ) isBottom := STRINT( _wsBottom() ) isRight := STRINT( _wsRight() ) iHidden := LEFT( _wHidden(), 25 ) iColor := _wColor() iShadow := STRINT( _wShadow() ) iFrame := STRINT( _wFrame() ) iFcolor := _wFcolor() iCurrent := LEFT( _wCurrent(), 25 ) iwLength := STRINT( VAL( iBottom ) - VAL( iTop ) + 1 ) iwWidth := STRINT( VAL( iRight ) - VAL( iLeft ) + 1 ) tClr:=SETCOLOR( YEL_BLU ) tScr := SAVESCREEN( 0, 3, 19, 44 ) @ 00, 3 CLEAR TO 19, 44 @ 00, 3 TO 19, 44 DOUBLE @ 00, 5 SAY "Instance Variables:" @ 19, 5 SAY "Press a Key..." @ 01, 5 SAY " _wHandle(): " + iHandle @ 02, 5 SAY " _wTop(): " + iTop @ 03, 5 SAY " _wLeft(): " + iLeft @ 04, 5 SAY " _wBottom(): " + iBottom @ 05, 5 SAY " _wRight(): " + iRight @ 06, 5 SAY " _wsTop(): " + isTop @ 07, 5 SAY " _wsLeft(): " + isLeft @ 08, 5 SAY "_wsBottom(): " + isBottom @ 09, 5 SAY " _wsRight(): " + isRight @ 10, 5 SAY " _wHidden(): " + iHidden @ 11, 5 SAY " _wColor(): " + iColor @ 12, 5 SAY " _wShadow(): " + iShadow @ 13, 5 SAY " _wFrame(): " + iFrame @ 14, 5 SAY " _wFcolor(): " + iFcolor @ 15, 5 SAY "_wCurrent(): " + iCurrent @ 16, 5 SAY " WinLength: " + iwLength @ 17, 5 SAY " WinWedth: " + iwWidth IF MainChoice == MenuLen INKEY( 1 ) ELSE lKey := INKEY( 0 ) ENDIF RESTSCREEN( 0, 3, 19, 44, tScr ) SETCOLOR( tClr ) RETURN( lKey ) //******************************************************************* // // FUNCTION Menu_Udf( Mode, Elem, Pos ) // // Parameters: // // Return: // // Purpose: // //***** Documented: 05-02-91 at 10:44:05pm ************************** FUNCTION Menu_Udf( Mode, Elem, Pos ) LOCAL RetVal, nKey, dCB := { |Elem| tShow( Elem )} STATIC FirstTime := .T. MEMVAR mNum, mRow nKey := LASTKEY() IF FirstTime tShow( 1 ) FirstTime := .F. ENDIF DO CASE CASE Mode = AC_HITTOP KEYBOARD CHR( K_CTRL_PGDN ) mNum := 17; mRow := 16 RetVal := AC_CONT CASE Mode = AC_HITBOTTOM KEYBOARD CHR( K_CTRL_PGUP ) mNum := 1; mRow := 0 RetVal := AC_CONT CASE Mode = AC_EXCEPT DO CASE CASE ( nKey = K_ESC ) RetVal := AC_ABORT CASE ( nKey = K_ENTER ) RetVal := AC_SELECT IF Elem > 0 .AND. Elem < 18 tShow( Elem ) ENDIF OTHERWISE RetVal := AC_CONT ENDCASE OTHERWISE DO CASE CASE ( nKey == K_DOWN ) mNum++; mRow++ CASE ( nKey == K_UP ) mNum--; mRow-- CASE ( nKey == K_PGDN ) mNum := 17; mRow := 16 CASE ( nKey == K_PGUP ) mNum := 1; mRow := 0 ENDCASE IF Elem > 0 .AND. Elem < 18 tShow( Elem ) ENDIF CLEAR TYPEAHEAD RetVal := AC_CONT ENDCASE RETURN( RetVal ) //******************************************************************* // // PROCEDURE tShow( Num ) // // Purpose: // //***** Documented: 05-02-91 at 10:44:13pm ************************** PROCEDURE tShow( Num ) LOCAL DispArray:={}, f, displen, startrow, tClr AADD( DispArray, {"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( DispArray, {"You can pick from four shadow positions or",; "have no shadow if you choose."," ",; "Shadow thickness, 1 or 2 lines on the sides",; "of the windows may be globally set.",; "Monochrome shadows are rendered with ASCII7",; "and Colour in ASCII8."}) AADD( DispArray, {"There are 14 border types to choose from. A",; "window's frame colour can be passed either",; "as a character string or a 2 element array.",; "Therefore, you can have one frame colour in",; "active windows and another for inactive."," ",; "Wise use of colour can give you interesting",; "effects."," ",; "Frame types can also be changed on the fly."," ",; "Of course, you may opt to open windows with",; "no border, for example, wOpen() opens full",; "screen windows with no border in current",; "colours when no parameters are passed!"}) AADD( DispArray, {"Horizontal and vertical line functions give",; "you 11 choices for horizontal lines and 12",; "for vertical."," ",; "You can choose colours other than those for",; "the default window text colour."}) AADD( DispArray, {"You can put boxes anywhere within a window."," ",; "There are 14 types to choose from. Colour",; "is your choice anytime. Other library calls",; "normally made to windows may be used on",; "boxes. For example, you can scroll in a box",; "and either include or exclude the border."}) AADD( DispArray, {"You can fill, clear, colour or shadow boxes",; "you make as well as change the border type."," ",; "In all cases, you can include or exclude a",; "border area in the operation. TSDWIN offers",; "you wide flexibility, but the defaults make",; "common function calls easily."}) AADD( DispArray, {"You can effortlessly make titles for your,",; "windows. TSDWIN offers you two ways to make",; "your headers and footers:"," ",; "You can pass an array to wOpen() or define",; "them later with wTitle()."," ",; "The titles can be in any colour you choose,",; "or you can default them to the window text",; "colour."," ",; "You may also pass a delimiter string with",; "to further customize your window titles!"}) AADD( DispArray, {"You can justify, center or position text",; "anywhere you want in a window."," ",; "Replication and a typing mode are at your",; "disposal.","",; "You can scroll any region of a window, and",; "either include or exclude the border!","",; "At all times you fully control all colour",; "selections, but can easily work with our",; "sensible defaults."}) AADD( DispArray, {"You can easily create and position gets by",; "passing code blocks to wGet() or wSayGet()!",; "In this version, RANGE should be handled in",; "a VALID clause, but PICTURE, WHEN and VALID",; "are included."," ",; "You can create menus with wPrompt(). But if",; "you want to use your own get/menu systems,",; "TSDWIN makes it easy for you to incorporate",; "your methods into the window system."}) AADD( DispArray, {"You can redisplay windows from the stack",; "without activating them.","",; "This is useful in lists you have previously",; "displayed and don't want to modify."}) AADD( DispArray, {"Any window on the stack can be made active",; "in order that all other library functions",; "will operate on that window.","",; "Remember, you can have inactive and active",; "frame colours defined differently.","",; "As well as activating a window, which shows",; "in the foreground of the display, you can",; "also redirect all TSDWIN function output to",; "an inactive window. If you want to do that",; "you may have to do some bounds checking!"}) AADD( DispArray, {"You can MOVE, SLIDE and SIZE any active",; "window!! In all such cases, the shadow is",; "updated as the window moves.","",; "The wSize() and wSlide() functions are big",; "and should be linked only if needed.","",; "VMM swapping can create a problem when you",; "are using Clipper 5.0. If you have any, try",; "setting CLIPPER=E0000. These functions are",; "optimized for speed with 'C' or ASM code."}) AADD( DispArray, {"There are functions which will let you show",; "picklists from databases or arrays. TSDWIN"," ",; "adds scrollbars automatically and will also",; "use a default color scheme unless you want",; "define one. The default is SETCOLOR().","",; "Functions like this are NOT linked in UNTIL",; "you call them! TSDWIN treats memory as a",; "precious commodity."}) AADD( DispArray, {"You have access to the instance variables",; "for windows. You can use them to make your",; "own functions to operate within the TSDWIN",; "environment."}) AADD( DispArray, {"TSDWIN Function List displayed with one of",; "the library MaxiFunctions, wTextFile()."}) AADD( DispArray, {"TSDWIN Revision History.","",; "Watch for more exciting tools from TSD Ltd."}) AADD( DispArray, {"We push the keys!!","",; "You Watch!!"}) //************************* // clear display area //************************* wScroll( 17, .F., 1, 30, 17, 75 ) tClr := SETCOLOR( YEL_BLU ) displen := LEN( disparray[num] ) startrow := 9 - INT( displen / 2 ) FOR f = 1 TO displen @ wRow( f - 1 + startrow ), wCol( 30 ) say DispArray[ num, f ] NEXT SETCOLOR( tClr ) RETURN