home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a004 / 4.ddi / TUTORIAL / WINDOWS.PRG < prev    next >
Encoding:
Text File  |  1988-01-17  |  1.4 KB  |  69 lines

  1. * WINDOWS.PRG  A program to demonstrate windowing.
  2.  
  3. SET BELL OFF
  4. SET SAFETY OFF
  5. CLEAR
  6.  
  7. * Define window Choice.
  8. WSET WINDOW Choice TO 15,1,18,41 DOUBLE
  9. TEXT
  10. Welcome to windowing with dBXL.
  11.  
  12. This demonstration illustrates several basic windowing commands.
  13. With them, you can make windows:
  14.  
  15.         A.  Move
  16.         B.  Expand
  17.         C.  Contract
  18.         D.  Overlap
  19.  
  20. Make a selection by letter. Press Q to quit.
  21. ENDTEXT
  22. STORE " " TO ans
  23. DO WHILE ans <> "Q"
  24.  
  25.   * Open window Choice in Area 1. Display message.
  26.   WSELECT 1
  27.   WUSE Choice
  28.   @ 1,7 SAY "Your choice:" GET ans PICTURE "!"
  29.   READ
  30.   * Erase window contents.
  31.   CLEAR
  32.  
  33.   DO CASE
  34.     CASE ans = "A"
  35.       * Move window to new coordinates.
  36.       WMOVE TO 4,35
  37.       WAIT
  38.     CASE ans = "B"
  39.       * Stretch window from top left to bottom
  40.       * right of screen.
  41.       WSET SIZE TO 1,1,23,78
  42.       WAIT
  43.     CASE ans = "C"
  44.       * Shrink window.
  45.       WSET SIZE TO 15,1,16,30
  46.       WAIT
  47.     CASE ans = "D"
  48.       * Save Choice to a screen file and then
  49.       * restore it in three different areas.
  50.       * Move each window to new coordinates.
  51.       WSAVE TO Archive
  52.       WSELECT 2
  53.       WRESTORE FROM Archive
  54.       WMOVE TO 1,1
  55.       WSELECT 3
  56.       WRESTORE FROM Archive
  57.       WMOVE TO 4,4
  58.       WSELECT 4
  59.       WRESTORE FROM Archive
  60.       WMOVE TO 7,7
  61.       WAIT
  62.   ENDCASE
  63.  
  64.   * Remove all windows.
  65.   WCLOSE ALL
  66.  
  67. ENDDO
  68.  
  69.