Module Dd_cddeo.pkg

     1//****************************************************************************//
     2//                                                                            //
     3// $File name  : DD_CDDEO.PKG                                                 //
     4// $File title :                                                              //
     5// Notice      :                                                              //
     6// $System     : Extended Data Sets 3.1                                       //
     7// Created     : 06/04/96 10:44 am                                            //
     8// $Last Rev   : 06/04/96 10:44 am                                            //
     9//                                                                            //
    10// $Description                                                               //
    11//  This is a mixin class that is used by DEOs that need code desription      //
    12//  display support. When a "code" value is changed an associated descrip-    //
    13//  tion is also displayed. The description will always be the next item.     //
    14//  This is used by tables and character-mode multi-item forms.               //
    15//                                                                            //
    16// $Rev History                                                               //
    17//JT 06/04/96 File header created                                             //
    18//                                                                            //
    19//****************************************************************************//
    20Use VdfBase.pkg
    21
    22Define IGNORE$ME$PLEASE for "$-$IGNORE$-$"
    23
    24#REPLACE DFLT$EXPORT_CODE_DESCRIPTION_STATE    __X__
    25
    26//****************************************************************************//
    27//Mixin Class: This creates the following interface                           //
    28//    Get/Set Export_Code_Description_State item Item# to State               //
    29//             this determines if this "code" value in this item should be    //
    30//             used to determine the description value which MUST be the next //
    31//             item.                                                          //
    32//    Entry_Item (Code_Description(self))                           //
    33//             This must be the next item and is used as a marker. You MUST   //
    34//             Use this function and you may not alter its return value.      //
    35//****************************************************************************//
    36
    37Class Code_Description_Mixin is a mixin
    38    { Visibility=Private }
    39    Procedure Define_Code_Description_Mixin
    40       #PUSH !Zb                // save current definition state
    41       #SET ZB$ -1              // Object will append to parent
    42       Object Export_Array is an Array
    43       End_Object
    44       #POP ZB$                 //restore obj_flag
    45    End_Procedure // Define_Code_Description_Mixin
    46
    47   //************************************************************************//
    48   // Get/Set Export_Code_Description_State                                  //
    49   //   When true, the next item will be used to display a code description  //
    50   //************************************************************************//
    51    { MethodType=Property }
    52    { InitialValue=False }
    53    { Category=Behavior }
    54    { PropertyType=Boolean }
    55    { ItemParameter=1 }
    56    Procedure Set Export_Code_Description_State Integer iItem Integer iState
    57       If iItem eq CURRENT get Current_Item to iItem
    58       Set Value of (Export_Array(Self)) item iItem to iState
    59    End_Procedure // Set Export_Code_Description_State
    60
    61    { MethodType=Property }
    62    { ItemParameter=1 }
    63    Function Export_Code_Description_State Integer iItem Returns Integer
    64       If iItem eq CURRENT get Current_Item to iItem
    65       Function_Return (Value(Export_Array(Self),iItem))
    66    End_Function // Export_Code_Description_State
    67
    68    //***********************************************************************//
    69    // Code_description                                                      //
    70    // Set Value will be augmented to see this return value and do           //
    71    // nothing with it (it will not set the value). This allows the actual   //
    72    // code item to do all of the work.                                      //
    73    // Should only be used by entry_item                                     //
    74    //***********************************************************************//
    75    { MethodType=Method }
    76    Function Code_Description Returns String
    77       Function_Return IGNORE$ME$PLEASE // Set Value will understand this!
    78    End_Function // Prompt_Description
    79
    80    //***********************************************************************//
    81    // Set Local_Value                                                       //
    82    //    Augmented to handle code description support. It:                  //
    83    //    1. Does nothing if passed value is the description token (IGNORE$  //
    84    //       ME$PLEASE).                                                     //
    85    //    2. If a "code" item with export (Export_code_description_state for //
    86    //       item is T) it will display description in next item.            //
    87    //                                                                       //
    88    // NOTE!! This will REPLACE the set local_value in the extended deo mixin//
    89    // These get mixed at the same level!                                    //
    90    //***********************************************************************//
    91
    92    { MethodType=Property Visibility=Private }
    93    Procedure Set Local_Value integer iItem string sVal
    94       integer iObj
    95       string sDesc
    96       If sVal eq IGNORE$ME$PLEASE Procedure_Return
    97       Forward Set Value item iItem to sVal
    98       If (Export_Code_Description_State(Self,iItem-base_item(Self))) Begin
    99          Get Item_Field_Property GET_File_Field_Table_Object iItem to iObj
   100          If iObj get Find_Code_Description of iObj sVal to sDesc
   101          Set Local_Value Item (iItem+1) to sDesc
   102       End
   103    End_Procedure // Set Local_Value
   104
   105End_Class // Code_Description_Mixin
   106
   107
   108