Changeset 110 for trunk/Score.pas


Ignore:
Timestamp:
Dec 10, 2024, 11:05:12 AM (5 weeks ago)
Author:
chronos
Message:
  • Added: Sorting by individual columns in Score window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Score.pas

    r109 r110  
    44
    55uses
    6   Classes, SysUtils, Generics.Collections, RegistryEx;
     6  Classes, SysUtils, Generics.Collections, RegistryEx, ListViewSort;
    77
    88type
     
    3131    procedure SaveToRegistry(Reg: TRegistryEx; RegContext: TRegistryContext);
    3232    procedure LoadFromRegistry(Reg: TRegistryEx; RegContext: TRegistryContext);
     33    procedure AssignToList(List: TObjects);
    3334  end;
    3435
     
    121122end;
    122123
     124procedure TScores.AssignToList(List: TObjects);
     125var
     126  I: Integer;
     127begin
     128  while List.Count > Count do List.Delete(List.Count - 1);
     129  for I := 0 to List.Count - 1 do List[I] := Items[I];
     130  while List.Count < Count do List.Add(Items[List.Count]);
     131end;
     132
    123133end.
    124134
Note: See TracChangeset for help on using the changeset viewer.