home *** CD-ROM | disk | FTP | other *** search
- QuickBasic Subroutine to Highlight Menu Items, Pick Lists, and Other Text
- Placed in the Public Domain, 09/18/93 by Dave Wright, CIS 76635,1136
- ----------------------------------------------------------------------------
-
- HILITE.BAS QuickBasic Subroutine to Highlight selected text
- HILITE.OBJ QB45 .OBJ File for HILITE.BAS
- HILITE.DOC This Documentation File
- HILIDEMO.EXE Demo of HILITE.BAS
- HILIDEMO.BAS Source Code for HILIDEMO.EXE
- HILIDEMO.OBJ QB45 .OBJ File for HILIDEMO.BAS
-
- HiLite is a simple demonstration program of a method to highlight selected
- text. This is useful for menuing systems, pick lists and various other
- tasks when programing in QB. There are several programs within the Public
- Domain which accomplish the same task as HiLite; however, most of the other
- programs rely upon dimensioning string arrays which can add considerable
- overhead to programs and eat up valuable string storage space. HiLite does
- not "rewrite" string arrays using a highlight color, but rather Pokes a new
- color attribute at the proper offset to the video memory segment at &HB800.
- Therefore, it will function on all 4 text video pages of a CGA or better.
-
- When the highlight bar is repositioned by the cursor keys, HiLite Pokes the
- selected color attribute, first to the currently highlighted item to return
- it to its default colors, and then Pokes the selected color attribute to the
- newly highlighted item. The user will note that HiLite is set to one column
- lists. However, with very little effort, the Select Case Loop could be
- modified to allow for multiple column lists, and rows greater than the
- physical dimensions of the display screen.
-
- HiLite can be added to a Library, Loaded as a Subprogram within the QB
- Environment, or its object file linked with a program, from the Command
- Line.
-
- Declaration for HiLite, placed in your Program:
- DECLARE SUB HiLite (Row%,Col%,Length%,MaxRow%,DeAttr%,HiAttr%,RetCode%)
-
- Syntax for call to HiLite from your Program:
- HiLite Row%, Col%, Length%, MaxRow%, DeAttr%, HiAttr%, RetCode%
-
- Row% Row of the 1st item to be HiLited
- Col% Column where HiLiting will start
- Length% Length of the HiLite Bar
- MaxRow% Last row of the HiLite list
- DeAttr% Default Color Attribute of the HiLite List
- HiAttr% HiLite Color Attribute for the HiLite Bar
- RetCode% Value returned from HiLite to your program.
-
- If Enter is pressed HiLite returns to the calling program
- and the relative position of the selected item within the
- list is returned by RetCode%.
-
- If Esc is pressed HiLite returns to the calling program
- and the value -27 is returned by RetCode%.
-
- If Alt is pressed HiLite returns to the calling program
- and the value -8 is returned by RetCode%.
-
- Once again, these codes could be easily modified if so
- desired.
-
- Perusal of HILIDEMO.BAS should provide the user with a full understanding
- of how HiLite functions. Questions or comments are welcome.
-
- Dave Wright
- CIS 76635,1136
-
-