ImageEn, unit iexFolderMView

TImageEnFolderMView.RenameFile

TImageEnFolderMView.RenameFile


Declaration

function RenameFile(idx: Integer; NewName: string) : boolean; overload;
function RenameFile(InplaceEditing: Boolean = False): boolean; overload;


Description

Renames the file at idx to sNewName using the standard windows functionality.
If second overload is used, the user will be prompted to specify a new filename for the current file, either as a dialog (InplaceEditing = False) or by making the filename field editable (InplaceEditing = True).

Result is true unless an error was encountered.

You can specify IEF_CURRENT_FILE for idx to rename the currently selected file.

Note:
 NewName must be a name only, without a folder path
 Has no effect for files on a device folder
 Users can rename files using F2 or double-clicking a filename. You can prevent this by disabling ReadOnly




Examples

// Rename current file to "Selected.jpg"
RenameFile( IEF_CURRENT_FILE, 'Selected.jpg' );

// Display a dialog to specify a new filename for the current file
RenameFile( False );

// Make the filename of the of the current file editable
RenameFile( True );