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

  1. //************************************************************************
  2. //
  3. // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
  4. // All Rights reserved
  5. // DataFlex is a registered trademark of Data Access Corporation.
  6. //
  7. //
  8. //     $Source: /u3/source.30/product/pkg/RCS/enclient.pkg,v $
  9. //     $Revision: 1.1 $
  10. //     $State: Exp $
  11. //     $Author: james $
  12. //     $Date: 1992/09/08 14:43:04 $
  13. //     $Locker:  $
  14. //
  15. //     $Log: enclient.pkg,v $
  16. //Revision 1.1  1992/09/08  14:43:04  james
  17. //Initial revision
  18. //
  19. //Revision 1.8  92/06/27  09:33:16  lee
  20. //changed child_wrapping to use new clientRecurse flag in inquire msgs.
  21. //
  22. //Revision 1.7  92/06/03  15:09:25  steve-l
  23. //altered child_wrapping to pass origin-object ID to wrap-destination
  24. //
  25. //Revision 1.6  92/05/29  14:06:22  lee
  26. //removed end_construct_* messages from mixins; now, classes that use the mixin
  27. //send the message that used to be sent by the end_construct_* message (for
  28. //efficiency).
  29. //
  30. //Revision 1.5  92/05/14  17:06:02  SWM
  31. //Updated Copyright slug.
  32. //
  33. //Revision 1.4  92/04/20  18:02:31  lee
  34. //added image argument error checking
  35. //
  36. //Revision 1.3  92/03/29  18:44:54  lee
  37. //added MSG_END_CONSTRUCT_OBJECT, moved ENDMAC macro stuff into END_CONSTRUCT-
  38. //OBJECT procedures (in .pkgs). moved Flag_ITems to list.pkg after generalizing
  39. //it based on PROTOTYPE_OBJECT instead of Whether or not it is a table-oriented
  40. //object. Moved define_access_keys mechanism completely into actionbr.pkg.
  41. //fixed two typos: import_class_protocol used !# instead of !3, and register-
  42. //procedure used !1 instead of !2.
  43. //
  44. //Revision 1.2  92/03/09  19:01:18  james
  45. //Added #CHKSUB directive to insure source
  46. //only compiled with correct revision of 
  47. //compiler.
  48. //
  49. //Revision 1.1  91/10/23  10:20:19  elsa
  50. //Initial revision
  51. //
  52. //************************************************************************/
  53.  
  54. //************************************************************************
  55. //     File Name: EnClient.Pkg
  56. // Creation Date: January 1, 1991
  57. // Modified Date: July 1, 1991
  58. //     Author(s): Steven A. Lowe
  59. //
  60. // This module contains the Entry_Client class definition.
  61. //************************************************************************/
  62.  
  63. #CHKSUB 1 1 // Verify the UI subsystem.
  64.  
  65. use NESTING       //include DEO nesting standard support module
  66. use NAVIGATE      //include DEO navigation standard support module
  67. use SERVER        //include Server support module
  68. use VERIFY        //include Verification support module
  69. use ACTIONBR      //include action-bar support module
  70.  
  71.  
  72. //
  73. //Class: Entry_Client
  74. //
  75. //SuperClass: CLIENT
  76. //
  77. //Description: This class implements a data-entry object grouping agent
  78. //
  79. Class Entry_Client is a CLIENT STARTMAC ECstart
  80.  
  81.   //
  82.   //Operation: CONSTRUCT_OBJECT
  83.   //
  84.   //Assumption(s): MyImg identifies an image for the client area
  85.   //
  86.   //Goal(s): define an instance of client with a properties appropriate to
  87.   //  this specialization.
  88.   //
  89.   //Algorithm: augmented to define and initialize properties
  90.   //
  91.   //Usage: used internally
  92.   //
  93.   procedure construct_object integer myImg 
  94.     forward send construct_object myImg
  95.     set Ring_State to false
  96.     Property integer Changed_State PRIVATE 0
  97.     send define_nesting      //invoke DEO nesting standard support constructor
  98.     send define_navigation   //invoke DEO navigation standard support constructor
  99.     send define_server       //invoke Server support constructor
  100.     send define_action_bar   //invoke action-bar support constructor
  101.     send define_verify       //invoke Verification support constructor
  102.   end_procedure
  103.  
  104.   IMPORT_CLASS_PROTOCOL NESTING_Mixin    
  105.   IMPORT_CLASS_PROTOCOL NAVIGATE_Mixin   
  106.   IMPORT_CLASS_PROTOCOL SERVER_Mixin     
  107.   IMPORT_CLASS_PROTOCOL VERIFY_Mixin     
  108.   IMPORT_CLASS_PROTOCOL ACTION_BAR_Mixin 
  109.  
  110.  
  111.  
  112.   //
  113.   // created for Navigation support
  114.   //
  115.   procedure Top_of_Panel
  116.     local integer firstChild curFoc#
  117.     get focus of desktop to curFoc#
  118.     if (Has_Components_State(current_object)) begin
  119.       get find_first_deo to firstChild
  120.       if firstChild ne 0 send Top_Of_Panel to firstChild
  121.       else if current_object ne curFoc# send activate
  122.     end
  123.     else if current_object ne curFoc# send activate
  124.   end_procedure
  125.  
  126.   //
  127.   // created for Navigation support
  128.   //
  129.   procedure Bottom_of_Panel
  130.     local integer lastChild curfoc#
  131.     get focus of desktop to curFoc#
  132.     if (Has_Components_State(current_object)) begin
  133.       get Find_Last_DEO to lastChild
  134.       if lastChild ne 0 begin
  135.         send Bottom_Of_Panel to lastChild
  136.         procedure_return
  137.       end
  138.     end
  139.     if current_object ne curFoc# send activate
  140.   end_procedure
  141.  
  142.   //
  143.   // created for Navigation support
  144.   //
  145.   procedure Child_Wrapping integer direction integer ignoreThisID
  146.     local integer ChildID curfoc# origID
  147.  
  148.     get focus of desktop to curFoc#
  149.     if direction eq 0 begin             //wrapping backward, first to last
  150.       set Last_DEO to 0
  151.       broadcast_focus send inquire_last_deo current_object FALSE  //sets last_DEO prop.
  152.       get Last_DEO to ChildID
  153.       if ChildID ne 0 begin
  154.         set First_DEO to 0
  155.         broadcast_focus send inquire_first_deo current_object TRUE //sets first_DEO prop.
  156.         get First_DEO to origID
  157.         if origID eq 0 move ChildID to origID
  158.         send child_wrapping to ChildID direction origID  //pass origin iff DEO or dest
  159.       end
  160.       else if current_object ne curFoc# send activate
  161.     end
  162.     else begin                          //wrapping forward, last to first
  163.       set First_DEO to 0
  164.       broadcast_focus send inquire_first_deo current_object FALSE //sets first_DEO prop.
  165.       get First_DEO to ChildID
  166.       if ChildID ne 0 begin
  167.         set Last_DEO to 0
  168.         broadcast_focus send inquire_last_deo current_object TRUE  //sets last_DEO prop.
  169.         get Last_DEO to origID
  170.         if origID eq 0 move ChildID to origID
  171.         send child_wrapping to ChildID direction origID  //pass origin iff DEO or dest
  172.       end
  173.       else if current_object ne curFoc# send activate
  174.     end
  175.     procedure_return 1
  176.   end_procedure
  177.  
  178.   //
  179.   // created for Server support
  180.   //
  181.   procedure display
  182.     broadcast send display   
  183.   end_procedure
  184.  
  185.   //
  186.   // created for Server support
  187.   //
  188.   procedure clear
  189.     broadcast send clear
  190.   end_procedure
  191.  
  192.   //
  193.   // created for Server support
  194.   //
  195.   procedure clear_set
  196.     broadcast send clear_set
  197.   end_procedure
  198.  
  199.   //
  200.   // created for property support
  201.   //
  202.   function Changed_State returns integer
  203.     local integer retval
  204.     get Entry_Client.Changed_State to retval
  205.     function_Return retval
  206.   end_function
  207.  
  208.   //
  209.   // cancelled from Server mixin
  210.   //
  211.   procedure SET Changed_State integer newVal
  212.   end_procedure
  213.  
  214.   //
  215.   // created for EntItem convenience
  216.   //
  217.   procedure Entry_Clear integer file# 
  218.     if (Has_Components_State(current_object)) ;
  219.         broadcast send Entry_Clear file#
  220.   end_procedure
  221.  
  222.   //
  223.   // created for EntItem convenience
  224.   //
  225.   procedure Entry_Clear_All integer file# 
  226.     if (Has_Components_State(current_object)) ;
  227.         broadcast send Entry_Clear_All file#
  228.   end_procedure
  229.  
  230.   //
  231.   // created for EntItem convenience
  232.   //
  233.   procedure Entry_Display integer file# integer flag
  234.     if (Has_Components_State(current_object)) ;
  235.         broadcast send Entry_Display file# flag
  236.   end_procedure
  237.  
  238.   //
  239.   // created for EntItem convenience
  240.   //
  241.   procedure Entry_Update integer file# integer flag
  242.     if (Has_Components_State(current_object)) ;
  243.         broadcast send Entry_Update file# flag
  244.   end_procedure
  245.  
  246.   procedure End_Construct_Object
  247.     send Mark_Components      // nesting
  248.     send Define_Access_Keys 0 // action_bar_keys
  249.     forward send End_Construct_Object
  250.   end_procedure
  251.  
  252. end_class
  253.  
  254.  
  255. //
  256. //Support Commands
  257. //
  258.  
  259. //
  260. // ECstart <className> <ImageName> {ACTION_BAR <ActionBar#>} {POP_UP}
  261. //     {RING} {USING <DataSetID>}
  262. //
  263. // this macro handles the creation-statement syntax for Entry_Clients
  264. //
  265. #COMMAND ECstart R 
  266.   #IFDEF !2
  267.   #ELSE
  268.     #IFDEF !2.N
  269.     #ELSE
  270.       #ERROR 100 IMAGE ARGUMENT MISSING IN OBJECT STATEMENT
  271.     #ENDIF
  272.   #ENDIF
  273.   FORWARD_BEGIN_CONSTRUCT !1 !2
  274.   bind_using !2 !3 !4 !5 !6 !7 !8 !9
  275.   bind_action_bar !2 !3 !4 !5 !6 !7 !8 !9
  276.   bind_pop_up !2 !3 !4 !5 !6 !7 !8 !9
  277.   bind_ring !2 !3 !4 !5 !6 !7 !8 !9
  278. #ENDCOMMAND
  279.    
  280.