ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 A component similar to ShellListView
 New Topic  Reply to Topic
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

ali

Iran
110 Posts

Posted - Jun 04 2019 :  00:53:06  Show Profile  Reply
Hi Nigel

> I don't know if I understand your requirements fully.
> When you say "refresh" do you mean refilling the control when files are added or deleted to a watched folder.

Yes I want refilling ImageEnFolderMView when I added with Delphi code and I checked with TlImageEnFolderMView.append (...) it refilling good.

> But you are manually filling the control with your own code (custom file list).
> How can any control automatically refresh when it does not generate its own file list?

Other shelllistvuew refilling good by manually add files/folders.
You are better than me find a solution for this.
ImageEnFolderMView.append working good and this is useful for us.

Best Regards

Ali Abbasi
Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 04 2019 :  01:28:30  Show Profile  Reply
Dear Nigel

I can add with append and it working good and I can not save all files/folders of IEFolderMView to other directory.
this directory:
PChar(Path_of_Documents1+'\'+'Contracting'+'\'+MainForm.ContractingTable.FieldByName('employee_number_correct').AsString )

In the below you can see my codes:

procedure TAttachment_Contracting_View_Form.BitBtn1Click(Sender: TObject);
var
  openDialog : topendialog;    // Open dialog variable
  i : Integer;
begin
  WaitLabel.Caption :='Plaease wait... ';

  //Change table name **********************
  if not DirectoryExists( PChar(Path_of_Documents1+'\'+'Contracting'+'\'+MainForm.ContractingTable.FieldByName('employee_number_correct').AsString ) )
   then CreateDir( PChar(Path_of_Documents1+'\'+'Contracting'+'\'+ MainForm.ContractingTable.FieldByName('employee_number_correct').AsString ) );

  // Create the open dialog object - assign to our open dialog variable
  openDialog := TOpenDialog.Create(self);

  // Set up the starting directory to be the current one
  openDialog.InitialDir := GetCurrentDir;

  // Allow multiple files to be selected - of any type
  openDialog.Options := [ofAllowMultiSelect];

  // Display the open file dialog
  if  openDialog.Execute then
  begin
   // Display the selected file names
   for i := 0 to openDialog.Files.Count-1 do
   begin
     //Change table name **********************
     IEFolderMView.AppendImage(openDialog.Files[i], True );
     WaitLabel.Caption := openDialog.Files[i];
   end;
  end;

  // Free up the dialog
  openDialog.Free;
  WaitLabel.Caption :='';
end;

Problem is I can not save all files/foldsrs of IEFolderMView to other directory (folder).

Best Regards

Ali Abbasi
Go to Top of Page

xequte

38182 Posts

Posted - Jun 04 2019 :  17:28:29  Show Profile  Reply
Hi Ali

The files are already on the system, so you should just do a file copy from their current location to their new one.

You could do something like:

// Copy all files in the control a new folder
if WindowsSelectDirectory( 'Specify Folder to Copy to:', newFolder ) = False then
  exit;
for I := 0 to ImageEnMView1.ImageCount - 1 do
begin
  oldFilename := ImageEnMView1.ImageFilename[I];
  WindowsCopy(Form1.Handle, oldFilename, newFolder, True, True, True);
end;



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 05 2019 :  05:05:50  Show Profile  Reply
Dear Nigel

Thank you for your help.

But my problems with some test are:
1. When I delete a files or folders then IEFolderMView show IEFolderMView deleted icon and I want to which IEFolderMView do not show icon of deleted folders or files.
You can see in the attachment which show with red flash.

2. Imageen do not Sort By Type after add new folder (I want to IEFolderMView show first folders after that files...).
You can see in the second attachment.

3. Can I delete whole (directory) folder of IEFolderMView with Delphi code?

4. Can I active select all for folders and files by Ctrl+A keys in IEFolderMView also with IEFolderMView Delphi code?

4.I tested IEFolderMView load batch images with open dialuge in with 10 files with size 1.4GB and 2.5GB... then memory usese and specially hard disk speed is low.

Best Regards

Ali Abbasi



Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 05 2019 :  13:01:54  Show Profile  Reply
Dear Nigel

I wrote below code for delete folder for iefoldermview and it working good, but I thinks with iefoldermview you can send me better codes.

procedure TAttachment_Contracting_View_Form.BitBtn_Delete_AttachmentClick(  Sender: TObject);
var
  Full_Path1:string;
  i:Integer;
begin
 Full_Path1 := PChar(Path_of_Documents1+'\'+'Contracting'+'\'+ MainForm.ContractingTable.FieldByName('employee_number_correct').AsString )+'\';
 if MessageDlg('can you delete folder? ', mtConfirmation,[mbok,mbCancel],0) =  mrCancel Then
   Abort
 else
 if DirectoryExists(Full_Path1) then
  begin
   for i := 0 to IEFolderMView.ImageCount - 1 do
    begin
    IEFolderMView.SelectImage(i);
    end;
   IEFolderMView.DeleteSelectedImages;
   DM1.DelDir(Full_Path1);
  end;
end;



Best Regards

Ali Abbasi
Go to Top of Page

xequte

38182 Posts

Posted - Jun 05 2019 :  23:15:26  Show Profile  Reply
Hi Ali

1. In next weeks release you can call UpdateFileList() to remove files that are no longer available.

2. After adding files call: IEFolderMView.RefreshSorting();

3. Generate a list of all files to delete (or a specific folder) and call WindowsErase

https://www.imageen.com/help/WindowsErase.html

4. Yes, in next weeks release

5. Try the performance demo:

\demos\Multi\MViewPerformance\Performance.dpr

6. Your code is OK, but you should call LockUpdate() and UnlockUpdate(); to speed it up


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 06 2019 :  01:22:52  Show Profile  Reply
Dear Nigel

Thank you for your help.

3. I can not use below code:
WindowsErase(Form1.Handle, 'C:\My Image.jpg', True, True, True);
Please send with delphi sample for windowd erase and copy files or folders.
But my delete code working good.

5. Try the performance demo.
I test it 55MB jpg 1.5GB tiff and 2.2GB tiff images and it computer was low and memory usage was 93% and hard disk usage (no SSD hard disk) was 97% until 100%.

6. Your code is OK, but you should call LockUpdate() and UnlockUpdate(); to speed it up.

Where most use LockUpdate() and unLockUpdate for my codes?
I tested and I do not increase speed.
I use a folder with one big 2.2GB tiff and iefoldermview with thumbnails can not view images and computer hang, I deleted big 2.2GB and iefoldermview show view correctly.
Also can not show thumbnail for it image.

Best Regards

Ali Abbasi
Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 06 2019 :  02:58:12  Show Profile  Reply
Dear Nigel

Added after load below code for batch load items and do not working:
IEFolderMView.RefreshSorting;

I added load it code for load folder and do not working.

I added to IEFolderMViewFolderChanged event of IEFolderMViewFolder and it do order first folders and after files.
Also do not sort all folders by name and after that sort all folders by name!
//////////////////////////////////////////////////////////


procedure TAttachment_Contracting_View_Form.BitBtn1Click(Sender: TObject);
var
  openDialog : topendialog;    // Open dialog variable
  i : Integer;
  Full_Path1,Old_File_Name11:string;
begin
  WaitLabel.Caption :='';
  Full_Path1 := PChar(Path_of_Documents1+'\'+'Contracting'+'\'+ MainForm.ContractingTable.FieldByName('employee_number_correct').AsString )+'\';

  if not DirectoryExists(Full_Path1)
   then CreateDir(Full_Path1);

  // Create the open dialog object - assign to our open dialog variable
  openDialog := TOpenDialog.Create(self);

  // Set up the starting directory to be the current one
  openDialog.InitialDir := GetCurrentDir;

  // Allow multiple files to be selected - of any type
  openDialog.Options := [ofAllowMultiSelect];

  // Display the open file dialog
  if  openDialog.Execute then
  begin
   // Display the selected file names
   for i := 0 to openDialog.Files.Count-1 do
   begin
     IEFolderMView.AppendImage(openDialog.Files[i], True );
     WaitLabel.Caption := ' Please wait... '+openDialog.Files[i];

    //Copy all files in the control a new folder
    Old_File_Name11 := openDialog.Files[i];
    DM1.CopyDir2(Old_File_Name11 ,Full_Path1);
   end;
  end;

  // Free up the dialog
  openDialog.Free;
  WaitLabel.Caption :='';
end;
////////////////////////////////////////////////
procedure TAttachment_Contracting_View_Form.BitBtn2Click(Sender: TObject);
var
  Full_Path1,Old_File_Name11:string;
begin
  Full_Path1 := PChar(Path_of_Documents1+'\'+'Contracting'+'\'+ MainForm.ContractingTable.FieldByName('employee_number_correct').AsString )+'\';

  if not DirectoryExists(Full_Path1)
   then CreateDir(Full_Path1);

  with TFileOpenDialog.Create(nil) do
   try
    Options := [fdoPickFolders];
    if Execute then
     begin
      IEFolderMView.AppendImage(FileName, True );

      WaitLabel.Caption :=WaitLabel.Caption :='Plese wait'+'...'+FileName;

      //Copy all files in the control a new folder
      Old_File_Name11 := FileName;
      DM1.CopyDir2(Old_File_Name11 ,Full_Path1);
     end;
   finally
    Free;
   end;

  WaitLabel.Caption :='';
end;

///////////////////////////

Best Regards

Ali Abbasi
Go to Top of Page

xequte

38182 Posts

Posted - Jun 07 2019 :  00:25:09  Show Profile  Reply
> I test it 55MB jpg 1.5GB tiff and 2.2GB tiff images

Those are massive files. I'm quite sure any application is going to slow while loading them. Did any of the options available in the Performance demo improve it?

> Where most use LockUpdate() and unLockUpdate for my codes?

LockUpdate() before making a lot of changes, and UnlockUpdate() when you are finished. Whether it increases speed will depend on your usage.


Regarding the sorting issue, what is your value for:

https://www.imageen.com/help/TImageEnFolderMView.SortOrder.html

You can also manually call Sort:

https://www.imageen.com/help/TImageEnMView.Sort.html


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 07 2019 :  03:04:11  Show Profile  Reply
Dear Nigel

I used LockUpdate() and UnLockUpdate() and thank you.
My problem of iefoldermview sort fixed by your sample.
Better sort is sort by type and by name together.
For example sort folder Acmilan, folder Barsa, folder Zagreb after that images file
Ali.bmp,Bob.bmp.jpg,Bob.jpg... after that Ali.doc,Bob.doc....



Best Regards

Ali Abbasi
Go to Top of Page

ali

Iran
110 Posts

Posted - Jun 10 2019 :  08:13:53  Show Profile  Reply
Hi Nigel

I am in business trip and you realssed new imageen.
Do you added below properties for IEFoldermview?

If No, Please you will added append/delete ... to IEFoldermview for append folders and files to a folder include folders and file.

Best Regards

Ali Abbasi

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
Jump To: