home *** CD-ROM | disk | FTP | other *** search
- Help file for the "Application" project.
-
- Ralph Gonzalez, PO Box 54, Newark, DE 19711, USA.
-
-
-
- (Note: We'll call it the "App" project for short, but don't confuse this
- with Apple's own Object Pascal MacApp application shell - see
- References.)
-
-
- INTRODUCTION:
-
- App is a simple interface class library intended to experiment with
- alternative interfaces for text-based applications. It was written with
- the object-oriented Think C 4.0 compiler by Symantec Corp., using
- Macintosh computers. However, the code includes conditional compilation
- directives to allow compilation on any computer with a C++ compiler,
- without need for graphics capabilities.
-
- You may develop a text-based application whose user interface component
- is provided by the App library. You can recompile your application with
- a new interface by simply changing a single line in your source code.
- The following interfaces are presently available: command-line, menu
- list, and Macintosh-style pull-down menu (Macintosh computers only).
- Thus, the App library serves as an object-oriented user interface
- management system (UIMS). (See References.)
-
- Since the App library provides structure to the overall application, it
- may also be considered an "application framework" similar to - but much
- simpler than - Apple's MacApp application shell and Think's own Think
- Class Library.
-
-
- DISTRIBUTION:
-
- App may be distributed freely as long as this Help file is included. It
- is intended for educational use, although you may adapt if for
- commercial use if you find it useful. I would appreciate well-
- documented copies of any App applications you come up with. Users are
- also encouraged to add functionality to the existing App library
- (perhaps in the form of additional user interface alternatives). Please
- send any such additions to me, including documentation, so I can include
- them for distribution.
-
-
- DESCRIPTION:
-
- App consists of the following major classes: Generic_Class,
- Generic_App, Menu, Menu_App, Command_App, and Mac_App (not related to
- Apple's MacApp Object Pascal class library). The Menu and Generic_App
- classes are descendants of Generic_Class.
-
- The Generic_App class contains as an instance variable a Menu object
- used to relate character strings representing command names to the
- procedures which realize the commands. In addition to initialization
- and destruction methods, the Generic_App defines dummy run(), query(),
- and respond() methods. (These are virtual functions, so that the
- corresponding methods of derived classes are invoked when appropriate.)
- For the purposes of this study, query() and respond() methods are the
- only means of communication between the application and the user.
-
- The Menu_App, Command_App, and Mac_App classes derive from the
- Generic_App, inheriting its instance variables and adding new data and
- functionality. Namely, these classes each override the run(), query(),
- and respond() methods in order to implement menu-driven or command-line
- applications.
-
- Your completed application class ╤ say, Test_App ╤ must derive from
- either the Menu_App, Command_App, or Mac_App class. The Test_App
- contains special-purpose instance variables appropriate to the
- application, as well as special-purpose methods for each command the
- application's user should invoke. For example, if Test_App is a simple
- database manager, its instance variables may contain data records (or a
- data object or your own design) and its methods may include open_file(),
- enter_data(), sort(), list_data(), save_file(), quit(), etc. As stated
- above, all user interaction in these methods must be accomplished using
- the query() and respond() methods inherited from the parent class. The
- initialization method of Test_App should log the command names and
- pointers of the functions realizing the commands into the Menu object
- inherited from Generic_App.
-
- If Test_App derives from Menu_App, then the Menu_App's run() method is
- invoked when a Test_App object receives a 'run' message, and the
- Menu_App's query() and respond() methods are used. This run() method
- allows the user to select a command from a hierarchical menu structure.
- The appropriate Test_App special-purpose method is then invoked. This
- method may call the inherited respond() method, which writes its
- argument string to the display. The query() method does the same, and
- returns a string entered by the user from the keyboard.
-
- On the other hand, if Test_App derives from Command_App, then the
- Command_App's run() method is invoked and different query() and
- respond() methods are used. This run() method simply prompts the user
- for a command line. The user enters a command name followed by a list
- of arguments. The appropriate Test_App special-purpose method is
- invoked. This method calls the inherited query() and respond() methods;
- however, the argument string of the Command_App's query() method is not
- echoed to the display, and strings returned by query() calls are
- obtained in sequence from the command-line arguments.
-
- Likewise, if Mac_App is the parent class of Test_App then a rudimentary
- Macintosh-style pull-down menu interface is generated.
-
- The programmer may convert the parent class of Test_App from Menu_App to
- Command_App to Mac_App by changing a single line of the source code.
-
-
- FILES:
-
- apphelp this file
-
- (The following files comprise the App library. Please read the comments
- in the source and header files of any classes you will override,
- especially Generic_App and its descendants.)
-
- app.h defines Generic_App class
- app.c method definitions for Generic_App
- class.h defines Generic_Class, from which all classes derive.
- Also includes declarations for Think C/C++ compatibility
- class.c methods for Generic_Class
- comapp.h defines Command_App
- comapp.c methods for Command_App
- comline.h defines Comline, used by Command_App
- comline.c Comline methods
- macapp.h defines Mac_App (not related to Apple's MacApp)
- macapp.c Mac_App methods
- menapp.h defines Menu_App
- menu.h defines Menu class, used by Generic_App
- menu.c Menu methods
- menubar.h defines Menu_Bar class, used by Mac_App
- menubar.c Menu_Bar methods
- morestr.h declares a few extra string-handling functions
- morestr.c defines these functions
-
- (The following files are used to demonstrate how to use the App library.
- The Test_App application is a very simple database example, which makes
- use of a Dfile - database file - object. Comments in these files
- indicate how to compile the application.)
-
- dfile.h defines the Dfile class, used by Test_App
- dfile.c Dfile methods
- testapp.h defines the Test_App, descended from any one of the
- three abstract App classes
- testapp.c Test_App methods and command functions
-
-
- REFERENCES:
-
- Thomas, J. J., and G. Hamlin, "Graphical Input Interaction Technique,
- Workshop Summary", Computer Graphics, vol. 17, no. 1, pp. 16-20, ACM
- 1983
-
- Olsen, D. R., W. Buxton, R. Ehrich, D. J. Kasik, J. R. Rhyne, J. Sibert,
- "A Context for User Interface Management", Computer Graphics and
- Applications, vol. 4, no. 12, pp. 33-43, IEEE 1984
-
- Schmucker, K. J., "MacApp: An Application Framework", Byte vol. 11, no.
- 8, pp. 189-193, 1986
-
- Lowgren, J., "History, State and Future of User Interface Management
- Systems", SIGCHI Bulletin vol. 20, no. 1, pp. 32-44, 1988
-