home *** CD-ROM | disk | FTP | other *** search
- Program BigMenu;
- {$C-}
- {$R-}
- {$V-}
- {$I-}
- {$U-}
- { ***********************************************************************
- * *
- * This is the system main menu program. A window is printed on the *
- * screen and the menu is the printed inside the window. *
- * *
- * Additions made: Code for frame around menu has been commented out.*
- * Sound alarm has been commented out at end of main.*
- * *
- ***********************************************************************
- }
-
- const Windows = 1;
- Wtab : array [1..Windows,1..5] of Integer { X0,Y0,X1,Y1,LineNo }
- = ((2,3,78,21,1));
- Up = true;
- Down = false;
- MenuBackColor = 0;
- FrameColor = 12;
- MenuColor = 10;
- CommandColor = 12;
- { TIM = 30; {Sound duration in Miliseconds}
-
- type MaxString = string [255];
-
- var I : Integer;
- Ch : char;
- MenuFile : Text[$800];
- MenuRec : String[77];
-
- procedure Frame(UpperLeftX, UpperLeftY, LowerRightX, LowerRightY: Integer);
- var I : Integer;
-
- begin {Frame}
- { GotoXY(UpperLeftX, UpperLeftY);
- Write(chr(218));
- for I := (UpperLeftX + 1) to (LowerRightX - 1) do
- begin
- Write(chr(196));
- end;
- Write(chr(191));
- for I := (UpperLeftY + 1) to (LowerRightY - 1) do
- begin
- GotoXY(UpperLeftX , I); Write(chr(179));
- GotoXY(LowerRightX, I); Write(chr(179));
- end;
- GotoXY(UpperLeftX, LowerRightY);
- Write(chr(192));
- for I := (UpperLeftX + 1) to (LowerRightX - 1) do
- begin
- Write(chr(196));
- end;
- Write(chr(217));
- }
- end; {Frame}
-
- procedure MakeScreen;
-
- begin
- ClrScr;
- GotoXY(21,1);
- TextColor(9);
- Write('System Access Control Program v2.0');
- TextColor(CommandColor);
- GotoXY(22,23);
- Write('Enter Selection and Press ');
- TextColor(CommandColor + Blink);
- Write('<Return>');
- TextColor(CommandColor);
- I:=1;
- TextColor(FrameColor);
- Frame(Wtab[I,1] - 1, Wtab[I,2] - 1, Wtab[I,3] + 1, Wtab[I,4] + 1);
- end; {MakeScreen}
-
- procedure UpdateWindow (Win,StringLen: integer;Scroll: boolean);
-
- begin
- Assign(MenuFile,'MENU.DTA'); Reset(MenuFile);
- Window(2,3,78,21);
- GotoXY(1,2);
- TextBackground(MenuBackColor);
- ClrScr;
- TextColor(MenuColor);
- While not Eof(MenuFile) do
- begin
- ReadLn(MenuFile,MenuRec);
- Writeln(MenuRec);
- end;
- end; {UpdateWindow}
-
- procedure DrawWindows;
- begin
- GotoXY(1,1);
- UpdateWindow(1,55,Down);
- Window(1,1,80,25);
- GotoXY(1,24);
- end; {DrawWindows}
-
- begin { Program body }
- MakeScreen;
- DrawWindows;
- TextColor(2);
- { Sound(740); Delay(TIM); Sound(1040); Delay(TIM); NoSound;}
- end.