home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / zcat / grdemo.lbr / GRDEMO.Z80 < prev    next >
Text File  |  1991-01-30  |  19KB  |  732 lines

  1. ;program grdemo
  2. ;version 1.0
  3. ;author dennis l. wright
  4. ;echelon, inc.
  5. ;date 1-23-86
  6. ;
  7. ;assembly and link with ei zas and zlink using
  8. ; syslib, z3lib, vlib, grxlib, grwlib, and pdmlib rel libraries
  9. ;
  10. z3env    equ    0fe00h
  11. ;
  12. CR    EQU    0DH
  13. LF    EQU    0AH
  14. DIM    EQU    1
  15. BRT    EQU    2
  16. ;
  17. ;
  18. ;    external routines used by demo program
  19. ;
  20.     EXT    TINIT,GXYMSG,CLS,EREOL,CRLF,CIN,COUT,AT,VPRINT,PRINT
  21.  
  22.     EXT    DRBOX,ATW,WXYMSG,DRHBAR,DRVBAR
  23.     EXT    DRVERT,DRHORZ,GRXINIT,OPENW,CLOSEW,CLREOS
  24.     EXT    LTISEC,RTISEC,UISEC,LISEC,ISEC,DRFULL,DRHASH
  25.     EXT    ULEFT,URIGHT,LRIGHT,LLEFT,CLEARW,OPENFW
  26.     EXT    PDMINIT,SETPDM,SELPDM,CLRPDM
  27. ;
  28. ;    program to test graphics and window lib functions
  29. ;
  30.     JP    START
  31.     DB    'Z3ENV'
  32.     DB    1
  33. Z3EADR:    DW    Z3ENV
  34. ;
  35. START:    LD    HL,(Z3EADR)
  36.     CALL    GRXINIT        ; Initialize the graphic and Z3 environment
  37.     JR    NZ,START1
  38.     CALL    PRINT
  39.     DB    CR,LF,'*** Extended Z3TCAP not available ***',CR,LF,0
  40.     RET
  41. START1:    CALL    TINIT        ; Initialize users terminal
  42.     CALL    PDMINIT
  43.     JR    Z,START2
  44.     LD    A,-1        ; Pull Down Menus and Windows are supported
  45.     LD    (PDMFLG),A    ; Set Pull Down Menu Window flag
  46. START2:    LD    HL,0
  47.     ADD    HL,SP
  48.     LD    (OLDSTK),HL
  49.     LD    HL,STACK
  50.     LD    SP,HL
  51.     CALL    CLS
  52.     LD    A,(PDMFLG)
  53.     OR    A        ; Pull Down Menus supported?
  54.     JP    Z,LOGON
  55.     CALL    SETPDM        ; Yes setup GRXLIB pull down menu
  56.     DB    1,'GRAPHICS',1
  57.     DB    'GRAPHIC PRIMATIVES',2
  58.     DB    'Graphic Characters',3
  59.     DB    'LINE AND BAR DRAWING',2
  60.     DB    'Vertical Routines',3
  61.     DB    'Horizontal Routines',3
  62.     DB    'ADVANCED GRAPHICS',2
  63.     DB    'Box Routine',3
  64.     DB    'Graph Demo',3
  65.     DB    0
  66.     CALL    SETPDM        ; Setup GRWLIB pull down menu
  67.     DB    2,'WINDOWS',1
  68.     DB    'WINDOW HANDLING',2
  69.     DB    'Introduction',3
  70.     DB    'Window Demo',3
  71.     DB    0
  72.     CALL    SETPDM        ; Setup PDMLIB pull down menu
  73.     DB    3,'PULL-DOWN-MENUS',1
  74.     DB    'PULL DOWN MENU ROUTINES',2
  75.     DB    'SETPDM Routine',3
  76.     DB    'SELPDM Routine',3
  77.     DB    'CLRPDM Routine',3
  78.     DB    0
  79.            CALL    SETPDM        ; Setup a dummy pull down menu
  80.     DB    4,'DUMMY MENU 1',1
  81.     DB    'SUBHEADER 1',2
  82.     DB    'ITEM 1',3
  83.     DB    'ITEM 2',3
  84.     DB    'ITEM 3',3
  85.     DB    'SUBHEADER 2',2
  86.     DB    'ITEM 4',3
  87.     DB    'ITEM 5',3
  88.     DB    0
  89. LOGON:    CALL    GXYMSG
  90.           DB    3,1
  91.     DB    '                   GRXLIB, GRWLIB AND PDMLIB DEMO'
  92.     DB    ' PROGRAM',CR,LF
  93.     DB    CR,LF
  94.     DB    '     This  program demonstrates the use of Graphic,'
  95.     DB    '  Windowing and Pull ',CR,LF
  96.     DB    '     Down  Menu  routines  in the  GRXLIB.REL,'
  97.     DB    '  GRWLIB.REL  and  PDMLIB ',CR,LF
  98.     DB    '     libraries. GRXLIB, GRWLIB and PDMLIB use'
  99.     DB    ' the new Z-System extended ',CR,LF
  100.     DB    '     Z3TCAP information to make them terminal'
  101.     DB    ' independent. ',CR,LF,LF,0
  102.     LD    A,(PDMFLG)
  103.     OR    A
  104.     JP    NZ,PDMOK
  105.     CALL    GXYMSG
  106.     DB    17,7
  107.     DB    'Sorry your Terminal does not support Windows'
  108.      DB    ' or Pull Down Menus',0
  109.     JP    MENU        ; Can't use pull down menus
  110. ;
  111. PDMOK:    CALL    VPRINT
  112.     DB    '          Since  your terminal has the needed'
  113.     DB    ' capabilities for Pull Down ',CR,LF
  114.     DB    '     Menus  you will be able to select the demonstrations'
  115.     DB    ' you  want  to ',CR,LF
  116.     DB    '     see by using the pull down selections you'
  117.     DB    ' see on the top line.',CR,LF
  118.     DB    CR,LF
  119.     DB    '          If  you  look at the top line of your'
  120.     DB    ' screen you will  see  a ',CR,LF
  121.     DB    '     line  of  Pull  Down Menu selections the'
  122.     DB    ' left  most  selection  is ',CR,LF
  123.     DB    '     printed in hi-intensity.  To move to the'
  124.     DB    ' other selections use your ',CR,LF
  125.     DB    '     left  and  right cursor keys or Control-S'
  126.     DB    ' (move  left),  Control-D ',CR,LF
  127.     DB    '     (move right).   Once you reach the desired'
  128.     DB    ' selection press  Return ',CR,LF
  129.     DB    '     and a Pull Down Menu will appear. You can'
  130.     DB    ' escape from this menu by ',CR,LF
  131.     DB    '     pressing  the  escape  key  or  you can move'
  132.     DB    '  to  a  desired  menu ',CR,LF
  133.     DB    '     selection with the up and down cursor keys'
  134.     DB    ' or Control-R (move up), ',CR,LF
  135.     DB    '     Control-C  (move down).  Press Return when'
  136.     DB    ' at desired selection.  ',0
  137.     JP    PDMENU
  138. ;
  139. MENU:    CALL    WAIT
  140.     CALL    CLR9
  141.     CALL    GXYMSG        ; Display a conventional menu
  142.     DB    12,1
  143.     DB    '                 PLEASE SELECT ONE OF THE FOLLOWING'
  144.     DB    ' OPTIONS',CR,LF
  145.     DB    CR,LF
  146.     DB    '                1. Graphic Characters',CR,LF
  147.     DB    '                2. Vertical Routines',CR,LF
  148.     DB    '                3. Horizontal Routines',CR,LF
  149.     DB    '                4. Box Routine',CR,LF
  150.     DB    '                5. Graph Demo',CR,LF
  151.     DB    '                6. Exit Demo Program',0
  152. MENU1:    CALL    CHOICE
  153. MENU2:    LD    (OPT),A
  154.     CP    '1'
  155.     JP    Z,GCHAR
  156.     CP    '2'
  157.     JP    Z,DRV
  158.     CP    '3'
  159.     JP    Z,GRAPHIC
  160.     CP    '4'
  161.     JP    Z,DRBX
  162.     CP    '5'
  163.     JP    Z,GRAF
  164.     CP    '6'
  165.     JP    Z,DONE
  166.     JR    MENU1
  167. ;
  168. PDMENU:    LD    A,(PDMFLG)
  169.     OR    A        ; Pull down menus available?
  170.     JP    Z,MENU
  171.     CALL    PDMC
  172.     CALL    SELPDM        ; Enter Pull down Menu mode
  173.     JP    Z,DONE         ; Done if no selection made
  174.     LD    A,H        ; Else get menu number from (H) reg
  175.     CP    1        ; Menu 1?
  176.     JP    Z,DEMO2
  177.     CP    2        ; Menu 2?
  178.     JP    Z,DEMO3
  179.     CP    3        ; Menu 3?
  180.     JP    Z,DEMO4
  181.     JP    PDMENU
  182. ;
  183. DEMO2:    LD    A,L
  184.     CP    1        ; Menu item 1?
  185.     JP    Z,GCHAR
  186.     CP    2
  187.     JP    Z,DRV
  188.     CP    3
  189.     JP    Z,GRAPHIC
  190.     CP    4
  191.     JP    Z,DRBX
  192.     JP    GRAF
  193. DEMO3    LD    A,L
  194.     CP    1
  195.     JP    Z,WINDOW1
  196.     JP    WINDOW2
  197. ;
  198. DEMO4:    LD    A,L
  199.     CP    1
  200.     JP    Z,SETDMO
  201.     CP    3
  202.     JP    Z,CLRDMO
  203.     CALL    CLR9
  204.     CALL    GXYMSG
  205.     DB    10,1
  206.     DB    '     PDMLIB  routine SELPDM is used to enter Pull'
  207.     DB    ' Down Menu  Mode.  The ',CR,LF
  208.     DB    '     first  Pull  Down  Selection on the menu'
  209.     DB    ' line at the  top  of  the ',CR,LF
  210.     DB    '     screen  is printed in hi-intensity and user'
  211.     DB    ' input to select a menu ',CR,LF
  212.     DB    '     or  move to another selection is awaited.'
  213.     DB    '  The following code will ',CR,LF
  214.     DB    '     now be used to enter Pull Down Menu Mode.'
  215.     DB    '  The return from  SELPDM ',CR,LF
  216.     DB    '     either contains Zero Status,  in which case'
  217.     DB    ' user exited Pull  Down ',CR,LF
  218.     DB    '     Mode  without making a selection or Non-Zero'
  219.     DB    ' Status in which  case ',CR,LF
  220.     DB    '     the  register  pair (HL) contain the Menu'
  221.     DB    ' number (H) and the  Item ',CR,LF
  222.     DB    '     number (L) selected.',CR,LF
  223.     DB    CR,LF
  224.     DB    '         CALL    SELPDM                  ; Enter'
  225.     DB    ' Pull Down Menu Mode',CR,LF
  226.     DB    '         ...',CR,LF
  227.     DB    '         < Code to interrogate the return status'
  228.     DB    ' and user selection >',0
  229.     JP    PDMENU
  230. ;
  231. CLRDMO:    CALL    CLR9
  232.     CALL    GXYMSG
  233.     DB    12,1
  234.     DB    '     PDMLIB  routine  CLRPDM  is used to clear'
  235.     DB    ' a Pull  Down  Menu.  The ',CR,LF
  236.     DB    '     following code will now be used to clear'
  237.     DB    ' DUMMY MENU 1.',CR,LF
  238.     DB    CR,LF
  239.     DB    CR,LF
  240.     DB    '        LD      A,4                     ; Menu'
  241.     DB    ' number in register (A)',CR,LF
  242.     DB    '        CALL    CLRPDM                  ; Clear'
  243.     DB    ' the menu',CR,LF
  244.     DB    0
  245.     CALL    WAIT
  246.     LD    A,4
  247.     CALL    CLRPDM
  248.     JP    PDMENU
  249. ;
  250. SETDMO:    CALL    CLR9
  251.     CALL    GXYMSG
  252.     DB    10,1
  253.     DB    '     PDMLIB routine SETPDM is used to setup a'
  254.     DB    ' Pull Down Menu.  Up to 10 ',CR,LF
  255.     DB    '     Pull  Down Menus can be present at one time'
  256.     DB    ' as long as the top  of ',CR,LF
  257.     DB    '     screen headers can all fit on the screen.'
  258.     DB    '  The following code will ',CR,LF
  259.     DB    '     now be used to setup a new menu.',CR,LF
  260.     DB    CR,LF
  261.     DB    '       CALL    SETPDM                  ; Setup the'
  262.     DB    ' following menu',CR,LF
  263.     DB    '       DB      5,''DUMMY MENU 2'',1      '
  264.     DB    '; Menu Number, Header String',cr,lf
  265.     DB    '       DB      ''SUBHEADER'',2           '
  266.     DB    '; Subheader String (optional)',cr,lf
  267.     DB    '       DB      ''ITEM 1'',3              ; Item String',cr,lf
  268.     DB    '       DB      ''ITEM 2'',3              ;  "     "',cr,lf
  269.     DB    '       DB      0                       ; End of menu',cr,lf
  270.     DB    0
  271.     CALL    WAIT
  272.     CALL    SETPDM
  273.     DB    5,'DUMMY MENU 2',1
  274.     DB    'SUBHEADER',2
  275.     DB    'ITEM 1',3
  276.     DB    'ITEM 2',3
  277.     DB    0
  278.     JP    PDMENU
  279. ;
  280. GRAPHIC:CALL    CLR9
  281.     CALL    GXYMSG
  282.     DB    12,1
  283.     DB    '     The following is a demonstration of GRXLIB'
  284.     DB    ' graphics routines.  The ',CR,LF
  285.     DB    '     following  routine will draw a horizontal'
  286.     DB    ' line starting at row 17, ',CR,LF
  287.     DB    '     column 10  The line will be 60 columns long'
  288.     DB    ' and will be drawn from ',CR,LF
  289.     DB    '     left to right.                ',CR,LF
  290.     DB    CR,LF
  291.     DB    '     CALL      DRHORZ',CR,LF
  292.     DB    '     DB        17,10,60,0     ; row,col,length,direction',0
  293.     CALL    WAIT
  294.     CALL    CLR9
  295.     CALL    GXYMSG
  296.     DB    14,16
  297.     DB    'Horizontal line created by GRXLIB routine DRHORZ',0
  298.     CALL    DRHORZ
  299.     DB    17,10,60,0    ; Row 22, Col 10, 60 columns long, rt to lt
  300.     CALL    WAIT
  301. DRHB:    CALL    CLR9
  302.     CALL    GXYMSG
  303.     DB    12,1
  304.     DB    '     Horizontal  bars  can  also be created using'
  305.     DB    '  the  GRXLIB  routine ',CR,LF
  306.     DB    '     DRHBAR.   The following  are examples of'
  307.     DB    ' the GRXLIB horizontal bar ',CR,LF
  308.     DB    '     routine:',CR,LF,LF
  309.     DB    '     CALL      DRHBAR',CR,LF
  310.     DB    '     DB        1,16,10,60,0    '
  311.     DB    '; type, row,col,length,left to right',cr,lf
  312.     DB    '     CALL      DRHBAR',CR,LF
  313.     DB    '     DB        2,18,69,60,1    '
  314.     DB    '; type, row,col,length,right to left',0
  315.     CALL    WAIT
  316.     CALL    CLR9
  317.     CALL    GXYMSG
  318.     DB    13,16
  319.     DB    'Horizontal bars created by GRXLIB routine DRHBAR',0
  320.     CALL    GXYMSG
  321.     DB    16,2
  322.     DB    'Type 1',0
  323.     CALL    DRHBAR        ; Draw dark horizontal bar
  324.     DB    1,16,10,60,0    ; Row 16, Col 10, 60 columns long, lt to rt
  325.     CALL    GXYMSG
  326.     DB    18,2
  327.     DB    'Type 2',0
  328.     CALL    DRHBAR        ; Draw light horizontal bar
  329.     DB    2,18,69,60,1    ; Row 18, Col 69, 60 columns long, rt to lt
  330.     JP    PDMENU
  331. ;
  332. DRV:    CALL    CLR9
  333.     CALL    GXYMSG
  334.     DB    12,1
  335.     DB    '     The  following  routine will draw a vertical'
  336.     DB    ' line starting at  row ',CR,LF
  337.     DB    '     16, column 38  The line will be 5 rows long'
  338.     DB    ' and will be drawn from ',CR,LF
  339.     DB    '     top to bottom.',CR,LF
  340.     DB    CR,LF
  341.     DB    '     CALL      DRVERT',CR,LF
  342.     DB    '     DB        16,38,5,0      ; row,col,length,direction',0
  343.     CALL    WAIT
  344.     CALL    CLR9
  345.     CALL    GXYMSG
  346.     DB    13,17
  347.     DB    'Vertical line created by GRXLIB routine DRVERT',0
  348.     CALL    DRVERT        ; Draw vertical line
  349.     DB    16,38,5,0    ; Row 16, Col 40, 5 rows deep, Top down
  350.     CALL    WAIT
  351. DRVB:    CALL    CLR9
  352.     CALL    GXYMSG
  353.     DB    12,1
  354.     DB    '     Vertical  bars  can  also  be  created using'
  355.     DB    '  the  GRXLIB  routine ',CR,LF
  356.     DB    '     DRVBAR as follows:',CR,LF,LF
  357.     DB    '     CALL      DRVBAR',CR,LF
  358.     DB    '     DB        1,16,25,5,0'
  359.         DB    '    ; type,row,col,height,direction',cr,lf
  360.     DB    '     CALL      DRVBAR',CR,LF
  361.     DB    '     DB        2,16,35,5,0'
  362.         DB    '    ; type,row,col,height,direction',cr,lf
  363.     DB    '     CALL      DRVBAR',CR,LF
  364.     DB    '     DB        3,16,45,5,0'
  365.         DB    '    ; type,row,col,height,direction',cr,lf
  366.     DB    '     CALL      DRVBAR',CR,LF
  367.     DB    '     DB        4,16,55,5,0'
  368.         DB    '    ; type,row,col,height,direction',0
  369.     CALL    WAIT
  370.     CALL    CLR9
  371.     CALL    GXYMSG
  372.     DB    12,17
  373.     DB    'Vertical bars created by GRXLIB routine DRVBAR',0
  374.     CALL    GXYMSG
  375.     DB    14,22
  376.     DB    'Type 1',0
  377.     CALL    GXYMSG
  378.     DB    14,32
  379.     DB    'Type 2',0
  380.     CALL    GXYMSG
  381.     DB    14,42
  382.     DB    'Type 3',0
  383.     CALL    GXYMSG
  384.     DB    14,52
  385.     DB    'Type 4',0
  386.     CALL    DRVBAR
  387.     DB    1,16,25,5,0
  388.     CALL    DRVBAR
  389.     DB    2,16,35,5,0
  390.     CALL    DRVBAR
  391.     DB    3,16,45,5,0
  392.     CALL    DRVBAR
  393.     DB    4,16,55,5,0
  394.     JP    PDMENU
  395. ;
  396. GCHAR:    CALL    CLR9
  397.     CALL    GXYMSG
  398.     DB    12,1
  399.     DB    '     GRXLIB  contains routines to draw individual'
  400.     DB    ' graphics  characters. ',CR,LF
  401.     DB    '     The  routines  LTISEC (draw left intersect),'
  402.     DB    '  RTISEC  (draw  right ',CR,LF
  403.     DB    '     intersect),  UISEC  (draw  upper  intersect),'
  404.     DB    '  LISEC  (draw  lower ',CR,LF
  405.     DB    '     intersect),  ISEC (draw intersection),  DRFULL'
  406.     DB    ' (draw full  block), ',CR,LF
  407.     DB    '     DRHASH  (draw hashed block),  and  ULEFT,'
  408.     DB    '  URIGHT,  LRIGHT,  LLEFT ',CR,LF
  409.     DB    '     (corner drawing routines) are demonstrated.',0
  410.     CALL    WAIT
  411.     CALL    CLR9
  412.     CALL    GXYMSG
  413.     DB    13,13
  414.     DB    'Individual graphics characters supported by GRXLIB',0
  415.     CALL    AT
  416.     DB    16,18
  417.     CALL    ULEFT        ; Draw upper left corner
  418.     CALL    AT
  419.     DB    16,38
  420.     CALL    UISEC        ; Draw upper intersect
  421.     CALL    AT
  422.     DB    16,58
  423.     CALL    URIGHT        ; Draw upper right corner
  424.     CALL    AT
  425.     DB    18,18
  426.     CALL    LTISEC        ; Draw left intersect
  427.     CALL    AT
  428.     DB    18,38
  429.     CALL    ISEC        ; Draw intersection
  430.     CALL    AT
  431.     DB    18,58
  432.     CALL    RTISEC        ; Draw right intersect
  433.     CALL    AT
  434.     DB    20,18
  435.     CALL    LLEFT        ; Draw lower left corner
  436.     CALL    AT
  437.     DB    20,38
  438.     CALL    LISEC        ; Draw lower intersect
  439.     CALL    AT
  440.     DB    20,58
  441.     CALL    LRIGHT        ; Draw lower right corner
  442.     CALL    AT
  443.     DB    18,28
  444.     CALL    DRFULL        ; Draw full block
  445.     CALL    AT
  446.     DB    18,48
  447.     CALL    DRHASH        ; Draw hashed block
  448.     JP    PDMENU
  449. ;
  450. DRBX:    CALL    CLR9
  451.     CALL    GXYMSG
  452.     DB    12,1
  453.     DB    '     The  following  is an example of the GRXLIB'
  454.     DB    '  DRBOX  routine.  this ',CR,LF
  455.     DB    '     example  will  draw a box starting at row'
  456.     DB    ' 16,  column 10  The  box ',CR,LF
  457.     DB    '     will be 5 rows high and 20 columns wide.',CR,LF
  458.     DB    CR,LF
  459.     DB    '     CALL      DRBOX',CR,LF
  460.     DB    '     DB        16,10,5,20     ; row,col,height,width',0
  461.     CALL    WAIT
  462.     CALL    CLR9
  463.     CALL    GXYMSG
  464.     DB    13,3
  465.     DB    'Box drawn with GRXLIB routine DRBOX',0
  466.     CALL    DRBOX        ; Draw a box
  467.     DB    16,10,5,20    ; Row 16, col 10, 5 X 20
  468.     JP    PDMENU
  469. ;
  470. GRAF:    CALL    CLR9
  471.          CALL    GXYMSG
  472.     DB    12,1
  473.     DB    '     The  next  demonstration  will show how by'
  474.     DB    '  combining  the  GRXLIB ',CR,LF
  475.     DB    '     routines DRBOX, and DRVBAR a bar graph'
  476.     DB    ' chart can be created.',0
  477.     CALL    WAIT
  478.     CALL    CLR9
  479.     CALL    DRBOX        ; Draw a box
  480.     DB    11,10,11,60    ; Row 12, col 10, 11 X 60
  481.     CALL    GXYMSG
  482.     DB    12,3        ; Vertical descriptors
  483.     DB    '100% - ',0
  484.     CALL    GXYMSG
  485.     DB    16,4
  486.     DB    '50% - ',0
  487.     CALL    GXYMSG
  488.     DB    20,5
  489.     DB    '0% _ ',0
  490.     CALL    GXYMSG
  491.     DB    22,18        ; Horizontal descriptors
  492.     DB    '1976',0
  493.     CALL    GXYMSG
  494.     DB    22,26
  495.     DB    '1977',0
  496.     CALL    GXYMSG
  497.     DB    22,34
  498.     DB    '1978',0
  499.     CALL    GXYMSG
  500.     DB    22,42
  501.     DB    '1979',0
  502.     CALL    GXYMSG
  503.     DB    22,50
  504.     DB    '1980',0
  505.     CALL    GXYMSG
  506.     DB    22,58
  507.     DB    '1981',0
  508.     CALL    DRVBAR        ; Draw dark vertical bar
  509.     DB    2,20,18,5,1    ; Row 19, col 18, 5 rows deep, bottom up
  510.     CALL    DRVBAR        ; Draw light vertical bar
  511.     DB    4,20,20,3,1    ; Row 19, col 20, 3 rows deep, bottom up
  512.     CALL    DRVBAR        ; Draw dark vertical bar
  513.     DB    2,20,26,6,1    ; Row 19, col 26, 6 rows deep, bottom up
  514.     CALL    DRVBAR        ; Draw light vertical bar
  515.     DB    4,20,28,4,1    ; Row 19, col 28, 4 rows deep, bottom up
  516.     CALL    DRVBAR
  517.     DB    2,20,34,7,1
  518.     CALL    DRVBAR
  519.     DB    4,20,36,6,1
  520.     CALL    DRVBAR
  521.     DB    2,20,42,8,1
  522.     CALL    DRVBAR
  523.     DB    4,20,44,8,1
  524.     CALL    DRVBAR
  525.     DB    2,20,50,8,1
  526.     CALL    DRVBAR
  527.     DB    4,20,52,9,1
  528.     CALL    DRVBAR
  529.     DB    2,20,58,7,1
  530.     CALL    DRVBAR
  531.     DB    4,20,60,9,1
  532.     JP    PDMENU
  533. ;
  534. WINDOW1:CALL    CLR9
  535.     CALL    GXYMSG
  536.     DB    12,1
  537.     DB    '                   INTRODUCTION TO GRWLIB WINDOW'
  538.     DB    ' ROUTINES',CR,LF
  539.     DB    CR,LF
  540.     DB    '     GRWLIB  contains routines to create and maintain'
  541.     DB    ' up to 16 separate ',CR,LF
  542.     DB    '     on screen windows.  GRWLIB supports two types'
  543.     DB    ' of  windows,  framed ',CR,LF
  544.     DB    '     windows  (those  which  are  surrounded by'
  545.     DB    '  a  bold  boarder)  and ',CR,LF
  546.     DB    '     standard  windows  (those  which are surrounded'
  547.     DB    ' by a  thin  line). ',CR,LF
  548.     DB    '     Routines are provided to create (OPENW, '
  549.     DB    ' OPENFW),  clear (CLEARW), ',CR,LF
  550.     DB    '     position cursor and print in (ATW,  WXYMSG),'
  551.     DB    '  interrogate (GETCUR, ',CR,LF
  552.     DB    '     GETLEV), and close (CLOSEW), windows.',0
  553.     JP    PDMENU
  554. ;
  555. WINDOW2:CALL    CLR9
  556.          CALL    GXYMSG
  557.     DB    12,1
  558.     DB    '     The  following demonstrations will demonstrate'
  559.     DB    ' the use of some  of ',CR,LF
  560.     DB    '     the  routines  in  the  GRWLIB  window  library.'
  561.     DB    '  GRWLIB  contains ',CR,LF
  562.     DB    '     routines  to  create and maintain up to 16'
  563.     DB    '  separate  windows  the ',CR,LF
  564.     DB    '     following  routine  will open window number'
  565.     DB    ' 1 starting at  row  2, ',CR,LF
  566.     DB    '     column  33  The window will be framed 15'
  567.     DB    ' rows high and 42  columns ',CR,LF
  568.     DB    '     wide.',CR,LF
  569.     DB    CR,LF
  570.     DB    '     LD     DE,SAVBUF        ; Address of buffer'
  571.     DB    ' to save current screen',CR,LF
  572.     DB    '     CALL   OPENFW           ; Open a framed window',cr,lf
  573.     DB    '     DB     1,2,33,15,42     '
  574.     DB    '; window number,row,col,height,width',0
  575.     CALL    WAIT
  576.     LD    DE,SBUFF1
  577.     CALL    OPENFW
  578.          DB    1,2,33,15,42
  579.     LD    A,1
  580.     CALL    CLEARW
  581.      CALL    WXYMSG
  582.     DB    1,2,5
  583.      DB    'THIS IS A GRWLIB FRAMED WINDOW',0
  584.     CALL    WXYMSG
  585.     DB    1,4,2
  586.     DB    'Data was printed in this window  using',0
  587.     CALL    WXYMSG
  588.     DB    1,5,2
  589.     DB    'calls to  GRWLIB  routines  CLEARW and',0
  590.     CALL    WXYMSG
  591.     DB    1,6,2
  592.     DB    'WXYMSG as follows:',0
  593.     CALL    WXYMSG
  594.     DB    1,8,4
  595.     DB    'LD     A,WINDOW  ; Window # in (A)',0
  596.     CALL    WXYMSG
  597.     DB    1,9,4
  598.     DB    'CALL   CLEARW    ; Clear the window',0
  599.     CALL    WXYMSG
  600.     DB    1,10,4
  601.     DB    'CALL   WXYMSG    ; Send the message',0
  602.     CALL    WXYMSG
  603.     DB    1,11,4
  604.     DB    'DB     WINDOW,ROW,COL',0
  605.     CALL    WXYMSG
  606.     DB    1,12,4
  607.     DB    'DB     ''MESSAGE'',0',0
  608.     CALL    WAIT
  609.     LD    DE,SBUFF2
  610.     CALL    OPENW
  611.     DB    2,9,14,10,36
  612.     LD    A,2
  613.     CALL    CLEARW
  614.     CALL    WXYMSG
  615.     DB    2,2,2
  616.     DB    'THIS IS A GRWLIB STANDARD WINDOW',0
  617.     CALL    WXYMSG
  618.     DB    2,4,2
  619.     DB    'This window was created with the',0
  620.     CALL    WXYMSG
  621.     DB    2,5,2
  622.     DB    'GRWLIB routine OPENW.',0
  623.     CALL    WXYMSG
  624.     DB    2,7,2
  625.     DB    'As  can be seen  windows can  be',0
  626.     CALL    WXYMSG
  627.     DB    2,8,2
  628.     DB    'overlayed.',0
  629.     CALL    WAIT
  630.         LD    DE,SBUFF3
  631.     CALL    OPENFW
  632.     DB    3,4,3,11,56
  633.     LD    A,3
  634.     CALL    CLEARW
  635.     CALL    WXYMSG
  636.     DB    3,2,4
  637.     DB    DIM,'To insure that the ',BRT,'original screen',DIM
  638.     DB    ' is properly',0
  639.     CALL    WXYMSG
  640.     DB    3,3,4
  641.     DB    'restored, windows should be closed in the reverse',0
  642.     CALL    WXYMSG
  643.     DB    3,4,4
  644.     DB    'order from which they were opened. The GRXLIB',0
  645.     CALL    WXYMSG
  646.     DB    3,5,4
  647.     DB    'routine ',BRT,'CLOSEW',DIM,' is used as follows:',BRT,0
  648.     CALL    WXYMSG
  649.     DB    3,7,4
  650.     DB    '    LD     A,WINDOW NUMBER',0
  651.     CALL    WXYMSG
  652.     DB    3,8,4
  653.     DB    '    CALL   CLOSEW',0
  654.     CALL    WAIT1
  655.     LD    A,3
  656.     CALL    CLOSEW
  657.     CALL    WAIT2
  658.     LD    A,2
  659.     CALL    CLOSEW
  660.     CALL    WAIT3
  661.     LD    A,1
  662.     CALL    CLOSEW
  663.     JP    PDMENU
  664. ;
  665. DONE:    CALL    CLR9
  666.     XOR    A        ; Clear all pull down menus
  667.     CALL    CLRPDM
  668.     CALL    GXYMSG
  669.     DB    17,12
  670.     DB      ' This concludes the GRXLIB/GRWLIB/PDMLIB demonstration. ',0
  671.     CALL    AT
  672.     DB    23,1
  673.     LD    HL,(OLDSTK)
  674.     LD    SP,HL
  675.     RET
  676. ;
  677. CHOICE:    CALL    GXYMSG
  678.     DB    24,1
  679.     DB    DIM,'     Enter your choice: ',BRT,0
  680.     JP    WCIN
  681. ;
  682. PDMC:    CALL    GXYMSG
  683.     DB    24,1
  684.     DB    DIM,'     Select Pull Down Menu or Press <ESC> '
  685.         DB      'to quit: ',BRT,0
  686.     RET
  687. ;
  688. WAIT:    CALL    GXYMSG
  689.     DB    24,1
  690.     DB    DIM,'     Press any key to continue: ',BRT,0
  691.     JP    WCIN
  692. ;
  693. WAIT1:    CALL    GXYMSG
  694.     DB    24,1
  695.     DB    DIM,'     Press any key to close window 3: ',BRT,0
  696.     JP    WCIN
  697. ;
  698. WAIT2:    CALL    GXYMSG
  699.     DB    24,1
  700.     DB    DIM,'     Press any key to close window 2: ',BRT,0
  701.     JP    WCIN
  702. ;
  703. WAIT3:    CALL    GXYMSG
  704.     DB    24,1
  705.     DB    DIM,'     Press any key to close window 1: ',BRT,0
  706. ;
  707. WCIN:    CALL    CIN
  708.     PUSH    AF
  709.     LD    A,CR
  710.     CALL    COUT
  711.     CALL    EREOL
  712.     POP    AF
  713.     RET
  714. ;
  715. CLR9:    CALL    AT
  716.     DB    9,1
  717.     CALL    CLREOS
  718.     RET
  719. ;
  720. PDMFLG:    DB    0
  721. OPT:    DB    0
  722. SBUFF1:    DS    2000
  723. SBUFF2:    DS    2000
  724. SBUFF3:    DS    2000
  725. OLDSTK:    DW    0
  726.     DS    128
  727. STACK    EQU    $
  728. ;
  729. ;    end test program
  730. ;
  731.