* Fix compilation of spk_Buttons

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

View File

@ -309,6 +309,8 @@ type
operator - (Left: T2DIntRect; Right: T2DIntVector): T2DIntRect; operator - (Left: T2DIntRect; Right: T2DIntVector): T2DIntRect;
operator + (Left: T2DIntRect; Right: T2DIntVector): T2DIntRect;
operator := (ARect: TRect): T2DIntRect; operator := (ARect: TRect): T2DIntRect;
operator - (Left: T2DVector; Right: T2DVector): T2DVector; operator - (Left: T2DVector; Right: T2DVector): T2DVector;
@ -347,6 +349,12 @@ begin
Left.Right - Right.x, Left.Bottom - Right.y); Left.Right - Right.x, Left.Bottom - Right.y);
end; end;
operator + (Left: T2DIntRect; Right: T2DIntVector): T2DIntRect;
begin
Result.Create(Left.left + Right.x, Left.top + Right.y,
Left.Right + Right.x, Left.bottom + Right.y);
end;
operator := (ARect: TRect): T2DIntRect; operator := (ARect: TRect): T2DIntRect;
begin begin
Result.Left := ARect.Left; Result.Left := ARect.Left;

View File

@ -1,5 +1,8 @@
unit spkt_Buttons; unit spkt_Buttons;
{$mode delphi}
{.$Define EnhancedRecordSupport}
(******************************************************************************* (*******************************************************************************
* * * *
* Plik: spkt_Buttons.pas * * Plik: spkt_Buttons.pas *
@ -12,7 +15,8 @@ unit spkt_Buttons;
interface interface
uses Windows, Graphics, Classes, Controls, Menus, ImgList, ActnList, Math, uses
Graphics, Classes, Controls, Menus, ImgList, ActnList, Math,
Types, Dialogs, Types, Dialogs,
SpkGuiTools, SpkGraphTools, SpkMath, SpkGuiTools, SpkGraphTools, SpkMath,
spkt_Const, spkt_BaseItem, spkt_Exceptions, spkt_Tools; spkt_Const, spkt_BaseItem, spkt_Exceptions, spkt_Tools;
@ -31,15 +35,15 @@ type TSpkBaseButton = class;
FClient : TSpkBaseButton; FClient : TSpkBaseButton;
procedure AssignClient(AClient: TObject); override; procedure AssignClient(AClient: TObject); override;
function IsCaptionLinked: Boolean; override;
function IsEnabledLinked: Boolean; override;
function IsVisibleLinked: Boolean; override;
function IsOnExecuteLinked: Boolean; override; function IsOnExecuteLinked: Boolean; override;
procedure SetCaption(const Value: string); override; procedure SetCaption(const Value: string); override;
procedure SetEnabled(Value: Boolean); override; procedure SetEnabled(Value: Boolean); override;
procedure SetVisible(Value: Boolean); override; procedure SetVisible(Value: Boolean); override;
procedure SetOnExecute(Value: TNotifyEvent); override; procedure SetOnExecute(Value: TNotifyEvent); override;
public public
function IsCaptionLinked: Boolean; override;
function IsEnabledLinked: Boolean; override;
function IsVisibleLinked: Boolean; override;
end; end;
TSpkBaseButton = class abstract(TSpkBaseItem) TSpkBaseButton = class abstract(TSpkBaseItem)
@ -154,6 +158,9 @@ type TSpkSmallButton = class(TSpkBaseButton)
implementation implementation
uses
LCLType, LCLIntf;
{ TSpkButtonActionLink } { TSpkButtonActionLink }
procedure TSpkButtonActionLink.AssignClient(AClient: TObject); procedure TSpkButtonActionLink.AssignClient(AClient: TObject);
@ -231,13 +238,15 @@ constructor TSpkBaseButton.Create(AOwner : TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
FCaption:='Button'; FCaption:='Button';
FOnClick:=nil;
FActionLink:=nil;
FButtonState:=bsIdle; FButtonState:=bsIdle;
FButtonRect:=T2DIntRect.Create(0, 0, 1, 1);
FButtonKind:=bkButton; FButtonKind:=bkButton;
{$IFDEF EnhancedRecordSupport}
FButtonRect:=T2DIntRect.Create(0, 0, 1, 1);
FDropdownRect:=T2DIntRect.Create(0, 0, 1, 1); FDropdownRect:=T2DIntRect.Create(0, 0, 1, 1);
FDropdownMenu:=nil; {$ELSE}
FButtonRect.Create(0, 0, 1, 1);
FDropdownRect.Create(0, 0, 1, 1);
{$ENDIF}
FMouseHoverElement:=beNone; FMouseHoverElement:=beNone;
FMouseActiveElement:=beNone; FMouseActiveElement:=beNone;
end; end;
@ -360,10 +369,18 @@ var NewMouseHoverElement : TSpkMouseButtonElement;
begin begin
if FEnabled then if FEnabled then
begin begin
{$IFDEF EnhancedRecordSupport}
if FButtonRect.Contains(T2DIntPoint.Create(X,Y)) then if FButtonRect.Contains(T2DIntPoint.Create(X,Y)) then
{$ELSE}
if FButtonRect.Contains(X,Y) then
{$ENDIF}
NewMouseHoverElement:=beButton else NewMouseHoverElement:=beButton else
if (FButtonKind = bkButtonDropdown) and if (FButtonKind = bkButtonDropdown) and
{$IFDEF EnhancedRecordSupport}
(FDropdownRect.Contains(T2DIntPoint.Create(X,Y))) then (FDropdownRect.Contains(T2DIntPoint.Create(X,Y))) then
{$ELSE}
(FDropdownRect.Contains(X,Y)) then
{$ENDIF}
NewMouseHoverElement:=beDropdown else NewMouseHoverElement:=beDropdown else
NewMouseHoverElement:=beNone; NewMouseHoverElement:=beNone;
@ -612,6 +629,7 @@ end;
procedure TSpkLargeButton.CalcRects; procedure TSpkLargeButton.CalcRects;
begin begin
{$IFDEF EnhancedRecordSupport}
if FButtonKind = bkButtonDropdown then if FButtonKind = bkButtonDropdown then
begin begin
FButtonRect:=T2DIntRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE); FButtonRect:=T2DIntRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE);
@ -622,6 +640,18 @@ else
FButtonRect:=FRect; FButtonRect:=FRect;
FDropdownRect:=T2DIntRect.Create(0, 0, 0, 0); FDropdownRect:=T2DIntRect.Create(0, 0, 0, 0);
end; end;
{$ELSE}
if FButtonKind = bkButtonDropdown then
begin
FButtonRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE);
FDropdownRect.Create(FRect.Left, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE + 1, FRect.Right, FRect.Bottom);
end
else
begin
FButtonRect:=FRect;
FDropdownRect.Create(0, 0, 0, 0);
end;
{$ENDIF}
end; end;
constructor TSpkLargeButton.Create(AOwner: TComponent); constructor TSpkLargeButton.Create(AOwner: TComponent);
@ -677,10 +707,17 @@ if FButtonKind in [bkButton, bkDropdown] then
begin begin
{$REGION 'T³o dla HotTrack'} {$REGION 'T³o dla HotTrack'}
TGuiTools.DrawRoundRect(ABuffer.Canvas, TGuiTools.DrawRoundRect(ABuffer.Canvas,
{$IFDEF EnhancedRecordSupport}
T2DIntRect.Create(FButtonRect.left, T2DIntRect.Create(FButtonRect.left,
FButtonRect.Top, FButtonRect.Top,
FButtonRect.Right, FButtonRect.Right,
FButtonRect.Bottom), FButtonRect.Bottom),
{$ELSE}
Create2DIntRect(FButtonRect.left,
FButtonRect.Top,
FButtonRect.Right,
FButtonRect.Bottom),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
FAppearance.Element.HotTrackGradientFromColor, FAppearance.Element.HotTrackGradientFromColor,
FAppearance.Element.HotTrackGradientToColor, FAppearance.Element.HotTrackGradientToColor,
@ -688,10 +725,17 @@ if FButtonKind in [bkButton, bkDropdown] then
ClipRect); ClipRect);
TGuiTools.DrawAARoundFrame(ABuffer, TGuiTools.DrawAARoundFrame(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntRect.Create(FButtonRect.left+1, T2DIntRect.Create(FButtonRect.left+1,
FButtonRect.top+1, FButtonRect.top+1,
FButtonRect.right-1, FButtonRect.right-1,
FButtonRect.Bottom-1), FButtonRect.Bottom-1),
{$ELSE}
Create2DIntRect(FButtonRect.left+1,
FButtonRect.top+1,
FButtonRect.right-1,
FButtonRect.Bottom-1),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
FAppearance.Element.HotTrackInnerLightColor, FAppearance.Element.HotTrackInnerLightColor,
ClipRect); ClipRect);
@ -706,10 +750,17 @@ if FButtonKind in [bkButton, bkDropdown] then
begin begin
{$REGION 'T³o dla Pressed'} {$REGION 'T³o dla Pressed'}
TGuiTools.DrawRoundRect(ABuffer.Canvas, TGuiTools.DrawRoundRect(ABuffer.Canvas,
{$IFDEF EnhancedRecordSupport}
T2DIntRect.Create(FButtonRect.left, T2DIntRect.Create(FButtonRect.left,
FButtonRect.Top, FButtonRect.Top,
FButtonRect.Right, FButtonRect.Right,
FButtonRect.Bottom), FButtonRect.Bottom),
{$ELSE}
Create2DIntRect(FButtonRect.left,
FButtonRect.Top,
FButtonRect.Right,
FButtonRect.Bottom),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
FAppearance.Element.ActiveGradientFromColor, FAppearance.Element.ActiveGradientFromColor,
FAppearance.Element.ActiveGradientToColor, FAppearance.Element.ActiveGradientToColor,
@ -718,10 +769,17 @@ if FButtonKind in [bkButton, bkDropdown] then
TGuiTools.DrawAARoundFrame(ABuffer, TGuiTools.DrawAARoundFrame(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntRect.Create(FButtonRect.left+1, T2DIntRect.Create(FButtonRect.left+1,
FButtonRect.top+1, FButtonRect.top+1,
FButtonRect.right-1, FButtonRect.right-1,
FButtonRect.Bottom-1), FButtonRect.Bottom-1),
{$ELSE}
Create2DIntRect(FButtonRect.left+1,
FButtonRect.top+1,
FButtonRect.right-1,
FButtonRect.Bottom-1),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
FAppearance.Element.ActiveInnerLightColor, FAppearance.Element.ActiveInnerLightColor,
ClipRect); ClipRect);
@ -748,7 +806,11 @@ if FButtonKind in [bkButton, bkDropdown] then
TGuiTools.DrawImage(ABuffer.Canvas, TGuiTools.DrawImage(ABuffer.Canvas,
FDisabledLargeImages, FDisabledLargeImages,
FLargeImageIndex, FLargeImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x, y), T2DIntPoint.Create(x, y),
{$ELSE}
Create2DIntPoint(x, y),
{$ENDIF}
ClipRect); ClipRect);
end else end else
if (FLargeImageIndex>=0) and if (FLargeImageIndex>=0) and
@ -761,7 +823,11 @@ if FButtonKind in [bkButton, bkDropdown] then
TGuiTools.DrawDisabledImage(ABuffer.Canvas, TGuiTools.DrawDisabledImage(ABuffer.Canvas,
FLargeImages, FLargeImages,
FLargeImageIndex, FLargeImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x, y), T2DIntPoint.Create(x, y),
{$ELSE}
Create2DIntPoint(x, y),
{$ENDIF}
ClipRect); ClipRect);
end; end;
{$ENDREGION} {$ENDREGION}
@ -779,7 +845,11 @@ if FButtonKind in [bkButton, bkDropdown] then
TGUITools.DrawImage(ABuffer.Canvas, TGUITools.DrawImage(ABuffer.Canvas,
FLargeImages, FLargeImages,
FLargeImageIndex, FLargeImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x,y), T2DIntPoint.Create(x,y),
{$ELSE}
Create2DIntPoint(x,y),
{$ENDIF}
ClipRect); ClipRect);
end; end;
{$ENDREGION} {$ENDREGION}
@ -970,13 +1040,21 @@ else
{$REGION 'Ramka przycisku'} {$REGION 'Ramka przycisku'}
// Wewnêtrzna ramka // Wewnêtrzna ramka
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FButtonRect.Left + 1, FButtonRect.Top + 1), T2DIntPoint.Create(FButtonRect.Left + 1, FButtonRect.Top + 1),
{$ELSE}
Create2DIntPoint(FButtonRect.Left + 1, FButtonRect.Top + 1),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpLeftTop, cpLeftTop,
InnerLightColor, InnerLightColor,
ClipRect); ClipRect);
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FButtonRect.Right - LARGEBUTTON_RADIUS, FButtonRect.Top + 1), T2DIntPoint.Create(FButtonRect.Right - LARGEBUTTON_RADIUS, FButtonRect.Top + 1),
{$ELSE}
Create2DIntPoint(FButtonRect.Right - LARGEBUTTON_RADIUS, FButtonRect.Top + 1),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpRightTop, cpRightTop,
InnerLightColor, InnerLightColor,
@ -1016,13 +1094,21 @@ else
// Zewnêtrzna ramka // Zewnêtrzna ramka
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FButtonRect.Left, FButtonRect.Top), T2DIntPoint.Create(FButtonRect.Left, FButtonRect.Top),
{$ELSE}
Create2DIntPoint(FButtonRect.Left, FButtonRect.Top),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpLeftTop, cpLeftTop,
FrameColor, FrameColor,
ClipRect); ClipRect);
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FButtonRect.Right - LARGEBUTTON_RADIUS + 1, FButtonRect.Top), T2DIntPoint.Create(FButtonRect.Right - LARGEBUTTON_RADIUS + 1, FButtonRect.Top),
{$ELSE}
Create2DIntPoint(FButtonRect.Right - LARGEBUTTON_RADIUS + 1, FButtonRect.Top),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpRightTop, cpRightTop,
FrameColor, FrameColor,
@ -1120,12 +1206,20 @@ else
// Wewnêtrzna ramka // Wewnêtrzna ramka
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS), T2DIntPoint.Create(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
{$ELSE}
Create2DIntPoint(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpLeftBottom, cpLeftBottom,
InnerLightColor); InnerLightColor);
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FDropdownRect.right - LARGEBUTTON_RADIUS, FDropdownRect.Bottom - LARGEBUTTON_RADIUS), T2DIntPoint.Create(FDropdownRect.right - LARGEBUTTON_RADIUS, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
{$ELSE}
Create2DIntPoint(FDropdownRect.right - LARGEBUTTON_RADIUS, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpRightBottom, cpRightBottom,
InnerLightColor); InnerLightColor);
@ -1166,12 +1260,20 @@ else
// Zewnêtrzna ramka // Zewnêtrzna ramka
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1), T2DIntPoint.Create(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
{$ELSE}
Create2DIntPoint(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpLeftBottom, cpLeftBottom,
FrameColor); FrameColor);
TGuiTools.DrawAARoundCorner(ABuffer, TGuiTools.DrawAARoundCorner(ABuffer,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(FDropdownRect.right - LARGEBUTTON_RADIUS + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1), T2DIntPoint.Create(FDropdownRect.right - LARGEBUTTON_RADIUS + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
{$ELSE}
Create2DIntPoint(FDropdownRect.right - LARGEBUTTON_RADIUS + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
{$ENDIF}
LARGEBUTTON_RADIUS, LARGEBUTTON_RADIUS,
cpRightBottom, cpRightBottom,
FrameColor); FrameColor);
@ -1213,7 +1315,11 @@ else
TGuiTools.DrawImage(ABuffer.Canvas, TGuiTools.DrawImage(ABuffer.Canvas,
FDisabledLargeImages, FDisabledLargeImages,
FLargeImageIndex, FLargeImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x, y), T2DIntPoint.Create(x, y),
{$ELSE}
Create2DIntPoint(x, y),
{$ENDIF}
ClipRect); ClipRect);
end else end else
if (FLargeImageIndex>=0) and if (FLargeImageIndex>=0) and
@ -1226,7 +1332,11 @@ else
TGuiTools.DrawDisabledImage(ABuffer.Canvas, TGuiTools.DrawDisabledImage(ABuffer.Canvas,
FLargeImages, FLargeImages,
FLargeImageIndex, FLargeImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x, y), T2DIntPoint.Create(x, y),
{$ELSE}
Create2DIntPoint(x, y),
{$ENDIF}
ClipRect); ClipRect);
end; end;
{$ENDREGION} {$ENDREGION}
@ -1244,7 +1354,11 @@ else
TGUITools.DrawImage(ABuffer.Canvas, TGUITools.DrawImage(ABuffer.Canvas,
FLargeImages, FLargeImages,
FLargeImageIndex, FLargeImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x,y), T2DIntPoint.Create(x,y),
{$ELSE}
Create2DIntPoint(x,y),
{$ENDIF}
ClipRect); ClipRect);
end; end;
{$ENDREGION} {$ENDREGION}
@ -1365,11 +1479,21 @@ end;
function TSpkLargeButton.GetDropdownPoint: T2DIntPoint; function TSpkLargeButton.GetDropdownPoint: T2DIntPoint;
begin begin
case FButtonKind of {$IFDEF EnhancedRecordSupport}
case FButtonKind of
bkDropdown: result:=T2DIntPoint.Create(FButtonRect.left, FButtonRect.Bottom+1); bkDropdown: result:=T2DIntPoint.Create(FButtonRect.left, FButtonRect.Bottom+1);
bkButtonDropdown: result:=T2DIntPoint.Create(FDropdownRect.left, FDropdownRect.Bottom+1); bkButtonDropdown: result:=T2DIntPoint.Create(FDropdownRect.left, FDropdownRect.Bottom+1);
else result:=T2DIntPoint.Create(0,0); else
end; result:=T2DIntPoint.Create(0,0);
end;
{$ELSE}
case FButtonKind of
bkDropdown: result.Create(FButtonRect.left, FButtonRect.Bottom+1);
bkButtonDropdown: result.Create(FDropdownRect.left, FDropdownRect.Bottom+1);
else
result.Create(0,0);
end;
{$ENDIF}
end; end;
function TSpkLargeButton.GetGroupBehaviour: TSpkItemGroupBehaviour; function TSpkLargeButton.GetGroupBehaviour: TSpkItemGroupBehaviour;
@ -1444,7 +1568,11 @@ var RectVector : T2DIntVector;
begin begin
ConstructRects(FButtonRect, FDropdownRect); ConstructRects(FButtonRect, FDropdownRect);
{$IFDEF EnhancedRecordSupport}
RectVector:=T2DIntVector.Create(FRect.Left, FRect.Top); RectVector:=T2DIntVector.Create(FRect.Left, FRect.Top);
{$ELSE}
RectVector.Create(FRect.Left, FRect.Top);
{$ENDIF}
FButtonRect:=FButtonRect + RectVector; FButtonRect:=FButtonRect + RectVector;
FDropdownRect:=FDropdownRect + RectVector; FDropdownRect:=FDropdownRect + RectVector;
end; end;
@ -1458,8 +1586,13 @@ var BtnWidth : integer;
AdditionalPadding: Boolean; AdditionalPadding: Boolean;
begin begin
{$IFDEF EnhancedRecordSupport}
BtnRect:=T2DIntRect.Create(0, 0, 0, 0); BtnRect:=T2DIntRect.Create(0, 0, 0, 0);
DropRect:=T2DIntRect.Create(0, 0, 0, 0); DropRect:=T2DIntRect.Create(0, 0, 0, 0);
{$ELSE}
BtnRect.Create(0, 0, 0, 0);
DropRect.Create(0, 0, 0, 0);
{$ENDIF}
if not(assigned(FToolbarDispatch)) then if not(assigned(FToolbarDispatch)) then
exit; exit;
@ -1512,8 +1645,13 @@ case FButtonKind of
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH; BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
{$IFDEF EnhancedRecordSupport}
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1); BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
DropRect:=T2DIntRect.Create(0, 0, 0, 0); DropRect:=T2DIntRect.Create(0, 0, 0, 0);
{$ELSE}
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
DropRect.Create(0, 0, 0, 0);
{$ENDIF}
end; end;
bkButtonDropdown: begin bkButtonDropdown: begin
// Lewa krawêdŸ przycisku // Lewa krawêdŸ przycisku
@ -1532,11 +1670,17 @@ case FButtonKind of
DropdownWidth:=DropdownWidth + SMALLBUTTON_HALF_BORDER_WIDTH else DropdownWidth:=DropdownWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
DropdownWidth:=DropdownWidth + SMALLBUTTON_BORDER_WIDTH; DropdownWidth:=DropdownWidth + SMALLBUTTON_BORDER_WIDTH;
{$IFDEF EnhancedRecordSupport}
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1); BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
DropRect:=T2DIntRect.Create(BtnRect.right+1, DropRect:=T2DIntRect.Create(BtnRect.right+1,
0, 0,
BtnRect.right+DropdownWidth, BtnRect.right+DropdownWidth,
PANE_ROW_HEIGHT - 1); PANE_ROW_HEIGHT - 1);
{$ELSE}
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
DropRect.Create(BtnRect.right+1, 0,
BtnRect.right+DropdownWidth, PANE_ROW_HEIGHT - 1);
{$ENDIF}
end; end;
bkDropdown: begin bkDropdown: begin
// Lewa krawêdŸ przycisku // Lewa krawêdŸ przycisku
@ -1553,8 +1697,13 @@ case FButtonKind of
// dla kompatybilnoœci wymiarów z dkButtonDropdown // dla kompatybilnoœci wymiarów z dkButtonDropdown
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH; BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
{$IFDEF EnhancedRecordSupport}
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1); BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
DropRect:=T2DIntRect.Create(0, 0, 0, 0); DropRect:=T2DIntRect.Create(0, 0, 0, 0);
{$ELSE}
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
DropRect.Create(0, 0, 0, 0);
{$ENDIF}
end; end;
end; end;
end; end;
@ -1677,7 +1826,11 @@ if not(FEnabled) then
TGuiTools.DrawImage(ABuffer.Canvas, TGuiTools.DrawImage(ABuffer.Canvas,
FDisabledImages, FDisabledImages,
FImageIndex, FImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x, y), T2DIntPoint.Create(x, y),
{$ELSE}
Create2DIntPoint(x, y),
{$ENDIF}
ClipRect); ClipRect);
end else end else
if (FImageIndex>=0) and if (FImageIndex>=0) and
@ -1692,7 +1845,11 @@ if not(FEnabled) then
TGuiTools.DrawDisabledImage(ABuffer.Canvas, TGuiTools.DrawDisabledImage(ABuffer.Canvas,
FImages, FImages,
FImageIndex, FImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x, y), T2DIntPoint.Create(x, y),
{$ELSE}
Create2DIntPoint(x, y),
{$ENDIF}
ClipRect); ClipRect);
end; end;
{$ENDREGION} {$ENDREGION}
@ -1712,7 +1869,11 @@ else
TGUITools.DrawImage(ABuffer.Canvas, TGUITools.DrawImage(ABuffer.Canvas,
FImages, FImages,
FImageIndex, FImageIndex,
{$IFDEF EnhancedRecordSupport}
T2DIntPoint.Create(x,y), T2DIntPoint.Create(x,y),
{$ELSE}
Create2DIntPoint(x,y),
{$ENDIF}
ClipRect); ClipRect);
end; end;
{$ENDREGION} {$ENDREGION}
@ -1928,9 +2089,15 @@ end;
function TSpkSmallButton.GetDropdownPoint: T2DIntPoint; function TSpkSmallButton.GetDropdownPoint: T2DIntPoint;
begin begin
{$IFDEF EnhancedRecordSupport}
if FButtonKind in [bkButtonDropdown, bkDropdown] then if FButtonKind in [bkButtonDropdown, bkDropdown] then
result:=T2DIntPoint.Create(FButtonRect.left, FButtonRect.bottom+1) else result:=T2DIntPoint.Create(FButtonRect.left, FButtonRect.bottom+1) else
result:=T2DIntPoint.Create(0,0); result:=T2DIntPoint.Create(0,0);
{$ELSE}
if FButtonKind in [bkButtonDropdown, bkDropdown] then
result.Create(FButtonRect.left, FButtonRect.bottom+1) else
result.Create(0,0);
{$ENDIF}
end; end;
function TSpkSmallButton.GetGroupBehaviour: TSpkItemGroupBehaviour; function TSpkSmallButton.GetGroupBehaviour: TSpkItemGroupBehaviour;