Ignore:
Timestamp:
Oct 25, 2012, 2:11:47 PM (12 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/ULastOpenedList.pas

    r402 r432  
    1818    procedure SetMaxCount(AValue: Integer);
    1919    procedure LimitMaxCount;
     20    procedure ItemsChange(Sender: TObject);
     21    procedure DoChange;
    2022  public
    2123    Items: TStringList;
     
    5860end;
    5961
     62procedure TLastOpenedList.ItemsChange(Sender: TObject);
     63begin
     64  DoChange;
     65end;
     66
     67procedure TLastOpenedList.DoChange;
     68begin
     69  if Assigned(FOnChange) then
     70    FOnChange(Self);
     71end;
     72
    6073constructor TLastOpenedList.Create(AOwner: TComponent);
    6174begin
    6275  inherited;
    6376  Items := TStringList.Create;
     77  Items.OnChange := ItemsChange;
    6478  MaxCount := 10;
    6579end;
     
    134148  Items.Insert(0, FileName);
    135149  LimitMaxCount;
    136   if Assigned(FOnChange) then
    137     FOnChange(Self);
     150  DoChange;
    138151end;
    139152
Note: See TracChangeset for help on using the changeset viewer.