home *** CD-ROM | disk | FTP | other *** search
- READ ME FIRST!!!
-
- This documentation tells you how to create a Graphics mode
- Pull-down Menu using TurboPower Software's TPRO 4.0 package. You
- will need from the package the following files to create the
- GPMENU.TPU unit:
-
- TPCRT.TPU, TPSTRING.TPU, and TPCRT.PAS.
-
- You will also need the Turbo Pascal GRAPH.TPU unit, the file
- GXMENU.PAS, and the Appropriate .BGI driver for your computer.
-
- 1. First, make a copy of TPMENU.PAS and rename it to GPMENU.PAS.
-
- Then using your editor, go into the GPMENU.PAS file and:
-
- 2. Change the unit name to GPMENU.
- 3. Add GXMENU to the Uses statement.
- 4. Change all occurrences of "FastWrite" to "GTWrite".
- 5. Find the procedure call "FrameWindow" and rename it to
- "GFWindow" (it is in the procedure DrawFrame).
- 6. Find the two calls to "SaveWindow" and rename them to
- "GSaveWindow" (both are in the procedure DrawSubMenu).
- 7. Find the two calls to "RestoreWindow" and rename them to
- "GRestoreWindow" (both are in the procedure EraseSubMenu).
- 8. Find the two occurances of "ClearWindow" calls in the
- DrawSubMenu procedure and rename them to "GClearWindow"
- (Leave the "ClearWindow" procedure itself alone).
-
- Now compile GPMENU into a .TPU file.
-
- --
-
- You can now compile and run GMDEMO to see the demo.
-
-
- Caveats:
-
- - This is not the most efficient method of doing a pull down
- menu in graphics mode. And in fact, you will find that it is a
- bit slow. Particularly if you are using a PC or XT you may get
- the urge to go get a cup of coffee while you wait for the menu to
- be drawn. With small menus the speed is tolerable on an AT, and
- acceptable on a 386. You can improve the speed by getting rid of
- the extra nicities such as the help line, menu headings, and the
- menu frames (i.e. go to a "LotusStyle" menu without help lines).
-
- - The primary advantage to using this menu program is if you
- already have TPRO 4.0. It is a snap to create the menuing system,
- and since it uses the existing TPRO files as a base it remains
- compatible. In fact, the more adventurous of you out there after
- seeing the changes that were made may decide to merge them into
- your existing TPMENU so that you don't have to worry about the
- mode you are in.
-
- - GPMenu relies on a system type font to be in place in order
- to draw frames around the menu windows. The frames should be
- properly drawn as long as you use the default bitmaped font.
- If you use a stroked font you will probably find the frame
- characters missing and/or weird. Either turn off the framing
- (which will be faster anyway) by setting the Lotus menu mode (all
- frame characters set to #255), or find a set of frame characters
- that suits your tastes instead.
-
- - I've had varied response from the .BGI driver in regard to
- the frame font. On my AT clone with an EGA card it works fine
- including in CGA emulation. Yet on my Heath H-150 which uses a
- CGA card they aren't drawn. I am uncertain at this point as to
- why the frame characters aren't drawn on the H-150 but are drawn
- on the EGA in CGA mode.
-
- - The GMDemo program is similar to the one that TurboPower
- gives for TPMenu, but has been modified to allow graphics mode
- operation plus some stuff thrown in to allow menu display
- manipulation on the fly.
-
- - You should be aware that the TPro 4.0 color mapping will
- cause the frame to be painted black in monochrome mode, so you
- may want to adjust the color scheme if you are using a Hercules
- or CGA card in monochrome mode. The GMDemo program has been
- modified to take this into account. You will also find that the
- titling doesn't map very well either. Adjust the colors to suit
- your own tastes.
-
-
- Other misc fixes:
-
- TPMenu (upto V4.03 as of this writting) currently has a
- problem if you try to use vertical menus without a frame. The
- area behind the menu is not properly saved, cleared, and
- restored.
-
- You can correct this by going into GPMENU.PAS and replacing
- this code segment in the procedure "DrawSubMenu":
-
- if not(GSaveWindow(XL, YL, XH, YH, True, Pointer(Covers))) then
- begin
- PrevMenuStatus := MenuNoMem;
- Exit;
- end;
- GClearWindow(XL, YL, XH, YH, Colors[BodyColor]);
-
- --
-
- In its place put this code segment:
-
- {Save and clear screen area for menu}
- if (Orient = Vertical) and LotusStyle then
- begin
- if not(GSaveWindow(XL, succ(YL), XH, succ(YH), True, Pointer(Covers))) then
- begin
- PrevMenuStatus := MenuNoMem;
- Exit;
- end;
- GClearWindow(XL, succ(YL), XH, succ(YH), Colors[BodyColor]);
- end
- else
- begin
- if not(GSaveWindow(XL, YL, XH, YH, True, Pointer(Covers))) then
- begin
- PrevMenuStatus := MenuNoMem;
- Exit;
- end;
- GClearWindow(XL, YL, XH, YH, Colors[BodyColor]);
- end;
-
-
- -------
-
- Next go to the Procedure "EraseSubMenu" (just below DrawSubMenu)
- and find the code segment:
-
- GRestoreWindow(XL, YL, XH, YH, True, Pointer(Covers));
-
- --
-
- Replace that line with:
-
- if (Orient = Vertical) and LotusStyle then
- GRestoreWindow(XL, succ(YL), XH, succ(YH), True, Pointer(Covers))
- else
- GRestoreWindow(XL, YL, XH, YH, True, Pointer(Covers));
-
- --
-
- The GPMenu unit will now properly draw the vertical menus
- when framing is not used. You can make the appropriate changes to
- TPMENU as well of course if you so desire.
-
-
- -- MED