home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / dataflex / pes.frm < prev    next >
Encoding:
Text File  |  1993-05-19  |  52.6 KB  |  1,288 lines

  1.  
  2. USE UI
  3. SET APPLICATION_NAME to "PES"
  4. // *********************************************************************
  5. //  System: PES (Personal Expense System)                              *
  6. // Program: PES.FRM                                                    *
  7. //  Author: Doug Goldner 7/9/90                                        *
  8. // Purpose: Personal Expense System master program. Allows modification*
  9. //          of all files and creation of new expense entries.          *
  10. // *********************************************************************
  11. /Title
  12. ______________________________________________________________________________
  13. /action_bar
  14.     ______  ____  ____  ____                                                  
  15. /Record_Exit_Pull_Down
  16. ┌──────────────────────────────────┐
  17. │  ______________________________  │
  18. │  ______________________________  │
  19. │  ______________________________  │
  20. │  ______________________________  │
  21. │  ______________________________  │
  22. │  ______________________________  │
  23. │  ______________________________  │
  24. │  ______________________________  │
  25. │  ______________________________  │
  26. │  ______________________________  │
  27. │  ______________________________  │
  28. │  ______________________________  │
  29. ├──────────────────────────────────┤
  30. │  ______________________________  │
  31. └──────────────────────────────────┘
  32. /view_pull_down
  33. ┌──────────────────────┐
  34. │  ___________________ │
  35. │  ___________________ │
  36. │  ___________________ │
  37. │  ___________________ │
  38. │  ___________________ │
  39. │  ___________________ │
  40. └──────────────────────┘
  41. /edit_pull_down
  42. ┌────────────────────┐
  43. │  _________________ │
  44. │  _________________ │
  45. └────────────────────┘
  46. /Choose_Event
  47. ┌────────────────────────────────────┐
  48. │          Choose an Event           │
  49. │                                    │
  50. │  ____________ ____________________ │
  51. │  ____________ ____________________ │
  52. │  ____________ ____________________ │
  53. │  ____________ ____________________ │
  54. │  ____________ ____________________ │
  55. └────────────────────────────────────┘
  56. /Choose_Person
  57. ┌──────────────────────────────────────────────────────┐
  58. │                    Choose a Person                   │
  59. │                                                      │
  60. │  ________ ____________________ ____________________  │
  61. │  ________ ____________________ ____________________  │
  62. │  ________ ____________________ ____________________  │
  63. │  ________ ____________________ ____________________  │
  64. │  ________ ____________________ ____________________  │
  65. └──────────────────────────────────────────────────────┘
  66. /Choose_Tran_Typ
  67. ┌───────────────────────────┐
  68. │ Choose a Transaction Type │
  69. │                           │
  70. │   ____________________    │
  71. │   ____________________    │
  72. │   ____________________    │
  73. │   ____________________    │
  74. └───────────────────────────┘
  75. /Choose_Payment_Type
  76. ┌───────────────────────────┐
  77. │   Choose a Payment Type   │
  78. │                           │
  79. │   ____________________    │
  80. │   ____________________    │
  81. │   ____________________    │
  82. │   ____________________    │
  83. └───────────────────────────┘
  84. /Transact_Screen
  85. ┌────────────────────────────────────────────────────────────────────────────┐
  86. │                            Transaction Edit                                │
  87. │ Assignment Identifier                                                      │
  88. │    Person Unique ID . . . ________                                         │
  89. │    Name   . . . . . . . . ____________________ , ____________________      │
  90. │                                                                            │
  91. │    Event Unique ID  . . . ________                                         │
  92. │    Event Name   . . . . . ____________________   __/__/__ thru __/__/__    │
  93. │                                                                            │
  94. │    Cash Advanced  . . . . $______.__    Cash Spent . . $______.__          │
  95. │    Credit Spent   . . . . $______.__    Total Spent  . $______.__          │
  96. │ ┌────────────────────────── Transaction Details ─────────────────────────┐ │
  97. │ │    Date      Type             Amount    Payment   Receipt?             │ │
  98. │ │    __/__/__  _______________  $____.__  ________  _                    │ │
  99. │ │    __/__/__  _______________  $____.__  ________  _                    │ │
  100. │ │    __/__/__  _______________  $____.__  ________  _                    │ │
  101. │ └────────────────────────────────────────────────────────────────────────┘ │
  102. │ Comments:                                                                  │
  103. │                                                                            │
  104. │                                                                            │
  105. └────────────────────────────────────────────────────────────────────────────┘
  106. /Verify_Image
  107. ╔══════════════════════════════╗
  108. ║ ____________________________ ║
  109. ║ ┌──────────────────────────┐ ║
  110. ║ │     <__>   <______>      │ ║
  111. ║ └──────────────────────────┘ ║
  112. ╚══════════════════════════════╝
  113. /about
  114. ╔═════════════════════════════════════════════════════╗
  115. ║_____________________________________________________║
  116. ║─────────────────────────────────────────────────────║
  117. ║                                                     ║
  118. ║                       P E S                         ║
  119. ║                                                     ║
  120. ║                   Version 1.00b                     ║
  121. ║              Written by Doug Goldner                ║
  122. ║                                                     ║
  123. ║     Copyright 1987-1992 Data Access Corporation     ║
  124. ║         Miami FL, USA - All rights reserved         ║
  125. ║                                                     ║
  126. ║              Memory: __________ Bytes               ║
  127. ║                                                     ║
  128. ║                         <__>                        ║
  129. ╚═════════════════════════════════════════════════════╝
  130. /*
  131. //*************************************************************************
  132. //************************ Initialization Routines ************************
  133. //*************************************************************************
  134.  
  135. // Open the files that we are using in this program 
  136.   
  137.   open Assign
  138.   open Person
  139.   open Event
  140.   open Tran_Typ
  141.   open Transact
  142.  
  143.  
  144. //**************************************************************************
  145. //************************* Package Inclusions *****************************
  146. //**************************************************************************
  147.  
  148. // Tell the DataFlex compiler which packages we are using. The UI package
  149. // is a special case of the USE command which tells DataFlex to include the
  150. // UI initialization code from FMAC.
  151.   
  152.   Use UI
  153.   Use Data_Set
  154.   Use Menu
  155.   Use Sellist
  156.   Use Text_win
  157.   Use Table
  158.   Use EntryFrm
  159.   Use PickList
  160.   Use Enterr
  161.  
  162. // Define our help system object. It is named Help and is of type Help_System
  163. // (the standard help class). No other information is required since the
  164. // Help System package defines the image and all associated properties of
  165. // the object.
  166.  
  167.   Use Help
  168.   set Filename_Prefix of Help_Object to "PES"
  169.  
  170. // Break our main image down into a sub image and a main image. We 
  171. // defined them as one big image and broke them down with the 
  172. // Sub_Page command so that our positioning would be easier to code.
  173.  
  174.   Sub_Page Transact_Entry   FROM Transact_Screen  RECTANGULAR 12 5 3
  175.   Sub_Page Transact_Header  FROM Transact_Screen 1 2 3 4 5 6 7 8 9 10 11 
  176.   Sub_Page Ok_Cancel_Prompt FROM Verify_Image     2 3
  177.  
  178.  
  179. //**************************************************************************
  180. //************************* Object Definitions *****************************
  181. //**************************************************************************
  182.  
  183.   // The Verify_It object is a generic object used to pop-up a verification
  184.   // object. The function VALIDATE_OK is used to set the verification
  185.   // message and returns a MSG_OK if the user chooses OK. It is used
  186.   // like this:
  187.   //   If (Validate_Ok(Verify_It.obj,"Delete Confirmation")) eq MSG_OK ...
  188.   
  189.  
  190.   object Verify_It is a CLIENT Verify_Image
  191.  
  192.      set LOCATION to 7 25 ABSOLUTE
  193.      set CENTER_STATE of current_object item 0 to TRUE
  194.      
  195.      // Define this object (and its children) as a separate, popped up
  196.      // object with an entirely different scope. This will automatically
  197.      // turn off the mouse when in this object (you cannot click on other
  198.      // objects) and it will not send the Exit and Entry messages when this
  199.      // object is activated.
  200.      
  201.      set SCOPE_STATE to TRUE
  202.      set POPUP_STATE to TRUE
  203.      
  204.      object Ask_Ok is a button Ok_Cancel_Prompt
  205.  
  206.         item_list
  207.             On_Item "OK"     SEND Ok
  208.             On_Item "CANCEL" SEND Cancel
  209.         end_item_list
  210.      
  211.      End_Object // Ask_Ok
  212.         
  213.      function Validate_Ok string Description returns integer
  214.         local integer Return_Val
  215.         set VALUE of Verify_It item 0 to Description
  216.         ui_accept Verify_It object to Return_Val
  217.         function_return Return_Val
  218.      end_function
  219.  
  220.   End_Object // Verify_It
  221.  
  222. // The global function verify_a_delete returns a 1 if the delete is
  223. // aborted, or a 0 if it is confirmed.
  224.  
  225. function verify_a_delete returns integer
  226.    if (Validate_Ok(Verify_It.obj,"Delete Confirmation")) ne MSG_OK ;
  227.       function_Return 1
  228. end_function
  229.  
  230.  
  231.  
  232. // We kept the Trace Object included in the example so that you can see
  233. // how it is used. To invoke the trace object, press the Shift-F10 keys
  234. // while running the program.
  235.  
  236. use traceobj
  237.  
  238. // We need to register all objects which we refer to prior to their appearance
  239. // in the source code.
  240.  
  241. register_object Choose_Event
  242. register_object Choose_Person
  243. register_object Assign_Data_Set
  244. register_object Event_Client
  245. register_object Person_Entry
  246. register_object Tran_Typ_Entry
  247. register_object Choose_Tran_Typ
  248. register_object Choose_Payment_Type
  249. register_object Assignment_Entry
  250.  
  251. //**************************************************************************
  252. //************************* Our Action Bar Object **************************
  253. //**************************************************************************
  254.  
  255.  
  256.   // Here, we create our action bar using the Create_Menu command defined
  257.   // in the Menu package.
  258.  
  259.   Create_Menu action_bar LOCATION 1 0 ABSOLUTE
  260.  
  261.          SET ACTION_BAR_KEYS_MSG TO MAIN_MENU_KEYS
  262.       
  263.       // recde_Pd.inc is a section of code which defines the RECORD
  264.       // action bar item (with EXIT as the last choice).
  265.       // It saves us from having to insert all of the
  266.       // On_Item commands for the RECORD pull down in every program
  267.       // that uses it. Look at the file Recde_Pd.Inc to see what code
  268.       // is invoked by its use.
  269.  
  270.       #include RECDE_PD.INC
  271.       
  272.       On_Item 'View' begin_pull_down View_pull_down
  273.          On_Item "Transactions..."        send activate_scope to ;
  274.             (Assign_Data_Set(desktop))
  275.          On_Item "Events..."              send activate_scope to ;
  276.             (Event_Client(Desktop))
  277.          On_Item "People..."              send activate_scope to ;
  278.             (Person_Entry(Desktop))
  279.          On_Item "Assignments..."         send activate_scope to ;
  280.             (Assignment_Entry(Desktop))
  281.          On_Item "Transaction Types..."   send activate_scope to ;
  282.             (Tran_Typ_Entry(Desktop))
  283.          On_Item "Expense Report..."      send Show_Expense_Report to ;
  284.             desktop
  285.       End_Pull_Down
  286.     
  287.       On_Item 'Edit' begin_pull_down Edit_Pull_Down
  288.          on_item "Prompt  F4"         send prompt
  289.          on_item "Zoom    Alt+F6"     send zoom
  290.       End_Pull_Down 
  291.     
  292.       #include helpa_pd.inc
  293.       
  294.    End_Menu // Action_Bar
  295.  
  296.        PROCEDURE MAIN_MENU_KEYS FOR DESKTOP INTEGER ACT_OBJ
  297.          ON_KEY KEY_ALT+KEY_R SEND ACTIVATE_PULL_DOWN TO (Record_PULL_DOWN(ACT_OBJ)) PRIVATE
  298.          ON_KEY KEY_ALT+KEY_V SEND ACTIVATE_PULL_DOWN TO (VIEW_PULL_DOWN(ACT_OBJ)) PRIVATE
  299.          ON_KEY KEY_ALT+KEY_E SEND ACTIVATE_PULL_DOWN TO (Edit_PULL_DOWN(ACT_OBJ)) PRIVATE
  300.          ON_KEY KEY_ALT+KEY_H SEND ACTIVATE_PULL_DOWN TO (HELP_PULL_DOWN(ACT_OBJ)) PRIVATE
  301.        END_PROCEDURE
  302.  
  303. // Define our Data sets. Since multiple data entry objects can use the
  304. // same data set, it is generally a good idea to define the data sets
  305. // at the beginning of your program so that all data entry objects
  306. // can refer to the same set of data sets.
  307.  
  308. Object Event_Data_Set is a Data_Set NO_IMAGE Main_File ;
  309.    EVENT 
  310. End_Object // Event_Data_Set
  311.  
  312. Object Person_Data_Set is a Data_Set NO_IMAGE Main_File ;
  313.    PERSON  
  314. End_Object // Person_Data_Set
  315.  
  316. Object Tran_Typ_Data_Set is a Data_Set NO_IMAGE Main_File ;
  317.    TRAN_TYP 
  318. End_Object // Tran_Typ_Data_Set
  319.  
  320.  
  321. // Data sets can also be defined as parents of data entry objects. You
  322. // would do this to visually enforce data set relationships.
  323.  
  324. // Define the Data Set that oversees creation/modification of the assigment
  325. // file. The name of the Data Set is Assign_Data_Set and it uses
  326. // an image named Transact_Screen.
  327. // The Entry_Form of the Data Set is for finding
  328. // Assignment/Person/Event records and the Table is for editing/creating
  329. // individual Transactions.
  330.  
  331. // The updating component lists other data sets which this data set updates.
  332. // Normally, a data set UPDATEs all data sets which are parents of the
  333. // main file for the data set. In this case, ASSIGN relates to Event and
  334. // Person so the data set for ASSIGN UPDATEs the Event and Person data sets.
  335. // Notice, because Event_Data_Set and Person_Data_Set are forward referenced,
  336. // we need to refer to them using their "access methods." That is why we
  337. // use (Event_Data_Set(Desktop)) instead of just Event_Data_Set.obj
  338. // The ACTION_BAR component lists the Action Bar object to switch to when
  339. // the switch to action bar key is pressed.
  340.  
  341.    Object Assign_Data_Set is a DATA_SET Transact_Screen ;
  342.       ACTION_BAR Action_Bar.obj RING;
  343.       MAIN_FILE Assign;
  344.       UPDATING;
  345.       (Event_Data_Set(desktop));
  346.       (Person_Data_Set(Desktop))
  347.                                                    
  348.       set LOCATION to 2 0 ABSOLUTE
  349.       set VERIFY_DELETE_MSG to GET_VERIFY_A_DELETE
  350.       
  351.  
  352.        // Define the Transact_Header Entry_Form. This object is the UI
  353.        // component that allows the user to communicate with the Data Set.
  354.        // Because it appears nested within our data set, it assumes that its
  355.        // data set is its parent. See below for examples of UI objects which
  356.        // communicate with data sets which are not their parents.
  357.        
  358.        Object Transact_Header is an ENTRY_FORM Transact_Header 
  359.        
  360.           // Override the FIND keys to perform SUPERFINDs
  361.           
  362.           on_key kFind                SEND SuperFind          
  363.           on_key kFind_Next           SEND SuperFind_Next     
  364.           on_key kFind_Previous       SEND SuperFind_Previous 
  365.           
  366.           // Here, we list the individual fields to enter data into
  367.           // including any entry options we want placed on the field 
  368.           // (within {} )
  369.                                                                                                             
  370.           Item_List
  371.              
  372.              // The following is a list of which fields we want displayed
  373.              // and will allow the user to see. The entry options are
  374.              // enclosed in curly braces to the right of the Entry_Item
  375.              // lines.
  376.              
  377.              Entry_Item Person.Id         ;
  378.                 {AUTOFIND, CAPSLOCK, iPROMPT=(Choose_Person(desktop))}
  379.              Entry_Item Person.Last       {DISPLAYONLY}
  380.              Entry_Item Person.First      {DISPLAYONLY}
  381.              Entry_Item Event.Id          ;
  382.                 {CAPSLOCK, AUTOFIND, FINDREQ,iPROMPT=(Choose_Event(desktop))}
  383.              Entry_Item Event.Name        {DISPLAYONLY}
  384.              Entry_Item Event.Start       {DISPLAYONLY}
  385.              Entry_Item Event.End         {DISPLAYONLY}
  386.              
  387.              // The following Entry_Item are display only and show
  388.              // calculated totals from the assignment file. This data is
  389.              // updated in the Backout and Update procedures.
  390.              
  391.              Entry_Item Assign.Cash_Adv     {DISPLAYONLY}
  392.              Entry_Item Assign.Cash_Spent   {DISPLAYONLY}
  393.              Entry_Item Assign.Credit_Spent {DISPLAYONLY}
  394.              Entry_Item (Assign.Cash_Spent + Assign.Credit_Spent)
  395.            
  396.            End_Item_List
  397.         
  398.         End_Object // Transact_Header
  399.         
  400.          
  401.         // We need to define another Data Set for our virtual table
  402.         // since we are dealing with another file (Transact).
  403.         // Since we have nested this Data Set within our ASSIGN data set,
  404.         // we do not need to use the UPDATING clause since nesting of
  405.         // data sets implies an UPDATING.
  406.          
  407.         Object Transact_Entry_Header is a Data_Set Transact_Entry RING;
  408.                                      MAIN_FILE Transact  ;
  409.                                      updating tran_typ_data_set.obj
  410.  
  411.            set VERIFY_DELETE_MSG to GET_VERIFY_A_DELETE
  412.                
  413.             // Here, we define our Virtual Table object that will allow the
  414.             // user to enter/edit multiple expense items at once. It is
  415.             // called Transact_Entry.  It talks to the Transact_Entry_Header
  416.             // data set since it is nested as a child of that data set.
  417.             // The RING option tells the Table to create a closed focus list.
  418.             // The NEXT and PREVIOUS keys will rotate within the table 
  419.             // (perhaps wrapping at top and bottom).
  420.  
  421.             Object Transact_Entry is a Table Transact_Entry by index.1
  422.  
  423.                // Force the Switch and Switch_Back key to exit the
  424.                // table and go back into the entry_form or down into
  425.                // the edit object.
  426.                on_key KSWITCH send SWITCH_NEXT_GROUP
  427.                on_key KSWITCH_BACK send SWITCH_PRIOR_GROUP
  428.  
  429.                // We want our Scroll Bar to be at a different location than
  430.                // the default so we create it (by making it visible) and then
  431.                // change its location.
  432.                                         
  433.                set SCROLL_BAR_VISIBLE_STATE to TRUE
  434.                set LOCATION of (ScrollBar(current_object)) to 13 62 RELATIVE
  435.                
  436.                // Below, we define a prototype row. We list all of the
  437.                // entries that the row needs to have along with appropriate
  438.                // entry options.
  439.  
  440.                Begin_Row
  441.     
  442.                   Entry_Item Transact.Date
  443.                   Entry_Item Tran_Typ.Type_Code    ;
  444.                      {CAPSLOCK, AUTOFIND, FINDREQ, ;
  445.                      iPROMPT=(Choose_Tran_Typ(Desktop))}
  446.                   Entry_Item Transact.Amount       {AUTOCLEAR}
  447.                   Entry_Item Transact.Payment_Typ  ;
  448.                      {CAPSLOCK,IVALIDATE=Get_Validate_Pay_Typ, ;
  449.                      iPROMPT=(Choose_Payment_Type(Desktop))}
  450.                   Entry_Item Transact.Receipt      {CAPSLOCK, CHECK="YN "}
  451.  
  452.                End_Row
  453.  
  454.                // Override the Help_Name function to return a help
  455.                // name unique for each item in our table. The return
  456.                // will be the old help name followed by the current
  457.                // column number.
  458.                
  459.                function Help_Name returns string
  460.                   local string temp_name
  461.                   local integer temp_item
  462.                   forward get Help_Name to temp_name               
  463.                   get current_item to temp_item
  464.                   
  465.                   // Determine our column number by subtracting the
  466.                   // first item in our row from the curret item in the
  467.                   // row.
  468.                   
  469.                   move (temp_item - base_item(current_object)) to temp_item
  470.                   function_return (temp_name + "." + string(temp_item))
  471.                End_Function // Help_Name                
  472.                procedure Request_Delete
  473.                  forward send Request_Delete
  474.                  // After we're done updating data in the assignment file,
  475.                  // we need to tell the data entry object (Transact_Header)
  476.                  // to redisplay the changed values.
  477.                  send Entry_Display to (Transact_Header(Current_Object)) 0 0
  478.                end_procedure
  479.  
  480.                procedure save_Row
  481.                  forward send save_Row
  482.                  // After we're done updating data in the assignment file,
  483.                  // we need to tell the data entry object (Transact_Header)
  484.                  // to redisplay the changed values.
  485.                  send Entry_Display to (Transact_Header(Current_Object)) 0 0
  486.                end_procedure
  487.  
  488.                // Define our validation function for the Pay Type field.
  489.                // If this function returns a 1, the user is not allowed to
  490.                // progress past this field, otherwise, the user can.
  491.                   
  492.                function Validate_Pay_Typ integer Item_Number returns integer
  493.  
  494.                   local integer fine
  495.                   local string Temp_Value
  496.  
  497.                   // What we are doing is making sure that the user has
  498.                   // entered the name of a credit card that the user has
  499.                   // set up in his person file.
  500.                   
  501.                   move 0 to fine
  502.                   get value of current_object item Item_Number to Temp_Value
  503.                   if Temp_Value ne "CASH" begin
  504.                      if Person.Card_1 ne '' if Person.Card_1 eq Temp_Value ;
  505.                         move 1 to fine
  506.                      if Person.Card_2 ne '' if Person.Card_2 eq Temp_Value ;
  507.                         move 1 to fine
  508.                      if Person.Card_3 ne '' if Person.Card_3 eq Temp_Value ;
  509.                         move 1 to fine
  510.                      
  511.                      // If we haven't found a match (between the card the
  512.                      // user typed in and the user's record in the person
  513.                      // file) declare an error and cause the validation
  514.                      // to fail (by function_return 1).
  515.                      
  516.                      if fine eq 0 begin
  517.                         error 201 'Invalid Payment Type (press PROMPT)'
  518.                         function_return 1
  519.                      end
  520.                   end
  521.                end_function
  522.                   
  523.             End_Object // Transact_Entry
  524.  
  525.             // This procedure is called when we edit or delete an
  526.             // existing record. It decrements the ASSIGN file with
  527.             // the values from the TRANSACT file.
  528.  
  529.             procedure Backout
  530.                if Transact.Payment_Typ eq "CASH" ;
  531.                   move (Assign.Cash_Spent - Transact.Amount) to ;
  532.                      Assign.Cash_Spent
  533.                 else move (Assign.Credit_Spent - Transact.Amount) to ;
  534.                    Assign.Credit_Spent
  535.              end_procedure
  536.  
  537.             // This procedure is called when we save a record (either a
  538.             // new or existing record). It increments the ASSIGN file
  539.             // with the values from the TRANSACT file.
  540.  
  541.             procedure Update
  542.                if Transact.Payment_Typ eq "CASH" ;
  543.                   move (Assign.Cash_Spent + Transact.Amount) to ;
  544.                      Assign.Cash_Spent
  545.                 else move (Assign.Credit_Spent + Transact.Amount) to ;
  546.                    Assign.Credit_Spent
  547.             end_procedure
  548.                
  549.         End_Object // Transact_Entry_Header
  550.            
  551.         // Define the Text_Window object used in our Entry Form for 
  552.         // the ASSIGN comment field.
  553.         // The Text_Window object also talks to the Assign
  554.         // Data Set. The FOR clause tells the Text_Window what field
  555.         // it is for.
  556.          
  557.         Object Edit_Event_Comment is a Text_Window FOR Assign.Comments 
  558.   
  559.           set LOCATION to 18 2 RELATIVE
  560.           set SIZE to 2 72
  561.             
  562.         End_Object // Edit_Event_Comment
  563.          
  564.      End_Object // Assign_Data_Set
  565.          
  566.  
  567. //**************************************************************************
  568. //**************** Images and objects for editing the EVENT file ***********
  569. //**************************************************************************
  570.  
  571. /Event_Entry
  572. ┌────────────────────────────────────────────────────────────────────────────┐
  573. │                                  Event Edit                                │
  574. │                                                                            │
  575. │ Unique ID  . . . ________                                                  │
  576. │ Event Name . . . ____________________                                      │
  577. │ Start Date . . . __/__/__                                                  │
  578. │ End Date . . . . __/__/__                                                  │
  579. │                                                                            │
  580. │ Comments                                                                   │
  581. │                                                                            │
  582. │                                                                            │
  583. │                                                                            │
  584. │                                                                            │
  585. │                                                                            │
  586. │                                                                            │
  587. │                                                                            │
  588. │                                                                            │
  589. │ <_______>  <__________>                                                    │
  590. │                                                                            │
  591. └────────────────────────────────────────────────────────────────────────────┘
  592. /event_client
  593. /*
  594. // Define our sub_page for our button object.
  595.  
  596. Sub_Page Event_Buttons FROM Event_Entry 5 6
  597.  
  598. object Event_Client is an Entry_Client Event_Client RING
  599. // Define the Event_Entry Entry_Form. This is the UI Component that
  600. // talks to the Event data set (Event_Data_Set). Note the USING clause
  601. // which tells the entry_form who its data set is.
  602. // The ACTION_BAR clause tells the UI object what action bar to switch to
  603. // when the user presses the switch to action bar key.
  604.      
  605.    Object Event_Entry is an Entry_Form Event_Entry ACTION_BAR Action_Bar.obj ;
  606.                                                    USING Event_Data_Set.obj
  607.      
  608.       set LOCATION to 3 0 ABSOLUTE
  609.          
  610.       procedure switch_back
  611.       end_procedure
  612.       
  613.       // Here, we list the individual fields to enter data into including any
  614.       // entry options we want placed on the field (within {} )
  615.  
  616.       Item_List
  617.           
  618.          Entry_Item Event.Id   {AUTOFIND, CAPSLOCK}
  619.          Entry_Item Event.Name 
  620.          Entry_Item Event.Start
  621.          Entry_Item Event.End
  622.     
  623.       End_Item_List
  624.  
  625.         
  626.       // Define the Text_Window object used in our Entry Form for the Event
  627.       // comment field.
  628.       // The Text_Window object also talks to the Event Data Set (see the
  629.       // USING clause). The FOR clause tells the Text_Window what field
  630.       // it is for.
  631.          
  632.       Object Edit_Event_Comment is a Text_Window USING Event_Data_Set.obj ;
  633.                                                       FOR Event.Comment
  634.   
  635.          set LOCATION to 10 2 RELATIVE
  636.          set SIZE to 6 73
  637.      
  638.          procedure switch
  639.          end_procedure
  640.          
  641.       End_Object // Edit_Event_Comment
  642.   
  643.       // Define the button object used in our Entry Form (we pop up our 
  644.       // buttons at the bottom of the screen to allow a mouse user to "click" 
  645.       // on a function rather than having to press a key and to act as a quick
  646.       // key reference for a keyboard user). The object is named Event_Buttons
  647.       // and defaults to using an image of the same name.
  648.  
  649.       Object Event_Buttons is a Button
  650.  
  651.          // We don't want the user to be able to rotate down to the button
  652.          // area so we change the Focus_Mode of the object to Pointer_Only.
  653.          // This makes sure that the button object cannot take the focus,
  654.          // however, it CAN still be clicked on and WILL send the appropriate
  655.          // message, it just won't RETAIN the focus.
  656.  
  657.          set FOCUS_MODE to POINTER_ONLY
  658.  
  659.          Item_List
  660.     
  661.             // Perform help if the first button is clicked
  662.             On_Item "F1=Help" send Help
  663.            
  664.             // Exit this client if the second button is clicked.
  665.             On_Item "ESC=Cancel" send Request_Cancel
  666.  
  667.          End_Item_List
  668.  
  669.       End_Object // Event_Buttons
  670.      
  671.    End_Object // Event_Entry
  672. End_Object
  673.  
  674.    // The Choose_Event object is a selection list. It is called by any
  675.    // UI component which wants to invoke a pop-up list of events from
  676.    // the Event file. This program uses it when the user presses the
  677.    // PROMPT key while looking up an assignment or entering new assignments   
  678.    // Because it uses the Event file, its USING clause specifies the
  679.    // Event_Data_Set.
  680.    
  681.    Object Choose_Event is a Selection_List Choose_Event POP_UP RING USING ;
  682.                                            Event_Data_Set.obj by index.1
  683.                                                                
  684.       set LOCATION to 8 17 ABSOLUTE
  685.       // We set the SCOPE_STATE to true whenever an object is a different
  686.       // entity (a different set of related objects etc.). In previous
  687.       // objects, we didn't need to do this since we invoked those objects
  688.       // with the ACTIVATE_SCOPE message from the action bar. The 
  689.       // ACTIVATE_SCOPE message automatically sets the SCOPE_STATE of the
  690.       // object it activates.
  691.         
  692.       set SCOPE_STATE to TRUE
  693.    
  694.       Begin_Row
  695.    
  696.          Entry_Item Event.Id
  697.          Entry_Item Event.Name
  698.    
  699.       End_Row
  700.  
  701.    End_Object // Choose_Event
  702.  
  703.    // The Choose_Person object is a selection list. It is called by any
  704.    // UI component which wants to invoke a pop-up list of people from
  705.    // the Person file. This program uses it when the user presses the
  706.    // PROMPT key while looking up an assignment or entering new assignments.
  707.    // Because it uses the Person file, its USING clause specifies the
  708.    // Person_Data_Set.
  709.  
  710.    Object Choose_Person is a Selection_List Choose_Person POP_UP RING USING ;
  711.                Person_Data_Set.obj by index.1
  712.    
  713.       set LOCATION to 8 11 ABSOLUTE
  714.       set SCOPE_STATE to TRUE
  715.       
  716.       Begin_Row
  717.    
  718.          Entry_Item Person.Id
  719.          Entry_Item Person.First
  720.          Entry_Item Person.Last
  721.    
  722.       End_Row
  723.  
  724.    End_Object // Choose_Person
  725.  
  726.  
  727. //**************************************************************************
  728. //************ The images and objects for editing the PERSON file **********
  729. //**************************************************************************
  730.  
  731. /Choose_Card
  732. ╔═══════════════════════════╗
  733. ║ Choose a credit card type ║
  734. ║                           ║
  735. ║       ____________        ║
  736. ║       ____________        ║
  737. ║       ____________        ║
  738. ║       ____________        ║
  739. ╚═══════════════════════════╝
  740. /Person_Entry
  741. ┌────────────────────────────────────────────────────────────────────────────┐
  742. │                                 Person Edit                                │
  743. │ Personal Information                                                       │
  744. │                                                                            │
  745. │    Person Unique ID . . . ________                                         │
  746. │    Name   . . . . . . . . ____________________ , ____________________      │
  747. │                                 (Last)                  (First)            │
  748. │    Department   . . . . . ____________________                             │
  749. │    Title    . . . . . . . ____________________                             │
  750. │                                                                            │
  751. │ Credit Card Information                                                    │
  752. │                                                                            │
  753. │    1) Card Name . . . . . ________     Number  . . . ____________________  │
  754. │    2) Card Name . . . . . ________     Number  . . . ____________________  │
  755. │    3) Card Name . . . . . ________     Number  . . . ____________________  │
  756. │                                                                            │
  757. │                                                                            │
  758. │ <_______>  <__________>                                                    │
  759. └────────────────────────────────────────────────────────────────────────────┘
  760. /*
  761.  
  762. // Break our main image down into 2 sub images. We defined them as one
  763. // big image and broke them down with the Sub_Page command so that our
  764. // positioning would be easier to code.
  765.  
  766.  Sub_Page Person_Buttons FROM Person_Entry 12 13
  767.  
  768.  
  769.   // The Person_Entry object is the UI object that allows us
  770.   // to edit/enter Person records. It uses the PERSON file so its
  771.   // data set is Person_Data_Set (See the USING clause).
  772.            
  773.   Object Person_Entry is an Entry_Form Person_Entry ACTION_BAR Action_Bar.obj;
  774.                                                     USING Person_Data_Set
  775.         
  776.      set LOCATION to 4 0 ABSOLUTE
  777.      
  778.       procedure switch
  779.       end_procedure
  780.       
  781.       procedure switch_back
  782.       end_procedure
  783.      
  784.      // While in our Person_Entry object, we want to be able to pop-up a
  785.      // list of valid credit cards when the user presses the PROMPT key
  786.      // while in a credit card name field. The Choose_Card object is a
  787.      // selection list and will pop-up a list of credit cards.
  788.      
  789.      Object Choose_Card is a Pick_List Choose_Card STATIC RADIO
  790.           
  791.         set SCOPE_STATE to TRUE
  792.         set POPUP_STATE to TRUE
  793.         set LOCATION to 1 3 ITEM_RELATIVE
  794.         set EXPORT_ITEM_STATE to TRUE
  795.         
  796.         // Auto_Select mode means that as the user uses the mouse or arrows
  797.         // to move through the list, the current item becomes selected. In
  798.         // a single select list, the space bar or a double click from the
  799.         // mouse is needed to select an item.
  800.         
  801.         set SELECT_MODE to AUTO_SELECT
  802.                
  803.         // Define our choices. Note that the first letter is capitalized to
  804.         // allow for first letter selection (press a 'D' and the selection
  805.         // rotates to Diners)
  806.         
  807.         item_list
  808.            on_item  "AMEX"     send NONE 
  809.            on_item  "DINERS"   send NONE 
  810.            on_item  "MASTERCD" send NONE  
  811.            on_item  "VISA"     send NONE 
  812.         end_item_list
  813.               
  814.      End_Object // Choose_Card
  815.   
  816.      // Here, we list the individual fields to enter data into including any
  817.      // entry options we want placed on the field (within {} )
  818.  
  819.      Item_List
  820.  
  821.         Entry_Item Person.Id         {AUTOFIND, CAPSLOCK}
  822.         Entry_Item Person.Last
  823.         Entry_Item Person.First      
  824.         Entry_Item Person.Dept       
  825.         Entry_Item Person.Title
  826.      
  827.      
  828.         Entry_Item Person.Card_1 {IVALIDATE=Get_Validate_Card_Name,CAPSLOCK, ;
  829.            iPROMPT=(Choose_Card(Person_Entry.obj))}
  830.         Entry_Item Person.Cnum_1 {CAPSLOCK}
  831.         Entry_Item Person.Card_2 {IVALIDATE=Get_Validate_Card_Name,CAPSLOCK, ;
  832.            iPROMPT=(Choose_Card(Person_Entry.obj))}
  833.         Entry_Item Person.Cnum_2 {CAPSLOCK}
  834.         Entry_Item Person.Card_3 {IVALIDATE=Get_Validate_Card_Name,CAPSLOCK, ;
  835.            iPROMPT=(Choose_Card(Person_Entry.obj))}
  836.         Entry_Item Person.Cnum_3 {CAPSLOCK}
  837.   
  838.      End_Item_List
  839.          
  840.      // This procedure is called to validate each card name field.
  841.      // It checks the value in the field with the values in the  
  842.      // Choose_Card object and aborts the save if the value in the 
  843.      // field is incorrect.
  844.   
  845.      function Validate_Card_Name integer Item_Number returns integer
  846.      
  847.         local string Item_Value
  848.         local integer start
  849.         
  850.         // The algorithm used to validate a card is to compare the
  851.         // card name that the user has typed in with the Choose_Card
  852.         // object. We use the Item_Matching message to see if there is
  853.         // an item matching what the user has entered, in the Choose_Card
  854.         // object (which lists all possible cards). This way, if we add new
  855.         // card types in Choose_Card, our validation routine automatically
  856.         // changes to reflect the new cards.
  857.         // If the validation fails, we function_return a 1.
  858.              
  859.         move 0 to start
  860.         get VALUE of current_object ITEM Item_Number to Item_Value
  861.         if Item_Value ne '' begin
  862.            get Item_Matching of (Choose_Card(current_object)) ;
  863.               Item_Value Start 
  864.            
  865.            // If Item_Matching returns a -1, it didn't find a match. This
  866.            // means that we declare an error and fail the validation.
  867.            
  868.            if Start eq -1 begin
  869.               error 202 'Invalid card, press PROMPT'
  870.               function_return 1
  871.            end
  872.         end
  873.           
  874.      end_function // Validate_Card_Name
  875.      
  876.      // Define the button object used in our Entry Form.
  877.                       
  878.      Object Person_Buttons is a Button
  879.  
  880.         // We don't want the user to be able to rotate down to the 
  881.         // button area so we change the Focus_Mode of the object to
  882.         // Pointer_Only. This makes sure that the button object 
  883.         // cannot take the focus, however, it CAN still be clicked
  884.         // on and WILL send the appropriate message, it just won't
  885.         // RETAIN the focus.
  886.  
  887.         set FOCUS_MODE to POINTER_ONLY
  888.  
  889.         Item_List
  890.                         
  891.            // Perform help if the first button is clicked
  892.            On_Item "F1=Help" send Help
  893.  
  894.            // Exit this panel when if the second button is clicked.
  895.            On_Item "ESC=Cancel" send Request_Cancel
  896.  
  897.         End_Item_List
  898.  
  899.      End_Object // Person_Buttons
  900.       
  901.   End_Object // Person_Entry
  902.  
  903.  
  904.  
  905. //**************************************************************************
  906. //****** The images and objects for editing the TRAN_TYP FILE file**********
  907. //**************************************************************************
  908.  
  909. /Tran_Typ
  910. ┌────────────────────────────────────────────────────────────────────────────┐
  911. │                            Transaction Type Edit                           │
  912. │                                                                            │
  913. │ Transaction Type . . . ______________                                      │
  914. │                                                                            │
  915. │                                                                            │
  916. │                                                                            │
  917. │ <_______>  <__________>                                                    │
  918. │                                                                            │
  919. └────────────────────────────────────────────────────────────────────────────┘
  920. /*
  921.  
  922.  
  923. // Break our main image down into 2 sub images. We defined them as one
  924. // big image and broke them down with the Sub_Page command so that our
  925. // positioning would be easier to code.
  926.  
  927. Sub_Page Tran_Typ_Buttons FROM Tran_Typ 2 3
  928.  
  929.  
  930.    Object Tran_Typ_Entry is an Entry_Form Tran_Typ ACTION_BAR Action_Bar.obj;
  931.                                                    USING Tran_Typ_Data_Set.obj
  932.      
  933.       set LOCATION to 5 0 ABSOLUTE
  934.       
  935.       procedure switch
  936.       end_procedure
  937.       
  938.       procedure switch_back
  939.       end_procedure
  940.       
  941.       // Here, we list the individual fields to enter data into including any
  942.       // entry options we want placed on the field (within {} )
  943.        
  944.       Item_List
  945.  
  946.          Entry_Item Tran_Typ.Type_Code  {AUTOFIND, CAPSLOCK}
  947.  
  948.       End_Item_List
  949.  
  950.      // Define the button object used in our Entry Form (we pop up our buttons
  951.      // at the bottom of the screen to allow a mouse user to "click" on a
  952.      // function rather than having to press a key and to act as a quick key
  953.      // reference for a keyboard user). The object is named Tran_Typ_Buttons
  954.      // and defaults to using an image of the same name.
  955.  
  956.        Object Tran_Typ_Buttons is a Button
  957.  
  958.           // We don't want the user to be able to rotate down to the button
  959.           // area so we change the Focus_Mode of the object to Pointer_Only.
  960.           // This makes sure that the button object cannot take the focus,
  961.           // however, it CAN still be clicked on and WILL send the appropriate
  962.           // message, it just won't RETAIN the focus.
  963.  
  964.             set FOCUS_MODE to POINTER_ONLY
  965.  
  966.           Item_List
  967.  
  968.              // Perform help if the first button is clicked
  969.                On_Item "F1=Help" send Help
  970.  
  971.              // Exit this panel when if the second button is clicked.
  972.                On_Item "ESC=Cancel" send Request_Cancel
  973.  
  974.           End_Item_List
  975.  
  976.        End_Object // Tran_Typ_Buttons
  977.  
  978.   End_Object // Tran_Typ_Entry
  979.  
  980.  
  981.    // The Choose_Tran_Typ object is a selection list. It is called by any
  982.    // UI component which wants to invoke a pop-up list of Transaction Types
  983.    // from the Person file. This program uses it when the user presses the
  984.    // PROMPT key while creating a transaction.
  985.    // Because it uses the Tran_Typ file, its USING clause specifies the
  986.    // Tran_Typ_Data_Set.
  987.  
  988.    Object Choose_Tran_Typ is a Selection_List Choose_Tran_Typ POP_UP RING;
  989.                                                USING Tran_Typ_Data_Set.obj ;
  990.                                                BY Index.1
  991.    
  992.       set LOCATION to 8 11 ABSOLUTE
  993.       set SCOPE_STATE to TRUE
  994.    
  995.       Begin_Row
  996.    
  997.          Entry_Item Tran_Typ.Type_Code
  998.    
  999.       End_Row
  1000.  
  1001.    End_Object // Choose_Tran_Typ
  1002.  
  1003.  
  1004.  
  1005. //**************************************************************************
  1006. //****** The images and objects for editing the ASSIGN FILE file ***********
  1007. //**************************************************************************
  1008.  
  1009. /Assignment_Entry
  1010. ┌────────────────────────────────────────────────────────────────────────────┐
  1011. │                               Assignment Edit                              │
  1012. │ Assignment Identifier                                                      │
  1013. │                                                                            │
  1014. │    Person Unique ID . . . ________                                         │
  1015. │    Name   . . . . . . . . ____________________ , ____________________      │
  1016. │                                                                            │
  1017. │    Event Unique ID  . . . ________                                         │
  1018. │    Event Name   . . . . . ____________________                             │
  1019. │                                                                            │
  1020. │ Assignment Details                                                         │
  1021. │                                                                            │
  1022. │    Cash Advanced  . . . . $______.__                                       │
  1023. │    Cash Spent   . . . . . $______.__                                       │
  1024. │    Credit Spent . . . . . $______.__                                       │
  1025. │    Date Settled . . . . . __/__/__                                         │
  1026. │                                                                            │
  1027. │ Comments                                                                   │
  1028. │                                                                            │
  1029. │                                                                            │
  1030. └────────────────────────────────────────────────────────────────────────────┘
  1031. /*
  1032.  
  1033.    Object Assignment_Entry is an Entry_Form Assignment_Entry ACTION_BAR ;
  1034.                                  Action_Bar.obj USING Assign_Data_Set.obj
  1035.  
  1036.       
  1037.        set LOCATION to 2 0 ABSOLUTE
  1038.  
  1039.        procedure switch_back
  1040.        end_procedure
  1041.       
  1042.        // Here, we list the individual fields to enter data into including any
  1043.        // entry options we want placed on the field (within {} )
  1044.  
  1045.        Item_List
  1046.  
  1047.           // The following Entry_Items are from the Person File. We are using
  1048.           // this information as lookup only.
  1049.      
  1050.           Entry_Item Person.Id         {AUTOFIND, CAPSLOCK, ;
  1051.                                        iPROMPT=Choose_Person.obj}
  1052.           Entry_Item Person.Last       {NOPUT}
  1053.           Entry_Item Person.First      {FINDREQ, NOPUT}
  1054.      
  1055.           // The following Entry_Items are from the Event File. We are using 
  1056.           // this information as lookup only.
  1057.      
  1058.           Entry_Item Event.Id          {CAPSLOCK, AUTOFIND, ;
  1059.                                        iPROMPT=Choose_Event.obj}
  1060.           Entry_Item Event.Name        {FINDREQ, NOPUT}
  1061.              
  1062.           // The following Entry_Items are from the Assign file. We are 
  1063.           // WRITING to these fields.
  1064.      
  1065.           Entry_Item Assign.Cash_Adv    
  1066.           Entry_Item Assign.Cash_Spent
  1067.           Entry_Item Assign.Credit_Spent
  1068.           Entry_Item Assign.Date_Settled
  1069.   
  1070.        End_Item_List
  1071.        
  1072.        // Allow this object to have file level help. By changing the
  1073.        // help name returned when the user is in different entry_items
  1074.        // for different files, we create a different help name for
  1075.        // those items.  We can then create different help text for those
  1076.        // help names and give the user file level help.
  1077.        
  1078.        Function Help_Name returns string
  1079.           local string temp_name
  1080.           local string temp_filename
  1081.           local integer temp_file
  1082.           forward get Help_Name to temp_name
  1083.           get data_file to temp_file
  1084.           if temp_file eq event.file_number move "EVENT" to temp_filename
  1085.           if temp_file eq person.file_number move "PERSON" to temp_filename
  1086.           if temp_file eq assign.file_number function_return temp_name
  1087.           function_return (temp_name + "." + temp_filename)
  1088.        End_Function // Help_Name
  1089.   
  1090.        // Define the Assign_Comments object. This object is an edit object
  1091.        // displayed on the screen that shows the Assign.Comments field for
  1092.        // the current assignment.
  1093.    
  1094.   
  1095.        Object Edit_Assign_Comment is a Text_Window FOR Assign.Comments
  1096.           
  1097.           set LOCATION to 18 2 RELATIVE
  1098.           set SIZE to 2 72
  1099.           
  1100.       
  1101.           procedure switch
  1102.           end_procedure
  1103.                 
  1104.        End_Object // Edit_Assign_Comment
  1105.     
  1106.     End_Object // Assignment_Entry
  1107.     
  1108.  
  1109. //**************************************************************************
  1110. //******************* Miscellaneous Global Objects *************************
  1111. //**************************************************************************
  1112.  
  1113.  
  1114.      // While in our Transact_Entry object, we want to be able to pop-up a
  1115.      // list of valid payment types when the user presses the PROMPT key
  1116.      // while in the payment field. The Choose_Payment_Type object is a
  1117.      // pick list and will pop-up a list of payment types valid for
  1118.      // this user (using the Person file).
  1119.      
  1120.      Object Choose_Payment_Type is a Pick_List Choose_Payment_Type RADIO
  1121.           
  1122.         set SCOPE_STATE to TRUE
  1123.         set POPUP_STATE to TRUE
  1124.         set LOCATION to 8 3 ABSOLUTE
  1125.          
  1126.         procedure deactivating
  1127.            send delete_data
  1128.         end_procedure
  1129.         
  1130.         // Auto_Select mode means that as the user uses the mouse or arrows
  1131.         // to move through the list, the current item becomes selected. In
  1132.         // a single select list, the space bar or a double click from the
  1133.         // mouse is needed to select an item.
  1134.         
  1135.         set SELECT_MODE to AUTO_SELECT
  1136.                
  1137.         procedure fill_list
  1138.            // When we activate this pop-up, add only valid payment types
  1139.            // for this user (start with CASH unconditionally).
  1140.            
  1141.            send add_item MSG_NONE "CASH" 
  1142.            if Person.Card_1 ne '' send Add_Item MSG_NONE Person.Card_1 
  1143.            if Person.Card_2 ne '' send Add_Item MSG_NONE Person.Card_2 
  1144.            if Person.Card_3 ne '' send Add_Item MSG_NONE Person.Card_3 
  1145.         end_procedure
  1146.               
  1147.      End_Object // Choose_Payment_Type
  1148.  
  1149.  
  1150.  
  1151.    // The ABOUT object is popped-up from the action bar help pull down when
  1152.    // the user requests information about the program.  The object is
  1153.    // actually a button with a special override of item_change which keeps
  1154.    // the user from changing to any item other than item 2 (the OK)
  1155.    // button.
  1156.    
  1157.    Object about is a button
  1158.       
  1159.       set LOCATION to 5 11 absolute
  1160.       set BLOCK_MOUSE_STATE to true
  1161.       set SCOPE_STATE to true
  1162.       set AUTO_TOP_ITEM_STATE to false
  1163.    
  1164.       Item_List
  1165.          
  1166.          On_Item 'DataFlex Personal Expense System' send none
  1167.          set CENTER_STATE to TRUE
  1168.          
  1169.          On_Item '' send NONE
  1170.          On_Item 'OK' send STOP_UI
  1171.       
  1172.       End_Item_List
  1173.    
  1174.       set CURRENT_ITEM to 2
  1175.       
  1176.       // The item_change procedure overrides the standard item_change
  1177.       // procedure. It's intention is to insure that the user cannot
  1178.       // rotate onto any item other than item 2 (the OK button).
  1179.         
  1180.       procedure item_change integer i_from integer i_to returns integer
  1181.          procedure_return 2
  1182.       end_procedure
  1183.         
  1184.       // The activating procedure fills in item 1 of ABOUT with the
  1185.       // current available memory.
  1186.       
  1187.       procedure activating
  1188.          local integer mem
  1189.          memory mem
  1190.          set VALUE item 1 to mem
  1191.       end_procedure
  1192.    
  1193.    End_Object // About
  1194.  
  1195.    // Title is our title bar. It appears at the top of our images and is
  1196.    // not able to receive the focus.
  1197.    
  1198.    Object Title is a Title
  1199.      
  1200.       set CENTER_STATE item 0 to TRUE
  1201.       set VALUE item 0 to "Per$onal Expen$e Sy$tem"
  1202.       set ATTACH_PARENT_STATE to TRUE
  1203.       set FOCUS_MODE to NONFOCUSABLE
  1204.       
  1205.    End_Object // Title
  1206.    
  1207. //**************************************************************************
  1208. //************************* Global Procedures  *****************************
  1209. //**************************************************************************
  1210.    
  1211.    
  1212.    // Here, we define a global procedure Show_Expense_Report. This message
  1213.    // is sent by the action bar when the user chooses to print a report.
  1214.    // In this procedure, we chain wait to the report (EXPENSE), passing it
  1215.    // parameters about which expense report to generate. When we return, we
  1216.    // send the refresh_screen message to restore the screen.
  1217.    
  1218.    procedure Show_Expense_Report
  1219.      local string report_string
  1220.      
  1221.      move "Expense " to report_string
  1222.      append report_string assign.person ' '  assign.event  ' '  event.start;
  1223.            ' '  event.end  ' '  'test.fil'
  1224.      chain wait report_string 
  1225.      send refresh_screen
  1226.    end_procedure  
  1227.  
  1228.  
  1229.    // Here we define a global procedure, show_about which is called when we
  1230.    // want to pop-up the ABOUT object (which shows us information about the
  1231.    // program).
  1232.    
  1233.    procedure About for Desktop
  1234.       ui_accept about to windowindex
  1235.    end_procedure
  1236.  
  1237. Item_Group
  1238.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 0
  1239.    Dependent_Item Person_Entry 0
  1240. End_Item_Group
  1241.  
  1242. Item_Group
  1243.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 1
  1244.    Dependent_Item Person_Entry 1
  1245. End_Item_Group
  1246.  
  1247. Item_Group
  1248.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 2
  1249.    Dependent_Item Person_Entry 2
  1250. End_Item_Group
  1251.    
  1252. Item_Group
  1253.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 3
  1254.    Dependent_Item (Event_Entry(Event_Client.obj)) 0
  1255. End_Item_Group
  1256.  
  1257. Item_Group
  1258.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 4
  1259.    Dependent_Item (Event_Entry(Event_Client.obj)) 1
  1260. End_Item_Group
  1261.  
  1262. Item_Group
  1263.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 5
  1264.    Dependent_Item (Event_Entry(Event_Client.obj)) 2
  1265. End_Item_Group
  1266.    
  1267. Item_Group
  1268.    Dependent_Item (Transact_Header(Assign_Data_Set.obj)) 6
  1269.    Dependent_Item (Event_Entry(Event_Client.obj)) 3
  1270. End_Item_Group
  1271.  
  1272. //**************************************************************************
  1273. //*********** End of object definitons and start of main program ***********
  1274. //**************************************************************************
  1275.  
  1276. // Put our Title object on the screen
  1277.  
  1278. send add_focus to Title (parent(Title.obj))
  1279.  
  1280. // Start the User Interface system and give the focus to Transact_Screen
  1281.  
  1282.   start_ui Action_Bar
  1283.  
  1284. // After the last object has been deactivated, we return here.
  1285.  
  1286.   clearscreen
  1287.   abort
  1288.