Browse Source

* Some changes for easier IDE handling

git-svn-id: trunk@9159 -
michael 18 years ago
parent
commit
745230b984

+ 0 - 6
packages/fcl-db/src/export/Makefile

@@ -2148,9 +2148,3 @@ makefiles: fpc_makefiles
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 endif
-fpcsvexport$(PPUEXT): fpdbexport$(PPEXT)
-fpfixedexport$(PPUEXT): fpdbexport$(PPEXT)
-fpsqlexport$(PPUEXT): fpdbexport$(PPEXT)
-fpsimplexmlexport$(PPUEXT): fpdbexport$(PPEXT)
-fpsimplejsonexport$(PPUEXT): fpdbexport$(PPEXT)
-fpdbfexport$(PPUEXT): fpdbexport$(PPEXT)

+ 7 - 6
packages/fcl-db/src/export/Makefile.fpc

@@ -19,15 +19,16 @@ fpcpackage=y
 fpcdir=../../../..
 
 [rules]
+#fpdbexport$(PPUEXT): fpdbexport$(PPEXT)
 
-fpcsvexport$(PPUEXT): fpdbexport$(PPEXT)
+#fpcsvexport$(PPUEXT): fpdbexport$(PPEXT)
 
-fpfixedexport$(PPUEXT): fpdbexport$(PPEXT)
+#fpfixedexport$(PPUEXT): fpdbexport$(PPEXT)
 
-fpsqlexport$(PPUEXT): fpdbexport$(PPEXT)
+#fpsqlexport$(PPUEXT): fpdbexport$(PPEXT)
 
-fpsimplexmlexport$(PPUEXT): fpdbexport$(PPEXT)
+#fpsimplexmlexport$(PPUEXT): fpdbexport$(PPEXT)
 
-fpsimplejsonexport$(PPUEXT): fpdbexport$(PPEXT)
+#fpsimplejsonexport$(PPUEXT): fpdbexport$(PPEXT)
 
-fpdbfexport$(PPUEXT): fpdbexport$(PPEXT)
+#fpdbfexport$(PPUEXT): fpdbexport$(PPEXT)

+ 13 - 1
packages/fcl-db/src/export/fpdbexport.pp

@@ -8,6 +8,7 @@ uses
   Classes, SysUtils, DB;
   
 Type
+  TCustomDatasetExporter = Class;
 
   // Quote string fields if value contains a space or delimiter char.
   TQuoteString = (qsAlways,qsSpace,qsDelimiter);
@@ -24,6 +25,7 @@ Type
     FFieldName: String;
     FExportedName: String;
     function GetExportedName: String;
+    function GetExporter: TCustomDatasetExporter;
     procedure SetExportedName(const AValue: String);
   Protected
     Procedure BindField (ADataset : TDataset); virtual;
@@ -32,6 +34,7 @@ Type
     Constructor Create(ACollection : TCollection); override;
     Procedure Assign(Source : TPersistent); override;
     Property Field : TField Read FField;
+    Property Exporter : TCustomDatasetExporter Read GetExporter;
   Published
     Property Enabled : Boolean Read FEnabled Write FEnabled default True;
     Property FieldName : String Read FFieldName Write SetFieldName;
@@ -42,6 +45,7 @@ Type
 
   TExportFields = Class(TCollection)
   private
+    FExporter : TCustomDatasetExporter;
     function GetFieldItem(Index : Integer): TExportFieldItem;
     procedure SetFieldItem(Index : Integer; const AValue: TExportFieldItem);
   Public
@@ -51,9 +55,9 @@ Type
     Function FindExportName(Const AFieldName : String) : TExportFieldItem;
     Function AddField(Const AFieldName : String) : TExportFieldItem; virtual;
     Property Fields[Index : Integer] : TExportFieldItem Read GetFieldItem Write SetFieldItem; Default;
+    Property Exporter : TCustomDatasetExporter Read FExporter;
   end;
 
-  { TExportFormatSettings }
 
   { TCustomExportFormatSettings }
 
@@ -85,6 +89,7 @@ Type
   end;
   TCustomExportFormatSettingsClass = Class of TCustomExportFormatSettings;
   
+  { TExportFormatSettings }
   TExportFormatSettings = Class(TCustomExportFormatSettings)
   Published
     Property IntegerFormat;
@@ -331,6 +336,12 @@ begin
     Result:=FFieldName;
 end;
 
+function TExportFieldItem.GetExporter: TCustomDatasetExporter;
+begin
+  If Collection is TExportFields then
+    Result:=(Collection as TExportFields).Exporter;
+end;
+
 procedure TExportFieldItem.SetExportedName(const AValue: String);
 
 Var
@@ -641,6 +652,7 @@ begin
   inherited Create(AOwner);
   FromCurrent:=True;
   FExportFields:=CreateExportFields;
+  FExportFields.FExporter:=Self;
   FFormatSettings:=CreateFormatSettings;
 end;