home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / DFMTOOLS.ZIP / Delphi_DFM / Source / fMDIChild.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-11-01  |  2.4 KB  |  88 lines

  1. unit fMDIChild;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ExtCtrls, DB,
  8.   {$IFNDEF VCL3+}DBTables, {$ENDIF}
  9.   DBCtrls, StdCtrls, Mask, ComCtrls,
  10.   Buttons, ToolWin, cShape,
  11.   fParent, fMDIParent;
  12.  
  13. type
  14.   TChild = class(TParent)
  15.     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  16.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  17.     procedure FormCreate(Sender: TObject);
  18.   private    { Private declarations }
  19.   protected
  20.     fReportTitle,
  21.     fExportFileName:String;
  22.     procedure ExportMasterData(Sender: TObject);
  23.   public     { Public declarations }
  24.     Function GetName:String;dynamic;
  25.     Procedure SetReportTitle(Const Value:String);
  26.     Procedure SetExportFileName(Const Value:String);
  27.   end;
  28.  
  29. implementation
  30.  
  31. uses cdcLibrary, cdcUtils;
  32.  
  33. {$R *.DFM}
  34.  
  35. //-----------------------------------------------------------------------------}
  36. Function TChild.GetName:String;
  37. begin
  38.   result:=Self.Caption;
  39. end;
  40.  
  41. //-----------------------------------------------------------------------------}
  42. procedure TChild.SetReportTitle(Const Value:String);
  43. Begin
  44. fReportTitle:=Value;
  45. if fExportFileName='' then fExportFileName:=Value;
  46. End;
  47.  
  48. //-----------------------------------------------------------------------------}
  49. procedure TChild.SetExportFileName(Const Value:String);
  50. Begin
  51. fExportFileName:=Value;
  52. if fReportTitle='' then fReportTitle:=Value;
  53. End;
  54.  
  55. //-----------------------------------------------------------------------------}
  56. procedure TChild.FormCreate(Sender: TObject);
  57. begin
  58.   inherited;
  59.   fReportTitle:='';
  60.   fExportFileName:='';
  61. end;
  62.  
  63. //-----------------------------------------------------------------------------}
  64. procedure TChild.FormClose(Sender: TObject; var Action: TCloseAction);
  65. begin
  66.   inherited;
  67.   Action:=caFree
  68. end;
  69.  
  70. //-----------------------------------------------------------------------------}
  71. procedure TChild.FormCloseQuery(Sender: TObject;var CanClose: Boolean);
  72. begin
  73.   //inherited;
  74.   CanClose:=True
  75. end;
  76.  
  77. //-------------------------------------------------
  78. procedure TChild.ExportMasterData(Sender: TObject);
  79. Begin
  80. //  Assert(Assigned(fDataSet));
  81. //  if (fDataSet is TDBDataSet) then
  82.   //   cdcLibrary.Carlos_ExportData(DELIMITED_TextFormat,MyRegistry.ExportFolder,(fDataSet as TDBDataSet),fExportFileName)
  83. //  else
  84.      Beep
  85. End;
  86.  
  87. end.
  88.