You've already forked lazarus-ccr
spktoolbar: Option to draw selection in TSpkToolbar with rounded corners.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8749 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -247,6 +247,11 @@ type
|
||||
LeftBottomRound : boolean = true;
|
||||
RightBottomRound : boolean = true); overload;
|
||||
|
||||
class procedure DrawRoundRectBorder(ACanvas: TCanvas;
|
||||
ARect: T2DIntRect;
|
||||
ARadius: Integer;
|
||||
AColor: TColor);
|
||||
|
||||
class procedure DrawPopupItemRect(ACanvas: TCanvas;
|
||||
ARect: T2DIntRect;
|
||||
ARadius: Integer;
|
||||
@ -2265,6 +2270,84 @@ begin
|
||||
DeleteObject(ClipRgn);
|
||||
end;
|
||||
|
||||
class procedure TGUITools.DrawRoundRectBorder(ACanvas: TCanvas; ARect: T2DIntRect;
|
||||
ARadius: Integer; AColor: TColor);
|
||||
var
|
||||
x1, x2, y1, y2: Integer;
|
||||
begin
|
||||
// *** Straight edges ***
|
||||
// Top
|
||||
x1 := ARect.Left + ARadius ;
|
||||
x2 := ARect.Right - ARadius - 1;
|
||||
y1 := ARect.Top;
|
||||
TGuiTools.DrawHLine(ACanvas, x1, x2, y1, AColor);
|
||||
|
||||
// Bottom
|
||||
y1 := ARect.Bottom;
|
||||
TGuiTools.DrawHLine(ACanvas, x1, x2, y1, AColor);
|
||||
|
||||
// Left
|
||||
y1 := ARect.Top + ARadius;
|
||||
y2 := ARect.Bottom - ARadius;
|
||||
x1 := ARect.Left;
|
||||
TGuiTools.DrawVLine(ACanvas, x1, y1, y2, AColor);
|
||||
|
||||
// Right
|
||||
x1 := ARect.Right - 1;
|
||||
TGuiTools.DrawVLine(ACanvas, x1, y1, y2, AColor);
|
||||
|
||||
// *** Rounded corners ***
|
||||
// top/left
|
||||
TGuiTools.DrawAARoundCorner(
|
||||
ACanvas,
|
||||
{$IFDEF EnhancedRecordSupport}
|
||||
T2DIntPoint.Create(ARect.Left, ARect.Top),
|
||||
{$ELSE}
|
||||
Create2DIntPoint(ARect.Left, ARect.Top),
|
||||
{$ENDIF}
|
||||
ARadius,
|
||||
cpLeftTop,
|
||||
AColor
|
||||
);
|
||||
// top/right
|
||||
TGuiTools.DrawAARoundCorner(
|
||||
ACanvas,
|
||||
{$IFDEF EnhancedRecordSupport}
|
||||
T2DIntPoint.Create(ARect.Right - ARadius - 1, ARect.Top),
|
||||
{$ELSE}
|
||||
Create2DIntPoint(ARect.Right - ARadius - 1, ARect.Top),
|
||||
{$ENDIF}
|
||||
ARadius,
|
||||
cpRightTop,
|
||||
AColor
|
||||
);
|
||||
// bottom/left
|
||||
TGuiTools.DrawAARoundCorner(
|
||||
ACanvas,
|
||||
{$IFDEF EnhancedRecordSupport}
|
||||
T2DIntPoint.Create(ARect.Left, ARect.Bottom - ARadius),
|
||||
{$ELSE}
|
||||
Create2DIntPoint(ARect.Left, ARect.Bottom - ARadius),
|
||||
{$ENDIF}
|
||||
ARadius,
|
||||
cpLeftBottom,
|
||||
AColor
|
||||
);
|
||||
// bottom/right
|
||||
TGuiTools.DrawAARoundCorner(
|
||||
ACanvas,
|
||||
{$IFDEF EnhancedRecordSupport}
|
||||
T2DIntPoint.Create(ARect.Right - ARadius - 1, ARect.Bottom - ARadius),
|
||||
{$ELSE}
|
||||
Create2DIntPoint(ARect.Right - ARadius - 1, ARect.Bottom - ARadius),
|
||||
{$ENDIF}
|
||||
ARadius,
|
||||
cpRightBottom,
|
||||
AColor
|
||||
);
|
||||
end;
|
||||
|
||||
|
||||
class procedure TGUITools.DrawText(ACanvas: TCanvas; x, y: integer;
|
||||
const AText: string; TextColor: TColor);
|
||||
begin
|
||||
|
Reference in New Issue
Block a user