home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Cell Control / DATA1.CAB / DELPHIDM / USave.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-01-11  |  1.2 KB  |  52 lines

  1. unit USave;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Tempunit, ComCtrls, StdCtrls, Buttons, OleCtrls, CELLLib_TLB, ExtCtrls,main;
  8.  
  9. type
  10.   TFSave = class(TTemplate)
  11.     BitBtn2: TBitBtn;
  12.     BitBtn3: TBitBtn;
  13.     OpenDialog1: TOpenDialog;
  14.     SaveDialog1: TSaveDialog;
  15.     procedure BitBtn2Click(Sender: TObject);
  16.     procedure BitBtn3Click(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   FSave: TFSave;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TFSave.BitBtn2Click(Sender: TObject);
  31. begin
  32.   inherited;
  33.        if   OpenDialog1.Execute then
  34.        begin
  35.             if  Cell1.DoOpenFile(OpenDialog1.FileName)<=0 then
  36.                 messagedlg('File open failer, please check again!', mtInformation,[mbOk], 0);
  37.        end;
  38. end;
  39.  
  40. procedure TFSave.BitBtn3Click(Sender: TObject);
  41. begin
  42.   inherited;
  43.       if   SaveDialog1.Execute then
  44.        begin
  45.             if  Cell1.DoSaveFile(SaveDialog1.FileName)<=0 then
  46.                 messagedlg('File open failer, please check again!', mtInformation,[mbOk], 0);
  47.  
  48.        end;
  49. end;
  50.  
  51. end.
  52.