home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / visbuild / rapsheet / vbrapsht.spc < prev    next >
Encoding:
Text File  |  1996-02-20  |  16.5 KB  |  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 .ini files 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 (native and pmCompatible), including use of a menu handler to
  159.       dynamically update the popup menu
  160.  
  161.   o   Notebook
  162.  
  163.   o   Menu Bar and Menu Item
  164.  
  165.   o   Collection View List Box
  166.  
  167.   o   IVSequences
  168.  
  169.   o   Factories
  170.  
  171.   o   Sample parts (e.g., IAddress and IVBBooleanPart)
  172.  
  173.   o   Variables
  174.  
  175.   o   Text Entry Fields
  176.  
  177.   o   Multiline Edit Field
  178.  
  179.   o   Text Push Buttons
  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.   For information on how to inspect the parts of this sample application using
  223.   the Visual Builder, see the README.TXT file for this application.  The
  224.   README.TXT file also explains how you can build the application yourself and
  225.   how you can run it.
  226.  
  227.   The following identifies what parts were used to build the visual composite
  228.   parts and how these parts were used.
  229.  
  230.   o   Frame Windows
  231.  
  232.       -   Create subclasses of a frame window to represent application views
  233.           (e.g., IRapMainView, ISuspectCnrView, and ISuspectNotebook)
  234.  
  235.   o   Canvas (see the IAddressView part)
  236.  
  237.       -   Visually construct for reuse
  238.       -   Encapsulate access by using a variable
  239.       -   Imbed into another view
  240.  
  241.   o   Container
  242.  
  243.       -   Identify class of items
  244.       -   Identify icon to represent items
  245.       -   Identify item data to be displayed as the icon text
  246.       -   Enable users to switch between an Icon view and a Details view
  247.       -   Identify attributes to display as columns in the Details View
  248.       -   Get items thru a nonvisual part connection
  249.       -   Select and deselect all objects in the container using event-to-
  250.           member custom logic connections
  251.       -   Attach a user-created menu handler (that subclasses ICnrMenuHandler)
  252.           to control what menu items should appear in the popup menu (based on
  253.           the position of the mouse pointer - whether it's over an object or
  254.           not).  (
  255.  
  256.           NOTE:    do not make the container the client of a frame window - if
  257.           so, commandEvent will fire twice each time an item is selected from
  258.           the popup menu.  Recommend placing a IMultiCellCanvas part in the
  259.           client area of the frame window and then placing the container on the
  260.           IMultiCellCanvas part and identifying it as expandable).
  261.  
  262.  
  263.  
  264.                                The Police Rap Sheet Application -- Page 4 of 10
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.       -   Identify what should happen when the user double-clicks on an object
  275.           or selects one or more objects and hits Enter.
  276.       -   Use a pmCompatible container to represent the list of arrests on the
  277.           Priors page of the ISuspectNotebook part (NOTE: a pmCompatible part
  278.           was used because the details view headings for the native container
  279.           can not be hidden). A details view container is a better choice than
  280.           a collection view list box in this case since need to display mul-
  281.           tiple attributes of the arrest part.
  282.  
  283.   o   Notebook
  284.  
  285.       -   Define the layout of the notebook
  286.       -   Define the pages and subpages of a notebook
  287.       -   Enable tabbing between the notebook tabs and the pages (Alt+down
  288.           arrow to tab from a notebook tab to a control within its corre-
  289.           sponding page, and Alt+up arrow to tab from a page to its corre-
  290.           sponding notebook tab).
  291.  
  292.   o   Menu Bar and Menu Items
  293.  
  294.       See the ISuspectCnrView visual part for examples of how to:
  295.  
  296.       -   Identify a menu bar for a window
  297.       -   Define the pull-down menu items for the menu bar
  298.       -   Identify what should happen when a menu item is selected
  299.       -   Dynamically grey out a menu item
  300.       -   Check and uncheck a menu item
  301.  
  302.   o   Collection View List Box
  303.  
  304.       See the ISuspectNotebook visual part for examples of how to:
  305.  
  306.       -   Identify class of items
  307.       -   Identify item data to be displayed (via the asString member function
  308.           of the class that is specified for the items)
  309.       -   Get the items by connecting to an (IVSequence *) attribute of a non-
  310.           visual part
  311.       -   Allow data about a selected item to be updated (see the Priors page
  312.           of the ISuspectNotebook part).
  313.       -   Allow new items to be added (see the Priors page of the
  314.           ISuspectNotebook part).
  315.  
  316.   o   IVSequences
  317.  
  318.       See the ISuspectNotebook visual part for examples of how to:
  319.  
  320.       -   Map to the items of an ICollectionViewListBox or an
  321.           IVBContainerControl part
  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 (see the
  343.           IRapMainView and ISuspectCnrView visual parts).
  344.       -   New a nonvisual part (IArrest in ISuspectNotebook)
  345.       -   Set a part's variable or attributes prior to newing it
  346.  
  347.   o   Sample parts
  348.  
  349.       -   Use IVBBooleanPart to dynamically disable/enbable menu items (see the
  350.           ISuspectCnrView visual parts) or to support the mutual exclusion of
  351.           two radio buttons (see the ISuspectNotebook visual part)
  352.       -   Use the IAddress model part
  353.  
  354.   o   Variables
  355.  
  356.       -   Create a variable to represent a visual part and set it (the this
  357.           attribute) from the actionResult of the new action of a factory part
  358.           (see the ISuspectCnrView or the ISuspectNotebook visual parts)
  359.       -   Create a variable to represent a nonvisual part and set it from from
  360.           an attribute of a visual part (see the ISuspectNotebook and
  361.           ISuspectCnrView visual parts, respectively).
  362.       -   Use a variable to show data about an item that a user selects from an
  363.           IVBContainerControl part (see the Priors page of the ISuspectNotebook
  364.           visual part)
  365.  
  366.   o   Text Entry Fields
  367.  
  368.       -   Get/put data
  369.       -   Limit size of text
  370.       -   Specify default text
  371.       -   Enable auto scroll and auto tab
  372.       -   Specify read only fields
  373.  
  374.   o   Multiline Edit Field (MLE)
  375.  
  376.       See the ISuspectNotebook visual part for an example of how to:
  377.  
  378.       -   Connect to a nonvisual part
  379.  
  380.   o   Text Push Buttons
  381.  
  382.       See the UPDATE button on the Priors page of the ISuspectNotebook for an
  383.       example of how to:
  384.  
  385.       -   Dynamically disable
  386.       -   Connect to custom logic
  387.       -   Connect to a visual part
  388.  
  389.   o   Graphic Button
  390.  
  391.       See the IRapMainView visual part for an example of how to:
  392.  
  393.  
  394.  
  395.  
  396.                                The Police Rap Sheet Application -- Page 6 of 10
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.       -   Identify the icon for the graphic button in the settings notebook of
  407.           the part
  408.       -   Perform an action when a user clicks on it
  409.  
  410.   o   Animated Button
  411.  
  412.       See the BOOK button on the Priors page of the ISuspectNotebook part for
  413.       an example of how to:
  414.  
  415.       -   Identify in the settings notebook the initial resource ID, number of
  416.           bitmaps, and the resource DLL
  417.       -   Start and stop animation
  418.  
  419.   o   Radio Buttons
  420.  
  421.       See the radio buttons on the Personal page of the ISuspectNotebook part
  422.       for an example of how to:
  423.  
  424.       -   Group radio buttons (to support their mutual exclusion) and enable
  425.           tabbing for each
  426.       -   Identify the default radio button
  427.  
  428.   o   Numeric Spin Buttons
  429.  
  430.       See the IHeightSpinButton and ISuspectNotebook visual parts for an
  431.       example of how to:
  432.  
  433.       -   Identify the lower and upper range in the settings notebook of the
  434.           part
  435.       -   Map the value attribute of the numeric spin button to the attribute
  436.           of a nonvisual user part
  437.       -   Support a master and servant spin button, and use a handler to enable
  438.           the servant to automatically spin up or down whenever the master is
  439.           spun past one of its bounds.
  440.  
  441.   o   Check Boxes
  442.  
  443.       -   Use check boxes to represent Boolean attributes in a nonvisual part.
  444.  
  445.   o   String Combo boxes
  446.  
  447.       -   Specify the initial contents of the combo boxes using the settings
  448.           notebook.
  449.       -   Ensure the initial contents of the combo boxes get generated out as
  450.           resource strings by selecting the "Starting resource id" check box in
  451.           the Class Editor.
  452.       -   Since strings are not stored in the database, map the selection
  453.           attribute of the combination boxes to the appropriate nonvisual part
  454.           attributes (that accept an enumerated value).
  455.  
  456.   o   Bitmap Controls
  457.  
  458.       -   Identify which bitmap should be displayed by connecting to the bitmap
  459.           attribute.
  460.  
  461.  
  462.                                The Police Rap Sheet Application -- Page 7 of 10
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.   o   Group Boxes
  473.  
  474.       -   Update the label/text of the group boxes
  475.       -   Place parts within the group boxes  (
  476.  
  477.           NOTE:  If you place a group box over the parts you want it to group,
  478.           you need to update the tabbing and depth order to ensure that the
  479.           group box is higher in the depth order).
  480.  
  481.  
  482.   SPECIFICATION
  483.   _____________
  484.  
  485.   This application enables users to browse information about suspects - from
  486.   those who have not been charged yet, to those who have been charged and con-
  487.   victed.
  488.  
  489.   Since the main intent of this sample application is to show how to use other
  490.   parts to construct the views of an application, database support was kept to
  491.   a minimum.  Data is stored in .ini files, which on Windows, is stored as
  492.   Software in the Windows registry.  No updates to data (e.g., on the Priors
  493.   page of the ISuspectNotebook part) are written out to the .ini files.  The
  494.   .ini files are just used to simulate a primed database.
  495.  
  496.   Selection of the Witness Identification push button initiates the retrieval
  497.   of suspect information from the database.
  498.  
  499.   A container is used to display the list of known suspects. This container
  500.   supports extended selection so one or more suspects may be selected.
  501.  
  502.   You can view detailed information about one or more suspects, by opening the
  503.   suspects.  You can open one or more suspects by either:
  504.  
  505.   o   selecting mouse button 2 while the cursor is over a suspect and then
  506.       selecting Open from the popup menu
  507.   o   double-clicking on a suspect
  508.   o   selecting the suspects and then hitting Enter
  509.   o   selecting the suspects and then selecting SELECTED->OPEN
  510.   o   selecting the suspects and then selecting mouse button 2 while the cursor
  511.       is over one of the selected suspects
  512.  
  513.   Some of the information that may be displayed for a suspect are the suspect's
  514.   arrest history, current address, mug shots (if available), physical
  515.   description, and aliases.  (
  516.  
  517.   NOTE:   mug shots are available for the suspects that have a book number of 0
  518.   and 3)
  519.  
  520.   This application consists of the following visual parts:
  521.  
  522.   o   IRapMainView - a window that provides law enforcement officers and per-
  523.       sonnel with access to various functions.  Since this application is
  524.       limited in scope, only the Witness Identification function is supported.
  525.  
  526.  
  527.  
  528.  
  529.                                The Police Rap Sheet Application -- Page 8 of 10
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.   o   ISuspectCnrView - a window used for displaying an icon or details view of
  540.       known suspects.
  541.  
  542.   o   ISuspectNotebook - a window used to display detailed information about a
  543.       suspect.  This information includes a suspect's name, aliases, arrest
  544.       history, character description, and the suspect's birthdate.  The note-
  545.       book consists of the following pages:
  546.  
  547.       -   General page - used to display the suspect's first and last name,
  548.           book number, modus operandi, and general information.  The following
  549.           subpages provide additional information:
  550.  
  551.           --  Address page - displays the address of the suspect's residence
  552.           --  Personal page - displays physical information about the suspect,
  553.               such as their hair and eye color, weight and height, and gender.
  554.               The suspect's birthdate is also displayed if known.
  555.           --  Marks page - identifies any known distinguishing marks that the
  556.               suspect has
  557.           --  Mug Shots page - displays any mug shots that have been taken of
  558.               the suspect
  559.  
  560.       -   Aliases page - displays a list of aliases the suspect is known by
  561.  
  562.       -   Priors page - displays the suspect's arrest history.  The status and
  563.           status date fields of an arrest record can be updated as well.  The
  564.           suspect can also be booked on additional charges by specifying values
  565.           for the fields at the top of the page and then selecting the BOOK
  566.           animated push button (
  567.  
  568.           NOTE:   since this application is limited in scope, the updates and
  569.           the specification of additional charges are not saved to the .ini
  570.           files; they are only temporarily saved in the suspect object).
  571.  
  572.   o   IAddressView - a canvas created for reuse.  This part was added to the
  573.       Address subpage of the ISuspectNotebook part.
  574.  
  575.   o   IHeightSpinButton - a part that can be used to identify the height of an
  576.       object.  Two numeric spin buttons are used to represent the height.  One
  577.       represents the height in terms of feet, and the other in terms of inches.
  578.       The total height of the object (in inches) is calculated from the value
  579.       of these two buttons and is represented by the height attribute.  This
  580.       part was added to the Personal subpage of the ISuspectNotebook part.
  581.  
  582.   The nonvisual parts that support this application are contained in the fol-
  583.   lowing files:
  584.  
  585.   o   vbrapshtn.vbb
  586.  
  587.       This part file contains the following types of parts:
  588.       -   Parts that represent model parts.  These parts consist of the
  589.           following: IAlias, IArrest, IPerson, and ISuspect.
  590.       -   Parts that subclass the IRecord part (e.g., ISuspectRecord).  These
  591.           parts were created to facilitate expanding the Police Rap Sheet
  592.           application into a client-server application.
  593.  
  594.  
  595.                                The Police Rap Sheet Application -- Page 9 of 10
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.       -   Parts that serve to hide knowledge of where data is stored (e.g.,
  606.           ISuspectClientMgr).
  607.   o   vbsample.vbb
  608.  
  609.       Several parts from this part file are used for implementation purposes.
  610.       IVBBooleanPart is an example of such a part.  The only part that is used
  611.       as a model part is IAddress.
  612.  
  613.   END OF DOCUMENT
  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.