Use Windows.pkg Use dfSpnFrm.pkg Object oModifyFilelist is a ModalPanel Set Border_Style to Border_Thick Set Label to "(autolabel)" Set Location to 5 4 // Visual DataFlex 14.0 Client Size Adjuster, modified May 7, 2008: 13:11:32 // Set Size to 246 371 Set Size to 225 365 // Visual DataFlex 14.0 Client Size Adjuster, modified May 7, 2008: 13:11:32 // Set piMinSize to 104 217 Set piMinSize to 82 206 Object oFilelist is a Grid Property Boolean pbDoNotUpdateForms Set Size to 130 360 Set Location to 2 2 Set peDisabledTextColor to clWindowText Set Line_Width to 4 0 Set Form_Width Item 0 to 20 Set Header_Label Item 0 to "#" Set Form_Width Item 1 to 150 Set Header_Label Item 1 to "Root name" Set Form_Width Item 2 to 63 Set Header_Label Item 2 to "Logical name" Set Form_Width Item 3 to 116 Set Header_Label Item 3 to "Display name" Set peAnchors to anAll Set peResizeColumn to rcAll Set piMinSize to 130 360 //Sample method of how to fill a grid Procedure DoFillGrid Integer iRow iMaxRows iItem Integer iOldState String sFil sRootname sLogicalname sDisplayname Handle hFile Boolean bOk Get dynamic_update_state to iOldState Set dynamic_update_state to False Set pbDoNotUpdateForms to True Send delete_data Get pbFilelistUsed to bOk If (bOk = False) Begin Set dynamic_update_state to iOldState Set pbDoNotUpdateForms to False Send DoUpdateForms Procedure_Return End Get_Attribute DF_FILELIST_NAME to sFil Delegate Set label to ("Modify "+sFil) Move -1 to iItem Move 0 to hFile Get_Attribute DF_FILE_NEXT_USED of hFile to hFile While (hFile > 0) Get_Attribute DF_FILE_ROOT_NAME of hFile to sRootname Get_Attribute DF_FILE_LOGICAL_NAME of hFile to sLogicalname Get_Attribute DF_FILE_DISPLAY_NAME of hFile to sDisplayname Send Add_Item Msg_None hFile Increment iItem Set Item_Shadow_State Item iItem to True Send Add_Item Msg_None sRootname Increment iItem Set Item_Shadow_State Item iItem to True Send Add_Item Msg_None sLogicalname Increment iItem Set Item_Shadow_State Item iItem to True Send Add_Item msg_none sDisplayname Increment iItem Set Item_Shadow_State Item iItem to True Get_Attribute DF_FILE_NEXT_USED of hFile to hFile Loop Set dynamic_update_state to iOldState Set pbDoNotUpdateForms to False Send DoUpdateForms End_Procedure // DoFillGrid //Procedure OnChange Integer iNewItem // String sValue // // Get Value iNewItem To sValue // value of changed cell //End_Procedure // OnChange // Syncronise forms with current row. Procedure Set Current_Item Integer iItem Forward Set Current_Item to iItem Send DoUpdateForms End_Procedure // Dublicate information to the forms. Procedure DoUpdateForms Integer iCol iBaseItem iNo iItem String sRootname sLogicalname sDisplayname If (pbDoNotUpdateForms(Self)) Procedure_Return Get Current_Col to iCol Get current_item to iItem Move (iItem - iCol) to iBaseItem If ((iBaseItem + 3) < (Item_Count(Self))) Begin Get value Item iBaseItem to iNo Get value Item (iBaseitem + 1) to sRootname Get value Item (iBaseItem + 2) to sLogicalname Get value Item (iBaseItem + 3) to sDisplayname End Set value of oNo to iNo Set value of oRootname to sRootname Set value of oLogicalname to sLogicalname Set value of oDisplayname to sDisplayname End_Procedure // Finds a filelist entry with the applied no. // Forms are updated after the find. Procedure DoFindNo Integer iFindNo Integer iMax iItem iFoundItem iNo Get item_count to iMax Move 0 to iItem Move -1 to iFoundItem While (iItem < iMax and iFoundItem = -1) Get value Item iItem to iNo If (iFindNo = iNo) Move iItem to iFoundItem Move (iItem + 4) to iItem Loop If (iFoundItem <> -1) Set current_item to iFoundItem End_Procedure End_Object // oFilelist Object oNo is a SpinForm Set Label to "#:" Set Size to 13 45 Set Location to 144 72 Set Maximum_Position to 4095 Set Minimum_Position to 1 Set peAnchors to anBottomLeft //OnChange is called on every changed character //Procedure OnChange // String sValue // // Get Value To sValue //End_Procedure // OnChange End_Object // oNo Object oRootname is a Form Set Label to "Rootname:" Set Size to 13 183 Set Location to 165 72 Set Form_Margin to 40 Set peAnchors to anBottomLeft //OnChange is called on every changed character //Procedure OnChange // String sValue // // Get Value To sValue //End_Procedure // OnChange End_Object // oRootname Object oLogicalname is a Form Set Label to "Logical name:" Set Size to 13 59 Set Location to 186 72 Set Form_Margin to 8 Set peAnchors to anBottomLeft //OnChange is called on every changed character //Procedure OnChange // String sValue // // Get Value To sValue //End_Procedure // OnChange End_Object // oLogicalname Object oDisplayname is a Form Set Label to "Display name:" Set Size to 13 139 Set Location to 207 72 Set Form_Margin to 31 Set peAnchors to anBottomLeft //OnChange is called on every changed character //Procedure OnChange // String sValue // // Get Value To sValue //End_Procedure // OnChange End_Object // oDisplayname Object oClear_bn is a Button Set Label to "Clear" Set Location to 146 309 Set peAnchors to anBottomRight // fires when the button is clicked Procedure OnClick Send DoClearForms End_Procedure // OnClick End_Object // oClear_bn Object oSave_bn is a Button Set Label to "Save" Set Location to 166 309 Set peAnchors to anBottomRight // fires when the button is clicked Procedure OnClick Send DoSaveForms End_Procedure // OnClick End_Object // oSave_bn Object oDelete_bn is a Button Set Label to "Delete" Set Location to 186 309 Set peAnchors to anBottomRight // fires when the button is clicked Procedure OnClick Send DoDeleteForms End_Procedure // OnClick End_Object // oDelete_bn Object oCancel_btn is a Button Set Label to "&Close" Set Location to 206 309 Set peAnchors to anBottomRight Procedure OnClick Send Close_Panel End_Procedure // OnClick End_Object // oCancel_btn On_Key Key_F2 Send DoSaveForms On_Key Key_F5 Send DoClearForms On_Key Key_Shift+Key_F2 Send DoDeleteForms Procedure Popup Send DoFillGrid of oFilelist Forward Send Popup End_Procedure Function FileListEntry Integer iNo String sRootname String sLogicalname String sDisplayname Returns Integer If (iNo = 0) Get_Attribute DF_FILE_NEXT_EMPTY of iNo to iNo If (iNo <> 0) Begin Set_Attribute DF_FILE_ROOT_NAME of iNo to sRootname Set_Attribute DF_FILE_LOGICAL_NAME of iNo to sLogicalname Set_Attribute DF_FILE_DISPLAY_NAME of iNo to sDisplayname End Function_Return iNo End_Function Procedure DoSaveForms Integer iNo String sRootname sLogicalname sDisplayname Get value of oNo to iNo Get value of oRootname to sRootname Get value of oLogicalname to sLogicalname Get value of oDisplayname to sDisplayname Get FileListEntry iNo sRootname sLogicalName sDisplayname to iNo Send DoFillGrid of oFilelist Send DoFindNo of oFilelist iNo End_Procedure Procedure DoClearForms Set value of oNo to "" Set value of oRootname to "" Set value of oLogicalname to "" Set value of oDisplayname to "" End_Procedure Procedure DoDeleteForms Integer iNo Get value of oNo to iNo If (iNo = 0) Procedure_Return Get FileListEntry iNo "" "" "" to iNo Send DoFillGrid of oFilelist End_Procedure End_Object // oModifyFilelist