diff --git a/components/spktoolbar/SpkMath/SpkMath.pas b/components/spktoolbar/SpkMath/SpkMath.pas
index b682b9be2..e17b148d3 100644
--- a/components/spktoolbar/SpkMath/SpkMath.pas
+++ b/components/spktoolbar/SpkMath/SpkMath.pas
@@ -95,6 +95,9 @@ type
1 : (TopLeft : T2DIntVector; BottomRight : T2DIntVector);
end;
{$else}
+
+ { T2DIntRect }
+
T2DIntRect = object
Left, Top, Right, Bottom: integer;
//todo
@@ -104,6 +107,7 @@ type
constructor Create(ALeft, ATop, ARight, ABottom : integer); overload;
constructor Create(ATopLeft : T2DIntVector; ABottomRight : T2DIntVector); overload;
function Contains(APoint : T2DIntPoint) : boolean;
+ function Contains(Ax, Ay : Integer) : boolean;
function IntersectsWith(ARect : T2DIntRect) : boolean; overload;
function IntersectsWith(ARect : T2DIntRect; var Intersection : T2DIntRect) : boolean; overload;
procedure Move(dx, dy : integer); overload;
@@ -1101,6 +1105,12 @@ begin
(APoint.y>=self.Top) and (APoint.y<=self.Bottom);
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);
begin
self.left:=min(self.left,APoint.x);
diff --git a/components/spktoolbar/SpkToolbar/spkt_Appearance.pas b/components/spktoolbar/SpkToolbar/spkt_Appearance.pas
index 3d482d78d..a9c3bdbbd 100644
--- a/components/spktoolbar/SpkToolbar/spkt_Appearance.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_Appearance.pas
@@ -1,5 +1,7 @@
unit spkt_Appearance;
+{$mode Delphi}
+
(*******************************************************************************
* *
* Plik: spkt_Appearance.pas *
@@ -12,8 +14,8 @@ unit spkt_Appearance;
interface
-uses Windows, Graphics, Classes, Forms, SysUtils,
- SpkGraphTools, SpkGUITools, SpkXMLParser, SpkXMLTools,
+uses Graphics, Classes, Forms, SysUtils,
+ SpkGUITools, SpkXMLParser, SpkXMLTools,
spkt_Dispatch, spkt_Exceptions;
type TSpkTabAppearance = class(TPersistent)
@@ -209,6 +211,9 @@ type TSpkToolbarAppearance = class;
implementation
+uses
+ LCLIntf, LCLType;
+
{ TSpkBaseToolbarAppearance }
procedure TSpkTabAppearance.Assign(Source: TPersistent);
diff --git a/components/spktoolbar/SpkToolbar/spkt_BaseItem.pas b/components/spktoolbar/SpkToolbar/spkt_BaseItem.pas
index 5c8218c2d..1ca729fe4 100644
--- a/components/spktoolbar/SpkToolbar/spkt_BaseItem.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_BaseItem.pas
@@ -10,6 +10,9 @@ unit spkt_BaseItem;
* *
*******************************************************************************)
+{$mode delphi}
+{.$Define EnhancedRecordSupport}
+
interface
uses Windows, Graphics, Classes, Controls,
@@ -81,7 +84,12 @@ constructor TSpkBaseItem.Create(AOwner : TComponent);
begin
inherited Create(AOwner);
+ {$IFDEF EnhancedRecordSupport}
FRect:=T2DIntRect.create(0, 0, 0, 0);
+ {$ELSE}
+ FRect.create(0, 0, 0, 0);
+ {$ENDIF}
+
FToolbarDispatch:=nil;
FAppearance:=nil;
FImages:=nil;
diff --git a/components/spktoolbar/SpkToolbar/spkt_Const.pas b/components/spktoolbar/SpkToolbar/spkt_Const.pas
index 7ee1d554a..0738468ba 100644
--- a/components/spktoolbar/SpkToolbar/spkt_Const.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_Const.pas
@@ -1,5 +1,7 @@
unit spkt_Const;
+{$mode delphi}
+
(*******************************************************************************
* *
* Plik: spkt_Const.pas *
diff --git a/components/spktoolbar/SpkToolbar/spkt_Dispatch.pas b/components/spktoolbar/SpkToolbar/spkt_Dispatch.pas
index 59a113af0..ba4812551 100644
--- a/components/spktoolbar/SpkToolbar/spkt_Dispatch.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_Dispatch.pas
@@ -1,5 +1,7 @@
unit spkt_Dispatch;
+{$mode delphi}
+
(*******************************************************************************
* *
* Plik: spkt_Dispatch.pas *
@@ -13,7 +15,7 @@ unit spkt_Dispatch;
interface
-uses Windows, Classes, Controls, Graphics,
+uses Classes, Controls, Graphics,
SpkMath;
type TSpkBaseDispatch = class abstract(TObject)
diff --git a/components/spktoolbar/SpkToolbar/spkt_Exceptions.pas b/components/spktoolbar/SpkToolbar/spkt_Exceptions.pas
index e834d4bab..eebd14f5d 100644
--- a/components/spktoolbar/SpkToolbar/spkt_Exceptions.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_Exceptions.pas
@@ -1,5 +1,7 @@
unit spkt_Exceptions;
+{$mode delphi}
+
(*******************************************************************************
* *
* Plik: spkt_Exceptions.pas *
diff --git a/components/spktoolbar/SpkToolbar/spkt_Tools.pas b/components/spktoolbar/SpkToolbar/spkt_Tools.pas
index 2285a568f..e6bd9d272 100644
--- a/components/spktoolbar/SpkToolbar/spkt_Tools.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_Tools.pas
@@ -1,5 +1,8 @@
unit spkt_Tools;
+{$mode delphi}
+{.$Define EnhancedRecordSupport}
+
(*******************************************************************************
* *
* Plik: spkt_Tools.pas *
@@ -12,8 +15,8 @@ unit spkt_Tools;
interface
-uses Windows, Graphics, SysUtils,
- SpkMath, SpkGraphTools, SpkGUITools;
+uses
+ Graphics, SysUtils, SpkMath, SpkGraphTools, SpkGUITools;
type TButtonTools = class sealed(TObject)
private
@@ -102,28 +105,44 @@ if RightEdgeOpen then
// Zaokr¹glone naro¿niki
if not(LeftEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left + 1, Rect.Top + 1),
+ {$ELSE}
+ Create2DIntPoint(Rect.left + 1, Rect.Top + 1),
+ {$ENDIF}
Radius,
cpLeftTop,
InnerLightColor,
ClipRect);
if not(RightEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius, Rect.Top + 1),
+ {$ELSE}
+ Create2DIntPoint(Rect.right - radius, Rect.Top + 1),
+ {$ENDIF}
Radius,
cpRightTop,
InnerLightColor,
ClipRect);
if not(LeftEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left + 1, Rect.bottom - radius),
+ {$ELSE}
+ Create2DIntPoint(Rect.left + 1, Rect.bottom - radius),
+ {$ENDIF}
Radius,
cpLeftBottom,
InnerLightColor,
ClipRect);
if not(RightEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius, Rect.bottom - radius),
+ {$ELSE}
+ Create2DIntPoint(Rect.right - radius, Rect.bottom - radius),
+ {$ENDIF}
Radius,
cpRightBottom,
InnerLightColor,
@@ -165,28 +184,44 @@ if not(RightEdgeOpen) then
if not(LeftEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left, Rect.Top),
+ {$ELSE}
+ Create2DIntPoint(Rect.left, Rect.Top),
+ {$ENDIF}
Radius,
cpLeftTop,
FrameColor,
ClipRect);
if not(RightEdgeOpen or TopEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius + 1, Rect.Top),
+ {$ELSE}
+ Create2DIntPoint(Rect.right - radius + 1, Rect.Top),
+ {$ENDIF}
Radius,
cpRightTop,
FrameColor,
ClipRect);
if not(LeftEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.left, Rect.bottom - radius + 1),
+ {$ELSE}
+ Create2DIntPoint(Rect.left, Rect.bottom - radius + 1),
+ {$ENDIF}
Radius,
cpLeftBottom,
FrameColor,
ClipRect);
if not(RightEdgeOpen or BottomEdgeOpen) then
TGuiTools.DrawAARoundCorner(Bitmap,
+ {$IFDEF EnhancedRecordSupport}
T2DIntPoint.create(Rect.right - radius + 1, Rect.bottom - radius + 1),
+ {$ELSE}
+ Create2DIntPoint(Rect.right - radius + 1, Rect.bottom - radius + 1),
+ {$ENDIF}
Radius,
cpRightBottom,
FrameColor,
diff --git a/components/spktoolbar/SpkToolbar/spkt_Types.pas b/components/spktoolbar/SpkToolbar/spkt_Types.pas
index 1c1a95443..aba983694 100644
--- a/components/spktoolbar/SpkToolbar/spkt_Types.pas
+++ b/components/spktoolbar/SpkToolbar/spkt_Types.pas
@@ -1,5 +1,7 @@
unit spkt_Types;
+{$mode Delphi}
+
(*******************************************************************************
* *
* Plik: spkt_Types.pas *
@@ -12,7 +14,7 @@ unit spkt_Types;
interface
-uses Windows, Controls, Classes, ContNrs, SysUtils, Dialogs,
+uses Controls, Classes, ContNrs, SysUtils, Dialogs,
spkt_Exceptions;
type TSpkListState = (lsNeedsProcessing, lsReady);
diff --git a/components/spktoolbar/SpkXML/SpkXMLIni.pas b/components/spktoolbar/SpkXML/SpkXMLIni.pas
index e1edf4ef1..9061efe63 100644
--- a/components/spktoolbar/SpkXML/SpkXMLIni.pas
+++ b/components/spktoolbar/SpkXML/SpkXMLIni.pas
@@ -1,5 +1,8 @@
unit SpkXMLIni;
+{$mode ObjFpc}
+{$H+}
+
{$DEFINE SPKXMLINI}
interface
diff --git a/components/spktoolbar/SpkXML/SpkXMLParser.pas b/components/spktoolbar/SpkXML/SpkXMLParser.pas
index b9b27aaf6..e2b6df9cd 100644
--- a/components/spktoolbar/SpkXML/SpkXMLParser.pas
+++ b/components/spktoolbar/SpkXML/SpkXMLParser.pas
@@ -1,5 +1,6 @@
unit SpkXMLParser;
+{$mode Delphi}
{$DEFINE SPKXMLPARSER}
interface
@@ -8,8 +9,10 @@ interface
// Notatki: Stosujê konsekwentnie case-insensitivity
-uses SysUtils, Classes, ContNrs, Graphics, Math;
+uses
+ SysUtils, Classes, ContNrs, Graphics, Math;
+//todo: use LineEnding?
const CRLF=#13#10;
type // Rodzaj ga³êzi XML
diff --git a/components/spktoolbar/SpkXML/SpkXMLTools.pas b/components/spktoolbar/SpkXML/SpkXMLTools.pas
index 4e439fbd3..8499557c7 100644
--- a/components/spktoolbar/SpkXML/SpkXMLTools.pas
+++ b/components/spktoolbar/SpkXML/SpkXMLTools.pas
@@ -1,9 +1,12 @@
unit SpkXMLTools;
+{$mode ObjFpc}
+{$H+}
+
interface
-uses Windows, Graphics, SysUtils,
- SpkXMLParser;
+uses
+ Graphics, SysUtils, SpkXMLParser;
type TSpkXMLTools = class
private
diff --git a/components/spktoolbar/spktoolbarpackage.lpk b/components/spktoolbar/spktoolbarpackage.lpk
index 067caf743..e378bd0c3 100644
--- a/components/spktoolbar/spktoolbarpackage.lpk
+++ b/components/spktoolbar/spktoolbarpackage.lpk
@@ -8,8 +8,8 @@
-
-
+
+
@@ -26,7 +26,7 @@
-
+
@@ -87,6 +87,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/spktoolbar/spktoolbarpackage.pas b/components/spktoolbar/spktoolbarpackage.pas
index f49db4302..694985f4a 100644
--- a/components/spktoolbar/spktoolbarpackage.pas
+++ b/components/spktoolbar/spktoolbarpackage.pas
@@ -9,7 +9,8 @@ interface
uses
spkt_Appearance, spkt_BaseItem, spkt_Buttons, spkt_Const, spkt_Dispatch,
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