home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / Mdidemo2 / child.pas < prev    next >
Pascal/Delphi Source File  |  1998-03-12  |  1KB  |  50 lines

  1. unit Child;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls;
  8.  
  9. type
  10.   TChildForm = class(TForm)
  11.     Memo1: TMemo;
  12.     procedure FormClose(Sender: TObject;
  13.       var Action: TCloseAction);
  14.   private
  15.   {- Private declarations }
  16.   public
  17.   {- Public declarations }
  18.     procedure LoadData(const FileName: String); virtual;
  19.     procedure SaveData(const FileName: String); virtual;
  20.   end;
  21.  
  22. var
  23.   ChildForm: TChildForm;
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28.  
  29. procedure TChildForm.FormClose(Sender: TObject;
  30.   var Action: TCloseAction);
  31. begin
  32.   Action := caFree;
  33. end;
  34.  
  35. procedure TChildForm.LoadData(const FileName: String);
  36. begin
  37. //  ShowMessage('LoadData from ' + FileName);
  38.   Memo1.Lines.LoadFromFile(FileName);
  39.   Caption := LowerCase(FileName);
  40. end;
  41.  
  42. procedure TChildForm.SaveData(const FileName: String);
  43. begin
  44. //  ShowMessage('SaveData to ' + FileName);
  45.   Memo1.Lines.SaveToFile(FileName);
  46.   Caption := LowerCase(FileName);
  47. end;
  48.  
  49. end.
  50.