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/UFormServer.pas

    r243 r288  
    2222    Label3: TLabel;
    2323    SpinEdit1: TSpinEdit;
     24    procedure ButtonOkClick(Sender: TObject);
    2425    procedure FormShow(Sender: TObject);
    2526  private
    26 
    27   public
     27    FServerInfo: TServerInfo;
     28    procedure SetServerInfo(AValue: TServerInfo);
    2829    procedure Load(Server: TServerInfo);
    2930    procedure Save(Server: TServerInfo);
     31  public
     32    property ServerInfo: TServerInfo read FServerInfo write SetServerInfo;
    3033  end;
    3134
     
    4750end;
    4851
     52procedure TFormServer.ButtonOkClick(Sender: TObject);
     53begin
     54  Save(FServerInfo);
     55end;
     56
     57procedure TFormServer.SetServerInfo(AValue: TServerInfo);
     58begin
     59  if FServerInfo = AValue then Exit;
     60  FServerInfo := AValue;
     61  if Assigned(FServerInfo) then Load(FServerInfo);
     62end;
     63
    4964procedure TFormServer.Load(Server: TServerInfo);
    5065begin
Note: See TracChangeset for help on using the changeset viewer.