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
 TImageEnMView Restore Sort Order
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Oct 30 2014 :  16:26:42  Show Profile  Reply
Why doesn't iesbNone restore the sort order?

function XCompareFilename(i1, i2: Integer): Integer;
{ Custom sort function (by Filename). }
var
  s1, s2: string;
begin
  s1 := ExtractFileName(Form1.Collection1.MIO.Params[i1].FileName);
  s2 := ExtractFileName(Form1.Collection1.MIO.Params[i2].FileName);
  if s1 < s2 then
    Result := -1
  else if s1 > s2 then
    Result := 1
  else
    Result := 0;
end;

if ToggleSort1.Down then
  Form1.Collection1.Sort(XCompareFilename)
else
  Form1.Collection1.Sort(iesbNone);
Form1.Collection1.Update;

You should not have to store the original sort order in a stringlist to do so.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

xequte

39144 Posts

Posted - Oct 30 2014 :  17:54:49  Show Profile  Reply
Hi Bill

The only sort order that could be restored to would be the order they were retrieved, which would not be useful.

iesbNone is intended as a performance option. i.e. no resources are expended on sorting.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

39144 Posts

Posted - Oct 30 2014 :  17:55:38  Show Profile  Reply
Hi Bill

The only sort order that could be restored to would be the order they were retrieved, which would not be useful.

iesbNone is intended as a performance option. i.e. no resources are expended on sorting.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Oct 31 2014 :  05:31:48  Show Profile  Reply
So how do you restore the original sort order?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39144 Posts

Posted - Oct 31 2014 :  12:22:25  Show Profile  Reply
Hi Bill

Unfortunately TImageEnFolderMView does not have a way of doing that, though nor does Explorer for that matter.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: