Litebox
'`'`'`'

(c) 1999 Michael Preslar of Elysium Software

What it is
'`'`'`'`'`
Litebox.pas is a Turbo Pascal 7.0 unit that lets you easily add litebar
support to your programs. It has hotkey support and can do up to 25 items
at a time.

litebox2.pas is a Turbo Pascal 7.0 unit that lets you add litebar support
for as many items as you like. Its a bit more complex to use, but can do
more than 25 items at a time.

Legal
'`'`'
I end up using the one of these units in almost all of my config programs.
I originally wrote them a good 2 years ago, and have tweaked them over time.
Although I use them on a normal basis, I cant promise this unit to do
anything. If you have suggestions or find a bug, let me know.

Ive supplied the source code so that you can learn how to do litebars. This
does NOT mean you can claim the code to be your own. If you use this unit,
or a modified version, I ask that you say "thanks" to me in your docs.

Usage
'`'`'
The best way to see how to use litebox is by looking at liteex.pas .. Its an
example program using litebox. Using litebox2 isnt as easy as using litebox,
but its still rather simple..

Let me explain a few things.

The following type will have to be set for EACH item.

type   mrec=record
         skip:boolean; {allows you to have "blank lines"}
         name:string;  {what the end user will see}
         letter:char;  {the hotkey for this item if needed}
         x,y:byte;     {litebox2 only! the coordinates for the item}
         end;

 literec = Record   {Litebar config rec}
              choices: Integer; {how many choices will this litebar have?}
              menu: Array [1..25] Of mrec; {the items. change 25...}
              keycolor, {the color of the ( ) around the hot key letter}
              othercolor, {color of un-highlighted item}
              barcolor: Integer; {background color of highlighted item}
              usehotkeys:boolean; {true or false?}
            End;

And now a couple of notes..

litebox and litebox2
'`'`'`'`'`'`'`'`'`'`
1) Youll want to change background color back to whatever you use after the
call to litebar().
2) I highly recommend using pointers for your literec variable..
3) Youll notice hitting a function key will return some negative value.
You could use those negative keys for something like.. "Hit F1 for help"..
4) Hitting ESC while in the litebar routine will give you the last item.

litebox
'`'`'`'
1) Youll notice that it supports the keys 8 and 2.. meaning, the end user
could hit 8 to move up, and 2 to go down. You could leave that in, and NOT
use those chars as hotkeys, or take them out, and use them as hotkeys.

litebox2
'`'`'`'`
1) Litebox2 doesnt do the 8 and 2 thing.
2) The hard part about using litebox2 is that you have to handle left and
right moves. As in, if the user is on item #33 at 22 over, 10 down, where
will the litebar go if he hit the left arrow key? How would you set it?
Try something like..

repeat
 choice:litebar(litecfg);
 case choice of
 -11: case lastone of
       33: on:=23;
       blah blah
       else
       on:=1; {this is important}
       end;{case}
 end;{case}
until choice:=litecfg.choices; {i always make the last option 'Quit'}

wal-la..

Comments, feedback, etc
'`'`'`'`'`'`'`'`'`'`'`'
If you should happen to desire my attention..

Email: e_maus@covingtononline.com
ICQ: 9590896
irc: irc.tal-on.com .. look for E_Maus in #Elysium

in fido's doorgame and lord related echos..

