Ignore:
Timestamp:
Mar 24, 2019, 10:52:35 PM (6 years ago)
Author:
chronos
Message:
  • Modified: More forms use data item property instead Load/Save methods.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNation.pas

    r284 r288  
    2020    LabelName: TLabel;
    2121    LabelHealth: TLabel;
     22    procedure ButtonOkClick(Sender: TObject);
    2223  private
    23 
    24   public
     24    FNation: TNation;
    2525    procedure Load(Nation: TNation);
    2626    procedure Save(Nation: TNation);
     27    procedure SetNation(AValue: TNation);
     28  public
     29    property Nation: TNation read FNation write SetNation;
    2730  end;
    2831
     
    3639
    3740{ TFormNation }
     41
     42procedure TFormNation.ButtonOkClick(Sender: TObject);
     43begin
     44  Save(FNation);
     45end;
    3846
    3947procedure TFormNation.Load(Nation: TNation);
     
    5058end;
    5159
     60procedure TFormNation.SetNation(AValue: TNation);
     61begin
     62  if FNation = AValue then Exit;
     63  FNation := AValue;
     64  if Assigned(FNation) then Load(FNation);
     65end;
     66
    5267end.
    5368
Note: See TracChangeset for help on using the changeset viewer.