home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 1.ddi / SNAV0111.ZIP / DEMO.PRN < prev    next >
Encoding:
Text File  |  1990-04-16  |  8.2 KB  |  153 lines

  1. <         the╔══╗╔══╗╔                      ╔
  2.             ║  ╙╢  ╙╢                      ║ █
  3.             ║   ║   ║ ╔═══╗ ╠═ ╔═══╗╔ ╔═══╗║ ╔ ╔═══╗╔ ╔═══╗╔ ╓─╖ ╔═══╗╔ ╔═╗╔═╗╔
  4.             ║   ║   ║ ║   ║ ║  ║   ╙╢ ║   ╙╢ ║ ║   ╙╢ ║   ╙╢ ║╓╜ ║   ╙╢ ║ ╙╢ ╙╢
  5.             ║   ║   ║┌╫───╜ ║ ┌╢    ║┌╢    ║ ║┌╢    ║┌╢    ║ ║║ ┌╢    ║ ║  ║  ║
  6.             ║   ║   ║│║   ╓─╢ │║   ╓╢│║   ╓╢ ║│║   ╓╢│║   ╓╢ ║║ │║   ╓╢ ║  ║  ║
  7.             ╜   ╨   ╙┘╚═══╝ ╚═╛╚═══╝╙┘╚═══╝╙─╨┘╚═══╝╙┘╚═══╝║┌╜╙─┘╚═══╝╙─╜  ╨  ║
  8.                                                       ╓────╫┘                 ║
  9.             ╓─────────────────────────────────────────╚════╝──────────────────╜
  10.             ╙─── architecture
  11.          
  12.             (software foundation)
  13.                                 SNAV - demo documentation
  14.                                    - 16.4.90 page 1 -
  15.          
  16.                            ┌───────┐
  17.                  ─────────>│ AVNER │
  18.                  ─────────>│  BEN  │──────> Software Engineering Method
  19.                            └───────┘
  20.                  10 Dov-Hoz st. Tel-Aviv 63416 Israel tel. 972-3-221535
  21.          
  22.          
  23.          
  24.          
  25.          
  26.          
  27.          
  28.          
  29.          
  30.          
  31.          
  32.                    ┌─────────────────────────────────────────────────┐
  33.                    │             "The Screen NAVigator"              │
  34.                    │                                                 │
  35.                    │             THE C++ IMPLEMENTATION              │
  36.                    │            Demonstration Application            │
  37.                    │                                                 │
  38.                    │            Version 1.10, April 1990.            │
  39.                    └─────────────────────────────────────────────────┘
  40.          
  41.                             Copyright (c) 1990 by Avner Ben.
  42.          
  43.          
  44.          
  45.          
  46.          
  47.          
  48.                                                   Written by  Avner Ben
  49.                                                               15 April 1990.
  50.                                             original written  28 November 1989.
  51.                                 SNAV - demo documentation
  52.                                    - 16.4.90 page 2 -
  53.          
  54.          EPREFACEF
  55.          E───────────────────────────────────────────────────────────────────────F
  56.          
  57.          SNAV version 1.10 includes a sample application, compiled and ready to
  58.          run  on an IBM-PC or  true compatible, called "demo.exe".   The source
  59.          code  is  supplied  in  the  file  "demo.cpp",  and three source files
  60.          accompanied by four header files, named demo0, demo1, demo2 and demo3.
  61.          
  62.          The demo files are enclosed as tutorial pieces only.  No compatibility
  63.          with (or its very inclusion in) future releases is promised for  users
  64.          who wish to extend it for their applications.
  65.                                 SNAV - demo documentation
  66.                                    - 16.4.90 page 3 -
  67.          
  68.          EDEMO - SAMPLE APPLICATIONF
  69.          E───────────────────────────────────────────────────────────────────────F
  70.          
  71.          The demo program  is a menu-driven  application, showing some  uses of
  72.          the  Snav   software  foundation,   such  as   shape  drawing,   shape
  73.          recognition, screen management,  TypeWriter-Graphics conversion and  a
  74.          listing of the current semigraphic alphabet.
  75.          
  76.          The program divides  the screen into  three "panel" objects.   The top
  77.          line is occupied by a menu-bar, using an object of class "slide_menu".
  78.          Lines 2 through  24 are for  the drawing-board, using  a plain "panel"
  79.          object.  It  is enframed, using  the panel's "enframe"  facility.  The
  80.          bottom line  is reserved  for user-dialog,  using an  object of  class
  81.          "character_input".   The line  is also  used for  help messages by the
  82.          bar-menu object.
  83.                                 SNAV - demo documentation
  84.                                    - 16.4.90 page 4 -
  85.          
  86.          EDEMO0 - SCREEN DRIVER ALLOCATORF
  87.          E───────────────────────────────────────────────────────────────────────F
  88.          
  89.          Demo0 implements (inline)  the generic screen-driver  allocator class,
  90.          declared in snav2.   This is  a stub implementation,  recognizing only
  91.          the one driver implementation supplied with the demo - a memory-mapped
  92.          PC  driver,  and  returning  it  by  default.    The case structure is
  93.          supplied as a basis for extension by the user.
  94.          
  95.          Class screen_driver_manager's main method  - "allocate" returns the  a
  96.          pointer to the  desired screen type  by number, or  the implementation
  97.          default.  Its use frees the code of any device-specific references.
  98.                                 SNAV - demo documentation
  99.                                    - 16.4.90 page 5 -
  100.          
  101.          EDEMO1 - A PC SCREEN DRIVER IMPLEMENTATIONF
  102.          E───────────────────────────────────────────────────────────────────────F
  103.          
  104.          Demo1 is  a pc  implementation of  the generic  panel device of snav2.
  105.          All  virtual  methods  are  redefined,  to  suit pc architecture.  The
  106.          programming  used  is  straightforward,  addressing  the hardware in a
  107.          "quick and dirty" way, resulting in "misbehaved" code that may not run
  108.          properly under  a windowing  or other  multitasking system.   This  is
  109.          sufficient for the  demonstration.  The  user is expected  to beautify
  110.          and complicate the design, as fits the application.
  111.          
  112.          An obvious exercise for  the non-pc user is  to rewrite the driver  to
  113.          fit the architecture of his/her machine.  A good exercise is to  write
  114.          an  ANSI  driver.    (However,  the  pc  implementation of ANSI has no
  115.          console reading facilities,  so that must  remain hardware-dependent).
  116.          PC users may try writing  a non-memory-mapped driver, using the  bios,
  117.          ANSI  (partially)  or  the  compiler  vendor's  screen-driver library.
  118.          Modifying  the  enclosed  driver  to  work  with the Zortech "display"
  119.          library is really trivial (do not forget to call "disp_flush()" before
  120.          each important move!)
  121.                                 SNAV - demo documentation
  122.                                    - 16.4.90 page 6 -
  123.          
  124.          EDEMO2 - FORMATTED INPUT USING THE SCREEN DRIVERF
  125.          E───────────────────────────────────────────────────────────────────────F
  126.          
  127.          Demo2 defines  some rudimentary  formatted input  facilities that  are
  128.          lacking in SNAV (being limited to formatted output). the file supplies
  129.          some   datatype-accepting   routines,   as   methods   of   the  class
  130.          "character_input".  Class character_input  manages an object of  class
  131.          panel, for user dialog.  This  may be either supplied by the  user, or
  132.          allocated (and destroyed) by the class.
  133.          
  134.          Like  class  panel  of  snav2,  character_input  is  a  generic class,
  135.          defining  user-dialog  facilities  in  general.    Class   pc_keyboard
  136.          implements  device  specific  attributes,  such as identifying control
  137.          characters  and  function  keys.  keyboard  allocation  is  done  by a
  138.          "manager" class, similar to the panel_manager of demo0.  This  ensures
  139.          that the code is free of device-specific references.
  140.          
  141.          Also supplied are  a "slide_menu" object  whose constructor chops  the
  142.          top line off the  main window (which it  receives as argument), and  a
  143.          "text_window" object, displaying the welcome screen succession  (based
  144.          upon the "enframe" facility of the panel).
  145.                                 SNAV - demo documentation
  146.                                    - 16.4.90 page 7 -
  147.          
  148.          EDEMO3 - SAMPLE SHAPESF
  149.          E───────────────────────────────────────────────────────────────────────F
  150.          
  151.          demo3 supplies examples for some  regular shapes, a dented curve,  and
  152.          "spiral" self-enclosing curve, for use in the demo program.
  153.