home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / VISBUILD / RAPSHEET / VBRAPSHT.SPC < prev    next >
Text File  |  1995-05-20  |  16KB  |  665 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                                                           SPECIFICATION FOR THE
  14.                                                    POLICE RAP SHEET APPLICATION
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                 -- Page 1 of 10
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.   CONTENTS
  74.   ________
  75.  
  76.  
  77.  
  78.  
  79.  
  80.   THE POLICE RAP SHEET APPLICATION   3
  81.   What You Should Be Able To Do   4
  82.   Specification   8
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                                        Contents -- Page 2 of 10
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   THE POLICE RAP SHEET APPLICATION
  141.   ________________________________
  142.  
  143.  
  144.  
  145.  
  146.  
  147.   This application retrieves information about suspects from a database and
  148.   displays the list of suspects in a container.  A notebook is used to display
  149.   detailed information about a suspect.
  150.  
  151.   In building this application, the following was used:
  152.  
  153.   o   Frame Windows and using the IVBFactory part to create instances of them
  154.       (frame window subclasses that represent composite visual parts).
  155.  
  156.   o   Canvas, which one of the visual parts imbeds
  157.  
  158.   o   Container, including use of a menu handler to dynamically update the
  159.       popup menu
  160.  
  161.   o   Notebook
  162.  
  163.   o   Menu Bar and Menu Item
  164.  
  165.   o   Collection View List Boxes
  166.  
  167.   o   IVSequences
  168.  
  169.   o   Factories
  170.  
  171.   o   Sample parts (e.g., IAddress, IVBBooleanPart, and IVBLongPart)
  172.  
  173.   o   Variables
  174.  
  175.   o   Text Entry Fields
  176.  
  177.   o   Multiline Edit Field
  178.  
  179.   o   Text Push Button
  180.  
  181.   o   Graphic Push Buttons
  182.  
  183.   o   Animated Button
  184.  
  185.   o   Radio Buttons
  186.  
  187.   o   Numeric Spin Buttons
  188.  
  189.   o   Check Boxes
  190.  
  191.   o   String Combo Boxes
  192.  
  193.   o   Bitmap Controls
  194.  
  195.  
  196.  
  197.                                The Police Rap Sheet Application -- Page 3 of 10
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.   o   Group Boxes
  208.  
  209.   o   User provided Nonvisual Parts
  210.  
  211.   o   Parameterized Connections
  212.  
  213.   o   Event-to-Custom Logic Connections
  214.  
  215.   o   Event-to-Member Function Connections (see the ISuspectCnrView visual
  216.       part)
  217.  
  218.  
  219.   WHAT YOU SHOULD BE ABLE TO DO
  220.   _____________________________
  221.  
  222.   Because of its database dependency, this sample application was not intended
  223.   for execution.  However, you can browse the visual and nonvisual parts that
  224.   comprise the Police Rap Sheet application.  To browse the parts that comprise
  225.   this sample application:
  226.  
  227.   o   Start Visual Builder.
  228.  
  229.   o   Load the following files:
  230.  
  231.       -   vbrpshtn.vbb - nonvisual parts
  232.       -   vbrpshtv.vbb - visual parts
  233.       -   vbsample.vbb - Visual Builder sample parts
  234.  
  235.   The following identifies what parts were used to build the visual composite
  236.   parts and how these parts were used.
  237.  
  238.   o   Frame Windows
  239.  
  240.       -   Create subclasses of a frame window to represent application views
  241.           (e.g., IRapMainView, ISuspectCnrView, and ISuspectNotebook)
  242.  
  243.   o   Canvas (see IAddressView part)
  244.  
  245.       -   Visually construct for reuse
  246.       -   Encapsulate access by using a variable
  247.       -   Imbed into another view
  248.  
  249.   o   Container
  250.  
  251.       -   Identify class of items
  252.       -   Identify icon to represent items
  253.       -   Identify item data to be displayed as icon name
  254.       -   Enable users to switch between an Icon view and a Details view
  255.       -   Identify attributes to display as columns in the Details View
  256.       -   Get items thru a nonvisual part connection
  257.       -   Support a menu bar
  258.       -   Select and deselect all objects in the container using event-to-
  259.           member function connections
  260.       -   Attaching a user-created menu handler (that subclasses
  261.           ICnrMenuHandler) to control what menu items should appear in the
  262.  
  263.  
  264.                                The Police Rap Sheet Application -- Page 4 of 10
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.           popup menu (based on the position of the mouse pointer - whether it's
  275.           over an object or not) by attaching a container menu handler to the
  276.           container (
  277.  
  278.           NOTE:    do not make the container the client of a frame window - if
  279.           so, commandEvent will fire twice each time an item is selected from
  280.           the popup menu.  Recommend placing a IMultiCellCanvas part in the
  281.           client area of the frame window and then placing the container on the
  282.           IMultiCellCanvas part and identifying it as expandable).
  283.       -   Identify what should happen when the user double-clicks on an object
  284.           or selects one or more objects and hits Enter.
  285.  
  286.   o   Notebook
  287.  
  288.       -   Define the layout of the notebook
  289.       -   Define the pages and subpages of a notebook
  290.  
  291.   o   Menu Bar and Menu Items
  292.  
  293.       See the ISuspectCnrView visual part for examples of how to:
  294.  
  295.       -   Identify a menu bar for a window
  296.       -   Define the pull-down menu items for the menu bar
  297.       -   Identify what should happen when a menu item is selected
  298.       -   Dynamically grey out a menu item
  299.       -   Check and uncheck a menu item
  300.  
  301.   o   Collection View List Boxes
  302.  
  303.       See the ISuspectNotebook visual part for examples of how to:
  304.  
  305.       -   Identify class of items
  306.       -   Identify item data (one or more fields) to be displayed (via the
  307.           asString member function of the class that is specified for the
  308.           items)
  309.       -   Identify what font the item data should be displayed in
  310.       -   Get the items by connecting to an (IVSequence *) attribute of a  non-
  311.           visual part
  312.       -   Allow data about a selected item to be updated (see the Priors page
  313.           of the ISuspectNotebook part).
  314.       -   Allow new items to be added (see the Priors page of the
  315.           ISuspectNotebook part).
  316.  
  317.   o   IVSequences
  318.  
  319.       See the ISuspectNotebook visual part for examples of how to:
  320.  
  321.       -   Map to the items of ICollectionVIewListBox parts
  322.       -   Use custom logic to invoke member functions against an IVSequence
  323.           (e.g., to prime it or refresh it from another IVSequence)
  324.       -   Add to and update elements in an IVSequence (see the Priors page)
  325.  
  326.   o   Factories
  327.  
  328.  
  329.  
  330.                                The Police Rap Sheet Application -- Page 5 of 10
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.       Use an IVBFactory part from the parts palette to:
  341.  
  342.       -   New a user-created visual part, set its focus and show it (show() and
  343.           the AUTO DELETE check box in the factory part are used to show
  344.           ISuspectNotebook (see the ISuspectCnrView visual part), whereas
  345.           showModally() and deleteTarget() are used to show ISuspectCnrView
  346.           (see the IRapMainView visual part)).
  347.       -   New a nonvisual part (IArrest in ISuspectNotebook)
  348.       -   Set a part's variable or attributes prior to newing it
  349.  
  350.   o   Sample parts
  351.  
  352.       -   Use parts such as IVBBooleanPart, IVBLongPart, and
  353.           IVBUnsignedLongPart to dynamically disable/enbable menu items or a
  354.           push button (see the ISuspectCnrView and ISuspectNotebook visual
  355.           parts)
  356.       -   Use the IAddress model part
  357.  
  358.   o   Variables
  359.  
  360.       -   Create a variable to represent a visual part and set it (the this
  361.           attribute) from the actionResult of the new action of a factory part
  362.           (see the ISuspectCnrView or the ISuspectNotebook visual parts)
  363.       -   Create a variable to represent a nonvisual part and set it from from
  364.           an attribute of a visual part (see the ISuspectNotebook and
  365.           ISuspectCnrView visual parts, respectively).
  366.       -   Use a variable to show data about an item that a user selects from an
  367.           ICollectionViewListBox part (see the Priors page of the
  368.           ISuspectNotebook visual part)
  369.  
  370.   o   Text Entry Fields
  371.  
  372.       -   Get/put data
  373.       -   Limit size of text
  374.       -   Specify default text
  375.       -   Enable auto scroll and auto tab
  376.       -   Enable data update for most of the fields
  377.  
  378.   o   Multiline Edit Field (MLE)
  379.  
  380.       See the ISuspectNotebook visual part for an example of how to:
  381.  
  382.       -   Connect to a nonvisual part
  383.  
  384.   o   Text Push Button
  385.  
  386.       See the UPDATE button on the Priors page of the ISuspectNotebook for an
  387.       example of how to:
  388.  
  389.       -   Dynamically disable
  390.       -   Connect to custom logic
  391.       -   Connect to a visual part
  392.  
  393.   o   Graphic Button
  394.  
  395.  
  396.                                The Police Rap Sheet Application -- Page 6 of 10
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.       See the IRapMainView visual part for an example of how to:
  407.  
  408.       -   Identify the icon for the graphic button in the settings notebook of
  409.           the part
  410.       -   Perform an action when a user clicks on it
  411.  
  412.   o   Animated Button
  413.  
  414.       See the BOOK button on the Priors page of the ISuspectNotebook for an
  415.       example of how to:
  416.  
  417.       -   Identify in the settings notebook the initial resource ID, number of
  418.           bitmaps, and the resource DLL
  419.       -   Start and stop animation
  420.  
  421.   o   Radio Buttons
  422.  
  423.       -   Group radio buttons (to support their mutual exclusion) and enable
  424.           tabbing for each
  425.       -   Identify the default radio button
  426.  
  427.   o   Numeric Spin Buttons
  428.  
  429.       See the ISuspectNotebook visual part for an example of how to:
  430.  
  431.       -   Identify the lower and upper range in the settings notebook of the
  432.           part
  433.       -   Map the value attribute of the numeric spin button to the attribute
  434.           of a nonvisual user part
  435.  
  436.   o   Check Boxes
  437.  
  438.       -   Use check boxes to represent Boolean attributes in a nonvisual part.
  439.  
  440.   o   String Combo boxes
  441.  
  442.       -   Specify the initial contents of the combo boxes using the settings
  443.           notebook.
  444.       -   Ensure the initial contents of the combo boxes get generated out as
  445.           resource strings by selecting the "Starting resource id" check box in
  446.           the Class Editor.
  447.       -   Since strings are not stored in the database, map the selection
  448.           attribute of the combination boxes to the appropriate nonvisual part
  449.           attributes (that accept an enumerated value).
  450.  
  451.   o   Bitmap Controls
  452.  
  453.       -   Identify which bitmap should be displayed by connecting to the bitmap
  454.           attribute.
  455.  
  456.   o   Group Boxes
  457.  
  458.       -   Update the label/text of the group boxes
  459.       -   Place parts within the group boxes  (
  460.  
  461.  
  462.                                The Police Rap Sheet Application -- Page 7 of 10
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.           NOTE:  If you place a group box over the parts you want it to group,
  473.           you need to update the tabbing and depth order to ensure that the
  474.           group box is higher in the depth order).
  475.  
  476.  
  477.   SPECIFICATION
  478.   _____________
  479.  
  480.   This application enables users to browse information about suspects - from
  481.   those who have not been charged yet, to those who have been charged and con-
  482.   victed.
  483.  
  484.   Since the main intent of this sample application is to show how to use other
  485.   parts to construct the views of an application, database support was kept to
  486.   a minimum.  A database was only used for the storage and retrieval of suspect
  487.   information (so no updates, deletes, or specialized queries against the data-
  488.   base were performed).
  489.  
  490.   Selection of the Witness Identification push button initiates the retrieval
  491.   of suspect information from the database.
  492.  
  493.   A container is used to display the list of known suspects. This container
  494.   supports extended selection so one or more suspects may be selected.
  495.  
  496.   You can view detailed information about one or more suspects, by opening the
  497.   suspects.  You can open one or more suspects by either:
  498.  
  499.   o   selecting mouse button 2 while the cursor is over a suspect and then
  500.       selecting Open from the popup menu
  501.   o   double-clicking on a suspect
  502.   o   selecting the suspects and then hitting Enter
  503.   o   selecting the suspects and then selecting SELECTED->OPEN
  504.   o   selecting the suspects and then selecting mouse button 2 while the cursor
  505.       is over one of the selected suspects
  506.  
  507.   Some of the information that may be displayed for a suspect are the suspect's
  508.   arrest history, current address, mug shots (if available), physical
  509.   description, and aliases.
  510.  
  511.   This application consists of the following visual parts:
  512.  
  513.   o   IRapMainView - a window that provides law enforcement officers and per-
  514.       sonnel with access to various functions.  Since this application is
  515.       limited in scope, only the Witness Identification function is supported.
  516.  
  517.   o   ISuspectCnrView - a window used for displaying an icon or details view of
  518.       known suspects.
  519.  
  520.   o   ISuspectNotebook - a window used to display detailed information about a
  521.       suspect.  This information includes a suspect's name, aliases, arrest
  522.       history, character description, and the suspect's birthdate.  The note-
  523.       book consists of the following pages:
  524.  
  525.  
  526.  
  527.  
  528.  
  529.                                The Police Rap Sheet Application -- Page 8 of 10
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.       -   General page - used to display the suspect's first and last name,
  540.           book number, modus operandi, and general information.  The following
  541.           subpages provide additional information:
  542.  
  543.           --  Address page - displays the address of the suspect's residence
  544.           --  Personal page - displays physical information about the suspect,
  545.               such as their hair and eye color, weight and height, and gender.
  546.               The suspect's birthdate is also displayed if known.
  547.           --  Marks page - identifies any known distinguishing marks that the
  548.               suspect has
  549.           --  Mug Shots page - displays any mug shots that have been taken of
  550.               the suspect
  551.  
  552.       -   Aliases page - displays a list of aliases the suspect is known by
  553.  
  554.       -   Priors page - displays the suspect's arrest history.  The status and
  555.           status date fields of an arrest record can be updated as well.  The
  556.           suspect can also be booked on additional charges by specifying values
  557.           for the fields at the top of the page and then selecting the BOOK
  558.           animated push button (
  559.  
  560.           NOTE:   since this application is limited in scope, the updates and
  561.           the specification of additional charges are not saved to the data-
  562.           base; they are only temporarily saved in the suspect object).
  563.  
  564.   o   IAddressView - a canvas created for reuse.  This part was added to the
  565.       Address subpage of the ISuspectNotebook part.
  566.  
  567.   o   IHeightSpinButton - a part that can be used to identify the height of an
  568.       object.  Two numeric spin buttons are used to represent the height.  One
  569.       represents the height in terms of feet, and the other in terms of inches.
  570.       The total height of the object (in inches) is calculated from the value
  571.       of these two buttons and is represented by the height attribute.  This
  572.       part was added to the Personal subpage of the ISuspectNotebook part.
  573.  
  574.   The nonvisual parts that support this application are contained in the fol-
  575.   lowing files:
  576.  
  577.   o   vbrapshtn.vbb
  578.  
  579.       This part file contains the following types of parts:
  580.       -   Parts that represent model parts.  These parts consist of the
  581.           following: IAlias, IArrest, ILastSeen, IPerson, and ISuspect.
  582.       -   Parts that subclass the IRecord part (e.g., ISuspectRecord).  These
  583.           parts were created to facilitate expanding the Police Rap Sheet
  584.           application into a client-server application.
  585.       -   Parts that serve to hide knowledge of where data is stored (e.g.,
  586.           ISuspectClientMgr).
  587.   o   vbsample.vbb
  588.  
  589.       Several parts from this part file are used for implementation purposes.
  590.       IVBBooleanPart is an example of such a part.  The only part that is used
  591.       as a model part is IAddress.
  592.  
  593.  
  594.  
  595.                                The Police Rap Sheet Application -- Page 9 of 10
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.   END OF DOCUMENT
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                               The Police Rap Sheet Application -- Page 10 of 10
  662.  
  663.  
  664.  
  665.