home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / source / winobj / scr.doc < prev    next >
Text File  |  1991-01-14  |  12KB  |  312 lines

  1.  
  2.                       Object Windows Screen Painter
  3.  
  4.                                Version 1.0
  5.  
  6.                             January 14, 1991
  7.  
  8.                           by Lake View Software
  9.  
  10.                  Copyright (c) 1991  All Rights Reserved
  11.  
  12.                             Reference Manual
  13.  
  14.  
  15.  
  16.  
  17. ****************************************************************************
  18.                       Purpose of the Screen Painter
  19. ****************************************************************************
  20.  
  21.     The screen painter can be used to reduce the amount of coding needed
  22.     to produce professional looking data entry screens.
  23.  
  24.     The screen painter was written using the Object Windows library.
  25.  
  26.     The screen painter allows you to:
  27.  
  28.         - Position text and data fields any where on a 50 x 100
  29.           virtual window.
  30.  
  31.         - Easily move text and fields anywhere on the window.
  32.  
  33.         - Save the painted screen.
  34.  
  35.         - Produce the coded to duplicate your screen in your programs.
  36.  
  37.         - Produce a header file declaring the functions defined by your
  38.           screen.  The header file also defines a structure for the data
  39.           in your entry fields.
  40.  
  41.         - Produce additional code for users of CodeBase IV.  This can
  42.           be turned on or off.
  43.  
  44. ******************************************************************************
  45.                                 Files
  46. ******************************************************************************
  47.  
  48.         SCR.EXE     The main Screen Painter executable.
  49.         SCR.DOC     This file.
  50.  
  51. ******************************************************************************
  52.                   Using the Object Windows Screen Painter
  53. ******************************************************************************
  54.  
  55.     Using the screen painter is simple and straight forward.
  56.  
  57.     Designing and generating a screen requires 4 steps.
  58.  
  59.             1.) Place all desired screen text in the screen painters main
  60.                 window.  You have a 50 row X 100 column area to work in.
  61.                 You can place text by moving the cursor with the arrow
  62.                 keys then typing.
  63.  
  64.             2.) Place all desired input fields in the main screen painter
  65.                 window.  You must create fields using the Field Menu.  Alt-F.
  66.                 This allows you to specify the size and type of field to place
  67.                 on the screen.  You can also specify the name of a valid
  68.                 function to be called for the field.
  69.  
  70.             3.) Generate the code.  In normal operation the code generated
  71.                 will appear as in the example below.  Additional code can
  72.                 be generated for CodeBase users by turning the codebase switch
  73.                 on.  Ctrl-F4.
  74.  
  75.             4.) Create a main function to call your generated functions.
  76.                 See the example below.
  77.  
  78.  
  79. ******************************************************************************
  80.                 Example code produced by the screen painter
  81. ******************************************************************************
  82.  
  83. Screen: painted in SCR.EXE
  84. --------------------- TEST.SCR ----------------------------------------------
  85.  
  86.            Name: [                           ]
  87.  
  88.         Address: [                           ]
  89.  
  90.            City: [              ]
  91.  
  92.           State: []
  93.  
  94.             Zip: [        ]
  95.  
  96. -----------------------------------------------------------------------------
  97. Header: produced by the screen painter.
  98. --------------------- TEST.HPP ----------------------------------------------
  99.         #include <winobj.hpp>
  100.  
  101.         struct TEST_data {
  102.               char Name [31];
  103.               char Address [31];
  104.               char City [16];
  105.               char State [3];
  106.               char Zip [11];
  107.         };
  108.  
  109.         // Function prototypes
  110.         void TEST_screen (WinObj &w);
  111.         int TEST_get (struct TEST_data &d,WinObj &w);
  112.         void TEST_clear (struct TEST_data &d);
  113.  
  114. -----------------------------------------------------------------------------
  115. Code: produced by the screen painter.
  116. ------------------------ TEST.CPP -------------------------------------------
  117.         #include "TEST.HPP"
  118.  
  119.         void TEST_screen (WinObj &w)
  120.         {
  121.             w.printf(2,0,"        Name:");
  122.             w.printf(4,0,"     Address:");
  123.             w.printf(6,0,"        City:");
  124.             w.printf(8,0,"       State:");
  125.             w.printf(10,0,"         Zip:");
  126.         }
  127.  
  128.         int TEST_get (struct TEST_data &d,WinObj &w)
  129.         {
  130.             w.get (2,14,d.Name,'F');
  131.             w.get (4,14,d.Address,'F');
  132.             w.get (6,14,d.City,'F');
  133.             w.get (8,14,d.State,'U');
  134.             w.get (10,14,d.Zip,'Z');
  135.             return (W_OK);
  136.         }
  137.  
  138.         void TEST_clear (struct TEST_data &d)
  139.         {
  140.             str_clear (d.Name,30);
  141.             str_clear (d.Address,30);
  142.             str_clear (d.City,15);
  143.             str_clear (d.State,2);
  144.             str_clear (d.Zip,10);
  145.         }
  146.  
  147. -----------------------------------------------------------------------------
  148. Main: produced by you the programmer.
  149. ---------------------- MAIN.CPP ---------------------------------------------
  150.  
  151.         #include "TEST.HPP"
  152.  
  153.         void main()
  154.         {
  155.             WinObj w;
  156.             w.open (2,0,23,79,W_SINGLE,_BLACK|WHITE,_LGREY|RED);
  157.             struct TEST_data d;
  158.             TEST_screen (w);         // display screen
  159.             TEST_clear (d);          // clear the data
  160.             TEST_get (d,w);          // perform the gets
  161.             w.read();              // perform read
  162.         }
  163. -----------------------------------------------------------------------------
  164.  
  165.  
  166. *****************************************************************************
  167.            Functions & Data Types Created with the Screen Painter
  168. *****************************************************************************
  169.  
  170.     All functions created start with the name of the generated file,
  171.     Followed by an underscore then the function name.
  172.  
  173.         Ex.  If the generated code is named TEST.CPP the resultant functions
  174.              will have the name  TEST_function
  175.  
  176.     Each function created by the generator will be defined in the generated
  177.     header file.  (filename.HPP)
  178.  
  179. --------------------------------
  180. _data
  181.     A structure representing the data in your defined gets.  This
  182.     is just the structure definition, you must declare your own
  183.     data.  This structure is used by the screen painter get function.
  184.     The structure is defined int ?????.HPP.
  185.  
  186.     USAGE:   struct ?????_data d;
  187. --------------------------------
  188. _screen
  189.     Paint the screen text in the given window object.  You must open
  190.     the window your self.  The screen painter does not make an attempt
  191.     to guess the size & position of the window you wish to use.
  192.  
  193.     USAGE:  void ?????_screen (WinObj &w);
  194. --------------------------------
  195. _get
  196.     Call all the needed gets and valid statements.  The read function
  197.     is not called.  This is to allow you to call clear_gets.  Calling
  198.     clear_gets will cause the data to be displayed but not read from
  199.     the user.
  200.  
  201.     USAGE:   int ?????_get (struct ?????_data &d,WinObj &w);
  202. ---------------------------------
  203. _clear
  204.     Clear all data to blanks or 0 in the data struct.  This can be
  205.     used to initialize the data structure.
  206.  
  207.     USAGE:  void ?????_clear (struct ?????_data &d);
  208. ---------------------------------
  209.  
  210.  
  211.             Additional functions create for use with CodeBase.
  212. ---------------------------------
  213. _def[]
  214.     A Field definition array in codebase formate.  This structure can
  215.     be used to create your codebase data file.
  216.  
  217.     Definition:  FIELD ?????_def[] = {  fields };
  218. ----------------------------------
  219. _replace
  220.     Used to replace the data fields in your codebase field with
  221.     the data in your _data structure.  It assumes the file you
  222.     wish to replace is the currently selected file, also that the
  223.     fields in the file match the order of _def[].
  224.  
  225.     USAGE: ?????_replace (?????_data &d);
  226. ----------------------------------
  227. _load
  228.     Used to load the structure _data variables with the values
  229.     from the current database record.  It assumes the file you
  230.     wish to load from is the currently selected file, and that
  231.     the fields are in the same order as _def[].
  232. ----------------------------------
  233.  
  234. *****************************************************************************
  235.                       Screen Paint Keys and Menus
  236. *****************************************************************************
  237.  
  238.     Arrow keys      =   Move the cursor one character.
  239.     PgUp & PgDn     =   Move the cursor to the first/last rows.
  240.     Home & End      =   Move the cursor to the first/last column.
  241.     Delete          =   Delete the character under the cursor.
  242.     Insert          =   Toggle the insert/overtype mode.  See bottom right
  243.                         of the screen.
  244.     Backspace       =   Delete the character to the left of the cursor.
  245.  
  246.     Ctrl-F4         =   Toggle the codebase code generation mode.  See
  247.                         upper right corner of the screen.
  248.  
  249.     Alt-M           =   Display the main menu.  This is a slide bar menu
  250.     or F10              which can be used to select any of the other menus.
  251.  
  252.     Alt-S           =   Display the Screen menu.  Options:
  253.                             Save     = Save the current screen in a .SCR file.
  254.                             Retrieve = Retrieve a previous created screen.
  255.                             Clear    = Clear the work area.
  256.  
  257.     Alt-F           =   Display the Field menu.   Options:
  258.                             Add    = Add a new field.
  259.                             Change = Change the currently selected field.
  260.                             Delete = Delete the currently selected field.
  261.                             Move   = Move the currently selected field.
  262.                         See the field definitions below.
  263.  
  264.     Alt-C           =   Code generator.  You will be prompted for a file
  265.                         name.
  266.  
  267.     Alt-Q           =   Quit the Screen Painter.
  268.  
  269.  
  270.  
  271. Field Definition Values.
  272.     Name    =   Name used for field in programs.  This will be used in
  273.                 the structure definition and the codebase file definition.
  274.  
  275.     Order   =   The order the fields get is called.  This is the order
  276.                 the user will be prompted in.  Leave space for additional
  277.                 fields.  The generator will start with 100,200... by default.
  278.  
  279.     Type    =   The type of variable to be used.
  280.                     C   = Character
  281.                     L   = Long
  282.                     D   = Double
  283.  
  284.     Style   =   The picture style to use for the field.  This is valid
  285.                 in Character fields only.
  286.                     L   convert field to 'L'owercase.
  287.                     U   convert field to 'U'ppercase.
  288.                     F   convert 'F'irst character to uppercase.
  289.                     D   MM/DD/YY date field.
  290.                     S   999-99-9999 Social Security number field
  291.                     P   (999) 999-9999 phone number.
  292.                     Z   99999-9999 zip code.
  293.  
  294.     Length  =   The length of the field.  This is automatic in the case
  295.                 of some style.  D,S,P and Z
  296.  
  297.     Decimals=   The number of decimals in a Double field.
  298.  
  299.     Valid Function = The name of the function to be called as a valid
  300.                      for the field.  You must supply this function in
  301.                      your share of the code.  A declaration for the
  302.                      function will be provided in ?????.HPP.
  303.  
  304.  
  305.  
  306. *****************************************************************************
  307.                          Copyright Notices
  308. *****************************************************************************
  309.  
  310.     CodeBase 4 is a dBASE compatible function library by Sequitur.
  311.  
  312.