home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPMENU.ZIP / MENU.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1986-09-27  |  2.9 KB  |  110 lines

  1. Program BigMenu;
  2. {$C-}
  3. {$R-}
  4. {$V-}
  5. {$I-}
  6. {$U-}
  7. { ***********************************************************************
  8.   *                                                                     *
  9.   *   This is the system main menu program.  A window is printed on the *
  10.   *   screen and the menu is the printed inside the window.             *
  11.   *                                                                     *
  12.   *   Additions made: Code for frame around menu has been commented out.*
  13.   *                   Sound alarm has been commented out at end of main.*
  14.   *                                                                     *
  15.   ***********************************************************************
  16. }
  17.  
  18. const  Windows       = 1;
  19.        Wtab       : array [1..Windows,1..5] of Integer  { X0,Y0,X1,Y1,LineNo }
  20.                      =   ((2,3,78,21,1));
  21.        Up            = true;
  22.        Down          = false;
  23.        MenuBackColor = 0;
  24.        FrameColor    = 12;
  25.        MenuColor     = 10;
  26.        CommandColor  = 12;
  27. {       TIM           = 30;     {Sound duration in Miliseconds}
  28.  
  29. type   MaxString  = string [255];
  30.  
  31. var    I          : Integer;
  32.        Ch         : char;
  33.        MenuFile   : Text[$800];
  34.        MenuRec    : String[77];
  35.  
  36. procedure Frame(UpperLeftX, UpperLeftY, LowerRightX, LowerRightY: Integer);
  37. var  I : Integer;
  38.  
  39. begin {Frame}
  40. {  GotoXY(UpperLeftX, UpperLeftY);
  41.   Write(chr(218));
  42.   for I := (UpperLeftX + 1) to (LowerRightX - 1) do
  43.   begin
  44.     Write(chr(196));
  45.   end;
  46.   Write(chr(191));
  47.   for I := (UpperLeftY + 1) to (LowerRightY - 1) do
  48.   begin
  49.     GotoXY(UpperLeftX , I);  Write(chr(179));
  50.     GotoXY(LowerRightX, I);  Write(chr(179));
  51.   end;
  52.   GotoXY(UpperLeftX, LowerRightY);
  53.   Write(chr(192));
  54.   for I := (UpperLeftX + 1) to (LowerRightX - 1) do
  55.   begin
  56.     Write(chr(196));
  57.   end;
  58.   Write(chr(217));
  59.   }
  60. end; {Frame}
  61.  
  62. procedure MakeScreen;
  63.  
  64. begin
  65.   ClrScr;
  66.   GotoXY(21,1);
  67.   TextColor(9);
  68.   Write('System Access Control Program   v2.0');
  69.   TextColor(CommandColor);
  70.   GotoXY(22,23);
  71.   Write('Enter Selection and Press ');
  72.   TextColor(CommandColor + Blink);
  73.   Write('<Return>');
  74.   TextColor(CommandColor);
  75.   I:=1;
  76.   TextColor(FrameColor);
  77.   Frame(Wtab[I,1] - 1, Wtab[I,2] - 1, Wtab[I,3] + 1, Wtab[I,4] + 1);
  78. end; {MakeScreen}
  79.  
  80. procedure UpdateWindow (Win,StringLen: integer;Scroll: boolean);
  81.  
  82. begin
  83.   Assign(MenuFile,'MENU.DTA');  Reset(MenuFile);
  84.   Window(2,3,78,21);
  85.   GotoXY(1,2);
  86.   TextBackground(MenuBackColor);
  87.   ClrScr;
  88.   TextColor(MenuColor);
  89.   While not Eof(MenuFile) do
  90.   begin
  91.      ReadLn(MenuFile,MenuRec);
  92.      Writeln(MenuRec);
  93.   end;
  94. end; {UpdateWindow}
  95.  
  96. procedure DrawWindows;
  97. begin
  98.   GotoXY(1,1);
  99.   UpdateWindow(1,55,Down);
  100.   Window(1,1,80,25);
  101.   GotoXY(1,24);
  102. end; {DrawWindows}
  103.  
  104. begin { Program body }
  105.   MakeScreen;
  106.   DrawWindows;
  107.   TextColor(2);
  108. {  Sound(740); Delay(TIM); Sound(1040); Delay(TIM); NoSound;}
  109. end.
  110.