Ignore:
Timestamp:
Dec 28, 2017, 1:14:31 AM (6 years ago)
Author:
chronos
Message:
  • Added: API function DrawFrame.
  • Fixed: Drawing position of TWindow frame.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Kernel/UGraphics.pas

    r15 r16  
    1616    X: Integer;
    1717    Y: Integer;
    18     function Create(X, Y: Integer): TPoint;
     18    function Create(X, Y: Integer): TPoint; inline;
    1919    function Add(P: TPoint): TPoint;
    2020  end;
     
    3636    Size: TPoint;
    3737    function PointInside(P: TPoint): Boolean;
    38     function Create(Left, Top, Width, Height: Integer): TRectangle; overload;
    39     function Create(Position, Size: TPoint): TRectangle; overload;
     38    function Create(Left, Top, Width, Height: Integer): TRectangle; overload; inline;
     39    function Create(Position, Size: TPoint): TRectangle; overload; inline;
    4040    function AddPoint(P: TPoint): TRectangle;
    4141    property Left: Integer read GetLeft write SetLeft;
     
    5757    procedure DrawLine(P1, P2: TPoint; Color: TColor); virtual;
    5858    procedure DrawRect(Rect: TRectangle; Color: TColor); virtual;
     59    procedure DrawFrame(Rect: TRectangle; Color: TColor); virtual;
    5960    procedure SetPixel(P: TPoint; Color: TColor); virtual;
    6061  end;
     
    217218end;
    218219
     220procedure TCanvas.DrawFrame(Rect: TRectangle; Color: TColor);
     221begin
     222  if Assigned(Parent) then
     223    Parent.DrawFrame(Rect.AddPoint(Position), Color);
     224end;
     225
    219226procedure TCanvas.SetPixel(P: TPoint; Color: TColor);
    220227begin
     
    246253begin
    247254  inherited Paint;
    248   Canvas.DrawRect(Bounds, $ff0000);
     255  Canvas.DrawRect(TRectangle.Create(TPoint.Create(0, 0), Bounds.Size), $a0a0a0);
     256  Canvas.DrawFrame(TRectangle.Create(TPoint.Create(0, 0), Bounds.Size), $000000);
    249257end;
    250258
Note: See TracChangeset for help on using the changeset viewer.