home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / max / max130 / window.max < prev   
Text File  |  1988-10-30  |  3KB  |  130 lines

  1.  
  2. ; This file does not use the window definitions located in windef.max
  3. ; because it is read every time that Max is started and has been optimized.
  4.  
  5. ; Establish window defaults
  6.  
  7. window (1 1)                            ; border style
  8.  
  9. ; Colors may be specified for the windows and the status line by
  10. ; additively combining red, green and blue components. 
  11.  
  12. ;    bits    color
  13.  
  14. ;    1000    intensity
  15. ;    0100    red
  16. ;    0010    blue
  17. ;    0001    green
  18.  
  19. ; One byte controls both background and foreground. The high
  20. ; order four bits specify background and the low order four
  21. ; bits specify foreground.
  22.  
  23. ; These are good for monochrome
  24.  
  25. window (2 fmhex (0x07))            ; white text on black background
  26. window (5 fmhex (0x70))            ; black on white status line/popup
  27.  
  28. ; These are good for color
  29.  
  30. ;window (2 fmhex (0x03))                ; cyan text on black background
  31. ;window (5 fmhex (0x04))                ; red status line on black
  32.  
  33. ; Open window and associate with standard input and output
  34.  
  35. window (0 1 1 9 78)            ; location
  36. window (3 10000 127)                    ; buffer size and line length
  37. window (4 " Command Entry ")            ; title
  38. window (6)                ; open window
  39. window (9 0 0)                          ; associate with stdin
  40. window (9 1 0)                          ; associate with stdout
  41. window (9 2 0)                          ; associate with stderr
  42.  
  43. ; Open scratchpad window for function definitions
  44.  
  45. window (0 12 1 22 78)           ; location
  46. window (1 1)                ; border style
  47. window (3 30000 127)                    ; buffer size and line length
  48. window (4 " Function Definition ")  ; title
  49. window (6)              ; open
  50. window (23 1 1)         ; input mode
  51. window (24 1 0)         ; no overflow mode
  52.  
  53. ; Link scratchpad window to standard input and output
  54.  
  55. window (8 0 1)
  56. window (2 fmhex (0x07))                 ; subsequent windows are black/white
  57.  
  58. ; Define translate function and assign to F1
  59.  
  60. define (
  61.    f1 (
  62.       window (13 1)
  63.    )
  64. )
  65.  
  66. ; Define system function and assign to F2
  67.  
  68. ; This function can be modified to select a new display page on
  69. ; systems that support multiple video pages.
  70.  
  71. define (
  72.     f2 (
  73.     window (20)             ; Clear screen
  74.     system ("COMMAND")          ; Invoke system command processor
  75.     window (20)             ; Clear output from dos
  76.     window (26 0)           ; Toggle status line to refresh
  77.     window (26 1)
  78.     window (18 0)           ; Refresh command entry window
  79.     window (18 1)           ; Refresh function definition
  80.     )
  81. )
  82.  
  83. ; Print current user defined functions
  84.  
  85. define (
  86.     f3 (
  87.         udfdir ()
  88.     )
  89. )
  90.  
  91. ; Verify and clear transient area
  92.  
  93. define (
  94.     f6 (
  95.         put ("Clear transient area? (y/n)")
  96.         get (response)
  97.     if (eq (struc (strsub (response 1 1)) "Y")
  98.         then (
  99.             tclear ()
  100.         )
  101.     )
  102.     )
  103. )
  104.  
  105. ; Verify quit and terminate Max
  106.  
  107. define (
  108.     f10 (
  109.         put ("Quit? (y/n)")
  110.         get (response)
  111.         case (struc (strsub (response 1 1))
  112.             when ("Y"
  113.                 window (20)         ; Clear screen
  114.                 quit ()
  115.             )
  116.             when ("N"
  117.                 break ()
  118.             )
  119.             default (
  120.                 put ("No assumed.")
  121.                 break ()
  122.             )
  123.         )
  124.     )
  125. )
  126.  
  127. ; Set the base of the transient area
  128.  
  129. tset ()
  130.