* Fix compilation of various units

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1705 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2011-06-18 16:17:03 +00:00
parent 8e56c66be7
commit e943f03a21
13 changed files with 101 additions and 13 deletions

View File

@ -95,6 +95,9 @@ type
1 : (TopLeft : T2DIntVector; BottomRight : T2DIntVector); 1 : (TopLeft : T2DIntVector; BottomRight : T2DIntVector);
end; end;
{$else} {$else}
{ T2DIntRect }
T2DIntRect = object T2DIntRect = object
Left, Top, Right, Bottom: integer; Left, Top, Right, Bottom: integer;
//todo //todo
@ -104,6 +107,7 @@ type
constructor Create(ALeft, ATop, ARight, ABottom : integer); overload; constructor Create(ALeft, ATop, ARight, ABottom : integer); overload;
constructor Create(ATopLeft : T2DIntVector; ABottomRight : T2DIntVector); overload; constructor Create(ATopLeft : T2DIntVector; ABottomRight : T2DIntVector); overload;
function Contains(APoint : T2DIntPoint) : boolean; function Contains(APoint : T2DIntPoint) : boolean;
function Contains(Ax, Ay : Integer) : boolean;
function IntersectsWith(ARect : T2DIntRect) : boolean; overload; function IntersectsWith(ARect : T2DIntRect) : boolean; overload;
function IntersectsWith(ARect : T2DIntRect; var Intersection : T2DIntRect) : boolean; overload; function IntersectsWith(ARect : T2DIntRect; var Intersection : T2DIntRect) : boolean; overload;
procedure Move(dx, dy : integer); overload; procedure Move(dx, dy : integer); overload;
@ -1101,6 +1105,12 @@ begin
(APoint.y>=self.Top) and (APoint.y<=self.Bottom); (APoint.y>=self.Top) and (APoint.y<=self.Bottom);
end; end;
function T2DIntRect.Contains(Ax, Ay: Integer): boolean;
begin
result:=(Ax>=Left) and (Ax<=Right) and
(Ay>=Top) and (Ay<=Bottom);
end;
procedure T2DIntRect.ExpandBy(APoint: T2DIntPoint); procedure T2DIntRect.ExpandBy(APoint: T2DIntPoint);
begin begin
self.left:=min(self.left,APoint.x); self.left:=min(self.left,APoint.x);

View File

@ -1,5 +1,7 @@
unit spkt_Appearance; unit spkt_Appearance;
{$mode Delphi}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Appearance.pas * * Plik: spkt_Appearance.pas *
@ -12,8 +14,8 @@ unit spkt_Appearance;
interface interface
uses Windows, Graphics, Classes, Forms, SysUtils, uses Graphics, Classes, Forms, SysUtils,
SpkGraphTools, SpkGUITools, SpkXMLParser, SpkXMLTools, SpkGUITools, SpkXMLParser, SpkXMLTools,
spkt_Dispatch, spkt_Exceptions; spkt_Dispatch, spkt_Exceptions;
type TSpkTabAppearance = class(TPersistent) type TSpkTabAppearance = class(TPersistent)
@ -209,6 +211,9 @@ type TSpkToolbarAppearance = class;
implementation implementation
uses
LCLIntf, LCLType;
{ TSpkBaseToolbarAppearance } { TSpkBaseToolbarAppearance }
procedure TSpkTabAppearance.Assign(Source: TPersistent); procedure TSpkTabAppearance.Assign(Source: TPersistent);

View File

@ -10,6 +10,9 @@ unit spkt_BaseItem;
* * * *
*******************************************************************************) *******************************************************************************)
{$mode delphi}
{.$Define EnhancedRecordSupport}
interface interface
uses Windows, Graphics, Classes, Controls, uses Windows, Graphics, Classes, Controls,
@ -81,7 +84,12 @@ constructor TSpkBaseItem.Create(AOwner : TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
{$IFDEF EnhancedRecordSupport}
FRect:=T2DIntRect.create(0, 0, 0, 0); FRect:=T2DIntRect.create(0, 0, 0, 0);
{$ELSE}
FRect.create(0, 0, 0, 0);
{$ENDIF}
FToolbarDispatch:=nil; FToolbarDispatch:=nil;
FAppearance:=nil; FAppearance:=nil;
FImages:=nil; FImages:=nil;

View File

@ -1,5 +1,7 @@
unit spkt_Const; unit spkt_Const;
{$mode delphi}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Const.pas * * Plik: spkt_Const.pas *

View File

@ -1,5 +1,7 @@
unit spkt_Dispatch; unit spkt_Dispatch;
{$mode delphi}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Dispatch.pas * * Plik: spkt_Dispatch.pas *
@ -13,7 +15,7 @@ unit spkt_Dispatch;
interface interface
uses Windows, Classes, Controls, Graphics, uses Classes, Controls, Graphics,
SpkMath; SpkMath;
type TSpkBaseDispatch = class abstract(TObject) type TSpkBaseDispatch = class abstract(TObject)

View File

@ -1,5 +1,7 @@
unit spkt_Exceptions; unit spkt_Exceptions;
{$mode delphi}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Exceptions.pas * * Plik: spkt_Exceptions.pas *

View File

@ -1,5 +1,8 @@
unit spkt_Tools; unit spkt_Tools;
{$mode delphi}
{.$Define EnhancedRecordSupport}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Tools.pas * * Plik: spkt_Tools.pas *
@ -12,8 +15,8 @@ unit spkt_Tools;
interface interface
uses Windows, Graphics, SysUtils, uses
SpkMath, SpkGraphTools, SpkGUITools; Graphics, SysUtils, SpkMath, SpkGraphTools, SpkGUITools;
type TButtonTools = class sealed(TObject) type TButtonTools = class sealed(TObject)
private private
@ -102,28 +105,44 @@ if RightEdgeOpen then
// Zaokr¹glone naro¿niki // Zaokr¹glone naro¿niki
if not(LeftEdgeOpen or TopEdgeOpen) then if not(LeftEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left + 1, Rect.Top + 1), T2DIntPoint.create(Rect.left + 1, Rect.Top + 1),
{$ELSE}
Create2DIntPoint(Rect.left + 1, Rect.Top + 1),
{$ENDIF}
Radius, Radius,
cpLeftTop, cpLeftTop,
InnerLightColor, InnerLightColor,
ClipRect); ClipRect);
if not(RightEdgeOpen or TopEdgeOpen) then if not(RightEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius, Rect.Top + 1), T2DIntPoint.create(Rect.right - radius, Rect.Top + 1),
{$ELSE}
Create2DIntPoint(Rect.right - radius, Rect.Top + 1),
{$ENDIF}
Radius, Radius,
cpRightTop, cpRightTop,
InnerLightColor, InnerLightColor,
ClipRect); ClipRect);
if not(LeftEdgeOpen or BottomEdgeOpen) then if not(LeftEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left + 1, Rect.bottom - radius), T2DIntPoint.create(Rect.left + 1, Rect.bottom - radius),
{$ELSE}
Create2DIntPoint(Rect.left + 1, Rect.bottom - radius),
{$ENDIF}
Radius, Radius,
cpLeftBottom, cpLeftBottom,
InnerLightColor, InnerLightColor,
ClipRect); ClipRect);
if not(RightEdgeOpen or BottomEdgeOpen) then if not(RightEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius, Rect.bottom - radius), T2DIntPoint.create(Rect.right - radius, Rect.bottom - radius),
{$ELSE}
Create2DIntPoint(Rect.right - radius, Rect.bottom - radius),
{$ENDIF}
Radius, Radius,
cpRightBottom, cpRightBottom,
InnerLightColor, InnerLightColor,
@ -165,28 +184,44 @@ if not(RightEdgeOpen) then
if not(LeftEdgeOpen or TopEdgeOpen) then if not(LeftEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left, Rect.Top), T2DIntPoint.create(Rect.left, Rect.Top),
{$ELSE}
Create2DIntPoint(Rect.left, Rect.Top),
{$ENDIF}
Radius, Radius,
cpLeftTop, cpLeftTop,
FrameColor, FrameColor,
ClipRect); ClipRect);
if not(RightEdgeOpen or TopEdgeOpen) then if not(RightEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius + 1, Rect.Top), T2DIntPoint.create(Rect.right - radius + 1, Rect.Top),
{$ELSE}
Create2DIntPoint(Rect.right - radius + 1, Rect.Top),
{$ENDIF}
Radius, Radius,
cpRightTop, cpRightTop,
FrameColor, FrameColor,
ClipRect); ClipRect);
if not(LeftEdgeOpen or BottomEdgeOpen) then if not(LeftEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left, Rect.bottom - radius + 1), T2DIntPoint.create(Rect.left, Rect.bottom - radius + 1),
{$ELSE}
Create2DIntPoint(Rect.left, Rect.bottom - radius + 1),
{$ENDIF}
Radius, Radius,
cpLeftBottom, cpLeftBottom,
FrameColor, FrameColor,
ClipRect); ClipRect);
if not(RightEdgeOpen or BottomEdgeOpen) then if not(RightEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap, TGuiTools.DrawAARoundCorner(Bitmap,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius + 1, Rect.bottom - radius + 1), T2DIntPoint.create(Rect.right - radius + 1, Rect.bottom - radius + 1),
{$ELSE}
Create2DIntPoint(Rect.right - radius + 1, Rect.bottom - radius + 1),
{$ENDIF}
Radius, Radius,
cpRightBottom, cpRightBottom,
FrameColor, FrameColor,

View File

@ -1,5 +1,7 @@
unit spkt_Types; unit spkt_Types;
{$mode Delphi}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Types.pas * * Plik: spkt_Types.pas *
@ -12,7 +14,7 @@ unit spkt_Types;
interface interface
uses Windows, Controls, Classes, ContNrs, SysUtils, Dialogs, uses Controls, Classes, ContNrs, SysUtils, Dialogs,
spkt_Exceptions; spkt_Exceptions;
type TSpkListState = (lsNeedsProcessing, lsReady); type TSpkListState = (lsNeedsProcessing, lsReady);

View File

@ -1,5 +1,8 @@
unit SpkXMLIni; unit SpkXMLIni;
{$mode ObjFpc}
{$H+}
{$DEFINE SPKXMLINI} {$DEFINE SPKXMLINI}
interface interface

View File

@ -1,5 +1,6 @@
unit SpkXMLParser; unit SpkXMLParser;
{$mode Delphi}
{$DEFINE SPKXMLPARSER} {$DEFINE SPKXMLPARSER}
interface interface
@ -8,8 +9,10 @@ interface
// Notatki: Stosuj� konsekwentnie case-insensitivity // Notatki: Stosuj� konsekwentnie case-insensitivity
uses SysUtils, Classes, ContNrs, Graphics, Math; uses
SysUtils, Classes, ContNrs, Graphics, Math;
//todo: use LineEnding?
const CRLF=#13#10; const CRLF=#13#10;
type // Rodzaj ga��zi XML type // Rodzaj ga��zi XML

View File

@ -1,9 +1,12 @@
unit SpkXMLTools; unit SpkXMLTools;
{$mode ObjFpc}
{$H+}
interface interface
uses Windows, Graphics, SysUtils, uses
SpkXMLParser; Graphics, SysUtils, SpkXMLParser;
type TSpkXMLTools = class type TSpkXMLTools = class
private private

View File

@ -8,8 +8,8 @@
<Version Value="10"/> <Version Value="10"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="SpkToolbar;SpkMath;SpkGUITools;SpkGraphTools"/> <OtherUnitFiles Value="SpkToolbar;SpkMath;SpkGUITools;SpkGraphTools;SpkXML"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)\"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<Optimizations> <Optimizations>
@ -26,7 +26,7 @@
<Description Value="Ribbon like toolbar"/> <Description Value="Ribbon like toolbar"/>
<License Value="Modified LGPL"/> <License Value="Modified LGPL"/>
<Version Minor="1"/> <Version Minor="1"/>
<Files Count="15"> <Files Count="18">
<Item1> <Item1>
<Filename Value="SpkToolbar\spkt_Appearance.pas"/> <Filename Value="SpkToolbar\spkt_Appearance.pas"/>
<UnitName Value="spkt_Appearance"/> <UnitName Value="spkt_Appearance"/>
@ -87,6 +87,18 @@
<Filename Value="SpkGraphTools\SpkGraphTools.pas"/> <Filename Value="SpkGraphTools\SpkGraphTools.pas"/>
<UnitName Value="SpkGraphTools"/> <UnitName Value="SpkGraphTools"/>
</Item15> </Item15>
<Item16>
<Filename Value="SpkXML\SpkXMLIni.pas"/>
<UnitName Value="SpkXMLIni"/>
</Item16>
<Item17>
<Filename Value="SpkXML\SpkXMLParser.pas"/>
<UnitName Value="SpkXMLParser"/>
</Item17>
<Item18>
<Filename Value="SpkXML\SpkXMLTools.pas"/>
<UnitName Value="SpkXMLTools"/>
</Item18>
</Files> </Files>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="1"> <RequiredPkgs Count="1">

View File

@ -9,7 +9,8 @@ interface
uses uses
spkt_Appearance, spkt_BaseItem, spkt_Buttons, spkt_Const, spkt_Dispatch, spkt_Appearance, spkt_BaseItem, spkt_Buttons, spkt_Const, spkt_Dispatch,
spkt_Exceptions, spkt_Items, spkt_Pane, spkt_Tab, spkt_Tools, spkt_Types, spkt_Exceptions, spkt_Items, spkt_Pane, spkt_Tab, spkt_Tools, spkt_Types,
SpkToolbar, SpkMath, SpkGUITools, SpkGraphTools, LazarusPackageIntf; SpkToolbar, SpkMath, SpkGUITools, SpkGraphTools, SpkXMLIni, SpkXMLParser,
SpkXMLTools, LazarusPackageIntf;
implementation implementation