home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP5MENU.ZIP / MENUVARS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-01-22  |  8.1 KB  |  235 lines

  1. {
  2. Copyright (c) 1988 BittWare Computing, ALL RIGHTS RESERVED
  3. }
  4.  
  5. unit menuvars;
  6. {$v-}
  7. interface
  8. uses
  9.      dos,
  10.      crt;
  11. const
  12.         SynVarW         = 9;
  13.         MaxTextRow      = 25;
  14.         VarListMax      = 3;
  15.         MaxErrors       = 20;
  16.         NoError         = 0;
  17.         InvalidInput    = 1;
  18.         PathNotFound    = 2;
  19.         FileNotFound    = 3;
  20.         SeekPastHelp    = 4;
  21.         MaxIntHelp      = 4;
  22.         MaxHelpLines    = 4;
  23.         HelpLineWidth   = 70;
  24.         MaxHelpPages    = 5;
  25.         menu_min        = 1;
  26.         MonoLo          = 7;
  27.         MonoHi          = 15;
  28.         MaxTextWidth    = 15;
  29.         MaxMenuVarWidth = 14;
  30.         MenuMax         = 11;
  31.         HdrWidth        = 13;
  32.         HdrMax          = 6;
  33.         PickListWidth   = 14;
  34.         PickListStrW    = 13; {Width - 2 for separation}
  35.         PickListMaxStr  = 50;
  36.         MaxPathLength   = 50;
  37.  
  38.      InitYes = true;
  39.      InitNo  = false;
  40.      AutoOn  = true;
  41.      AutoOff = false;
  42.  
  43.      Undef               = 0;
  44.      RealCode            = 1;
  45.      IntCode             = 2;
  46.      LongintCode         = 3;
  47.      StringCode          = 4;
  48.  
  49.      FilePicked          = 0;
  50.      NoFilePicked        = 1;
  51.      NoFileFound         = 2;
  52.  
  53. type
  54.         linestrg = string[80];
  55.         title_type = string[60];
  56.         FileString = string[12];
  57.         PathString = string[MaxPathLength];
  58.         MenuString = string[MenuMax];
  59.         HelpMessType    = record
  60.                              NextRec:integer;  {NextRec = 0 if last, else}
  61.                              {NextRec = Seek Number of Next "Page" of Message}
  62.                              Str    :array[1..MaxHelpLines] of string[HelpLineWidth];
  63.                         end;
  64.  
  65.         HelpFileType = file of HelpMessType;
  66.  
  67.         screenptr = ^screentype;
  68.         screentype = array[1..25,1..80] of record
  69.                        ch :byte;
  70.                        at :byte;
  71.                      end;
  72.  
  73.         HalfScreenPtr = ^HalfScreenType;
  74.         HalfScreenType = array[1..2240] of byte;
  75.  
  76.         QuarterScreenPtr = ^QuarterScreenType;
  77.         QuarterScreenType = array[1..1000] of byte;
  78.  
  79.         EighthScreenPtr = ^EighthScreenType;
  80.         EighthScreenType = array[1..500] of byte;
  81.  
  82.         ConfirmScreenPtr = ^EighthScreenType;
  83.         ConfirmScreenType = array[1..200] of byte;
  84.  
  85.         InpStrPtr = ^InpStrType;
  86.         InpStrType = array[1..MenuMax] of record
  87.                        Str       :string[MaxMenuVarWidth];
  88.                        Typ       :byte;
  89.                        VarWidth  :byte;
  90.                     end;
  91.  
  92.         VarListPtr = ^VarListType;
  93.         VarListType = record
  94.                        Str    :array[1..VarListMax] of string[MaxTextWidth];
  95.                        Sel    :array[1..MenuMax] of byte;
  96.                        Max    :byte;
  97.                     end;
  98.  
  99.         MenuPtr         = ^MenuPtrType;
  100.         MenuPtrType     = record
  101.                              str             :array[1..MenuMax] of string[MaxTextWidth];
  102.                              SelPattern      :MenuString;
  103.                              PickKey         :string[MenuMax];
  104.                              max             :byte;
  105.                              EnLtRt          :boolean;
  106.                              sel             :byte;
  107.                              x               :byte;
  108.                              y               :byte;
  109.                              width           :byte;
  110.                              TxtLen          :byte;
  111.                              BorderBg        :byte;
  112.                              BorderFg        :byte;
  113.                              Fg              :byte;
  114.                              NoSelFg         :byte;
  115.                              SelBg           :byte;
  116.                              SelFg           :byte;
  117.                              NoSelBg         :byte;
  118.                              VarBg           :byte;
  119.                              VarFg           :byte;
  120.                              title           :title_type;
  121.                              ScreenBufPtr    :Pointer;
  122.                              VarPtr          :Pointer;
  123.                              OldWindMin      :word;
  124.                              OldWindMax      :word;
  125.                         end;
  126.         HdrPtr          = ^HdrPtrType;
  127.         HdrPtrType      = record
  128.                              str :array[1..HdrMax] of string[HdrWidth];
  129.                              max :integer;
  130.                              sel :byte;
  131.                              PickKey :string[HdrMax];
  132.                         end;
  133.         PickListPtr     = ^PickListPtrType;
  134.         PickListPtrType = record
  135.                              str :array[1..PickListMaxStr] of string[PickListStrW];
  136.                              max :integer;
  137.                              maxX :byte;
  138.                              sel :byte;
  139.                              y   :byte;
  140.                              x   :byte;
  141.                              title :title_type;
  142.                              ScreenBufPtr :Pointer;
  143.                              OldWindMin         :word;
  144.                              OldWindMax         :word;
  145.                              BorderBg   :byte;
  146.                              BorderFg   :byte;
  147.                              Fg         :byte;
  148.                              SelBg      :byte;
  149.                              NoSelBg    :byte;
  150.                              NoSelFg    :byte;
  151.                         end;
  152.  
  153.         MessagePtr      = ^MessagePtrType;
  154.         MessagePtrType  = record
  155.                              x            :byte;
  156.                              y            :byte;
  157.                              dx           :byte;
  158.                              dy           :byte;
  159.                              title        :title_type;
  160.                              ScreenBufPtr :Pointer;
  161.                              OldWindMin   :word;
  162.                              OldWindMax   :word;
  163.                              BorderBg     :byte;
  164.                              BorderFg     :byte;
  165.                              Fg           :byte;
  166.                              Bg           :byte;
  167.                              VarFg        :byte;
  168.                              VarBg        :byte;
  169.                              OldX         :byte;
  170.                              OldY         :byte;
  171.                         end;
  172.         ch_set = set of char;
  173.  
  174. var
  175.         Regs            :registers;
  176.         NumCharsSet     :ch_set;
  177.         PickListMaxX    :integer;
  178.         PickListMaxY    :integer;
  179.         ErrorNum        :integer;
  180.         HelpNum         :integer;
  181.  
  182. {auto, if true windows are not pulled open}
  183. {used for command files to pre-select menu choices}
  184.         Auto             :boolean;
  185.  
  186.         MaxHelps        :longint;
  187.         HelpFile        :file of HelpMessType;
  188.         HelpVar         :HelpMessType;
  189.         HelpFileFound   :boolean;
  190.  
  191.         DirInfo         :SearchRec;
  192.  
  193.         ErrorMessStr   :array[1..MaxErrors] of linestrg;
  194.         MenuSel         :byte;
  195.         PickListSel          :byte;
  196.  
  197. {crt vars}
  198.         Rtn2Main        :boolean;
  199.         TxtFg,TxtBg     :byte;
  200.         screen          :ScreenPtr;
  201.         HelpList        :MessagePtr;
  202.         ErrorList       :MessagePtr;
  203.         SkinnyIO        :MessagePtr;
  204.         SkinnySave      :QuarterScreenPtr;
  205.         MenuBorderBg    :byte;
  206.         MenuBorderFg    :byte;
  207.         MenuSelFg       :byte;
  208.         PickKeyFg       :byte;
  209.         MenuHiFg        :byte;
  210.         MenuLoFg        :byte;
  211.         MenuSelBg       :byte;
  212.         MenuNoSelBg     :byte;
  213.         MenuNoSelFg     :byte;
  214.         MenuVarBg       :byte;
  215.         MenuVarFg       :byte;
  216.         VarInpFg        :byte;
  217.         VarInpBg        :byte;
  218.         MainFg          :byte;
  219.         MainBg          :byte;
  220.         BottomFg        :byte;
  221.         BottomBg        :byte;
  222.  
  223.         CursStart       :byte;
  224.         CursEnd         :byte;
  225.  
  226. implementation
  227. begin
  228.      NumCharsSet := ['+','-','.','0'..'9','E',#13,#27,#8];
  229.      Auto        := false;
  230.      MainFg      := White;
  231.      MainBg      := Blue;
  232. end.
  233.  
  234.  
  235.