//AB/ Project Field List //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Field List" //AB/ Set ProjectFileName to "GlbFieldList.DG" //AB/ Set GenerateFileName to "NONAME5" // Project Object Structure // oFieldLookUp is a ModalPanel // field_list is a List // OOK_bn is a Button // OCancel_bn is a Button // Register all objects Register_Object field_list Register_Object OCancel_bn Register_Object OOK_bn Register_Object oFieldLookUp //AB-StoreTopStart //AB-StoreTopEnd //AB-IgnoreStart //AB-IgnoreEnd CD_Popup_Object oFieldLookUp is a ModalPanel //AB-StoreTopStart //---------------------------------------------> //- Used in Move_value_out //---------------------------------------------> Property Integer piDidAlready Public 0 On_Key KEnter Send KeyEnter On_Key KCancel Send Close_Panel Procedure KeyEnter Send Move_Value_Out To (Field_list(Current_Object)) End_Procedure //AB-StoreTopEnd Set Label to "Fields" Set Size to 148 133 Set Location to 5 6 //AB-DDOStart //AB-DDOEnd Object field_list is a List Set Size to 105 114 Set Location to 6 7 //AB-StoreStart Procedure Activating Forward Send Activating Send delete_data Send load_list End_Procedure Procedure Mouse_Click Integer iWin integer iChar Forward Send Mouse_Click iWin iChar Send Move_value_out End_Procedure Procedure Load_List // Load the list from Name_Array string sTemp_Str integer iCount iCounter iArray_obj Set piDidAlready to 0 Move (oName_array(Current_Object)) to iArray_obj Get item_count of iArray_obj to iCount For iCounter from 0 to (iCount - 1) Get string_value of iArray_obj item iCounter to sTemp_Str Get strip_field sTemp_Str to sTemp_Str Send add_item msg_none sTemp_Str Loop send sort_items ascending End_Procedure Procedure Move_value_out integer iField_Obj iPos iCI iField# string sNeed sTemp_String sOffSet sFieldName sLongName //--------------------------------------------------------------------> // For some unfathomable reason double clicking on a list where // procedure Mouse_click is used seems to fire this procedure twice. // Ordinarily this wouldn't be a problem except that we permit multiple // selections from this list to concatinate in the main view so that // we can "and" or "or" the various selections. //--------------------------------------------------------------------> If (piDidAlready(Self) = 1) Procedure_Return Set piDidAlready to 1 //--------------------------------------------------------------------> //- Get the calling object Id //--------------------------------------------------------------------> Get piCurrent_Field_Obj Of (oReplace_View(Current_Object)) To iField_Obj //--------------------------------------------------------------------> //- Get the current name from the list //--------------------------------------------------------------------> Get Current_Item To iCI Get Value Item iCI To sFieldName //--------------------------------------------------------------------> //- Get the field number from the name //--------------------------------------------------------------------> Field_Map FileNumber (trim(sFieldName)) to iField# //--------------------------------------------------------------------> // Special handling to set field name and field number // In this section we only need the field name, not the file name. // In the Else section we need the file name too. // The reason is one of the entry fields requires the whole file.field // name, the other just needs the field name. //--------------------------------------------------------------------> Get psNeed_Fld# Of (oReplace_View(Current_Object)) To sNeed IF (sNeed = "Y") Begin Set Value Of (oSel_Field_Numb(oReplace_View(Current_Object))) Item 0 to iField# //--------------------------------------------------------------------> //- Get current value of the field so we can concatinate for and/or logic //--------------------------------------------------------------------> Get Value of iField_Obj item 0 to sTemp_String Set Value of iField_Obj item 0 to (trim(sTemp_String)+" "+sFieldName) End //--------------------------------------------------------------------> // Here we need to append items //--------------------------------------------------------------------> else Begin Move (psFileName(Self) + "." + sFieldName) to sLongName Get piCurrent_Field_Obj Of (oReplace_View(Current_Object)) To iField_Obj Get Value of iField_Obj item 0 to sTemp_String Set Value of iField_Obj item 0 to (trim(sTemp_String)+" "+sLongName) Set piReplField# to iField# //---------------------------------------------> // Position the cursor at the end of the field in the old DOS days, // don't know how to do it in GUI environment... // Move (length(orig_string)+1) to Cursor_SET //---------------------------------------------> End Send Close_Panel End_Procedure //AB-StoreEnd End_Object // field_list Object OOK_bn is a Button Set Label to "&Ok" Set Location to 115 16 //AB-StoreStart Procedure OnClick Send Move_Value_Out To (Field_list(Current_Object)) End_Procedure //AB-StoreEnd End_Object // OOK_bn Object OCancel_bn is a Button Set Label to "&Cancel" Set Location to 115 71 //AB-StoreStart Procedure OnClick Send Close_Panel End_Procedure //AB-StoreEnd End_Object // OCancel_bn CD_End_Object // oFieldLookUp //AB/ End_Object // prj