Ignore:
Timestamp:
Feb 11, 2021, 11:20:18 PM (4 years ago)
Author:
chronos
Message:
  • Added: Toggle full screen mode (F11) from View main menu.
  • Modified: Updated Common package files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UMetaCanvas.pas

    r69 r79  
    66
    77uses
    8   Classes, SysUtils, Graphics, Contnrs, Types;
     8  Classes, SysUtils, Graphics, Contnrs, Types, fgl;
    99
    1010type
     
    1717    procedure Zoom(Factor: Double); virtual;
    1818    procedure Move(Delta: TPoint); virtual;
     19  end;
     20
     21  TCanvasObjects = class(TFPGObjectList<TCanvasObject>)
    1922  end;
    2023
     
    133136    procedure DoLineTo(X, Y: Integer); override;
    134137  public
    135     Objects: TObjectList;
     138    Objects: TCanvasObjects;
    136139    procedure FillRect(const ARect: TRect); overload; override;
    137140    procedure FillRect(X1,Y1,X2,Y2: Integer); overload;
     
    145148    procedure Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2,
    146149      StartX, StartY, EndX, EndY: Integer); override;
    147     procedure SetSize(Size: TPoint);
    148150    procedure Reset;
    149151    procedure DrawTo(Canvas: TCanvas);
     
    152154    constructor Create;
    153155    destructor Destroy; override;
    154   end;
     156    property Size: TPoint read FSize write FSize;
     157  end;
     158
    155159
    156160implementation
     
    198202  Pen.Free;
    199203  Brush.Free;
    200   inherited Destroy;
     204  inherited;
    201205end;
    202206
     
    228232destructor TCanvasStretchDraw.Destroy;
    229233begin
    230   inherited Destroy;
     234  inherited;
    231235end;
    232236
     
    264268  Pen.Free;
    265269  Brush.Free;
    266   inherited Destroy;
     270  inherited;
    267271end;
    268272
     
    304308  Brush.Free;
    305309  Pen.Free;
    306   inherited Destroy;
     310  inherited;
    307311end;
    308312
     
    336340begin
    337341  Pen.Free;
    338   inherited Destroy;
     342  inherited;
    339343end;
    340344
     
    375379  Pen.Free;
    376380  Brush.Free;
    377   inherited Destroy;
     381  inherited;
    378382end;
    379383
     
    408412  Brush.Free;
    409413  Font.Free;
    410   inherited Destroy;
     414  inherited;
    411415end;
    412416
     
    618622end;
    619623
    620 procedure TMetaCanvas.SetSize(Size: TPoint);
    621 begin
    622   FSize := Size;
    623 end;
    624 
    625624procedure TMetaCanvas.Reset;
    626625begin
     
    633632begin
    634633  for I := 0 to Objects.Count - 1 do
    635     TCanvasObject(Objects[I]).Paint(Canvas);
     634    Objects[I].Paint(Canvas);
    636635end;
    637636
     
    641640begin
    642641  for I := 0 to Objects.Count - 1 do
    643     TCanvasObject(Objects[I]).Zoom(Factor);
     642    Objects[I].Zoom(Factor);
    644643end;
    645644
     
    649648begin
    650649  for I := 0 to Objects.Count - 1 do
    651     TCanvasObject(Objects[I]).Move(Delta);
     650    Objects[I].Move(Delta);
    652651end;
    653652
     
    656655  inherited;
    657656  FPenPos := Point(0, 0);
    658   Objects := TObjectList.Create;
     657  Objects := TCanvasObjects.Create;
    659658end;
    660659
     
    662661begin
    663662  Objects.Free;
    664   inherited Destroy;
     663  inherited;
    665664end;
    666665
Note: See TracChangeset for help on using the changeset viewer.