i am working on a custom component in Delphi -7
for which i have some published
properties
private
{ Private declarations }
FFolderzip ,Fimagezip,Ftextzip,FActivatezipComp : Boolean;
FMessagebo : string;
published
{ Published declarations }
{component Properties}
{#1.Folder Zip}
property ZipFolder : Boolean read FFolderzip write FFolderzip default False;
{#2.Send imagezip ?}
property ZipImage : Boolean read Fimagezip write Fimagezip default False;
{#3.text files}
property ZipText : Boolean read Ftextzip write Ftextzip default False;
{#4.message}
property ZipMessage: String read FMessagebo write FMessagebo ;
{#5.Activate }
property ActivateZipper: Boolean read FActivatezipComp write FActivatezipComp Default false;
end;
When the user drops the component on the application, ActivateZipper
properties give the use a option to activate/enable or deactivate/disable the component from executing.
The component creates a file
so in the constructor i have this, CreateATextFileProc
will create the file in the application folder.So if i check in the constructor if the ActivateZipper
is true or false..
i have a constructor
constructor TcomProj.Create(aOwner: TComponent);
begin
inherited;
if ActivateZipper then CreateATextFileProc;
end;
The ActivateZipper
is always false even if i set it to true in the object inspector.
How can the component be disabled from doing it working with published property?
ActivateZipper
is always False in the constructor because objects are zero initialised. It will be set True when the properties are streamed in. Are you aware that most apps run without sufficient rights to write to the application folder? – David HeffernanC:\Documents and Settings\Myname\Application Data\myfolder
(i guess this is better) thank you:) – PresleyDias