home *** CD-ROM | disk | FTP | other *** search
- {Demonstration program for the EBMenu function. Just compile this and
- run it to see some simple samples of how this function can be used. }
-
- { Author: Ed Bachmann 5/28/85
- 9421 Mellenbrook Rd.
- Columbia,Md. , 21045
- Please send comments and suggestions to me on one
- of the following remote bulletin board systems:
- Elkridge-All-Purpose (301) 796-1223
- Capital PC Stat SIG (301) 596-3569
- Forbin Project (319) 266-8086
- }
-
- (*$IEBMENU.PAS*) {this file must be on your Turbo current directory}
-
- var
- ActionCode1,ActionCode2,ActionCode3 : integer;
- Fcolor,Bcolor,NewFcolor,NewBcolor : Byte;
- BlinkOn : Boolean;
-
- begin
- Textcolor(Black);
- TextBackground(White);
- BlinkOn:=False;
- ClrScr;
- GotoXY(1,6);
- Write(' Hello, This Is a Demonstration of the EBMenu Turbo Pascal Function.');
- GotoXY(1,10);
- Write(' What type of monitor are you using? (Use the Cursor Keys to Change Selection.)');
- ActionCode1:=0;
- Repeat
- { force user to select a field, use lines 12 and 14, start w/ No}
- ActionCode1:=EBMenu(2,12,14,White,Black,0,2,
- ' Are You Using A Color Monitor? ',
- 'Yes No',
- ' Press the enter key to set up the demo for a Color Monitor.',
- ' Press the enter key to set up the demo for a Monochrome or B/W Monitor.',
- '3','4','5','6','7','8','9','10');
- Until ActionCode1<>0;
- Fcolor:=White;
- Bcolor:=Black;
- ClrScr;
- if ActionCode1=1 then Bcolor:=Blue;
- ActionCode1:=1;
- while (ActionCode1<>5) do
- begin
- TextBackground(Black);
- TextColor(White);
- GotoXY(1,6);
- TextBackground(Bcolor);
- TextColor(Fcolor);
- if BlinkOn then TextColor(Fcolor+Blink);
- Write(' Demonstration of the EBMenu Turbo Pascal Function.');
- ClrEol;
- {escape not allowed, use line 1 & 2, start at last returned
- menu item number }
- ActionCode1:=EBMenu(2,1,2,Fcolor,Bcolor,ActionCode1,5,
- ' Do You Want To:',
- ' Change-Colors Beep Flash Sound End-Demo',
- ' Change the forground and background colors.',
- ' Make your PC sound the Beep Tone.',
- ' Set Blinking of the line below on or off.',
- ' Make your PC whine a little bit.',
- ' Terminate the demo.','6','7','8','9','10');
- Case ActionCode1 of
- 1 : begin
- ActionCode2:=1;
- NewFcolor:=Fcolor;
- NewBcolor:=BColor;
- while (ActionCode2>0) and (ActionCode2<3) do
- begin
- GotoXY(1,20);
- Write(' Forground color: ',NewFcolor,' ');
- if NewFcolor>7 then Write('Bright ');
- case (NewFcolor mod 8) of
- 0 : Write('Black');
- 1 : Write('Blue');
- 2 : Write('Green');
- 3 : Write('Cyan');
- 4 : Write('Red');
- 5 : Write('Magenta');
- 6 : Write('Brown');
- 7 : Write('White');
- end;
- Write('; Background color: ',NewBcolor,' ');
- case NewBcolor of
- 0 : Write('Black');
- 1 : Write('Blue');
- 2 : Write('Green');
- 3 : Write('Cyan');
- 4 : Write('Red');
- 5 : Write('Magenta');
- 6 : Write('Brown');
- 7 : Write('White');
- end;
- ClrEol;
- {escape IS allowed, use lines 1 & 2, start at last code
- returned }
- ActionCode2:=EBMenu(1,1,2,Fcolor,Bcolor,ActionCode2,5,
- ' Color setting:',
- ' Forground Background MonoChrome Abort Set-Them-And-Exit',
- ' Change the forground colors.',
- ' Change the Background colors.',
- ' Change to Black on White.',
- ' Do not do any color changes - even if you have set new ones.',
- ' Do the color changes and exit from the color setting menu.',
- '6','7','8','9','10');
- case ActionCode2 of
- 1 : begin
- {escape IS allowed, use line 3 (no explanation), start at
- last color set menu item number }
- ActionCode3:=EBMenu(3,3,0,Fcolor,Bcolor,(NewFcolor+1),8,
- ' Forground Color:',
- ' 0-Black 1-Blue 2-Green 3-Cyan 4-Red 5-Magenta 6-Brown 7-White',
- '1','2','3','4','5','6','7','8','9','10');
- if ActionCode3>58 then
- begin
- if ActionCode3=68 then ActionCode3:=58; {change F10}
- ActionCode3:=ActionCode3-57; {convert f1-f10 to 2-11}
- if (ActionCode3>8) then ActionCode3:=0;
- end;
- if (ActionCode3>0) then NewFcolor:=ActionCode3-1;
- {escape IS allowed, use lines 4 & 5,
- start at 1 always }
- ActionCode3:=EBMenu(1,4,5,Fcolor,Bcolor,1,2,
- ' Do You Want them bright?',
- ' Yes No',
- ' Use Bright Colors.','Use Normal Intensity Colors',
- '3','4','5','6','7','8','9','10');
- case ActionCode3 of
- 1 : NewFcolor:=(NewFcolor mod 8) + 8;
- 2 : NewFcolor:=(NewFcolor mod 8);
- end;
- end;
- 2 : begin
- {escape IS allowed & function keys also work,
- use line 5 (no explanation), start at
- last color set menu item number }
- ActionCode3:=EBMenu(3,5,0,Fcolor,Bcolor,(NewBcolor+1),8,
- ' Background Color:',
- ' 0-Black 1-Blue 2-Green 3-Cyan 4-Red 5-Magenta 6-Brown 7-White',
- '1','2','3','4','5','6','7','8','9','10');
- if ActionCode3>58 then
- begin
- if ActionCode3=68 then ActionCode3:=58; {change F10}
- ActionCode3:=ActionCode3-57; {convert f1-f10 to 2-11}
- if (ActionCode3>8) then ActionCode3:=0;
- end;
- if (ActionCode3>0) then NewBcolor:=ActionCode3-1;
- end;
- 3 : begin
- Fcolor:=White;
- Bcolor:=Black;
- end;
- 5 : begin
- If NewFcolor=NewBcolor then
- begin
- ActionCode3:=1;
- Write(^G);
- end
- else
- begin
- Fcolor:=NewFcolor;
- Bcolor:=NewBcolor
- end;
- end;
- end;
- end
- end;
- 2 : Write(^G);
- 3 : Begin
- if BlinkOn then BlinkOn:=False
- else BlinkOn:=True;
- end;
- 4 : begin
- for ActionCode3:=500 to 2000 do
- begin
- Sound(ActionCode3);
- Delay(1);
- end;
- NoSound;
- end;
- end; {end of case}
- end;
- GotoXY(1,21);
- WriteLn('Thanks for trying EBMenu. Hope it can be of use. Do with it as you will.');
- WriteLn(' Ed Bachmann 5/28/85');
- end.
- me for display}
- while not ExitMenu do
- begin
- while Ch1=chr(222) do
- begin
- if keypressed then