home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / GPMENU.ZIP / GPMENU.DOC < prev    next >
Encoding:
Text File  |  1988-04-01  |  5.6 KB  |  152 lines

  1.                         READ ME FIRST!!!
  2.  
  3.      This  documentation tells you how to create a Graphics  mode 
  4. Pull-down Menu using TurboPower Software's TPRO 4.0 package.  You 
  5. will  need  from the package the following files  to  create  the 
  6. GPMENU.TPU unit: 
  7.  
  8.      TPCRT.TPU, TPSTRING.TPU, and TPCRT.PAS. 
  9.  
  10. You  will  also need the Turbo Pascal GRAPH.TPU  unit,  the  file 
  11. GXMENU.PAS, and the Appropriate .BGI driver for your computer. 
  12.  
  13. 1.  First, make a copy of TPMENU.PAS and rename it to GPMENU.PAS. 
  14.      
  15. Then using your editor, go into the GPMENU.PAS file and:
  16.  
  17. 2.   Change the unit name to GPMENU.
  18. 3.   Add GXMENU to the Uses statement.
  19. 4.   Change all occurrences of "FastWrite" to "GTWrite". 
  20. 5.   Find the procedure call "FrameWindow" and rename it to
  21.        "GFWindow" (it is in the procedure DrawFrame). 
  22. 6.   Find the two calls to "SaveWindow" and rename them to 
  23.        "GSaveWindow" (both are in the procedure DrawSubMenu). 
  24. 7.   Find the two calls to "RestoreWindow" and rename them to
  25.        "GRestoreWindow" (both are in the procedure EraseSubMenu).
  26. 8.   Find the two occurances of "ClearWindow" calls in the 
  27.        DrawSubMenu procedure and rename them to "GClearWindow" 
  28.        (Leave the "ClearWindow" procedure itself alone).
  29.  
  30. Now compile GPMENU into a .TPU file.
  31.  
  32. -- 
  33.  
  34. You can now compile and run GMDEMO to see the demo.
  35.  
  36.  
  37. Caveats:  
  38.  
  39. -    This  is not the most efficient method of doing a pull  down 
  40. menu  in graphics mode. And in fact, you will find that it  is  a 
  41. bit  slow. Particularly if you are using a PC or XT you  may  get 
  42. the urge to go get a cup of coffee while you wait for the menu to 
  43. be  drawn. With small menus the speed is tolerable on an AT,  and 
  44. acceptable on a 386. You can improve the speed by getting rid  of 
  45. the extra nicities such as the help line, menu headings, and  the 
  46. menu frames (i.e. go to a "LotusStyle" menu without help lines).
  47.  
  48. -    The  primary advantage to using this menu program is if  you 
  49. already have TPRO 4.0. It is a snap to create the menuing system, 
  50. and  since it uses the existing TPRO files as a base  it  remains 
  51. compatible. In fact, the more adventurous of you out there  after 
  52. seeing  the changes that were made may decide to merge them  into 
  53. your  existing TPMENU so that you don't have to worry  about  the 
  54. mode you are in.
  55.  
  56. -    GPMenu relies on a system type font to be in place in  order 
  57. to  draw  frames around the menu windows. The  frames  should  be 
  58. properly drawn as long as you use the default bitmaped font.   
  59.      If  you use a stroked font you will probably find the  frame 
  60. characters  missing  and/or weird. Either turn  off  the  framing 
  61. (which will be faster anyway) by setting the Lotus menu mode (all 
  62. frame characters set to #255), or find a set of frame  characters 
  63. that suits your tastes instead.
  64.  
  65. -     I've had varied response from the .BGI driver in regard  to 
  66. the  frame  font. On my AT clone with an EGA card it  works  fine 
  67. including  in CGA emulation. Yet on my Heath H-150 which  uses  a 
  68. CGA  card they aren't drawn. I am uncertain at this point  as  to 
  69. why the frame characters aren't drawn on the H-150 but are  drawn 
  70. on the EGA in CGA mode. 
  71.  
  72. -     The  GMDemo program is similar to the one  that  TurboPower 
  73. gives  for TPMenu, but has been modified to allow  graphics  mode 
  74. operation  plus  some  stuff  thrown in  to  allow  menu  display 
  75. manipulation on the fly. 
  76.  
  77. -    You  should  be aware that the TPro 4.0 color  mapping  will 
  78. cause  the frame to be painted black in monochrome mode, so   you  
  79. may  want to adjust the color scheme if you are using a  Hercules 
  80. or  CGA  card  in monochrome mode. The GMDemo  program  has  been 
  81. modified  to take this into account. You will also find that  the 
  82. titling  doesn't map very well either. Adjust the colors to  suit 
  83. your own tastes.
  84.  
  85.  
  86. Other misc fixes:
  87.  
  88.      TPMenu  (upto  V4.03 as of this writting)  currently  has  a 
  89. problem  if  you try to use vertical menus without a  frame.  The 
  90. area  behind  the  menu  is  not  properly  saved,  cleared,  and 
  91. restored. 
  92.  
  93.      You can correct this by going into GPMENU.PAS and  replacing 
  94. this code segment in the procedure "DrawSubMenu":
  95.  
  96.   if not(GSaveWindow(XL, YL, XH, YH, True, Pointer(Covers))) then
  97.   begin
  98.     PrevMenuStatus := MenuNoMem;
  99.     Exit;
  100.   end;
  101.   GClearWindow(XL, YL, XH, YH, Colors[BodyColor]);
  102.  
  103. -- 
  104.  
  105. In its place put this code segment:
  106.  
  107.       {Save and clear screen area for menu}
  108.       if (Orient = Vertical) and LotusStyle then
  109.       begin
  110.         if not(GSaveWindow(XL, succ(YL), XH, succ(YH), True, Pointer(Covers))) then
  111.         begin
  112.           PrevMenuStatus := MenuNoMem;
  113.           Exit;
  114.         end;
  115.         GClearWindow(XL, succ(YL), XH, succ(YH), Colors[BodyColor]);
  116.       end
  117.       else
  118.       begin
  119.         if not(GSaveWindow(XL, YL, XH, YH, True, Pointer(Covers))) then
  120.         begin
  121.           PrevMenuStatus := MenuNoMem;
  122.           Exit;
  123.         end;
  124.         GClearWindow(XL, YL, XH, YH, Colors[BodyColor]);
  125.       end;
  126.  
  127.  
  128. -------
  129.  
  130. Next go to the Procedure "EraseSubMenu" (just below  DrawSubMenu) 
  131. and find the code segment:
  132.  
  133.         GRestoreWindow(XL, YL, XH, YH, True, Pointer(Covers));
  134.  
  135. --
  136.  
  137. Replace that line with:
  138.  
  139.         if (Orient = Vertical) and LotusStyle then
  140.           GRestoreWindow(XL, succ(YL), XH, succ(YH), True, Pointer(Covers))
  141.         else
  142.           GRestoreWindow(XL, YL, XH, YH, True, Pointer(Covers));
  143.  
  144. --
  145.  
  146.      The  GPMenu unit will now properly draw the  vertical  menus 
  147. when framing is not used. You can make the appropriate changes to 
  148. TPMENU as well of course if you so desire.
  149.  
  150.  
  151. -- MED
  152.