//**************************************************************************** // $Module type: CLASS // $Module name: cFieldList.pkg // $Author : Nils G. Svedmyr // Created : 2001-08-16 @ 21:58 // // Description : // // $Rev History // 2001-08-16 Module header created //**************************************************************************** Open SncTable Register_Object oToolbar Register_Procedure Set phoCopy Handle ho Register_Procedure Set phoPaste Handle ho Register_Procedure Set phoCut Handle ho Class cFieldList Is A List Procedure Construct_Object Forward Send Construct_Object // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=0 } #ENDIF Property Integer Server 0 // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=0 } #ENDIF Property Integer piFile 0 Property String psFieldName "" Set Oem_Translate_State To False On_Key Key_Home Send Begin_Of_Data On_Key Key_End Send End_Of_Data On_Key Key_F6 Send Switch On_Key Key_Shift+Key_F6 Send Switch_Back Set Entry_msg To DoDisableToolbarButtons Set Exit_msg To DoEnableToolbarButtons End_Procedure // Construct_Object Procedure End_Construct_Object Forward Send End_Construct_Object End_Procedure // End_Construct_Object Procedure Begin_Of_Data Set Current_Item To 0 End_Procedure // Beginning_Of_Data Procedure End_Of_Data Integer iCount Get Item_Count To iCount Set Current_Item To (iCount - 1) End_Procedure // Beginning_Of_Data Procedure DoFillList Integer iFile iField iSrv iPos iType iLength iPrec iOpen String sFieldName sSelFields sSpace sChar sType Set Dynamic_Update_State To False Send Delete_Data Move SncTable.File_Number To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen Get psFieldName To sFieldName If (Not(iOpen) Or Not(iFile) Or sFieldName = "") Begin Set Dynamic_Update_State To True Procedure_Return End Field_Map iFile sFieldName To iField // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=0 } #ENDIF Get Server To iSrv // Class property. If (iField And iSrv) Get File_Field_Current_Value Of iSrv iFile iField To sSelFields Move (Trim(sSelFields)) To sSelFields If (sSelFields = "") Begin Set Dynamic_Update_State To True Procedure_Return End Get piFile To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Begin Set Dynamic_Update_State To True Procedure_Return End // If Not iOpen Begin Repeat Move (Pos(' ', sSelFields)) To iPos If iPos Begin Move (Left(sSelFields, (iPos - 1))) To iField Move (Trim(Replace((String(iField) + ' '), sSelFields, ''))) To sSelFields End Else Begin Move (Trim(sSelFields)) To iField // Last item Move "" To sSelFields End If (iField < 0) Move (Abs(iField)) To iField Move "" To sSpace // We need to use spaces for field numbers since list is sorted. If (iField < 10) Move " " To sSpace Else If (iField >= 10 And iField < 100) Move " " To sSpace Get FieldSpecs iFile iField To sFieldName Send Add_Item msg_None (sSpace + String(iField) * "-" * sFieldName) // Set Button_Aspect (Item_Count(Self) - 1) item to BASPECT_PULLDOWN // Set Item_Shadow_State item (Item_Count(Self) - 1) to True // Set CurrentCellColor item (Item_Count(Self) - 1) to clBtnFace // Set CurrentCellTextColor item (Item_Count(Self) - 1) to clWhite // Set ItemColor item (Item_Count(Self) - 1) to clBtnFace // Set ItemTextColor item (Item_Count(Self) - 1) to clBlack // Set Form_Color item (Item_Count(Self) - 1) to clBlack clBlack //clYellow clYellow //clLtGray // Set Window_Color item (Item_Count(Self) - 1) to clBlack clBlack //clBtnFace // Set Item_Text_Color item (Item_Count(Self) - 1) to clBlack clBlack // End // If (iCount = iField) Begin Until (Trim(sSelFields) = "") Set Dynamic_Update_State To True End_Procedure // DoFillList Procedure OnKillFocus Integer iItem Get Current_Item To iItem Set Select_State item iItem To False End_Procedure // OnKillFocus Procedure DoEnableToolbarButtons Handle ho Move (oToolBar(Self)) To ho If ho Begin Get phoCut To ho If ho Set pbEnabled Of ho To True Get phoCopy To ho If ho Set pbEnabled Of ho To True Get phoPaste To ho If ho Set pbEnabled Of ho To True End // If ho Begin End_Procedure // DoEnableToolbarButtons Procedure DoDisableToolbarButtons Handle ho Move (oToolBar(Self)) To ho If ho Begin Get phoCut To ho If ho Set pbEnabled Of ho To False Get phoCopy To ho If ho Set pbEnabled Of ho To False Get phoPaste To ho If ho Set pbEnabled Of ho To False End // If ho Begin End_Procedure // DoDisableToolbarButtons End_Class // cFieldList