Changeset 131 for trunk/Packages/VCard


Ignore:
Timestamp:
Apr 9, 2022, 12:13:45 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Contact image unit moved into VCard package.
Location:
trunk/Packages/VCard
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/VCard/UContactImage.pas

    r130 r131  
    1111  { TContactImage }
    1212
    13   TContactImage = class
     13  TContactImage = class(TComponent)
    1414  private
    1515    FOnChange: TNotifyEvent;
     
    3636    procedure LoadFromFile(FileName: string);
    3737    procedure SaveToFile(FileName: string);
    38     procedure Assign(Source: TContactImage);
    39     constructor Create;
     38    procedure Assign(Source: TPersistent); override;
     39    constructor Create(AOwner: TComponent); override;
    4040    destructor Destroy; override;
     41  published
    4142    property Url: string read FUrl write SetUrl;
    4243    property Used: Boolean read FUsed write SetUsed;
     
    4445  end;
    4546
     47procedure Register;
     48
    4649
    4750implementation
    4851
     52procedure Register;
     53begin
     54  RegisterComponents('VCard', [TVCard]);
     55end;
    4956
    5057{ TContactImage }
     
    349356end;
    350357
    351 procedure TContactImage.Assign(Source: TContactImage);
    352 begin
    353   Bitmap.Assign(Source.Bitmap);
    354   Url := Source.Url;
    355   Loaded := Source.Loaded;
    356   Modified := Source.Modified;
    357   Format := Source.Format;
    358   FieldIndex := Source.FieldIndex;
    359   Contact := Source.Contact;
    360   Used := Source.Used;
    361 end;
    362 
    363 constructor TContactImage.Create;
    364 begin
     358procedure TContactImage.Assign(Source: TPersistent);
     359var
     360  SourceImage: TContactImage;
     361begin
     362  inherited;
     363  if Source is TContactImage then begin
     364    SourceImage := Source as TContactImage;
     365    Bitmap.Assign(SourceImage.Bitmap);
     366    Url := SourceImage.Url;
     367    Loaded := SourceImage.Loaded;
     368    Modified := SourceImage.Modified;
     369    Format := SourceImage.Format;
     370    FieldIndex := SourceImage.FieldIndex;
     371    Contact := SourceImage.Contact;
     372    Used := SourceImage.Used;
     373  end;
     374end;
     375
     376constructor TContactImage.Create(AOwner: TComponent);
     377begin
     378  inherited;
    365379  Bitmap := TBitmap.Create;
    366380end;
     
    372386end;
    373387
    374 
    375388end.
    376389
  • trunk/Packages/VCard/UVCard.pas

    r130 r131  
    360360procedure Register;
    361361begin
    362   RegisterComponents('Common', [TVCard]);
     362  RegisterComponents('VCard', [TVCard]);
    363363end;
    364364
  • trunk/Packages/VCard/VCard.lpk

    r130 r131  
    88      <Version Value="11"/>
    99      <SearchPaths>
    10         <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)/"/>
     10        <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    1111      </SearchPaths>
    1212      <Parsing>
     
    4747        <UnitName Value="UQuotedPrintable"/>
    4848      </Item>
     49      <Item>
     50        <Filename Value="UContactImage.pas"/>
     51        <HasRegisterProc Value="True"/>
     52        <UnitName Value="UContactImage"/>
     53      </Item>
    4954    </Files>
    5055    <i18n>
Note: See TracChangeset for help on using the changeset viewer.