home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / mactool / thinkcgu.sit / app ƒ / apphelp < prev    next >
Encoding:
Text File  |  1991-02-25  |  7.1 KB  |  163 lines

  1. Help file for the "Application" project.
  2.  
  3. Ralph Gonzalez, PO Box 54, Newark, DE 19711, USA.
  4.  
  5.  
  6.  
  7. (Note: We'll call it the "App" project for short, but don't confuse this 
  8. with Apple's own Object Pascal MacApp application shell - see 
  9. References.)
  10.  
  11.  
  12. INTRODUCTION:
  13.  
  14. App is a simple interface class library intended to experiment with 
  15. alternative interfaces for text-based applications.  It was written with 
  16. the object-oriented Think C 4.0 compiler by Symantec Corp., using 
  17. Macintosh computers.  However, the code includes conditional compilation 
  18. directives to allow compilation on any computer with a C++ compiler, 
  19. without need for graphics capabilities.
  20.  
  21. You may develop a text-based application whose user interface component 
  22. is provided by the App library.  You can recompile your application with 
  23. a new interface by simply changing a single line in your source code.  
  24. The following interfaces are presently available: command-line, menu 
  25. list, and Macintosh-style pull-down menu (Macintosh computers only).  
  26. Thus, the App library serves as an object-oriented user interface 
  27. management system (UIMS).  (See References.)
  28.  
  29. Since the App library provides structure to the overall application, it 
  30. may also be considered an "application framework" similar to - but much 
  31. simpler than - Apple's MacApp application shell and Think's own Think 
  32. Class Library.
  33.  
  34.  
  35. DISTRIBUTION:
  36.  
  37. App may be distributed freely as long as this Help file is included.  It 
  38. is intended for educational use, although you may adapt if for 
  39. commercial use if you find it useful.  I would appreciate well- 
  40. documented copies of any App applications you come up with.  Users are 
  41. also encouraged to add functionality to the existing App library 
  42. (perhaps in the form of additional user interface alternatives).  Please 
  43. send any such additions to me, including documentation, so I can include 
  44. them for distribution.
  45.  
  46.  
  47. DESCRIPTION:
  48.  
  49. App consists of the following major classes:  Generic_Class, 
  50. Generic_App, Menu, Menu_App, Command_App, and Mac_App (not related to 
  51. Apple's MacApp Object Pascal class library).  The Menu and Generic_App 
  52. classes are descendants of Generic_Class.
  53.  
  54. The Generic_App class contains as an instance variable a Menu object 
  55. used to relate character strings representing command names to the 
  56. procedures which realize the commands.  In addition to initialization 
  57. and destruction methods, the Generic_App defines dummy run(), query(), 
  58. and respond() methods.  (These are virtual functions, so that the 
  59. corresponding methods of derived classes are invoked when appropriate.)  
  60. For the purposes of this study, query() and respond() methods are the 
  61. only means of communication between the application and the user.
  62.  
  63. The Menu_App, Command_App, and Mac_App classes derive from the 
  64. Generic_App, inheriting its instance variables and adding new data and 
  65. functionality.  Namely, these classes each override the run(), query(), 
  66. and respond() methods in order to implement menu-driven or command-line 
  67. applications.
  68.  
  69. Your completed application class ╤ say, Test_App ╤ must derive from 
  70. either the Menu_App, Command_App, or Mac_App class.  The Test_App 
  71. contains special-purpose instance variables appropriate to the 
  72. application, as well as special-purpose methods for each command the 
  73. application's user should invoke.  For example, if Test_App is a simple 
  74. database manager, its instance variables may contain data records (or a 
  75. data object or your own design) and its methods may include open_file(), 
  76. enter_data(), sort(), list_data(), save_file(), quit(), etc.  As stated 
  77. above, all user interaction in these methods must be accomplished using 
  78. the query() and respond() methods inherited from the parent class.  The 
  79. initialization method of Test_App should log the command names and 
  80. pointers of the functions realizing the commands into the Menu object 
  81. inherited from Generic_App.
  82.  
  83. If Test_App derives from Menu_App, then the Menu_App's run() method is 
  84. invoked when a Test_App object receives a 'run' message, and the 
  85. Menu_App's query() and respond() methods are used.  This run() method 
  86. allows the user to select a command from a hierarchical menu structure.  
  87. The appropriate Test_App special-purpose method is then invoked.  This 
  88. method may call the inherited respond() method, which writes its 
  89. argument string to the display.  The query() method does the same, and 
  90. returns a string entered by the user from the keyboard.
  91.  
  92. On the other hand, if Test_App derives from Command_App, then the 
  93. Command_App's run() method is invoked and different query() and 
  94. respond() methods are used.  This run() method simply prompts the user 
  95. for a command line.  The user enters a command name followed by a list 
  96. of arguments.  The appropriate Test_App special-purpose method is 
  97. invoked.  This method calls the inherited query() and respond() methods; 
  98. however, the argument string of the Command_App's query() method is not 
  99. echoed to the display, and strings returned by query() calls are 
  100. obtained in sequence from the command-line arguments.
  101.  
  102. Likewise, if Mac_App is the parent class of Test_App then a rudimentary 
  103. Macintosh-style pull-down menu interface is generated.
  104.  
  105. The programmer may convert the parent class of Test_App from Menu_App to 
  106. Command_App to Mac_App by changing a single line of the source code.
  107.  
  108.  
  109. FILES:
  110.  
  111. apphelp        this file
  112.  
  113. (The following files comprise the App library.  Please read the comments 
  114. in the source and header files of any classes you will override, 
  115. especially Generic_App and its descendants.)
  116.  
  117. app.h        defines Generic_App class
  118. app.c        method definitions for Generic_App
  119. class.h        defines Generic_Class, from which all classes derive.  
  120.         Also includes declarations for Think C/C++ compatibility
  121. class.c        methods for Generic_Class
  122. comapp.h    defines Command_App
  123. comapp.c    methods for Command_App
  124. comline.h    defines Comline, used by Command_App
  125. comline.c    Comline methods
  126. macapp.h    defines Mac_App (not related to Apple's MacApp)
  127. macapp.c    Mac_App methods
  128. menapp.h    defines Menu_App
  129. menu.h        defines Menu class, used by Generic_App
  130. menu.c        Menu methods
  131. menubar.h    defines Menu_Bar class, used by Mac_App
  132. menubar.c    Menu_Bar methods
  133. morestr.h    declares a few extra string-handling functions
  134. morestr.c    defines these functions
  135.  
  136. (The following files are used to demonstrate how to use the App library.  
  137. The Test_App application is a very simple database example, which makes 
  138. use of a Dfile - database file - object.  Comments in these files 
  139. indicate how to compile the application.)
  140.  
  141. dfile.h        defines the Dfile class, used by Test_App
  142. dfile.c        Dfile methods
  143. testapp.h    defines the Test_App, descended from any one of the 
  144.         three abstract App classes
  145. testapp.c    Test_App methods and command functions
  146.  
  147.  
  148. REFERENCES:
  149.  
  150. Thomas, J. J., and G. Hamlin, "Graphical Input Interaction Technique, 
  151. Workshop Summary", Computer Graphics, vol. 17, no. 1, pp. 16-20, ACM 
  152. 1983
  153.  
  154. Olsen, D. R., W. Buxton, R. Ehrich, D. J. Kasik, J. R. Rhyne, J. Sibert, 
  155. "A Context for User Interface Management", Computer Graphics and 
  156. Applications, vol. 4, no. 12, pp. 33-43, IEEE 1984
  157.  
  158. Schmucker, K. J., "MacApp: An Application Framework", Byte vol. 11, no. 
  159. 8, pp. 189-193, 1986
  160.  
  161. Lowgren, J., "History, State and Future of User Interface Management 
  162. Systems", SIGCHI Bulletin vol. 20, no. 1, pp. 32-44, 1988
  163.