diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-14 09:16:31 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-14 09:16:31 +0200 |
commit | c4fec94cea77f303871b5f4449e7249fd9e32bcb (patch) | |
tree | 5211508dcc9bb370f0c65087c00e34e0ad26b3ca | |
parent | 2343f06232b032b7024c78572df1c97fbcf3d427 (diff) | |
download | fpGUI-c4fec94cea77f303871b5f4449e7249fd9e32bcb.tar.xz |
Applied standard code formatting.
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
-rw-r--r-- | src/HelpWindowDimensions.pas | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/src/HelpWindowDimensions.pas b/src/HelpWindowDimensions.pas index 948cf003..c8335176 100644 --- a/src/HelpWindowDimensions.pas +++ b/src/HelpWindowDimensions.pas @@ -1,12 +1,12 @@ -Unit HelpWindowDimensions; +unit HelpWindowDimensions; {$mode objfpc}{$H+} -// NewView - a new OS/2 Help Viewer -// Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) -// This software is released under the Gnu Public License - see readme.txt + // NewView - a new OS/2 Help Viewer + // Copyright 2003 Aaron Lawrence (aaronl at consultant dot com) + // This software is released under the Gnu Public License - see readme.txt -Interface +interface uses IPFFileFormatUnit; @@ -14,54 +14,52 @@ uses const ptCharacters = 0; ptPercentage = 1; - ptPixels = 2; - ptPoints = 3; - ptDynamic = 4; + ptPixels = 2; + ptPoints = 3; + ptDynamic = 4; - XPosRight = 577; // some random values as markers - YPosTop = 577; - XYPosCenter = 578; + XPosRight = 577; // some random values as markers + YPosTop = 577; + XYPosCenter = 578; type - THelpWindowRect = class - Left: longint; // xposright means, right aligned + THelpWindowRect = class(TObject) + public + Left: longint; // xposright means, right aligned Bottom: longint; // xpostop means top aligned - // both: xyposcenter means centered - Width: longint; + // both: xyposcenter means centered + Width: longint; Height: longint; constructor Create; - procedure Assign( Rect: THelpWindowRect ); + procedure Assign(Rect: THelpWindowRect); end; var FootnoteRect: THelpWindowRect; -procedure ReadHelpSize( const XY: THelpXYPair; - Var Rect: THelpWindowRect ); -procedure ReadHelpPosition( const XY: THelpXYPair; - Var Rect: THelpWindowRect ); +procedure ReadHelpSize(const XY: THelpXYPair; var Rect: THelpWindowRect); +procedure ReadHelpPosition(const XY: THelpXYPair; var Rect: THelpWindowRect); -Implementation +implementation constructor THelpWindowRect.Create; begin - Left := -1; + Left := -1; Bottom := -1; - Width := -1; + Width := -1; Height := -1; end; -procedure THelpWindowRect.Assign( Rect: THelpWindowRect ); +procedure THelpWindowRect.Assign(Rect: THelpWindowRect); begin - Left := Rect.Left; + Left := Rect.Left; Bottom := Rect.Bottom; - Width := Rect.Width; + Width := Rect.Width; Height := Rect.Height; end; -function GetPos( const PositionType: uint8; - const Value: longint ): longint; +function GetPos(const PositionType: uint8; const Value: longint): longint; begin case PositionType of ptCharacters: @@ -75,21 +73,20 @@ begin ptDynamic: case Value of 1: - Result := 0; // left + Result := 0; // left 2: - Result := XPosRight; // right + Result := XPosRight; // right 4: - Result := YPosTop; // top + Result := YPosTop; // top 8: - Result := 0; // bottom + Result := 0; // bottom 16: Result := XYPosCenter; // center. end; end; end; -procedure ReadHelpPosition( const XY: THelpXYPair; - Var Rect: THelpWindowRect ); +procedure ReadHelpPosition(const XY: THelpXYPair; var Rect: THelpWindowRect); var XPositionType: uint8; YPositionType: uint8; @@ -99,16 +96,15 @@ begin YPositionType := XY.Flags and 15; if XY.X <> $ffff then - Rect.Left := GetPos( XPositionType, XY.X ); + Rect.Left := GetPos(XPositionType, XY.X); if XY.Y <> $ffff then - Rect.Bottom := GetPos( YPositionType, XY.Y ); + Rect.Bottom := GetPos(YPositionType, XY.Y); end; -procedure ReadHelpSize( const XY: THelpXYPair; - Var Rect: THelpWindowRect ); +procedure ReadHelpSize(const XY: THelpXYPair; var Rect: THelpWindowRect); begin if XY.X <> $ffff then - Rect.Width := XY.X; + Rect.Width := XY.X; if XY.Y <> $ffff then Rect.Height := XY.Y; end; @@ -117,8 +113,8 @@ initialization FootnoteRect := THelpWindowRect.Create; with FootnoteRect do begin - Left := 10; - Width := 80; + Left := 10; + Width := 80; Bottom := 10; Height := 40; end; @@ -126,4 +122,5 @@ initialization finalization FootnoteRect.Free; -End. +end. + |