Browse Source

* Fix Active:=true at designtime

git-svn-id: trunk@30303 -
michael 10 years ago
parent
commit
1127dc9983
1 changed files with 31 additions and 8 deletions
  1. 31 8
      packages/fcl-process/src/simpleipc.pp

+ 31 - 8
packages/fcl-process/src/simpleipc.pp

@@ -76,6 +76,7 @@ Type
     Procedure CheckActive;
     Procedure Activate; virtual; abstract;
     Procedure Deactivate; virtual; abstract;
+    Procedure Loaded; override;
     Property Busy : Boolean Read FBusy;
   Published
     Property Active : Boolean Read FActive Write SetActive;
@@ -238,24 +239,29 @@ end;
 
 procedure TSimpleIPC.CheckInactive;
 begin
-  If Active then
-    DoError(SErrActive,[]);
+  if not (csLoading in ComponentState) then
+    If Active then
+      DoError(SErrActive,[]);
 end;
 
 procedure TSimpleIPC.CheckActive;
 begin
-  If Not Active then
-    DoError(SErrInActive,[]);
+  if not (csLoading in ComponentState) then
+    If Not Active then
+      DoError(SErrInActive,[]);
 end;
 
 procedure TSimpleIPC.SetActive(const AValue: Boolean);
 begin
   if (FActive<>AValue) then
     begin
-    If AValue then
-      Activate
-    else
-      Deactivate;
+    if (csLoading in ComponentState) then
+      FActive:=AValue
+    else  
+      If AValue then
+        Activate
+      else
+        Deactivate;
     end;
 end;
 
@@ -268,6 +274,20 @@ begin
     end;
 end;
 
+Procedure TSimpleIPC.Loaded; 
+
+Var
+  B : Boolean;
+
+begin
+  B:=FActive;
+  if B then
+    begin
+    Factive:=False;
+    Activate;
+    end;
+end;
+
 { ---------------------------------------------------------------------
     TSimpleIPCServer
   ---------------------------------------------------------------------}
@@ -374,6 +394,9 @@ begin
   StopServer;
 end;
 
+
+
+
 { ---------------------------------------------------------------------
     TSimpleIPCClient
   ---------------------------------------------------------------------}