Changeset 31 for VectorObject


Ignore:
Timestamp:
Jun 24, 2010, 4:18:03 PM (14 years ago)
Author:
george
Message:
  • Opravy a rozšíření funkčností některých tříd
File:
1 edited

Legend:

Unmodified
Added
Removed
  • VectorObject/UVectorObject.pas

    r26 r31  
    66
    77uses
    8   Classes, SysUtils, Graphics;
     8  Classes, SysUtils, Graphics, Contnrs;
    99
    1010type
     
    3636
    3737  TVectorLine = class(TVectorObject)
    38     Points: TList; // of TVectorDot
     38    Points: TObjectList; // of TVectorDot
    3939    procedure Add(Position: TPoint);
    4040    procedure Draw; override;
     
    8080  public
    8181    Brush: TBrush;
    82     Objects: TList; // of TVectorObject
     82    Objects: TObjectList; // of TVectorObject
    8383    BitmapCanvas: TCanvas;
    8484    Pen: TPen;
     
    136136  NewPoint := TVectorDot.Create;
    137137  NewPoint.Position := Position;
     138  Points.Add(NewPoint);
    138139end;
    139140
     
    155156begin
    156157  inherited;
    157   Points := TList.Create;
     158  Points := TObjectList.Create;
    158159end;
    159160
    160161destructor TVectorLine.Destroy;
    161 var
    162   I: Integer;
    163 begin
    164   for I := 0 to Points.Count - 1 do
    165     TVectorObject(Points[I]).Destroy;
     162begin
    166163  Points.Destroy;
    167164  inherited Destroy;
     
    210207begin
    211208  inherited;
    212   Objects := TList.Create;
     209  Objects := TObjectList.Create;
    213210  Brush := TBrush.Create;
    214211  Pen := TPen.Create;
     
    223220  Pen.Destroy;
    224221  Brush.Destroy;
    225   for I := 0 to Objects.Count - 1 do
    226     TVectorObject(Objects[I]).Destroy;
    227222  Objects.Destroy;
    228223  inherited Destroy;
Note: See TracChangeset for help on using the changeset viewer.