Browse Source

Quick.Config fpc sample updated

Unknown 6 years ago
parent
commit
30dbc057b3

+ 21 - 1
samples/fpc/QuickConfig/ConfigToFileAndRegistry/Config.json

@@ -1 +1,21 @@
-{ "Title" : "hola", "SessionName" : "", "Sizes" : [], "LastFilename" : "", "History" : [], "Complex" : { "Id" : 1, "Priority" : "msMed", "Redundant" : true }, "ModifyDate" : "2018-07-19T00:40:06.764Z " }
+{
+     "Title" :  "hola",
+     "SessionName" :  "Session01",
+     "Sizes" :  [
+        1,
+         2,
+         3,
+         4,
+         5,
+         6,
+         7
+    ],
+     "LastFilename" :  "C:\\library.txt",
+     "History" :  [    ],
+     "Complex" :  {
+         "Id" :  1,
+         "Priority" :  "msMed",
+         "Redundant" :  true 
+    },
+     "ModifyDate" :  "2018-12-11T22:25:29.250Z " 
+}

+ 1 - 1
samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/umain.lfm

@@ -1,7 +1,7 @@
 object Form1: TForm1
 object Form1: TForm1
   Left = 379
   Left = 379
   Height = 457
   Height = 457
-  Top = 229
+  Top = 254
   Width = 592
   Width = 592
   Caption = 'Form1'
   Caption = 'Form1'
   ClientHeight = 457
   ClientHeight = 457

+ 10 - 3
samples/fpc/QuickConfig/ConfigToFileAndRegistry/backup/umain.pas

@@ -9,7 +9,9 @@ uses
   Quick.Config,
   Quick.Config,
   Quick.Config.Provider.Registry,
   Quick.Config.Provider.Registry,
   Generics.Collections,
   Generics.Collections,
+  {$IFDEF FPC}
   registry,
   registry,
+  {$ENDIF}
   Quick.Config.Provider.Json;
   Quick.Config.Provider.Json;
 
 
 type
 type
@@ -52,12 +54,14 @@ type
     property hola : Integer read fhola write fhola;
     property hola : Integer read fhola write fhola;
   end;
   end;
 
 
+  TArraySizes = array of Integer;
+
   TMyConfig = class(TAppConfig)
   TMyConfig = class(TAppConfig)
   private
   private
     fTitle : string;
     fTitle : string;
     fHidden : Boolean;
     fHidden : Boolean;
     fSessionName: string;
     fSessionName: string;
-    fSizes : TArray<Integer>;
+    fSizes : TArraySizes;
     fLastFilename : string;
     fLastFilename : string;
     fWindowPos : TWinPos;
     fWindowPos : TWinPos;
     fHistory : TArray<TProcessType>;
     fHistory : TArray<TProcessType>;
@@ -67,12 +71,12 @@ type
   public
   public
     constructor Create; override;
     constructor Create; override;
     destructor Destroy; override;
     destructor Destroy; override;
-    procedure DefaultValues;
+    procedure DefaultValues; override;
     property Hidden : Boolean read fHidden write fHidden;
     property Hidden : Boolean read fHidden write fHidden;
   published
   published
     property Title : string read fTitle write fTitle;
     property Title : string read fTitle write fTitle;
     property SessionName : string read fSessionName write fSessionName;
     property SessionName : string read fSessionName write fSessionName;
-    property Sizes : TArray<Integer> read fSizes write fSizes;
+    property Sizes : TArraySizes read fSizes write fSizes;
     property LastFilename : string read fLastFilename write fLastFilename;
     property LastFilename : string read fLastFilename write fLastFilename;
     //property WindowPos : TWinPos read fWindowPos write fWindowPos;
     //property WindowPos : TWinPos read fWindowPos write fWindowPos;
     property History : TArray<TProcessType> read fHistory write fHistory;
     property History : TArray<TProcessType> read fHistory write fHistory;
@@ -211,6 +215,9 @@ var
   processtype : TProcessType;
   processtype : TProcessType;
 begin
 begin
   cConfig.Title := 'hola';
   cConfig.Title := 'hola';
+  cConfig.SessionName := 'Session01';
+  cConfig.LastFileName := 'C:\library.txt';
+  cConfig.Sizes := [1,2,3,4,5,6,7];
   cConfig.Complex := TProcessType.Create;
   cConfig.Complex := TProcessType.Create;
   cConfig.Complex.Id := 1;
   cConfig.Complex.Id := 1;
   cConfig.Complex.Redundant := True;
   cConfig.Complex.Redundant := True;

BIN
samples/fpc/QuickConfig/ConfigToFileAndRegistry/lib/i386-win32/QuickConfig.or


+ 1 - 1
samples/fpc/QuickConfig/ConfigToFileAndRegistry/lib/i386-win32/umain.lfm

@@ -1,7 +1,7 @@
 object Form1: TForm1
 object Form1: TForm1
   Left = 379
   Left = 379
   Height = 457
   Height = 457
-  Top = 229
+  Top = 230
   Width = 592
   Width = 592
   Caption = 'Form1'
   Caption = 'Form1'
   ClientHeight = 457
   ClientHeight = 457

+ 1 - 1
samples/fpc/QuickConfig/ConfigToFileAndRegistry/umain.lfm

@@ -1,7 +1,7 @@
 object Form1: TForm1
 object Form1: TForm1
   Left = 379
   Left = 379
   Height = 457
   Height = 457
-  Top = 229
+  Top = 230
   Width = 592
   Width = 592
   Caption = 'Form1'
   Caption = 'Form1'
   ClientHeight = 457
   ClientHeight = 457

+ 8 - 3
samples/fpc/QuickConfig/ConfigToFileAndRegistry/umain.pas

@@ -54,12 +54,14 @@ type
     property hola : Integer read fhola write fhola;
     property hola : Integer read fhola write fhola;
   end;
   end;
 
 
+  TArraySizes = array of Integer;
+
   TMyConfig = class(TAppConfig)
   TMyConfig = class(TAppConfig)
   private
   private
     fTitle : string;
     fTitle : string;
     fHidden : Boolean;
     fHidden : Boolean;
     fSessionName: string;
     fSessionName: string;
-    fSizes : TArray<Integer>;
+    fSizes : TArraySizes;
     fLastFilename : string;
     fLastFilename : string;
     fWindowPos : TWinPos;
     fWindowPos : TWinPos;
     fHistory : TArray<TProcessType>;
     fHistory : TArray<TProcessType>;
@@ -69,12 +71,12 @@ type
   public
   public
     constructor Create; override;
     constructor Create; override;
     destructor Destroy; override;
     destructor Destroy; override;
-    procedure DefaultValues;
+    procedure DefaultValues; override;
     property Hidden : Boolean read fHidden write fHidden;
     property Hidden : Boolean read fHidden write fHidden;
   published
   published
     property Title : string read fTitle write fTitle;
     property Title : string read fTitle write fTitle;
     property SessionName : string read fSessionName write fSessionName;
     property SessionName : string read fSessionName write fSessionName;
-    property Sizes : TArray<Integer> read fSizes write fSizes;
+    property Sizes : TArraySizes read fSizes write fSizes;
     property LastFilename : string read fLastFilename write fLastFilename;
     property LastFilename : string read fLastFilename write fLastFilename;
     //property WindowPos : TWinPos read fWindowPos write fWindowPos;
     //property WindowPos : TWinPos read fWindowPos write fWindowPos;
     property History : TArray<TProcessType> read fHistory write fHistory;
     property History : TArray<TProcessType> read fHistory write fHistory;
@@ -213,6 +215,9 @@ var
   processtype : TProcessType;
   processtype : TProcessType;
 begin
 begin
   cConfig.Title := 'hola';
   cConfig.Title := 'hola';
+  cConfig.SessionName := 'Session01';
+  cConfig.LastFileName := 'C:\library.txt';
+  cConfig.Sizes := [1,2,3,4,5,6,7];
   cConfig.Complex := TProcessType.Create;
   cConfig.Complex := TProcessType.Create;
   cConfig.Complex.Id := 1;
   cConfig.Complex.Id := 1;
   cConfig.Complex.Redundant := True;
   cConfig.Complex.Redundant := True;