home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / cddk9605.zip / HEADERS.ARJ / DMENUS.INT < prev    next >
Text File  |  1996-05-17  |  4KB  |  88 lines

  1.  
  2. { ───────────────────────────────────────────────────────────────────────── }
  3. {  Name        : DMENUS.PAS                                                 }
  4. {  Description : A simple menu system for door games * UNDER CONSTRUCTION * }
  5. { ───────────────────────────────────────────────────────────────────────── }
  6.  
  7. { Contact David Pinch if you wish to use this menu system in your door
  8.   game.  We will help you with the menu script system, which is not
  9.   documented in this version of Concerto. }
  10.  
  11. UNIT DMenus;
  12.  
  13. {$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
  14. {$F+} { . . . . . . . . . . . . . . . . . . . .  Force far calls for safety }
  15. {$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
  16. {$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
  17. {$Q-} { . . . . . . . . . . . . . .  Do not generate overflow-checking code }
  18. {$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
  19. {$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
  20. {$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
  21.  
  22. INTERFACE
  23.  
  24. USES
  25.   Objects, Scripts;
  26.  
  27. TYPE
  28.  
  29.   tMenuItem = OBJECT(tObject)
  30.     Id   : Byte;                      { . . . . . . . . . . . . Return code }
  31.     Bar  : pChar;                     { . . . .  Text shown in the lightbar }
  32.     Exec : pChar;                     { . . . . . . . . . Optional commands }
  33.     Key  : pChar;                     { . . . . . . . . . . . . . .  Hotkey }
  34.     Text : pChar;                     { . . . . . . . . . . . . . Help text }
  35.     CONSTRUCTOR Init(i:Byte; b,e,k,t:pChar);
  36.     DESTRUCTOR Done; VIRTUAL;
  37.     END;
  38.  
  39.   pMenuItem = ^tMenuItem;
  40.  
  41.   tMenu = OBJECT(tID)
  42.  
  43.     Columns   : Byte;        { .  Number of columns of the internal display }
  44.     Current   : Byte;        { . . . . . . . . Current item in the lightbar }
  45.     Draw      : pChar;       { . . . . . . . . . . . . . . . Drawing script }
  46.     FileName  : pChar;       { . . . . . . . . . . . . Location of MNU file }
  47.     Format    : pChar;       { . . . . . . . Format of the internal display }
  48.     Internal  : Boolean;     { . . . . . . . . . . . .  Draw internal menu? }
  49.     Items     : pCollection; { . . . . . . . . . . Collection of menu items }
  50.     LightBar  : Boolean;     { . . . . . . . Use the lightbar entry method? }
  51.     Pressed   : Char;        { . . . . . . . . . . . Last character pressed }
  52.     Prompt    : pChar;       { . . . Prompt shown on the bottom of the menu }
  53.     StartAt   : Byte;        { . . . .  Starting point of the lightbar menu }
  54.  
  55.     CONSTRUCTOR Init(Name,Path:pChar);
  56.  
  57.     PROCEDURE AddItem(i:Byte; b,c,k,t:pChar);
  58.  
  59.     PROCEDURE Defaults;                  { . . . . . Assigns default values }
  60.     PROCEDURE DrawMenu;                  { . . . . . . . . . Draws the menu }
  61.     PROCEDURE DrawPrompt;                { . . . . .  Draws the menu prompt }
  62.     PROCEDURE Load;                      { . . . . . . .  Loads an MNU file }
  63.     FUNCTION  Run:Byte;                  { . . . . . . .  Executes the menu }
  64.     PROCEDURE ShiftLightBar(n:ShortInt); { . . . . . .  Shifts the lightbar }
  65.     PROCEDURE Update(b,e,k,t:pChar);     { . . . . .  Updates the last item }
  66.     FUNCTION  Valid:Boolean;             { .  Returns validity of keystroke }
  67.  
  68.     DESTRUCTOR Done; VIRTUAL;
  69.     END;
  70.  
  71.   pMenu = ^tMenu;
  72.  
  73.  
  74. PROCEDURE RegisterMenu(Name,PathName:pChar);
  75.   {
  76.   PURPOSE  : Registers a menu with the system.
  77.  
  78.   NOTES    : The menu is immediately loaded but *NOT* executed.
  79.   }
  80.  
  81.  
  82. FUNCTION RunMenu(Name:pChar):Byte;
  83.   {
  84.   PURPOSE  : Executes a previously loaded menu.
  85.   }
  86.  
  87.  
  88.