home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 02a / pull55.zip / P55-VAR.INC < prev    next >
Text File  |  1989-08-24  |  9KB  |  290 lines

  1. { =========================================================================== }
  2. { P55-var.inc - Variables for Multi-level pull-down menus.  ver 5.5, 08-24-89 }
  3. {                                                                             }
  4. { This file contains all the variables needed for PULL55.TPU.  You cannot     }
  5. { change this file unless you have the complete PULL55.PAS source code.       }
  6. {   Copyright (c) 1987-1989 James H. LeMay, All rights reserved.              }
  7. { =========================================================================== }
  8.  
  9. { ================== Data Structure Configuration Constants ================= }
  10. const
  11.   NumOfMainMenus   =   8;    { 1 - 255 }
  12.   NumOfSubMenus    =   5;    { 1 - 255 }
  13.   MaxMenuLines     =  15;    { For Main and Sub menus }
  14.   MaxCharsPerLine  =  20;    { For Main and Sub menus, and Data Window titles }
  15.  
  16.   NumOfDataWndws   =  16;    { 1 - 255 }
  17.   NumOfDataEntries =  10;    { 1 - 255 }
  18.   DataStrSize      = 100;    { Max chars in data entry string }
  19.  
  20.   NumOfHelpWndws   =  14;    { 1 - 255 }
  21.   TotalHelpLines   =  89;    { 1 - 65535 }
  22.   HelpCharsPerLine =  50;    { 1 - Screen limit }
  23.  
  24.   NumOfMsgLines    =  11;    { 1 - 255 }
  25.   CrtStrSize       =  80;    { Screen limit for sizing strings }
  26.   NumOfErrMsgLines =   7;    { 1 - 65535 }
  27.   ErrStrSize       =  60;    { Error messages are usually short }
  28.  
  29. { ========================= Declarations for Menus ========================== }
  30. type
  31.   MenuModeType   = (ExecChoice, SingleChoice, MultipleChoice);
  32.   LineModeType   = (Choice, ExecOnly, NoChoice, Comment, Partition,
  33.                     ToDataWndw, ToSubMenu, ToUserWndw);
  34.   ProcPtrType    = pointer;
  35.   Toggle         = (Off, On, No, Yes);
  36.   CrtStrType     = string[CrtStrSize];
  37.   SeqStrType     = string[MaxWndw];
  38.   MenuRec =
  39.     record
  40.       Title:       string[MaxCharsPerLine];
  41.       CmdLtrs:     string[MaxMenuLines];
  42.       Line:        array[1..MaxMenuLines] of string[MaxCharsPerLine];
  43.       LineMode:    array[1..MaxMenuLines] of LineModeType;
  44.       Flagged:     array[1..MaxMenuLines] of boolean;
  45.       LinkNum:     array[1..MaxMenuLines] of byte;
  46.       ProcPtr:     array[1..MaxMenuLines] of ProcPtrType;
  47.       ParentDir,
  48.       LinkDir:     DirType;
  49.       MenuMode:    MenuModeType;
  50.       MenuLines:   byte;
  51.       NameCol:     byte;
  52.       Row, Col, Rows, Cols:                    byte;
  53.       DefaultLine, HiLiteLine, SingleFlagLine: byte;
  54.       Battr, Wattr, Hattr, Lattr, Cattr:       byte;
  55.       Border:                                  Borders;
  56.       BackToDefault, Changed:                  boolean;
  57.       MsgLineNum, HelpWndwNum:                 byte;
  58.     end;
  59.   MenuRecs = array[1..NumOfMainMenus] of MenuRec;
  60.  
  61. var
  62.   MainMenu:        ^MenuRecs;
  63.   TopMenu:         MenuRec;
  64.   MRI:             word;        { Top menu record index }
  65.   LastMainMenu:    byte;        { <= NumOfMainMenus }
  66.   TopLineStr:      CrtStrType;
  67.   TopLineRow,
  68.   MainMenuRow,
  69.  
  70.   InitAttr,
  71.   TopLineAttr,
  72.   TopLineHattr,
  73.   TopLineLattr,
  74.   MainMenuWattr,
  75.   MainMenuBattr,
  76.   MainMenuHattr,
  77.   MainMenuLattr,
  78.   MainMenuCattr:   byte;
  79.   MainMenuBrdr:    Borders;
  80.  
  81.   Key:             char;
  82.   ExtKey:          boolean;
  83.  
  84.   { -- Control Flags to Pull/Pop the menus. -- }
  85.   PullDown,
  86.   Pop,
  87.   PopToWorkWndw,
  88.   PopToTop,
  89.   PopAndProcess:   boolean;
  90.   PopLevels:       byte;
  91.  
  92.   { -- Variables to indicate location of menus and windows. -- }
  93.   TopCmdLtrs:      string[NumOfMainMenus];
  94.   CmdSeq,
  95.   MoreCmdSeq:      SeqStrType;  { Sequence of keys pressed. }
  96.   MPulled,
  97.   SPulled,
  98.   HiLited:         byte;
  99.   AccessedWorkWndw,
  100.   AccessedMenus:   boolean;
  101.   WorkWndwStep:    word;
  102.   TopWorkWndwName: WindowNames;
  103.  
  104.   { -- These are addresses for the indirect forward calls out of PULL.TPU -- }
  105.   AddrGetUserPullStats,
  106.   AddrGetOverrideStats,
  107.   AddrCheckGlobalKeys,
  108.   AddrWorkWndw,
  109.   AddrKbdIdle:     pointer;
  110.  
  111. const
  112.   InWorkWndw:      boolean = true;
  113.   Quit:            boolean = false;
  114.   WaitForKbd:      boolean = true;
  115.  
  116.   { -- Function keys -- }
  117.   HelpKey = #59;    { F1 }
  118.   PopKey  = #60;    { F2 }
  119.   TopKey1 = #68;    { F10 }  { Extended function key }
  120.  
  121.   { -- Data Entry keys -- }
  122.   NullKey  = #00;
  123.   RetKey   = #13;   { ^M }
  124.   BSKey    = #08;
  125.   EscKey   = #27;   { ^[ }
  126.   HomeKey  = #71;
  127.   UpArrKey = #72;
  128.   PgUpKey  = #73;
  129.   LArrKey  = #75;
  130.   RArrKey  = #77;
  131.   EndKey   = #79;
  132.   DnArrKey = #80;
  133.   PgDnKey  = #81;
  134.   InsKey   = #82;
  135.   DelKey   = #83;
  136.   CtrlLArrKey = #115;
  137.   CtrlRArrKey = #116;
  138.   CtrlEndKey  = #117;
  139.   CtrlPgDnKey = #118;
  140.   CtrlHomeKey = #119;
  141.   CtrlPgUpKey = #132;
  142.   TabKey      = #9;
  143.   ShiftTabKey = #15;
  144.  
  145. { ========================= SubMenu Declarations ============================ }
  146. {$ifdef UseSubMenuCode }
  147. type
  148.   SubMenus = array[1..NumOfSubMenus]  of MenuRec;
  149.  
  150. var
  151.   SubMenu:         ^SubMenus;
  152.   LastSubMenu:     byte;        { <= NumOfSubMenus }
  153.   SubMenuWattr,
  154.   SubMenuBattr,
  155.   SubMenuHattr,
  156.   SubMenuLattr,
  157.   SubMenuCattr:    byte;
  158.   SubMenuBrdr:     Borders;
  159.   LocationWarning: boolean;
  160. {$endif }
  161.  
  162. { ====================== Message Line Declarations ========================== }
  163. {$ifdef UseMsgLineCode }
  164. type
  165.   ErrMsgStrType = string[ErrStrSize];
  166.  
  167. const
  168.   CurrentMsgLineNum: word    = 0;   { Index of the message currently shown. }
  169.   EnableKeyStatus:   boolean = true;
  170.  
  171. var
  172.   MsgLine:         array[1..NumOfMsgLines]    of CrtStrType;
  173.   ErrMsgLine:      array[1..NumOfErrMsgLines] of ErrMsgStrType;
  174.   MsgLineRow,
  175.   CapsLockCol,
  176.   ErrMsgAttr,
  177.   KeyStatusAttr,
  178.   MsgLineAttr:     byte;
  179. {$endif }
  180.  
  181. { ======================== Help Window Declarations ========================= }
  182. {$ifdef UseHelpWndwCode }
  183. type
  184.   HelpWndwRec =
  185.     record
  186.       FirstLine, LastLine:      byte;
  187.       LinesToShow:              byte;
  188.       Row, Col, Rows, Cols:     byte;
  189.       Battr, Wattr:             byte;
  190.       Border:                   Borders;
  191.       HWmodes:                  byte;
  192.       MsgLineNum:               byte
  193.     end;
  194.  
  195. var
  196.   HelpWndw:        array[1..NumOfHelpWndws] of HelpWndwRec;
  197.   HelpLine:        array[1..TotalHelpLines] of string[HelpCharsPerLine];
  198.   HelpBottomRow,
  199.   HelpWndwModes,
  200.   HelpMsgLineNum,
  201.   HelpWndwWattr,
  202.   HelpWndwBattr:   byte;
  203.   HelpWndwBrdr:    Borders;
  204. {$endif }
  205.  
  206.  
  207. { ======================== Data Windows and Data Entry ====================== }
  208. {$ifdef UseDataEntryCode }
  209. type
  210.   TypeOfDataType = (
  211.     Bytes,Words,ShortInts,Integers,LongInts,Reals,UserNums,Chars,Strings);
  212.   SetNames = (
  213.     NoSet,UnsignedSet,SignedSet,RealSet,CharSet,HexSet,FileNameSet,PathSet,
  214.     MaskSet);
  215.   EntrySetArray  = array[UnsignedSet..MaskSet] of set of char;
  216.   DataEntryRec =
  217.     record
  218.       VarAddr:                  pointer;
  219.       TypeOfData:               TypeOfDataType;
  220.       Row,Col,Field,MaxField:   byte;
  221.       Decimals:                 shortint;
  222.       SetName:                  SetNames;
  223.       TranslateProc,
  224.       CheckRangeProc:           ProcPtrType;
  225.       JustifyOutput:            DirType;
  226.       Oattr, Iattr,
  227.       MsgLineNum, HelpWndwNum:  byte;
  228.     end;
  229.   DataWndwRec =
  230.     record
  231.       Title:  string[MaxCharsPerLine];
  232.       DWrow,DWcol: byte;
  233.       Battr:  byte;
  234.       Border: Borders;
  235.       Entry:  DataEntryRec;
  236.     end;
  237.   DataWndws   = array[1..NumOfDataWndws]   of DataWndwRec;
  238.   DataEntries = array[1..NumOfDataEntries] of DataEntryRec;
  239.   DataStrType = string[DataStrSize];
  240.   DataPadRec =
  241.     record
  242.       StoreMode,Valid,DataStored,NewData,PullDW: boolean;
  243.       FieldIndex,CursorOfs,Hattr: integer;
  244.       ErrMsg:  word;
  245.       Flex:    byte;
  246.       Justify: DirType;
  247.       case TypeOfDataType of
  248.         Bytes:        (Bdata:  byte);
  249.         Words:        (Wdata:  word);
  250.         ShortInts:    (SIdata: shortint);
  251.         Integers:     (Idata:  integer);
  252.         LongInts:     (Ldata:  longint);
  253.         Reals:        (Rdata:  real);
  254.         UserNums:     (UNdata: DataStrType);
  255.         Chars:        (Cdata:  char);
  256.         Strings:      (Sdata:  DataStrType);
  257.     end;
  258.  
  259. const
  260.   { -- Filter sets for valid data entry characters -- }
  261.   EntrySet:  EntrySetArray = (
  262.    { -- Reserved sets -- }
  263.    { UnsignedSet: } ['0'..'9'],
  264.    { SignedSet:   } ['0'..'9','-','+'],
  265.    { RealSet:     } ['0'..'9','-','+','.','E','e'],
  266.    { CharSet:     } [' '..'~'],
  267.    { -- User customized sets -- }
  268.    { HexSet:      } ['0'..'9','A'..'F','a'..'f'],
  269.    { FileNameSet: }
  270.      ['!','#'..')','-'..'.','0'..'9','@'..'Z','^'..'{','}'..'~'],
  271.    { PathSet:     }
  272.      ['!','#'..')','-'..'.','0'..':','@'..'Z','^'..'{','}'..'~','\'],
  273.    { MaskSet:     }
  274.      ['!','#'..'*','-'..'.','0'..':','?'..'Z','^'..'{','}'..'~','\']);
  275.  
  276. var
  277.   DWI:             word;        { Top data window record index }
  278.   DEI:             word;        { Top data entry record index }
  279.   TopDataWndw:     DataWndwRec;
  280.   TopEntry:        DataEntryRec;
  281.   DataWndw:        ^DataWndws;
  282.   DataEntry:       ^DataEntries;
  283.   DataStr:         DataStrType;
  284.   DataStrL:        byte absolute DataStr;  { length of DataStr }
  285.   DataPad:         DataPadRec;
  286.   AutoTab,
  287.   AutoNumLock:     boolean;
  288.  
  289. {$endif UseDataEntryCode }
  290.