home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / hl10osrc.lzh / Include / CommandScreen.h < prev    next >
Text File  |  1994-04-23  |  1KB  |  66 lines

  1. /* -*- Mode: C -*- */
  2. /* CommandScreen.h - CommandScreen class - command menu loop
  3.  * Created by Robert Heller on Wed Dec 11 19:34:26 1991
  4.  *
  5.  * ------------------------------------------------------------------
  6.  * Home Libarian by Deepwoods Software
  7.  * Common Header Files
  8.  * ------------------------------------------------------------------
  9.  * Modification History:
  10.  * ------------------------------------------------------------------
  11.  * Contents:
  12.  * ------------------------------------------------------------------
  13.  * 
  14.  * 
  15.  * Copyright (c) 1991,1992 by Robert heller (D/B/A Deepwoods Software)
  16.  *        All Rights Reserved
  17.  * 
  18.  */
  19.  
  20. #ifndef _COMMANDS_
  21. #define _COMMANDS_
  22. #include <stream.h>
  23. #include <common.h>
  24. #include <ctype.h>
  25. #include <Terminal.h>
  26.  
  27. const TextWidth = 80;
  28. const MaxNumCommands = 20;
  29.  
  30. typedef int (*CommandFunction)();
  31.  
  32. struct CommandDescr {
  33.     char Text[TextWidth];
  34.     CommandFunction Function;
  35.     int LineNumber;
  36. };
  37.  
  38. class CommandScreen {
  39.     int NumCommands;
  40.     int currentCommand;
  41.     CommandDescr CommandSpecs[MaxNumCommands];
  42.     char Title[80];
  43.     void HiliteCommand(int Command,Boolean hilite);
  44. public:
  45.     friend class Terminal;
  46.     int Commands    () {return NumCommands;}
  47.     int CurrentCommand () {return currentCommand;}
  48.         CommandScreen(const char* title,int numcommds,
  49.               CommandDescr *commands);
  50.     int RunScreen ();
  51.     void RePaint();
  52. };
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. #endif  
  66.