//**************************************************************************** // $Module type: CLASS // $Module name: cDbIndexComboForm // $Author : Nils G. Svedmyr, Eurosoft Sverige AB // Created : 2001-07-21 @ 11:18 // // Description : // // $Rev History // 2001-07-21 Module header created //**************************************************************************** // 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" } { OverrideProperty=Size InitialValue=13,246 } #ENDIF Class cDbIndexComboForm Is A cRDSdbComboform Procedure Construct_Object Forward Send Construct_Object Property Handle phoDD (Main_DD(Self)) Property Integer piFile 0 Property Integer piLowSize 0 Property Boolean pbFrom True Set Code_Display_Mode To cb_Code_Display_Both Set Combo_Sort_State To False Set Entry_State To False Set Oem_Translate_State To False Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right End_Procedure // Construct_Object Procedure End_Construct_Object Forward Send End_Construct_Object // If (pbFrom(Self)) Set Status_Help To "Select an Index from the list to use when doing a find equal search for the 'From' table. Only used when 'Auto delete old records' has been checked" // Else Set Status_Help To "Select an Index from the list to use when doing a find equal search for the 'To' table." Set piLowSize To (Low(GuiSize(Self))) End_Procedure // End_Construct_Object Procedure DoCheckClear Send Combo_Delete_Data End_Procedure // DoCheckClear Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Boolean bFromLocal Get pbFrom To bFromLocal If (bFrom <> bFromLocal) Procedure_Return If bFromLocal Set piFile to iFromFile Else Set piFile to iToFile Send DoComboFillList End_Procedure Procedure DoComboFillList String sFieldName sIndex sChar sLongIndex sDriver Integer iFile iIndexes iCount iCount2 iField iSegments iOrgSize iNewSize iOpen iValue Integer iDataFile iDataField iState iSrv Send Combo_Delete_Data Get piFile To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Procedure_Return Get piLowSize To iOrgSize If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDriver To sDriver Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDriver To sDriver Move (Trim(sDriver)) To sDriver Get Data_File To iDataFile Get Data_Field To iDataField Get Main_DD To iSrv Get File_Field_Changed_State of iSrv iDataFile iDataField To iState Get File_Field_Current_Value of iSrv iDataFile iDataField To iValue If (sDriver = FLEX_DRV_ID) Send Combo_Add_Item "Recnum" "0" Get_Attribute DF_FILE_LAST_INDEX_NUMBER Of iFile To iIndexes For iCount From 1 To iIndexes Get_Attribute DF_INDEX_NUMBER_SEGMENTS Of iFile iCount To iSegments If iSegments Begin Move "" To sIndex For iCount2 From 1 To iSegments Get_Attribute DF_INDEX_SEGMENT_FIELD Of iFile iCount iCount2 To iField Get_Attribute DF_FIELD_NAME Of iFile iField To sFieldName Move (Uppercase(Left(sFieldName, 1))) To sChar Move (sChar + Right(Lowercase(sFieldName), (Length(sFieldName) -1))) To sFieldName Move (sIndex + ", " + sFieldName ) To sIndex Loop // For iCount From 1 to iSegments Move (Trim(sIndex)) To sIndex If (Length(sIndex) > Length(sLongIndex)) Move sIndex To sLongIndex Move (Right(sIndex, (Length(sIndex) - 1))) To sIndex Send Combo_Add_Item sIndex iCount End // If iSegments Begin Loop // For iCount From 1 to iIndexes Get Text_Extent sLongIndex To iNewSize Move (Low(iNewSize) + 20) To iNewSize If (iNewSize > iOrgSize) Begin Set ListWidth To iNewSize Send DoSetListWidth End // If (iNewSize > iOrgSize) Begin If (sDriver <> FLEX_DRV_ID And iValue = 0) ; Set File_Field_Changed_Value of iSrv iDataFile iDataField To 1 End_Procedure // DoComboFillList End_Class // cDbIndexComboForm