Sorry, I added the two Size() functions as a last minute and only after sending the patch I noticed that it breaks the FPC build! Sorry!
I attached another patch, without the Size() functions... Anybody know how we can get around the Size() issue. It conflicts with the "SIZE = TSize;" line on line 94 in unit types.pp ---------------------------------- types.pp(267,14) Error: overloaded identifier "SIZE" isn't a function types.pp(268,14) Error: overloaded identifier "SIZE" isn't a function types.pp(271,1) Fatal: There were 2 errors compiling module, stopping types.pp(271,1) Fatal: Compilation aborted ---------------------------------- Regards, Graeme. On 7/25/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
Hi, Attached is a patch for the types.pp unit. I also include some Unit Tests for InflateRect() function in a separate file (uses fpcUnit) by wasn't sure how or where to incorporate them. The patch needs to be applied in the root FPC source directory. Changes: * Added a new InflateRect() function, which does the same as the Windows API call, but is cross-platform. * Added two Size() functions with different parameters that return a TSize record. It works the same as the Point() function that returns a TPoint record. Regards, Graeme. -- There's no place like 127.0.0.1
-- There's no place like 127.0.0.1
Index: rtl/objpas/types.pp =================================================================== --- rtl/objpas/types.pp (revision 4294) +++ rtl/objpas/types.pp (working copy) @@ -263,7 +263,9 @@ function IsRectEmpty(const Rect : TRect) : Boolean; function OffsetRect(var Rect : TRect;DX : Integer;DY : Integer) : Boolean; function CenterPoint(const Rect: TRect): TPoint; +function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; + implementation @@ -391,5 +393,22 @@ end; +function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean; +begin + if Assigned(@Rect) then + begin + with Rect do + begin + dec(Left, dx); + dec(Top, dy); + inc(Right, dx); + inc(Bottom, dy); + end; + Result := True; + end + else + Result := False; +end; + end.
_______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-devel
