//**************************************************************************** // $Module type: CLASS // $Module name: cDbFieldComboForm // $Author : Nils G. Svedmyr // Created : 2001-07-21 @ 10:46 // // Description // // $Rev History // 2001-07-21 Module header created //**************************************************************************** Open SncTable Open SncTHea Use SyncFuncs.pkg Use cRDSdbComboform.pkg // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Code_Display_Mode InitialValue=cb_Code_Display_Both } { OverrideProperty=Code_Display_Mode EnumList="cb_Code_Display_Both, cb_Code_Display_Description, cb_Code_Display_Code" } { OverrideProperty=Entry_State InitialValue=True } { OverrideProperty=Combo_Sort_State InitialValue=True } { OverrideProperty=Label_Row_Offset InitialValue=0 } { OverrideProperty=Label_Col_Offset InitialValue=2 } { OverrideProperty=Label_Justification_Mode InitialValue=jMode_Right } { OverrideProperty=Label_Justification_Mode EnumList="jMode_Right, jMode_Left, jMode_Center, jMode_Top" } { OverrideProperty=Size InitialValue=13,140 } #ENDIF Class cDbFieldComboForm Is A cRDSdbComboform Procedure Construct_Object Forward Send Construct_Object Property Handle phoDD (Main_DD(Self)) Property Integer piFile 0 // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=True } #ENDIF Property Boolean pbFrom True Set Code_Display_Mode To CB_Code_Display_Description //cb_Code_Display_Both Set Combo_Sort_State To False Set Entry_State To False Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Oem_Translate_State To False Set Entry_State Item 0 To False On_Key kFind Send msg_None On_Key kFind_Next Send msg_None On_Key kFind_Previous Send msg_None On_Key kSuper_Find Send msg_None On_Key kSuper_Find_Next Send msg_None On_Key kSuper_Find_Previous Send msg_None On_Key kBegin_Of_Data Send msg_None On_Key kEnd_Of_Data Send msg_None End_Procedure // Construct_Object Procedure End_Construct_Object Forward Send End_Construct_Object End_Procedure // End_Construct_Object Procedure DoCheckClear Send Combo_Delete_Data Send Combo_Add_Item "" Set Value item 0 To "- " End_Procedure // DoCheckClear Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom If (pbFrom(Self) <> bFrom) Procedure_Return Send DoCheckClear If bFrom Set piFile To iFromFile Else Set piFile To iToFile If Not (piFile(Self)) Procedure_Return Send DoFillData End_Procedure Procedure DoFillData Handle hoDD String sFieldName sType sDriver sLength Integer iFile iField iCount iFields iType iLength iPrec iNumber iOpen iStart Get phoDD To hoDD Get piFile To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Procedure_Return Get_Attribute DF_FILE_DRIVER Of iFile To sDriver Get_Attribute DF_FILE_NUMBER_FIELDS Of iFile To iFields If (Uppercase(sDriver) = FLEX_DRV_ID) Move 0 To iStart Else Move 1 To iStart Send Combo_Delete_Data Send Combo_Add_Item "" For iCount From iStart To iFields Get_Attribute DF_FIELD_TYPE Of iFile iCount To iType If (iType <> DF_OVERLAP) Begin Get_Attribute DF_FIELD_NUMBER Of iFile iCount To iNumber Get FieldSpecs iFile iCount To sFieldName // Function in SyncFuncs.pkg Send Combo_Add_Item (String(iNumber) + " - " + sFieldName) iCount End // If (iType <> DF_OVERLAP) Begin Loop // For iCount From iStart To iFields If (hoDD And Current_Record(hoDD)) Begin Get Data_File To iFile Get Data_Field To iField Get File_Field_Current_Value Of hoDD iFile iField To sFieldName Get WinCombo_Item_Matching sFieldName To iField If (iField > -1) Set WinCombo_Current_Item To iField Else Set Value item 0 To "- " End // If (hoDD And Current_Record(hoDD)) Begin Else Set Value item 0 To "- " End_Procedure // DoFillData // Procedure OnCloseUp // Handle hoDD // Integer iItem iFile iField sOldVal // String sField // Forward Send OnCloseUp // Get Main_DD To hoDD // Get Value item 0 To sField // // For some reason we need to do this to trigger a change in the DDO: // Get Data_File To iFile // Get Data_Field To iField // If (hoDD And iFile And iField) Begin // Get File_Field_Current_Value Of hoDD iFile iField To sOldVal // If (sOldVal <> sField) ; // Set File_Field_Changed_Value Of hoDD iFile iField To sField // End // If (hoDD And iFile And iField) Begin // End_Procedure // OnCloseUp Function FileFieldNumber Returns Integer String sField Integer iPos iField Get Value item 0 To sField Move (Pos("-", sField)) To iPos If (iPos > 1) Move (Left(sField, (iPos -2))) To iField Function_Return iField End_Function // FileFieldNumber End_Class // cDbFieldComboForm