From 12174cffb0d2fd0a27d502a37c3d5111f8a7eda2 Mon Sep 17 00:00:00 2001 From: lainz Date: Sat, 15 Aug 2020 10:12:26 -0300 Subject: [PATCH 01/11] Changes to BCMDButton by Fritz. Added global to change the position of the checkmark in tab mode. Added a global to change the color of the checkmark. --- bcmdbutton.pas | 35 ++++- .../test_materialdesign/mdbutton_tab/test.lpi | 9 +- .../mdbutton_tab/umain.lfm | 143 +++++++++++------- .../mdbutton_tab/umain.pas | 21 ++- 4 files changed, 145 insertions(+), 63 deletions(-) diff --git a/bcmdbutton.pas b/bcmdbutton.pas index 726aa98..5eef8eb 100644 --- a/bcmdbutton.pas +++ b/bcmdbutton.pas @@ -21,6 +21,9 @@ interface Forms, Controls, Graphics, Dialogs, BCBaseCtrls, BGRABitmap, BGRABitmapTypes, ExtCtrls, Math, BGRABlend; +type + TBCMDButtonCheckMarkPosition = (cmpBottom,cmpTop,cmpLeft,cmpRight); + var // Default icons for Check Box {BCMDBUTTONBALLOTBOX: string = '☐'; // '✗' @@ -47,6 +50,11 @@ interface // Global enable/disable animations BCMDBUTTONANIMATION: boolean = True; + // Global posiotn of checkmarks 0=bottom, 1=top, 2=left, 3=right + BCMDBUTTONCHECKMARKPOSITION : TBCMDButtonCheckMarkPosition = cmpBottom; + + BCMDBUTTONCHECKMARKCOLOR : TColor = $00BB513F; + const // Timer speed: default 15 (a bit more than 60 fps) // Other values: 16 (60 fps) 20 (50 fps) 25 (40 fps) 33 (30 fps) @@ -569,13 +577,34 @@ procedure TCustomBCMDButton.Paint; if FTimer.Enabled then begin iTemp := round((bmp.Width div 2) * easeInOutQuad(FPercent)); - bmp.Rectangle((bmp.Width div 2) - iTemp, bmp.Height - 2, - (bmp.Width div 2) + iTemp, bmp.Height, $00BB513F, dmSet); + case BCMDBUTTONCHECKMARKPOSITION of + cmpBottom : begin + iTemp := round((bmp.Width div 2) * easeInOutQuad(FPercent)); + bmp.Rectangle((bmp.Width div 2) - iTemp, bmp.Height - 2,(bmp.Width div 2) + iTemp, bmp.Height, BCMDBUTTONCHECKMARKCOLOR, dmSet); + end; + cmpTop : begin + iTemp := round((bmp.Width div 2) * easeInOutQuad(FPercent)); + bmp.Rectangle((bmp.Width div 2) - iTemp, 0,(bmp.Width div 2) + iTemp, 2, BCMDBUTTONCHECKMARKCOLOR, dmSet); + end; + cmpLeft : begin + iTemp := round((bmp.Height div 2) * easeInOutQuad(FPercent)); + bmp.Rectangle(0, (bmp.Height div 2) - iTemp, 2, (bmp.Height div 2) + iTemp, BCMDBUTTONCHECKMARKCOLOR, dmSet); + end; + cmpRight : begin + iTemp := round((bmp.Height div 2) * easeInOutQuad(FPercent)); + bmp.Rectangle(bmp.width-2, (bmp.Height div 2) - iTemp, bmp.width, (bmp.Height div 2) + iTemp, BCMDBUTTONCHECKMARKCOLOR, dmSet); + end; + end; // case end else begin if FChecked then - bmp.Rectangle(0, bmp.Height - 2, bmp.Width, bmp.Height, $00BB513F, dmSet); + case BCMDBUTTONCHECKMARKPOSITION of + cmpBottom : bmp.Rectangle(0, bmp.Height - 2, bmp.Width, bmp.Height, BCMDBUTTONCHECKMARKCOLOR, dmSet); + cmpTop : bmp.Rectangle(0, 0, bmp.Width, 2, BCMDBUTTONCHECKMARKCOLOR, dmSet); + cmpLeft : bmp.Rectangle(0, 0, 2, bmp.Height, BCMDBUTTONCHECKMARKCOLOR, dmSet); + cmpRight : bmp.Rectangle(bmp.Width - 2, 0, bmp.Width, bmp.Height, BCMDBUTTONCHECKMARKCOLOR, dmSet); + end; // case end; end; diff --git a/test/test_materialdesign/mdbutton_tab/test.lpi b/test/test_materialdesign/mdbutton_tab/test.lpi index 756a105..348a45b 100644 --- a/test/test_materialdesign/mdbutton_tab/test.lpi +++ b/test/test_materialdesign/mdbutton_tab/test.lpi @@ -1,7 +1,7 @@ - + @@ -52,9 +52,10 @@ - - - + + + + diff --git a/test/test_materialdesign/mdbutton_tab/umain.lfm b/test/test_materialdesign/mdbutton_tab/umain.lfm index 08d7e80..7e8cd11 100644 --- a/test/test_materialdesign/mdbutton_tab/umain.lfm +++ b/test/test_materialdesign/mdbutton_tab/umain.lfm @@ -1,36 +1,37 @@ object Form1: TForm1 Left = 438 - Height = 400 + Height = 320 Top = 174 - Width = 640 + Width = 512 Caption = 'Tabs' - ClientHeight = 400 - ClientWidth = 640 + ClientHeight = 320 + ClientWidth = 512 Color = clWhite - DesignTimePPI = 120 OnCreate = FormCreate Position = poScreenCenter - LCLVersion = '1.8.4.0' + LCLVersion = '2.0.10.0' object PageControl1: TPageControl - Left = 10 - Height = 320 - Top = 70 - Width = 620 + Left = 8 + Height = 255 + Top = 57 + Width = 496 ActivePage = TabSheet1 Align = alClient - BorderSpacing.Around = 10 + BorderSpacing.Around = 8 + ParentFont = False ShowTabs = False TabIndex = 0 TabOrder = 0 object TabSheet1: TTabSheet Caption = 'TabSheet1' - ClientHeight = 312 - ClientWidth = 612 + ClientHeight = 247 + ClientWidth = 488 + ParentFont = False object BCMDButton4: TBCMDButton - Left = 8 - Height = 30 - Top = 16 - Width = 120 + Left = 6 + Height = 25 + Top = 13 + Width = 101 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -46,12 +47,13 @@ object Form1: TForm1 AutoSize = True Caption = 'Change to left' OnClick = BCMDButton4Click + ParentFont = False end object BCMDButton10: TBCMDButton - Left = 8 - Height = 30 - Top = 56 - Width = 121 + Left = 6 + Height = 25 + Top = 45 + Width = 102 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -67,12 +69,13 @@ object Form1: TForm1 AutoSize = True Caption = 'Change to top' OnClick = BCMDButton10Click + ParentFont = False end object BCMDButton11: TBCMDButton - Left = 8 - Height = 30 - Top = 96 - Width = 129 + Left = 6 + Height = 25 + Top = 77 + Width = 109 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -88,12 +91,13 @@ object Form1: TForm1 AutoSize = True Caption = 'Change to right' OnClick = BCMDButton11Click + ParentFont = False end object BCMDButton12: TBCMDButton - Left = 8 - Height = 30 - Top = 136 - Width = 148 + Left = 6 + Height = 25 + Top = 109 + Width = 124 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -109,12 +113,13 @@ object Form1: TForm1 AutoSize = True Caption = 'Change to bottom' OnClick = BCMDButton12Click + ParentFont = False end object BCMDButton13: TBCMDButton - Left = 8 - Height = 30 - Top = 176 - Width = 112 + Left = 6 + Height = 25 + Top = 141 + Width = 100 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -132,16 +137,37 @@ object Form1: TForm1 AutoSize = True Caption = 'Animation' OnClick = BCMDButton13Click + ParentFont = False + end + object ColorBox1: TColorBox + Left = 168 + Height = 22 + Top = 40 + Width = 100 + Selected = clBlue + ItemHeight = 16 + OnChange = ColorBox1Change + TabOrder = 0 + end + object StaticText1: TStaticText + Left = 168 + Height = 16 + Top = 16 + Width = 89 + AutoSize = True + Caption = 'CheckmarkColor' + TabOrder = 1 end end object TabSheet2: TTabSheet Caption = 'TabSheet2' ClientHeight = 312 ClientWidth = 612 + ParentFont = False object BCMDButton5: TBCMDButton - Left = 8 + Left = 6 Height = 30 - Top = 16 + Top = 13 Width = 139 StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -156,16 +182,18 @@ object Form1: TForm1 TextProportionalRatio = 0.5 AutoSize = True Caption = 'Hello from Page 2' + ParentFont = False end end object TabSheet3: TTabSheet Caption = 'TabSheet3' ClientHeight = 312 ClientWidth = 612 + ParentFont = False object BCMDButton6: TBCMDButton - Left = 8 + Left = 6 Height = 30 - Top = 16 + Top = 13 Width = 139 StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -180,31 +208,33 @@ object Form1: TForm1 TextProportionalRatio = 0.5 AutoSize = True Caption = 'Hello from Page 3' + ParentFont = False end end end object Panel2: TPanel - Left = 10 - Height = 50 - Top = 10 - Width = 620 + Left = 8 + Height = 41 + Top = 8 + Width = 496 Align = alTop AutoSize = True - BorderSpacing.Around = 10 + BorderSpacing.Around = 8 BevelOuter = bvNone ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 - ClientHeight = 50 - ClientWidth = 620 + ClientHeight = 41 + ClientWidth = 496 Color = clWhite ParentColor = False + ParentFont = False TabOrder = 1 object BCMDButton7: TBCMDButton Cursor = crHandPoint Left = 0 - Height = 50 + Height = 41 Top = 0 - Width = 91 + Width = 77 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -220,16 +250,17 @@ object Form1: TForm1 TextProportional = False TextProportionalRatio = 0.5 AutoSize = True - BorderSpacing.InnerBorder = 20 + BorderSpacing.InnerBorder = 16 Caption = 'Page 1' OnClick = BCMDButton1Click + ParentFont = False end object BCMDButton8: TBCMDButton Cursor = crHandPoint - Left = 91 - Height = 50 + Left = 77 + Height = 41 Top = 0 - Width = 91 + Width = 77 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -244,16 +275,17 @@ object Form1: TForm1 TextProportional = False TextProportionalRatio = 0.5 AutoSize = True - BorderSpacing.InnerBorder = 20 + BorderSpacing.InnerBorder = 16 Caption = 'Page 2' OnClick = BCMDButton2Click + ParentFont = False end object BCMDButton9: TBCMDButton Cursor = crHandPoint - Left = 182 - Height = 50 + Left = 154 + Height = 41 Top = 0 - Width = 91 + Width = 77 Animation = True StyleNormal.Color = clWhite StyleNormal.TextColor = clBlack @@ -268,9 +300,10 @@ object Form1: TForm1 TextProportional = False TextProportionalRatio = 0.5 AutoSize = True - BorderSpacing.InnerBorder = 20 + BorderSpacing.InnerBorder = 16 Caption = 'Page 3' OnClick = BCMDButton3Click + ParentFont = False end end end diff --git a/test/test_materialdesign/mdbutton_tab/umain.pas b/test/test_materialdesign/mdbutton_tab/umain.pas index 98be002..7e2c810 100644 --- a/test/test_materialdesign/mdbutton_tab/umain.pas +++ b/test/test_materialdesign/mdbutton_tab/umain.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls, - BCMDButton; + ColorBox, StdCtrls, BCMDButton; type @@ -23,11 +23,14 @@ TForm1 = class(TForm) BCMDButton7: TBCMDButton; BCMDButton8: TBCMDButton; BCMDButton9: TBCMDButton; + ColorBox1: TColorBox; PageControl1: TPageControl; Panel2: TPanel; + StaticText1: TStaticText; TabSheet1: TTabSheet; TabSheet2: TTabSheet; TabSheet3: TTabSheet; + procedure ColorBox1Change(Sender: TObject); procedure FormCreate(Sender: TObject); procedure BCMDButton10Click(Sender: TObject); procedure BCMDButton11Click(Sender: TObject); @@ -60,24 +63,38 @@ procedure TForm1.BCMDButton1Click(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject); begin PageControl1.ActivePageIndex := 0; + BCMDBUTTONCHECKMARKPOSITION := cmpBottom; + BCMDBUTTONCHECKMARKCOLOR := ColorBox1.Selected; +end; + +procedure TForm1.ColorBox1Change(Sender: TObject); +begin + BCMDBUTTONCHECKMARKCOLOR := ColorBox1.Selected; + Panel2.Invalidate; end; procedure TForm1.BCMDButton10Click(Sender: TObject); begin + BCMDBUTTONCHECKMARKPOSITION := cmpBottom; Panel2.ChildSizing.Layout := cclLeftToRightThenTopToBottom; Panel2.Align := alTop; + Panel2.Invalidate; end; procedure TForm1.BCMDButton11Click(Sender: TObject); begin + BCMDBUTTONCHECKMARKPOSITION := cmpRight; Panel2.ChildSizing.Layout := cclTopToBottomThenLeftToRight; Panel2.Align := alRight; + Panel2.Invalidate; end; procedure TForm1.BCMDButton12Click(Sender: TObject); begin + BCMDBUTTONCHECKMARKPOSITION := cmpTop; Panel2.ChildSizing.Layout := cclLeftToRightThenTopToBottom; Panel2.Align := alBottom; + Panel2.Invalidate; end; procedure TForm1.BCMDButton13Click(Sender: TObject); @@ -97,8 +114,10 @@ procedure TForm1.BCMDButton3Click(Sender: TObject); procedure TForm1.BCMDButton4Click(Sender: TObject); begin + BCMDBUTTONCHECKMARKPOSITION := cmpLeft; Panel2.ChildSizing.Layout := cclTopToBottomThenLeftToRight; Panel2.Align := alLeft; + Panel2.Invalidate; end; end. From d37a09dccd4f567136b7c94f6a3a2b4f63d1fcfd Mon Sep 17 00:00:00 2001 From: Leandro Diaz Date: Sat, 15 Aug 2020 10:15:24 -0300 Subject: [PATCH 02/11] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ddceb62..8588a09 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,12 @@ A button control that has an animation effect according to Google Material Desig Author: Lainz. +### TBCMDButton + +A button control like TBCMaterialDesignButton, without shadow, but with more capabilities. + +Author: Lainz. Contributions by Fritz. + ### TBCPanel A panel control that can be styled through properties. You can assign an already made style through the property AssignStyle. From b78ce8813626a74504d0973349f2c32893392408 Mon Sep 17 00:00:00 2001 From: lainz Date: Wed, 9 Sep 2020 16:43:04 -0300 Subject: [PATCH 03/11] New component ATShapeLineBGRA --- atshapelinebgra.pas | 398 ++++++++++++++++++++++++++++++++++++++++++++ bgracontrols.lpk | 10 +- bgracontrols.pas | 3 +- 3 files changed, 408 insertions(+), 3 deletions(-) create mode 100644 atshapelinebgra.pas diff --git a/atshapelinebgra.pas b/atshapelinebgra.pas new file mode 100644 index 0000000..368c84f --- /dev/null +++ b/atshapelinebgra.pas @@ -0,0 +1,398 @@ +{ATShapeLine is a component which paints line (directions: left-right, up-down, diagonals), with or without arrows at both sides. Line width is option. Line color and arrow color are options. It is Lazarus port of Delphi component TLine (renamed since TLine id is busy with TAChart). + +Original author: Gon Perez-Jimenez (Spain, 2002) +Ported to Lazarus by: Alexey Torgashin (Russia) + +- I redone get/set of canvas.pen and canvas.brush: do it only inside Paint, before it was all accross the code, in getters, setters, etc. This gives crashes of IDE on changing props in Linux. +- I added any linewidth for any direction with arrow1=true and arrow2=true. +- I converted demo to Laz using ide converter. +- Icon added to component-pallette to 'Misc'. + +For BGRAControls by: Lainz + +- Using BGRABitmap antialiased drawing (2020-09-09) + +Lazarus: 1.6+} + +unit atshapelinebgra; + +interface + +{$mode delphi} + +uses + Graphics, SysUtils, Classes, Controls; + +type + TShapeLineDirection = (drLeftRight, drUpDown, drTopLeftBottomRight, drTopRightBottomLeft); + + { TShapeLineBGRA } + + TShapeLineBGRA = class(TGraphicControl) + private + { Private declarations } + FLineDir: TShapeLineDirection; + FArrow1: Boolean; + FArrow2: Boolean; + FArrowFactor: Integer; + FLineWidth: integer; + FLineColor: TColor; + FArrowColor: TColor; + + procedure SetArrowColor(AValue: TColor); + procedure SetLineColor(AValue: TColor); + procedure SetLineDir(AValue: TShapeLineDirection); + procedure SetArrow1(Value: Boolean); + procedure SetArrow2(Value: Boolean); + procedure SetArrowFactor(Value: integer); + procedure SetLineWidth(AValue: Integer); + protected + { Protected declarations } + procedure Paint; override; + public + { Public declarations } + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + { Published declarations } + property DragCursor; + property DragKind; + property DragMode; + property Align; + property Anchors; + property BorderSpacing; + property ParentShowHint; + property Hint; + property ShowHint; + property Visible; + property PopupMenu; + property Direction: TShapeLineDirection read FLineDir write SetLineDir default drLeftRight; + property LineColor: TColor read FLineColor write SetLineColor; + property ArrowColor: TColor read FArrowColor write SetArrowColor; + property LineWidth: Integer read FLineWidth write SetLineWidth; + property Arrow1: Boolean read FArrow1 write SetArrow1 default False; + property Arrow2: Boolean read FArrow2 write SetArrow2 default False; + property ArrowFactor: Integer read FArrowFactor write SetArrowFactor default 8; + property OnDragDrop; + property OnDragOver; + property OnEndDrag; + property OnEndDock; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnClick; + property OnDblClick; + end; + + procedure Register; + +implementation + +uses Math, BGRABitmap, BGRABitmapTypes; + +procedure Register; +begin + RegisterComponents('BGRA Controls', [TShapeLineBGRA]); +end; + +{ TShapeLineBGRA } + +constructor TShapeLineBGRA.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + ControlStyle := ControlStyle + [csReplicatable]; + Width:=110; + Height:=30; + FArrow1:=false; + FArrow2:=false; + FArrowFactor:=8; + FArrowColor:=clBlack; + FLineColor:=clBlack; + FLineWidth:=1; + FLineDir:=drLeftRight; +end; + +destructor TShapeLineBGRA.Destroy; +begin + inherited Destroy; +end; + +procedure TShapeLineBGRA.SetArrowFactor(Value: integer); +begin + if Value <> FArrowFactor then begin + FArrowFactor := Value; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.SetArrow1(Value: Boolean); +begin + if Value <> FArrow1 then begin + FArrow1 := Value; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.SetArrow2(Value: Boolean); +begin + if Value <> FArrow2 then begin + FArrow2 := Value; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.SetLineWidth(AValue: Integer); +begin + if AValue <> FLineWidth then + begin + FLineWidth := AValue; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.SetLineColor(AValue: TColor); +begin + if AValue <> FLineColor then + begin + FLineColor := AValue; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.SetArrowColor(AValue: TColor); +begin + if AValue <> FArrowColor then + begin + FArrowColor := AValue; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.SetLineDir(AValue: TShapeLineDirection); +begin + if AValue <> FLineDir then + begin + FLineDir := AValue; + Invalidate; + end; +end; + +procedure TShapeLineBGRA.Paint; +var + start: Integer; + p1,p2,p3: TPoint; + H0,W0,H,W: Integer; + Alfa: double; + bgra: TBGRABitmap; +begin + inherited; + + bgra := TBGRABitmap.Create(Canvas.Width, Canvas.Height, BGRAPixelTransparent); + bgra.CanvasBGRA.Pen.Color:= FLineColor; + bgra.CanvasBGRA.Brush.Color:=FArrowColor; + bgra.CanvasBGRA.Pen.Width:=FLineWidth; + + case FLineDir of + drLeftRight: + begin + start := (Height - FLineWidth) div 2; + bgra.CanvasBGRA.Pen.Width:= FLineWidth; + bgra.CanvasBGRA.MoveTo(IfThen(FArrow1, FArrowFactor), start); + bgra.CanvasBGRA.LineTo(Width-IfThen(FArrow2, FArrowFactor), Start); + bgra.CanvasBGRA.Pen.Width:= 1; + + if FArrow1 then begin + //Flecha hacia izquierda + p1:=Point(0,start); + p2:=Point(FArrowFactor,Start-FArrowFactor); + p3:=Point(FArrowFactor,Start+FArrowFactor); + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + + if FArrow2 then begin + //Flecha hacia derecha + p1:=Point(Width-1, Start); + p2:=Point(Width-(FArrowFactor+1),Start-FArrowFactor); + p3:=Point(Width-(FArrowFactor+1),Start+FArrowFactor); + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + end; + + drUpDown: + begin + start := (Width - FLineWidth) div 2; + bgra.CanvasBGRA.Pen.Width:= FLineWidth; + bgra.CanvasBGRA.MoveTo(start, IfThen(FArrow1, FArrowFactor)); + bgra.CanvasBGRA.LineTo(start, Height-IfThen(FArrow2, FArrowFactor)); + bgra.CanvasBGRA.Pen.Width:= 1; + + if FArrow1 then begin + //Flecha hacia arriba + p1:=Point(start,0); + p2:=Point(Start-FArrowFactor,FArrowFactor); + p3:=Point(Start+FArrowFactor,FArrowFactor); + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + + if FArrow2 then begin + //Flecha hacia abajo + p1:=Point(start,Height-1); + p2:=Point(Start-FArrowFactor,Height-(FArrowFactor+1)); + p3:=Point(Start+FArrowFactor,Height-(FArrowFactor+1)); + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + end; + + drTopLeftBottomRight: + begin + Alfa:= arctan2(Height, Width); + bgra.CanvasBGRA.Pen.Width:= FLineWidth; + bgra.CanvasBGRA.MoveTo( + IfThen(FArrow1, Trunc(FArrowFactor*cos(Alfa))), + IfThen(FArrow1, Trunc(FArrowFactor*sin(Alfa))) + ); + bgra.CanvasBGRA.LineTo( + Width-IfThen(FArrow2, Trunc(FArrowFactor*cos(Alfa))), + Height-IfThen(FArrow2, Trunc(FArrowFactor*sin(Alfa))) + ); + bgra.CanvasBGRA.Pen.Width:= 1; + + if FArrow1 and(Width>0)then begin + //Flecha hacia arriba + H0:=Round((FArrowFactor+1)*Sin(Alfa)); + W0:=Round((FArrowFactor+1)*Cos(Alfa)); + + p1:=Point(0,0); + W:=Round(W0+(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0-(FArrowFactor*Sin((Pi/2)-Alfa))); + + if H<0 then H:=0; + if W<0 then W:=0; + + p2:=Point(W,H); + + W:=Round(W0-(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0+(FArrowFactor*Sin((Pi/2)-Alfa))); + + if H<0 then H:=0; + if W<0 then W:=0; + + p3:=Point(W,H); + + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + + + if FArrow2 and(Width>0)then begin + //Flecha hacia abajo + H0:=Round((FArrowFactor+1)*Sin(Alfa)); + W0:=Round((FArrowFactor+1)*Cos(Alfa)); + + p1:=Point(Width-1, Height-1); + + W:=Round(W0-(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0+(FArrowFactor*Sin((Pi/2)-Alfa))); + + W:=Width-W-1; + H:=Height-H-1; + + if H>=Height then H:=Height-1; + if W>=Width then W:=Width-1; + + p2:=Point(W,H); + + W:=Round(W0+(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0-(FArrowFactor*Sin((Pi/2)-Alfa))); + + W:=Width-W-1; + H:=Height-H-1; + + if H>=Height then H:=Height-1; + if W>=Width then W:=Width-1; + + p3:=Point(W,H); + + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + + end; + + drTopRightBottomLeft: + begin + Alfa:= arctan2(Height, Width); + bgra.CanvasBGRA.Pen.Width:= FLineWidth; + bgra.CanvasBGRA.MoveTo( + Width-IfThen(FArrow1, Trunc(FArrowFactor*cos(Alfa))), + IfThen(FArrow1, Trunc(FArrowFactor*sin(Alfa))) + ); + bgra.CanvasBGRA.LineTo( + IfThen(FArrow2, Trunc(FArrowFactor*cos(Alfa))), + Height-IfThen(FArrow2, Trunc(FArrowFactor*sin(Alfa))) + ); + bgra.CanvasBGRA.Pen.Width:= 1; + + if FArrow1 and(Width>0)then begin + H0:=Round((FArrowFactor+1)*Sin(Alfa)); + W0:=Round((FArrowFactor+1)*Cos(Alfa)); + + p1:=Point(Width-1,0); + + W:=Round(W0+(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0-(FArrowFactor*Sin((Pi/2)-Alfa))); + + W:=Width-W-1; + + if H<0 then H:=0; + if W>=Width then W:=Width-1; + + p2:=Point(W,H); + + W:=Round(W0-(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0+(FArrowFactor*Sin((Pi/2)-Alfa))); + + W:=Width-W-1; + + if H<0 then H:=0; + if W>=Width then W:=Width-1; + + p3:=Point(W,H); + + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + + if FArrow2 and(Width>0)then begin + H0:=Round((FArrowFactor+1)*Sin(Alfa)); + W0:=Round((FArrowFactor+1)*Cos(Alfa)); + + p1:=Point(0, Height-1); + + W:=Round(W0-(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0+(FArrowFactor*Sin((Pi/2)-Alfa))); + + H:=Height-H-1; + + if H>=Height then H:=Height-1; + if W<0 then W:=0; + + p2:=Point(W,H); + + W:=Round(W0+(FArrowFactor*Cos((Pi/2)-Alfa))); + H:=Round(H0-(FArrowFactor*Sin((Pi/2)-Alfa))); + + H:=Height-H-1; + + if H>=Height then H:=Height-1; + if W<0 then W:=0; + + p3:=Point(W,H); + + bgra.CanvasBGRA.Polygon([p1,p2,p3]); + end; + end; + end; + + bgra.Draw(Canvas, 0, 0, False); + bgra.Free; +end; + +end. diff --git a/bgracontrols.lpk b/bgracontrols.lpk index b4e37e5..9dc5db1 100644 --- a/bgracontrols.lpk +++ b/bgracontrols.lpk @@ -1,6 +1,6 @@ - + @@ -34,7 +34,7 @@ - + @@ -312,7 +312,13 @@ + + + + + + diff --git a/bgracontrols.pas b/bgracontrols.pas index 8d5f1a8..feabc54 100644 --- a/bgracontrols.pas +++ b/bgracontrols.pas @@ -19,7 +19,7 @@ interface BGRAThemeCheckBox, BGRAThemeRadioButton, BGRAVirtualScreen, ColorSpeedButton, DTAnalogClock, DTAnalogCommon, DTAnalogGauge, dtthemedclock, dtthemedgauge, MaterialColors, BGRADrawerFlashProgressBar, - LazarusPackageIntf; + atshapelinebgra, LazarusPackageIntf; implementation @@ -63,6 +63,7 @@ procedure Register; RegisterUnit('DTAnalogGauge', @DTAnalogGauge.Register); RegisterUnit('dtthemedclock', @dtthemedclock.Register); RegisterUnit('dtthemedgauge', @dtthemedgauge.Register); + RegisterUnit('atshapelinebgra', @atshapelinebgra.Register); end; initialization From 13af9f5569c64316e12600085f6299842dba5274 Mon Sep 17 00:00:00 2001 From: lainz Date: Wed, 9 Sep 2020 17:47:36 -0300 Subject: [PATCH 04/11] Added license to new component --- atshapelinebgra.pas | 1 + 1 file changed, 1 insertion(+) diff --git a/atshapelinebgra.pas b/atshapelinebgra.pas index 368c84f..ed39ce2 100644 --- a/atshapelinebgra.pas +++ b/atshapelinebgra.pas @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: LGPL-3.0-only (modified to allow linking) {ATShapeLine is a component which paints line (directions: left-right, up-down, diagonals), with or without arrows at both sides. Line width is option. Line color and arrow color are options. It is Lazarus port of Delphi component TLine (renamed since TLine id is busy with TAChart). Original author: Gon Perez-Jimenez (Spain, 2002) From f7d28f768a84763443bfead6efa5b338be41e609 Mon Sep 17 00:00:00 2001 From: lainz Date: Thu, 10 Sep 2020 12:06:15 -0300 Subject: [PATCH 05/11] Fixed bug #76 --- bcradialprogressbar.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bcradialprogressbar.pas b/bcradialprogressbar.pas index c1ac721..e672be7 100644 --- a/bcradialprogressbar.pas +++ b/bcradialprogressbar.pas @@ -49,6 +49,7 @@ TBCRadialProgressBar = class(TBCGraphicControl) {%H-}WithThemeSpace: boolean); override; procedure DrawControl; override; procedure RenderControl; override; + procedure SetColor(Value: TColor); override; public { Public declarations } constructor Create(AOwner: TComponent); override; @@ -264,6 +265,13 @@ procedure TBCRadialProgressBar.RenderControl; textBmp.Free; end; +procedure TBCRadialProgressBar.SetColor(Value: TColor); +begin + inherited SetColor(Value); + RenderControl; + Invalidate; +end; + constructor TBCRadialProgressBar.Create(AOwner: TComponent); begin inherited Create(AOwner); From faf0bf251e8319f635fd75d9ea373aff357dd7f2 Mon Sep 17 00:00:00 2001 From: lainz Date: Thu, 10 Sep 2020 12:17:00 -0300 Subject: [PATCH 06/11] Fix bug #61 --- bgraimagemanipulation.pas | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bgraimagemanipulation.pas b/bgraimagemanipulation.pas index 4f53a62..cd5a009 100644 --- a/bgraimagemanipulation.pas +++ b/bgraimagemanipulation.pas @@ -2634,25 +2634,25 @@ procedure TBGRAImageManipulation.MouseUp(Button: TMouseButton; begin rSelectedCropArea :=rNewCropArea; rNewCropArea :=Nil; - end; - if (rSelectedCropArea.Area.Left > rSelectedCropArea.Area.Right) then - begin - // Swap left and right coordinates - temp := rSelectedCropArea.Area.Left; - rSelectedCropArea.Area.Left := rSelectedCropArea.Area.Right; - rSelectedCropArea.Area.Right := temp; - end; + if (rSelectedCropArea.Area.Left > rSelectedCropArea.Area.Right) then + begin + // Swap left and right coordinates + temp := rSelectedCropArea.Area.Left; + rSelectedCropArea.Area.Left := rSelectedCropArea.Area.Right; + rSelectedCropArea.Area.Right := temp; + end; - if (rSelectedCropArea.Area.Top > rSelectedCropArea.Area.Bottom) then - begin - // Swap left and right coordinates - temp := rSelectedCropArea.Area.Top; - rSelectedCropArea.Area.Top := rSelectedCropArea.Area.Bottom; - rSelectedCropArea.Area.Bottom := temp; - end; + if (rSelectedCropArea.Area.Top > rSelectedCropArea.Area.Bottom) then + begin + // Swap left and right coordinates + temp := rSelectedCropArea.Area.Top; + rSelectedCropArea.Area.Top := rSelectedCropArea.Area.Bottom; + rSelectedCropArea.Area.Bottom := temp; + end; - needRepaint := True; + needRepaint := True; + end; end; fAnchorSelected := []; From bcb632fb11dbd950b394487bf83b5eb3aa96bf15 Mon Sep 17 00:00:00 2001 From: Johann ELSASS Date: Sun, 27 Sep 2020 08:58:43 +0200 Subject: [PATCH 07/11] retina scaling for BCTrackbarUpDown --- bctrackbarupdown.pas | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bctrackbarupdown.pas b/bctrackbarupdown.pas index 544fa97..f25b31f 100644 --- a/bctrackbarupdown.pas +++ b/bctrackbarupdown.pas @@ -51,10 +51,12 @@ TCustomBCTrackbarUpdown = class(TBCCustomControl) FArrowColor: TColor; FHasTrackBar: boolean; + FCanvasScaling: double; FTextLeft: Integer; FBarLeft,FBarTop,FBarWidth,FBarHeight: Integer; FUpDownWidth: Integer; FUpDownLeft: Integer; + FDownButtonTop: integer; function GetValue: integer; procedure SetAllowNegativeValues(AValue: boolean); procedure SetArrowColor(AValue: TColor); @@ -431,6 +433,7 @@ procedure TCustomBCTrackbarUpdown.RenderOnBitmap(ABitmap: TBGRABitmap); FBarTop := bounds.bottom-FBarHeight; midy := ABitmap.Height div 2; + FDownButtonTop := midy; ABitmap.ClipRect := rect(fullbounds.left,fullbounds.top,FUpDownLeft+1,fullbounds.bottom); RenderBackgroundAndBorder(fullbounds, Background, ABitmap, Rounding, Border); @@ -544,12 +547,14 @@ function TCustomBCTrackbarUpdown.BarPosToValue(ABarPos: integer): integer; procedure TCustomBCTrackbarUpdown.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin + X := round(X*FCanvasScaling); + Y := round(Y*FCanvasScaling); if Button = mbLeft then begin FHandlingUserInput:= true; if X >= FUpDownLeft then begin - if Y > Height div 2 then + if Y > FDownButtonTop then begin FDownClick:= true; Value := Value-Increment; @@ -557,7 +562,7 @@ procedure TCustomBCTrackbarUpdown.MouseDown(Button: TMouseButton; FTimer.Interval := LongTimeInterval; FTimer.Enabled:= true; end else - if Y < Height div 2 then + if Y < FDownButtonTop then begin FUpClick:= true; Value := Value+Increment; @@ -584,6 +589,8 @@ procedure TCustomBCTrackbarUpdown.MouseDown(Button: TMouseButton; procedure TCustomBCTrackbarUpdown.MouseMove(Shift: TShiftState; X, Y: Integer); begin inherited MouseMove(Shift, X, Y); + X := round(X*FCanvasScaling); + Y := round(Y*FCanvasScaling); if FBarClick and (FBarWidth>1) then begin FHandlingUserInput:= true; @@ -596,6 +603,8 @@ procedure TCustomBCTrackbarUpdown.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited MouseUp(Button, Shift, X, Y); + X := round(X*FCanvasScaling); + Y := round(Y*FCanvasScaling); if Button = mbLeft then begin if FBarClick then FBarClick:= false else @@ -665,9 +674,10 @@ procedure TCustomBCTrackbarUpdown.DoExit; procedure TCustomBCTrackbarUpdown.DrawControl; var bmp: TBGRABitmap; begin - bmp := TBGRABitmap.Create(Width,Height); + FCanvasScaling:= GetCanvasScaleFactor; + bmp := TBGRABitmap.Create(round(Width*FCanvasScaling),round(Height*FCanvasScaling)); RenderOnBitmap(bmp); - bmp.Draw(Canvas,0,0,False); + bmp.Draw(Canvas,rect(0,0,Width,Height),False); bmp.Free; end; @@ -681,6 +691,7 @@ constructor TCustomBCTrackbarUpdown.Create(AOwner: TComponent); FValue := 50; FIncrement := 1; FBarExponent:= 1; + FCanvasScaling:= 1; FTimer := TTimer.Create(self); FTimer.Enabled := false; FTimer.OnTimer:=Timer; From 7ac17bf8ccb7b402a695faa62d98195c6da9953b Mon Sep 17 00:00:00 2001 From: Johann ELSASS Date: Sun, 27 Sep 2020 10:23:15 +0200 Subject: [PATCH 08/11] retina scaling for TBGRAShape --- bgrashape.pas | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/bgrashape.pas b/bgrashape.pas index 027e7fc..26b74d3 100644 --- a/bgrashape.pas +++ b/bgrashape.pas @@ -69,7 +69,6 @@ TBGRAShape = class(TBGRAGraphicCtrl) protected { Protected declarations } procedure Paint; override; - procedure Resize; override; public { Public declarations } constructor Create(AOwner: TComponent); override; @@ -278,11 +277,11 @@ procedure TBGRAShape.Paint; minCoord, maxCoord: TPointF; i: integer; borderGrad, fillGrad: TBGRACustomScanner; + scaling: Double; begin - {$IFNDEF FPC}//# //@ - if FBGRA <> nil then - FBGRA.SetSize(Width, Height); - {$ENDIF} + if FBGRA = nil then FBGRA := TBGRABitmap.Create; + scaling := GetCanvasScaleFactor; + FBGRA.SetSize(round(Width*scaling), round(Height*scaling)); FBGRA.FillTransparent; FBGRA.PenStyle := FBorderStyle; @@ -291,7 +290,7 @@ procedure TBGRAShape.Paint; lineJoin := 'round'; if FUseBorderGradient then begin - borderGrad := CreateGradient(FBorderGradient, Classes.rect(0, 0, Width, Height)); + borderGrad := CreateGradient(FBorderGradient, Classes.rect(0, 0, FBGRA.Width, FBGRA.Height)); strokeStyle(borderGrad); end else @@ -300,10 +299,10 @@ procedure TBGRAShape.Paint; strokeStyle(ColorToBGRA(ColorToRGB(FBorderColor), FBorderOpacity)); end; lineStyle(FBGRA.CustomPenStyle); - lineWidth := FBorderWidth; + lineWidth := FBorderWidth*scaling; if FUseFillGradient then begin - fillGrad := CreateGradient(FFillGradient, Classes.rect(0, 0, Width, Height)); + fillGrad := CreateGradient(FFillGradient, Classes.rect(0, 0, FBGRA.Width, FBGRA.Height)); fillStyle(fillGrad); end else @@ -311,10 +310,10 @@ procedure TBGRAShape.Paint; fillGrad := nil; fillStyle(ColorToBGRA(ColorToRGB(FFillColor), FFillOpacity)); end; - cx := Width / 2; - cy := Height / 2; - rx := (Width - FBorderWidth) / 2; - ry := (Height - FBorderWidth) / 2; + cx := FBGRA.Width / 2; + cy := FBGRA.Height / 2; + rx := (FBGRA.Width - FBorderWidth*scaling) / 2; + ry := (FBGRA.Height - FBorderWidth*scaling) / 2; if FUseRatioXY and (ry <> 0) and (FRatioXY <> 0) then begin curRatio := rx / ry; @@ -379,14 +378,7 @@ procedure TBGRAShape.Paint; fillGrad.Free; borderGrad.Free; end; - FBGRA.Draw(Self.Canvas, 0, 0, False); -end; - -procedure TBGRAShape.Resize; -begin - if FBGRA <> nil then - FBGRA.SetSize(Width, Height); - inherited Resize; + FBGRA.Draw(Self.Canvas, rect(0,0,Width,Height), False); end; constructor TBGRAShape.Create(AOwner: TComponent); @@ -396,7 +388,7 @@ constructor TBGRAShape.Create(AOwner: TComponent); with GetControlClassDefaultSize do SetInitialBounds(0, 0, CX, CY); - FBGRA := TBGRABitmap.Create(Width, Height, BGRAPixelTransparent); + FBGRA := nil; FBorderColor := clWindowText; FBorderOpacity := 255; From db4d16b3927d2f813de72d83ff6bd897d7cfb462 Mon Sep 17 00:00:00 2001 From: lainz Date: Sun, 27 Sep 2020 11:18:00 -0300 Subject: [PATCH 09/11] Added BCRoundedImage --- bcroundedimage.pas | 169 +++++++++++++++++++++++++++++++ bgracontrols.lpk | 247 +++++++++++++++++++++++---------------------- bgracontrols.pas | 17 ++-- 3 files changed, 304 insertions(+), 129 deletions(-) create mode 100644 bcroundedimage.pas diff --git a/bcroundedimage.pas b/bcroundedimage.pas new file mode 100644 index 0000000..3987a09 --- /dev/null +++ b/bcroundedimage.pas @@ -0,0 +1,169 @@ +{ + BCRoundedImage + by Lainz + + Last modified: 2020-09-06 19:16 GMT-3 + + Changelog: + - 2020-09-06: Initial version supporting circle, rounded rectangle and square. + Changing the quality of the resample, setting the rounding. + OnPaintEvent to customize the final drawing. +} +unit BCRoundedImage; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, + BGRABitmap, BGRABitmapTypes; + +type + TBCRoundedImage = class; + + // Event to draw before the image is sent to canvas + TBCRoundedImagePaintEvent = procedure (const Sender: TBCRoundedImage; const Bitmap: TBGRABitmap) of object; + // Supported styles are circle, rounded rectangle and square + TBCRoundedImageStyle = (isCircle, isRoundedRectangle, isSquare); + + // Control that draws an image within a rounded border + + { TBCRoundedImage } + + TBCRoundedImage = class(TGraphicControl) + private + FBorderStyle: TRoundRectangleOptions; + FOnPaintEvent: TBCRoundedImagePaintEvent; + FPicture: TPicture; + FQuality: TResampleFilter; + FStyle: TBCRoundedImageStyle; + FRounding: single; + procedure SetBorderStyle(AValue: TRoundRectangleOptions); + procedure SetPicture(AValue: TPicture); + procedure SetQuality(AValue: TResampleFilter); + procedure SetStyle(AValue: TBCRoundedImageStyle); + procedure SetRounding(AValue: single); + protected + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure Paint; override; + published + // The image that's used as background + property Picture: TPicture read FPicture write SetPicture; + // The style can be circle, rounded rectangle or square + property Style: TBCRoundedImageStyle read FStyle write SetStyle; + // The style of the rounded rectangle + property BorderStyle: TRoundRectangleOptions read FBorderStyle write SetBorderStyle; + // Rounding is used when you choose the rounded rectangle style + property Rounding: single read FRounding write SetRounding; + // The quality when resizing the image + property Quality: TResampleFilter read FQuality write SetQuality; + // You can paint before the bitmap is drawn on canvas + property OnPaintEvent: TBCRoundedImagePaintEvent read FOnPaintEvent write FOnPaintEvent; + published + property Anchors; + property Align; + property OnMouseEnter; + property OnMouseLeave; + property OnClick; + end; + +procedure Register; + +implementation + +procedure Register; +begin + RegisterComponents('BGRA Controls', [TBCRoundedImage]); +end; + +procedure TBCRoundedImage.SetPicture(AValue: TPicture); +begin + if FPicture = AValue then + Exit; + FPicture := AValue; + Invalidate; +end; + +procedure TBCRoundedImage.SetBorderStyle(AValue: TRoundRectangleOptions); +begin + if FBorderStyle=AValue then Exit; + FBorderStyle:=AValue; + Invalidate; +end; + +procedure TBCRoundedImage.SetQuality(AValue: TResampleFilter); +begin + if FQuality = AValue then + Exit; + FQuality := AValue; + Invalidate; +end; + +procedure TBCRoundedImage.SetStyle(AValue: TBCRoundedImageStyle); +begin + if FStyle = AValue then + Exit; + FStyle := AValue; + Invalidate; +end; + +procedure TBCRoundedImage.SetRounding(AValue: single); +begin + if FRounding = AValue then + Exit; + FRounding := AValue; + Invalidate; +end; + +constructor TBCRoundedImage.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FPicture := TPicture.Create; + FRounding := 10; + FQuality := rfBestQuality; +end; + +destructor TBCRoundedImage.Destroy; +begin + FPicture.Free; + inherited Destroy; +end; + +procedure TBCRoundedImage.Paint; +var + bgra: TBGRABitmap; + image: TBGRABitmap; +begin + if (FPicture.Width = 0) or (FPicture.Height = 0) then + Exit; + // Picture + image := TBGRABitmap.Create(FPicture.Bitmap); + bgra := TBGRABitmap.Create(Width, Height, BGRAPixelTransparent); + try + // Quality + image.ResampleFilter := FQuality; + BGRAReplace(image, image.Resample(Width, Height)); + // Style + case FStyle of + isCircle: bgra.FillEllipseAntialias(Width div 2, Height div 2, + Width div 2, Height div 2, image); + // Rounding, BorderStyle + isRoundedRectangle: bgra.FillRoundRectAntialias(0, 0, Width, + Height, FRounding, FRounding, image, FBorderStyle); + else + bgra.PutImage(0, 0, image, dmDrawWithTransparency); + end; + // OnPaintEvent + if Assigned(FOnPaintEvent) then + FOnPaintEvent(Self, bgra); + bgra.Draw(Canvas, 0, 0, False); + finally + bgra.Free; + image.Free; + end; +end; + +end. diff --git a/bgracontrols.lpk b/bgracontrols.lpk index 9dc5db1..dee9a49 100644 --- a/bgracontrols.lpk +++ b/bgracontrols.lpk @@ -34,289 +34,294 @@ - + + + + + + - - + + - - + + - - + + - - + + - - + + - - - - - - + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - + + + - - + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - + diff --git a/bgracontrols.pas b/bgracontrols.pas index feabc54..f9e4acf 100644 --- a/bgracontrols.pas +++ b/bgracontrols.pas @@ -8,23 +8,24 @@ interface uses - BCButton, BCButtonFocus, BCComboBox, BCEffect, bcfilters, BCGameGrid, - BCGradientButton, BCImageButton, BCLabel, BCListBox, BCMaterialDesignButton, - BCMDButton, BCMDButtonFocus, BCPanel, BCRadialProgressBar, BCRTTI, - BCSamples, BCStylesForm, BCSVGButton, BCSVGViewer, BCToolBar, - BCTrackbarUpdown, BGRAColorTheme, bgracontrolsinfo, BGRACustomDrawn, + atshapelinebgra, BCButton, BCButtonFocus, BCComboBox, BCEffect, bcfilters, + BCGameGrid, BCGradientButton, BCImageButton, BCLabel, BCListBox, + BCMaterialDesignButton, BCMDButton, BCMDButtonFocus, BCPanel, + BCRadialProgressBar, BCRoundedImage, BCRTTI, BCSamples, BCStylesForm, + BCSVGButton, BCSVGViewer, BCToolBar, BCTrackbarUpdown, BGRAColorTheme, + bgracontrolsinfo, BGRACustomDrawn, BGRADrawerFlashProgressBar, BGRAFlashProgressBar, BGRAGraphicControl, BGRAImageList, BGRAImageManipulation, BGRAImageTheme, BGRAKnob, BGRAResizeSpeedButton, BGRAShape, BGRASpeedButton, BGRASpriteAnimation, BGRATheme, BGRAThemeButton, BGRAThemeCheckBox, BGRAThemeRadioButton, BGRAVirtualScreen, ColorSpeedButton, DTAnalogClock, DTAnalogCommon, DTAnalogGauge, - dtthemedclock, dtthemedgauge, MaterialColors, BGRADrawerFlashProgressBar, - atshapelinebgra, LazarusPackageIntf; + dtthemedclock, dtthemedgauge, MaterialColors, LazarusPackageIntf; implementation procedure Register; begin + RegisterUnit('atshapelinebgra', @atshapelinebgra.Register); RegisterUnit('BCButton', @BCButton.Register); RegisterUnit('BCButtonFocus', @BCButtonFocus.Register); RegisterUnit('BCComboBox', @BCComboBox.Register); @@ -38,6 +39,7 @@ procedure Register; RegisterUnit('BCMDButtonFocus', @BCMDButtonFocus.Register); RegisterUnit('BCPanel', @BCPanel.Register); RegisterUnit('BCRadialProgressBar', @BCRadialProgressBar.Register); + RegisterUnit('BCRoundedImage', @BCRoundedImage.Register); RegisterUnit('BCSVGButton', @BCSVGButton.Register); RegisterUnit('BCSVGViewer', @BCSVGViewer.Register); RegisterUnit('BCToolBar', @BCToolBar.Register); @@ -63,7 +65,6 @@ procedure Register; RegisterUnit('DTAnalogGauge', @DTAnalogGauge.Register); RegisterUnit('dtthemedclock', @dtthemedclock.Register); RegisterUnit('dtthemedgauge', @dtthemedgauge.Register); - RegisterUnit('atshapelinebgra', @atshapelinebgra.Register); end; initialization From 5761befea1c55dbee339871b216156c11a54e5e7 Mon Sep 17 00:00:00 2001 From: lainz Date: Sun, 27 Sep 2020 11:18:51 -0300 Subject: [PATCH 10/11] Added license --- bcroundedimage.pas | 1 + 1 file changed, 1 insertion(+) diff --git a/bcroundedimage.pas b/bcroundedimage.pas index 3987a09..940be19 100644 --- a/bcroundedimage.pas +++ b/bcroundedimage.pas @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: LGPL-3.0-only (modified to allow linking) { BCRoundedImage by Lainz From 72eca21ae90f5b5991716f0a50a78839db851b45 Mon Sep 17 00:00:00 2001 From: lainz Date: Sun, 27 Sep 2020 12:38:30 -0300 Subject: [PATCH 11/11] v6.9 --- bgracontrols.lpk | 2 +- bgracontrolsinfo.pas | 2 +- bgrapascalscriptcomponent.lpk | 2 +- update_bgracontrols_force.json | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bgracontrols.lpk b/bgracontrols.lpk index dee9a49..c51af5d 100644 --- a/bgracontrols.lpk +++ b/bgracontrols.lpk @@ -33,7 +33,7 @@ - + diff --git a/bgracontrolsinfo.pas b/bgracontrolsinfo.pas index d772f0f..b0d21a0 100644 --- a/bgracontrolsinfo.pas +++ b/bgracontrolsinfo.pas @@ -9,7 +9,7 @@ interface Classes, SysUtils; const - BGRAControlsVersion = 6080000; + BGRAControlsVersion = 6090000; function BGRAControlsVersionStr: string; diff --git a/bgrapascalscriptcomponent.lpk b/bgrapascalscriptcomponent.lpk index 02c0aea..36409e4 100644 --- a/bgrapascalscriptcomponent.lpk +++ b/bgrapascalscriptcomponent.lpk @@ -11,7 +11,7 @@ - + diff --git a/update_bgracontrols_force.json b/update_bgracontrols_force.json index f064b71..9c37110 100644 --- a/update_bgracontrols_force.json +++ b/update_bgracontrols_force.json @@ -8,13 +8,13 @@ "ForceNotify" : true, "InternalVersion" : 25, "Name" : "bgracontrols.lpk", - "Version" : "6.8.0.0" + "Version" : "6.9.0.0" }, { "ForceNotify" : false, "InternalVersion" : 1, "Name" : "bgrapascalscriptcomponent.lpk", - "Version" : "6.8.0.0" + "Version" : "6.9.0.0" } ] } \ No newline at end of file