Use cRDCModalPanel.pkg Use Cursor.pkg Use vWin32fh.pkg Use cRDCCJSelectionGrid.pkg Use cRefactorTextbox.pkg Use cRDCButtonDPI.pkg Use SourceCode.inc Use cUnusedSourceFiles.pkg Object oUnusedSourceFiles_dg is a cRDCModalPanel Set Label to "Unused Source Files" Set Size to 209 366 Set Location to 2 2 Set piMinSize to 209 366 Set Icon to "UnusedSourceFiles.ico" Property tUnusedSourceFiles[] psaSourceFileArray Object oUnusedSourceFiles_grd is a cRDCCJSelectionGrid Set Size to 164 338 Set Location to 14 14 Object oCJGridColumnRowIndicator is a cCJGridColumnRowIndicator Set piWidth to 25 Set pbResizable to False End_Object Object oSourceFile_col is a cCJGridColumn // This must be here: Set phoData_Col to Self Set piWidth to 675 Set psCaption to "Full Path and File Name" End_Object Procedure LoadData Handle hoDataSource tDataSourceRow[] TheData TheDataEmpty tUnusedSourceFiles[] saSourceFileArray Integer iSize iRow iCount iDataCol iCheckBoxCol If (not(IsComObjectCreated(Self))) Begin Procedure_Return End Get psaSourceFileArray to saSourceFileArray Move (SizeOfArray(saSourceFileArray)) to iSize If (iSize = 0) Begin Procedure_Return End Move 0 to iCount Decrement iSize Get phoDataSource to hoDataSource Get DataSource of hoDataSource to TheData Move TheDataEmpty to TheData Get piColumnId of oSourceFile_col to iDataCol Get piColumnId of (phoCheckbox_Col(Self)) to iCheckBoxCol Move 0 to iRow For iCount from 0 to iSize Move (saSourceFileArray[iCount].sPath + String(saSourceFileArray[iCount].sFileName)) ; to TheData[iRow].sValue[iDataCol] Move False to TheData[iRow].sValue[iCheckBoxCol] Increment iRow Loop If (iRow <> 0) Begin Send ReInitializeData TheData False Send MoveToFirstRow End Else Begin Send InitializeData TheDataEmpty End Move (iSize + 1) to iCount Set psFooterText of oSourceFile_col to ("No of Files:" * String(iCount)) End_Procedure End_Object Object oOK_Btn is a cRDCButtonDPI Set Size to 14 60 Set Label to "Move Files" Set Location to 186 235 Set peAnchors to anBottomRight Set psToolTip to "The selected unused source files will be moved to the backup area." Set psImage to "ActionMoveBack.ico" Set pbAutoEnable to True Procedure OnClick Integer iCheckedItems iRetval Get CheckedItems of oUnusedSourceFiles_grd to iCheckedItems If (iCheckedItems = 0) Begin Send Info_Box "No files selected - nothing to do." Procedure_Return End Get YesNo_Box ("Are you sure you want to move" * String(iCheckedItems) * "source file(s) to the backup area?") to iRetval If (iRetval <> MBR_Yes) Begin Procedure_Return End Send MoveFilesToBackupArea Send Info_Box "Ready!" Send Close_Panel End_Procedure Function IsEnabled Returns Boolean Integer iCheckedItems Get CheckedItems of oUnusedSourceFiles_grd to iCheckedItems Function_Return (iCheckedItems <> 0) End_Function End_Object Procedure MoveFilesToBackupArea Integer iSize iCount iRetval String sBackupFileName sSourceFileName String[] saSelectedItems Send Cursor_Wait of Cursor_Control Get SelectedItems of oUnusedSourceFiles_grd to saSelectedItems Move (SizeOfArray(saSelectedItems)) to iSize Decrement iSize For iCount from 0 to iSize Move saSelectedItems[iCount] to sSourceFileName Get BackupFileName of ghoApplication sSourceFileName to sBackupFileName Get vMoveFile sSourceFileName sBackupFileName to iRetval If (iRetval <> 0) Begin Showln "Error moving file: " sSourceFileName " to: " sBackupFileName End Loop Send Cursor_Ready of Cursor_Control End_Procedure Object oCancel_Btn is a cRDCButton Set Label to "&Close" Set Location to 186 303 Set peAnchors to anBottomRight Procedure OnClick Send Close_Panel End_Procedure End_Object Object oInfo_tb is a cRefactorTextbox Set Size to 10 217 Set Location to 189 11 Set Label to "The selected unused source files will be moved to the backup area." Set peAnchors to anBottomRight Set Justification_Mode to JMode_Left End_Object Object oTextBox1 is a TextBox Set Size to 9 86 Set Location to 3 25 Set Label to "Right click grid for options" End_Object On_Key Key_Alt+Key_A Send SelectAll On_Key Key_Ctrl+Key_A Send SelectAll On_Key Key_Alt+Key_N Send SelectNone On_Key Key_Ctrl+Key_N Send SelectNone On_Key Key_Alt+Key_I Send SelectInvert On_Key Key_Ctrl+Key_I Send SelectInvert On_Key Key_Alt+Key_C Send KeyAction of oCancel_Btn End_Object Procedure FillUnusedSourceFilesDialog tUnusedSourceFiles[] saSourceFileArray Handle ho Move (oUnusedSourceFiles_dg(Self)) to ho If (not(SizeOfArray(saSourceFileArray))) Begin Procedure_Return End Set psaSourceFileArray of ho to saSourceFileArray End_Procedure Procedure DisplayUnusedSourceFilesDialog Handle ho tUnusedSourceFiles[] saSourceFileArray Move (oUnusedSourceFiles_dg(Self)) to ho Get psaSourceFileArray of ho to saSourceFileArray If (not(SizeOfArray(saSourceFileArray))) Begin Procedure_Return End Send Popup of ho End_Procedure