diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-07-12 11:45:55 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-07-12 11:58:39 +0100 |
commit | 3b9482f2e3bcb15d5faa5474665cf6d6bc1b327e (patch) | |
tree | 7be0c1e3ec671ca9c24e336e8ce474234ff7c4aa /extras/contributed/nicegrid/fpg_types.pas | |
parent | 7a41980dd5764124dbf1443615e67e54dfe0e4de (diff) | |
download | fpGUI-3b9482f2e3bcb15d5faa5474665cf6d6bc1b327e.tar.xz |
nicegrid: removed unnecessary fpg_types unit
* The code introduced in fpg_types.pas are now available in fpg_main -
maybe with slightly different names.
* replaced all references to fpg_types methods with new ones found in
fpg_main
Diffstat (limited to 'extras/contributed/nicegrid/fpg_types.pas')
-rw-r--r-- | extras/contributed/nicegrid/fpg_types.pas | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/extras/contributed/nicegrid/fpg_types.pas b/extras/contributed/nicegrid/fpg_types.pas deleted file mode 100644 index 96d5cbc2..00000000 --- a/extras/contributed/nicegrid/fpg_types.pas +++ /dev/null @@ -1,131 +0,0 @@ -unit fpg_types; -{$mode objfpc}{$H+} - -interface - -uses SysUtils, Classes, fpg_base; - -function EqualfpgRect(const r1,r2 : TfpgRect) : Boolean; -function PtInfpgRect(const ARect : TfpgRect; const p : TPoint) : Boolean; -function IntersectfpgRect(out ARect : TfpgRect; const R1,R2 : TfpgRect) : Boolean; -function UnionfpgRect(out ARect : TfpgRect; const R1,R2 : TfpgRect) : Boolean; -function IsfpgRectEmpty(const ARect : TfpgRect) : Boolean; -function OffsetfpgRect(var ARect : TfpgRect;DX : Integer;DY : Integer) : Boolean; -function InflatefpgRect(var ARect: TfpgRect; dx: Integer; dy: Integer): Boolean; -function CopyfpgRect(out Ds: TfpgRect;const Sc : TfpgRect): Boolean; - -implementation - - -function EqualfpgRect(const r1,r2 : TfpgRect) : Boolean; -begin - Result:= (r1.Left=r2.Left) and (r1.Right=r2.Right) and (r1.Width=r2.Width) and (r1.Height=r2.Height); -end; - -function PtInfpgRect(const ARect : TfpgRect;const p : TPoint) : Boolean; -begin - Result:=(p.y >= ARect.Top) and - (p.y <= ARect.Bottom) and - (p.x >= ARect.Left) and - (p.x <= ARect.Right); -end; - -function IsfpgRectEmpty(const ARect : TfpgRect) : Boolean; -begin - Result:=(ARect.Width <= 0) or (ARect.Height <= 0); -end; - -function IntersectfpgRect(out ARect : TfpgRect;const R1,R2 : TfpgRect) : Boolean; -begin - ARect:=R1; - with R2 do - begin - if Left > R1.Left then - ARect.Left:=Left; - if Top > R1.Top then - ARect.Top:=Top; - if Right < R1.Right then - ARect.Width:= ARect.Left + Right; - if Bottom < R1.Bottom then - ARect.Height:= ARect.Top + Bottom; - end; - if IsfpgRectEmpty(ARect) then - begin - FillChar(ARect,SizeOf(ARect),0); - Result:=false; - end - else - Result:=true; -end; - -function UnionfpgRect(out ARect : TfpgRect;const R1,R2 : TfpgRect) : Boolean; -begin - ARect:=R1; - with R2 do - begin - if Left < R1.Left then - ARect.Left:=Left; - if Top < R1.Top then - ARect.Top:=Top; - if Right > R1.Right then - ARect.Width:= ARect.Left + Right; - if Bottom>R1.Bottom then - ARect.Height:= ARect.Top + Bottom; - end; - if IsfpgRectEmpty(ARect) then - begin - FillChar(ARect,SizeOf(ARect),0); - Result:=false; - end - else - Result:=true; -end; - - - -function OffsetfpgRect(var ARect : TfpgRect;DX : Integer;DY : Integer) : Boolean; -begin - if assigned(@ARect) then - begin - with ARect do - begin - inc(Left,dx); - inc(Top,dy); - end; - Result:=true; - end - else - Result:=false; -end; - -function InflatefpgRect(var ARect: TfpgRect; dx: Integer; dy: Integer): Boolean; -begin - if Assigned(@ARect) then - begin - with ARect do - begin - dec(Left, dx); - dec(Top, dy); - inc(Width, dx*2); - inc(Height, dy*2); - end; - Result := True; - end - else - Result := False; -end; - -function CopyfpgRect(out Ds: TfpgRect;const Sc : TfpgRect): Boolean; -begin - Ds:=Sc; - if IsfpgRectEmpty(Ds) then - begin - FillChar(Ds,SizeOf(Ds),0); - Result:=false; - end - else - Result:=true; -end; - - -end. |