Ignore:
Timestamp:
Dec 15, 2021, 9:03:17 PM (3 years ago)
Author:
chronos
Message:
  • Modified: More preparation for future Previous and Next buttons in Contact window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.pas

    r71 r77  
    206206  private
    207207    FContact: TContact;
    208     FOnNext: TNotifyEvent;
    209     FOnPrevious: TNotifyEvent;
     208    FOnGetNext: TGetContactEvent;
     209    FOnGetPrevious: TGetContactEvent;
    210210    FormProperties: TFormProperties;
    211211    procedure SetContact(AValue: TContact);
     
    216216    procedure UpdateInterface;
    217217    property Contact: TContact read FContact write SetContact;
    218     property OnPrevious: TNotifyEvent read FOnPrevious write FOnPrevious;
    219     property OnNext: TNotifyEvent read FOnNext write FOnNext;
     218    property OnGetPrevious: TGetContactEvent read FOnGetPrevious write FOnGetPrevious;
     219    property OnGetNext: TGetContactEvent read FOnGetNext write FOnGetNext;
    220220  end;
    221221
     
    654654procedure TFormContact.ButtonNextClick(Sender: TObject);
    655655begin
    656   if Assigned(FOnNext) then FOnNext(Self);
     656  if Assigned(FOnGetNext) then
     657     Contact := FOnGetNext(Contact);
    657658end;
    658659
     
    679680procedure TFormContact.ButtonPreviousClick(Sender: TObject);
    680681begin
    681   if Assigned(FOnPrevious) then FOnPrevious(Self);
     682  if Assigned(FOnGetPrevious) then
     683    Contact := FOnGetPrevious(Contact);
    682684end;
    683685
     
    699701  APhotoSave.Enabled := ProfilePhotoActive;
    700702  APhotoClear.Enabled := ProfilePhotoActive;
     703  //ButtonNext.Enabled := Assigned(FOnGetNext) and Assigned(FOnGetNext(Contact));
     704  //ButtonPrevious.Enabled := Assigned(FOnGetPrevious) and Assigned(FOnGetPrevious(Contact));
    701705end;
    702706
Note: See TracChangeset for help on using the changeset viewer.