home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / dataflex / findedit.pkg < prev    next >
Encoding:
Text File  |  1993-08-10  |  7.3 KB  |  289 lines

  1. //************************************************************************
  2. //
  3. // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
  4. // All Rights reserved
  5. //
  6. //
  7. //     $Source: /u3/source.30/product/pkg/RCS/findedit.pkg,v $
  8. //     $Revision: 1.1 $
  9. //     $State: Exp $
  10. //     $Author: james $
  11. //     $Date: 1992/09/08 14:43:05 $
  12. //     $Locker:  $
  13. //
  14. //     $Log: findedit.pkg,v $
  15. //Revision 1.1  1992/09/08  14:43:05  james
  16. //Initial revision
  17. //
  18. //Revision 1.7  92/06/20  04:21:14  lee
  19. //altered wrapping to 1) ignore wrap_state, and 2) only save if not a child of 
  20. //a deo (child_wrapping will save if it's a child of a deo).
  21. //
  22. //Revision 1.6  92/06/03  15:19:44  steve-l
  23. //altered WRAPPING to check wrap_state (kindly ignore comments for prior rev.)
  24. //
  25. //Revision 1.5  92/06/03  15:17:29  steve-l
  26. //altered Child_Wrapping for proper argument dereferencing
  27. //
  28. //Revision 1.4  92/06/03  15:09:53  steve-l
  29. //added WRAPPING function
  30. //
  31. //Revision 1.3  92/05/14  15:46:18  unknown
  32. //Updated Copyright slug - SWM.
  33. //
  34. //Revision 1.2  92/03/09  19:01:57  james
  35. //Added #CHKSUB directive to insure source
  36. //only compiled with correct revision of 
  37. //compiler.
  38. //
  39. //Revision 1.1  91/10/23  10:20:43  elsa
  40. //Initial revision
  41. //
  42. //************************************************************************/
  43.  
  44. //************************************************************************
  45. //     File Name: FindEdit.Inc
  46. // Creation Date: January 1, 1991
  47. // Modified Date: May 23, 1991
  48. //     Author(s): Steven A. Lowe
  49. //
  50. // This module defines the messages and properties required to support
  51. // the data-editing standard for data-entry objects, collected in the
  52. // abstract class Find_Edit_Mixin.
  53. //
  54. // This file should be USEd prior to and IMPORTed within the scope of the
  55. // class definition by any user-interface (esp. data-entry) class which
  56. // must support the data-entry object standards.
  57. //
  58. // This file is used by ENTRYFRM.PKG, TEXT_WIN.PKG, and TABLE.PKG.
  59. //************************************************************************/
  60.  
  61.  
  62. //
  63. // Description
  64. //
  65. //   This block defines constants for the spceial find-modes understood by
  66. //   the Request_Find, Request_Read, Request_SuperFind, and Item_Find
  67. //   messages.
  68. //
  69. // Assumptions/Preconditions
  70. //
  71. //   If NEXT_RECORD is already defined as a symbol (i.e. using #REPLACE),
  72. //   it is assumed that FIRST_RECORD and LAST_RECORD are also assigned.
  73. //
  74. // Exceptions
  75. //
  76. //   If NEXT_RECORD is already defined as a symbol, no action is taken.
  77. //
  78. // Notes
  79. //
  80. //   None.
  81. //
  82. #IFSUB 'NEXT_RECORD'
  83. #ELSE
  84.   #REPLACE NEXT_RECORD   5   // find-next 
  85.   #REPLACE FIRST_RECORD  6   // find-first
  86.   #REPLACE LAST_RECORD   7   // find-last 
  87. #ENDIF
  88.  
  89. #CHKSUB 1 1 // Verify the UI subsystem.
  90.  
  91. use ui
  92. class find_edit_mixin is a message
  93.  
  94.   //
  95.   // Description
  96.   //
  97.   //   This procedure defines the accelerator keys and properties required to
  98.   //   support the data-editing standard for data-entry objects.  This includes
  99.   //   accelerator keys to support the finding, clearing, saving, and deleting
  100.   //   of database records, and two properties governing certain automatic
  101.   //   functions of editing (see Notes).
  102.   //
  103.   // Assumptions/Preconditions
  104.   //
  105.   //   This procedure should only be called from within the Construct_Object
  106.   //   procedure of a class definition.
  107.   //
  108.   // Exceptions
  109.   //
  110.   //   None.
  111.   //
  112.   // Notes
  113.   //
  114.   //   The Auto_Save_State property governs whether a Save is automatically
  115.   //   issued upon rotation wrap-around (from the last object/item to the
  116.   //   first object/item).
  117.   //
  118.   //   The Auto_Clear_DEO_State property governs whether a Clear is
  119.   //   automatically issued after a successful Save or Delete operation.
  120.   //
  121.   procedure define_find_edit
  122.     on_key kBegin_of_Data       SEND Beginning_of_Data  PRIVATE
  123.     on_key kClear               SEND Request_Clear      PRIVATE
  124.     on_key kClear_All           SEND Request_Clear_All  PRIVATE
  125.     on_key kDelete_Record       SEND Request_Delete     PRIVATE
  126.     on_key kEnd_of_Data         SEND End_of_Data        PRIVATE
  127.     on_key kFind                SEND Find_GE            PRIVATE
  128.     on_key kFind_Next           SEND Find_Next          PRIVATE
  129.     on_key kFind_Previous       SEND Find_Previous      PRIVATE
  130.     on_key kSave_Record         SEND Request_Save       PRIVATE
  131.     on_key kSuper_Find          SEND SuperFind          PRIVATE
  132.     on_key kSuper_Find_Next     SEND SuperFind_Next     PRIVATE
  133.     on_key kSuper_Find_Previous SEND SuperFind_Previous PRIVATE
  134.     Property integer Auto_Save_State      PUBLIC  0
  135.     Property integer Auto_Clear_DEO_State PUBLIC  1
  136.   end_procedure
  137.  
  138.  
  139.   //
  140.   // Description
  141.   //
  142.   //   This procedure finds greater-than-or-equal-to using the file and field,
  143.   //   if any, of the current item.
  144.   //
  145.   // Assumptions/Preconditions
  146.   //
  147.   //   None.
  148.   //
  149.   // Exceptions
  150.   //
  151.   //   None.
  152.   //
  153.   // Notes
  154.   //
  155.   //   Depends entirely upon Request_Find.
  156.   //
  157.   procedure Find_GE
  158.     send Request_Find GE TRUE
  159.   end_procedure
  160.  
  161.  
  162.   //
  163.   // Description
  164.   //
  165.   //   This procedure finds greater-than using the file and field, if any,
  166.   //   of the current item.
  167.   //
  168.   // Assumptions/Preconditions
  169.   //
  170.   //   None.
  171.   //
  172.   // Exceptions
  173.   //
  174.   //   None.
  175.   //
  176.   // Notes
  177.   //
  178.   //   Depends entirely upon Request_Find.
  179.   //
  180.   procedure Find_Next
  181.     send Request_Find GT TRUE
  182.   end_procedure
  183.  
  184.  
  185.   //
  186.   // Description
  187.   //
  188.   //   This procedure finds less-than using the file and field, if any,
  189.   //   of the current item.
  190.   //
  191.   // Assumptions/Preconditions
  192.   //
  193.   //   None.
  194.   //
  195.   // Exceptions
  196.   //
  197.   //   None.
  198.   //
  199.   // Notes
  200.   //
  201.   //   Depends entirely upon Request_Find.
  202.   //
  203.   procedure Find_Previous
  204.     send Request_Find LT TRUE
  205.   end_procedure
  206.  
  207.  
  208.   //
  209.   // Description
  210.   //
  211.   //   This procedure superfinds greater-than-or-equal-to using the file and
  212.   //   field, if any, of the current item.
  213.   //
  214.   // Assumptions/Preconditions
  215.   //
  216.   //   None.
  217.   //
  218.   // Exceptions
  219.   //
  220.   //   None.
  221.   //
  222.   // Notes
  223.   //
  224.   //   Depends entirely upon Request_SuperFind.
  225.   //
  226.   procedure SuperFind
  227.     send Request_SuperFind GE
  228.   end_procedure
  229.  
  230.  
  231.   //
  232.   // Description
  233.   //
  234.   //   This procedure superfinds greater-than using the file and field, if
  235.   //   any, of the current item.
  236.   //
  237.   // Assumptions/Preconditions
  238.   //
  239.   //   None.
  240.   //
  241.   // Exceptions
  242.   //
  243.   //   None.
  244.   //
  245.   // Notes
  246.   //
  247.   //   Depends entirely upon Request_SuperFind.
  248.   //
  249.   procedure SuperFind_Next
  250.     send Request_SuperFind GT
  251.   end_procedure
  252.  
  253.  
  254.   //
  255.   // Description
  256.   //
  257.   //   This procedure superfinds less-than using the file and field, if any,
  258.   //   of the current item.
  259.   //
  260.   // Assumptions/Preconditions
  261.   //
  262.   //   None.
  263.   //
  264.   // Exceptions
  265.   //
  266.   //   None.
  267.   //
  268.   // Notes
  269.   //
  270.   //   Depends entirely upon Request_SuperFind.
  271.   //
  272.   procedure SuperFind_Previous
  273.     send Request_SuperFind LT
  274.   end_procedure
  275.  
  276.   function wrapping
  277.     //
  278.     // if this is a child of a DEO, it will be saved by child_wrapping.
  279.     // however, if this is not a child of a DEO, and we are wrapping,
  280.     // and auto_save is true, save.
  281.     //
  282.     if (not(component_state(current_object)) AND ;
  283.         auto_save_state(current_object)) ;
  284.         send request_Save
  285.   end_function
  286.  
  287. end_class
  288.  
  289.