Skip to content

Commit da99678

Browse files
authored
Merge pull request #230 from bgrabitmap/dev-bgracontrols
Dev bgracontrols v9.0.1.7
2 parents 93dbad7 + c8a9a2f commit da99678

File tree

120 files changed

+23593
-2387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+23593
-2387
lines changed

.github/workflows/make.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
List := FindAllFiles(Target, '*.lpi');
187187
List.Sort;
188188
for Result in List do
189-
if not Result.Contains('backup') then
189+
if not Result.Contains('backup') and not Result.Contains('/use/') then
190190
BuildProject(Result);
191191
finally
192192
List.Free;
@@ -198,7 +198,7 @@
198198

199199
begin
200200
try
201-
BuildAll('.', ['BGRABitmap']);
201+
BuildAll('.', ['UEControls']);
202202
case ExitCode of
203203
0: OutLog(etInfo, 'Errors:'#9 + ExitCode.ToString);
204204
else

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
backup/*
66
backup
77
lib
8+
bin
89
debug
910
*.res
1011
*.lrt
@@ -19,3 +20,4 @@ test/test_bccombobox/test_bccombobox
1920
!images/bgracontrols_images.res
2021

2122
.DS_Store
23+
use/*/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "use/bgrabitmap"]
2+
path = use/bgrabitmap
3+
url = https://github.com/bgrabitmap/bgrabitmap.git

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ A label control that can be styled through properties, it supports shadow, custo
6464

6565
Author: Dibo.
6666

67+
### TBCRoundedImage
68+
69+
A Image Viewer which can show a resized image (even proportionally) or not and with different alignments, it can read both from a TPicture and from a TBGRABitmap.
70+
71+
Author: Lainz, Massimo Magnano.
72+
6773
### TBCMaterialDesignButton
6874

6975
A button control that has an animation effect according to Google Material Design guidelines. It supports custom color for background and for the circle animation, also you can customize the shadow.
@@ -114,9 +120,9 @@ Author: Circular.
114120

115121
### TBGRAFlashProgressBar
116122

117-
A progress bar with a default style inspired in the old Flash Player Setup for Windows progress dialog. You can change the color property to have different styles and also you can use the event OnRedraw to paint custom styles on it like text or override the entire default drawing.
123+
A progress bar inspired in the old Flash Player Setup for Windows progress dialog. You can change Colors and Style to Normal, MultiProgress (SubTotal and Total), Marquee (with or without Bounce effect), Timer (Countdown), Graph (as the details of Copy File). Also you can use the event OnRedraw to paint custom styles on it like text or override the entire default drawing.
118124

119-
Author: Circular.
125+
Author: Circular, Massimo Magnano.
120126

121127
### TBGRAGraphicControl
122128

@@ -128,19 +134,19 @@ Author: Circular.
128134

129135
An image list that supports alpha in all supported platforms.
130136

131-
Author: Dibo.
137+
Author: Dibo, Massimo Magnano.
132138

133139
### TBGRAImageManipulation
134140

135141
A tool to manipulate pictures, see the demo that shows all the capability that comes with it.
136142

137-
Author: Emerson Cavalcanti, maxm74 .
143+
Author: Emerson Cavalcanti, Massimo Magnano .
138144

139145
### TBGRAKnob
140-
146+
![Knob](https://raw.githubusercontent.com/bgrabitmap/bgracontrols/dev-bgracontrols/docs/img/BGRA-Knob-V2.png)
141147
A knob that can be styled through properties.
142148

143-
Author: Circular.
149+
Author: Circular, Sandy Ganz
144150

145151
### TBGRAResizeSpeedButton
146152

@@ -214,6 +220,12 @@ Another gauge.
214220

215221
Author: Digeo.
216222

223+
### TSuperGauge
224+
![SuperGauge](https://raw.githubusercontent.com/bgrabitmap/bgracontrols/dev-bgracontrols/docs/img/SuperGauge-V100.png)
225+
Updated and Enhanced Analog Gauge. Many new features, faster drawing, additonal events
226+
227+
Author: Sandy Ganz
228+
217229
### TPSImport_BGRAPascalScript
218230

219231
A component to load BGRABitmap pascal script utilities.
@@ -262,6 +274,13 @@ An imitation of a potentiometer.
262274

263275
Author: Boban Spasic.
264276

277+
### TBCExpandPanel
278+
279+
A Panel that collapses when clicked on the button.
280+
281+
Author: Massimo Magnano, Alexander Roth.
282+
283+
265284
# BGRA Custom Drawn
266285
BGRA Custom Drawn is a set of controls inherited from Custom Drawn. These come with a default dark style that is like Photoshop.
267286

atshapelinebgra.pas

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
1414
- Using BGRABitmap antialiased drawing (2020-09-09)
1515
16+
2025 - Massimo Magnano
17+
Fixed gtk draw outside area (Use Width/Height instead of Canvas.Width/Height)
18+
Added Color Property; Comments in English
19+
1620
Lazarus: 1.6+}
1721

1822
unit atshapelinebgra;
@@ -39,6 +43,7 @@ TShapeLineBGRA = class(TGraphicControl)
3943
FLineWidth: integer;
4044
FLineColor: TColor;
4145
FArrowColor: TColor;
46+
FLineStyle: TPenStyle;
4247

4348
procedure SetArrowColor(AValue: TColor);
4449
procedure SetLineColor(AValue: TColor);
@@ -47,6 +52,7 @@ TShapeLineBGRA = class(TGraphicControl)
4752
procedure SetArrow2(Value: Boolean);
4853
procedure SetArrowFactor(Value: integer);
4954
procedure SetLineWidth(AValue: Integer);
55+
procedure SetLineStyle(aLineStyle: TPenStyle);
5056
protected
5157
{ Protected declarations }
5258
procedure Paint; override;
@@ -56,6 +62,7 @@ TShapeLineBGRA = class(TGraphicControl)
5662
destructor Destroy; override;
5763
published
5864
{ Published declarations }
65+
property Color;
5966
property DragCursor;
6067
property DragKind;
6168
property DragMode;
@@ -71,9 +78,11 @@ TShapeLineBGRA = class(TGraphicControl)
7178
property LineColor: TColor read FLineColor write SetLineColor;
7279
property ArrowColor: TColor read FArrowColor write SetArrowColor;
7380
property LineWidth: Integer read FLineWidth write SetLineWidth;
81+
property LineStyle: TPenStyle read FLineStyle write SetLineStyle default psSolid;
7482
property Arrow1: Boolean read FArrow1 write SetArrow1 default False;
7583
property Arrow2: Boolean read FArrow2 write SetArrow2 default False;
7684
property ArrowFactor: Integer read FArrowFactor write SetArrowFactor default 8;
85+
7786
property OnDragDrop;
7887
property OnDragOver;
7988
property OnEndDrag;
@@ -110,6 +119,7 @@ constructor TShapeLineBGRA.Create(AOwner: TComponent);
110119
FArrowColor:=clBlack;
111120
FLineColor:=clBlack;
112121
FLineWidth:=1;
122+
FLineStyle:=psSolid;
113123
FLineDir:=drLeftRight;
114124
end;
115125

@@ -151,6 +161,15 @@ procedure TShapeLineBGRA.SetLineWidth(AValue: Integer);
151161
end;
152162
end;
153163

164+
procedure TShapeLineBGRA.SetLineStyle(aLineStyle: TPenStyle);
165+
begin
166+
if aLineStyle <> FLineStyle then
167+
begin
168+
FLineStyle := aLineStyle;
169+
Invalidate;
170+
end;
171+
end;
172+
154173
procedure TShapeLineBGRA.SetLineColor(AValue: TColor);
155174
begin
156175
if AValue <> FLineColor then
@@ -188,30 +207,35 @@ procedure TShapeLineBGRA.Paint;
188207
begin
189208
inherited;
190209

191-
bgra := TBGRABitmap.Create(Canvas.Width, Canvas.Height, BGRAPixelTransparent);
210+
try
211+
if (Color=Parent.Color) or (Color=clNone)
212+
then bgra := TBGRABitmap.Create(Width, Height, BGRAPixelTransparent)
213+
else bgra := TBGRABitmap.Create(Width, Height, ColorToBGRA(Color));
214+
192215
bgra.CanvasBGRA.Pen.Color:= FLineColor;
193216
bgra.CanvasBGRA.Brush.Color:=FArrowColor;
194217
bgra.CanvasBGRA.Pen.Width:=FLineWidth;
218+
bgra.CanvasBGRA.Pen.Style:=FLineStyle;
195219

196220
case FLineDir of
197221
drLeftRight:
198222
begin
199-
start := (Height - FLineWidth) div 2;
223+
start := (Height -1) div 2;
200224
bgra.CanvasBGRA.Pen.Width:= FLineWidth;
201225
bgra.CanvasBGRA.MoveTo(IfThen(FArrow1, FArrowFactor), start);
202226
bgra.CanvasBGRA.LineTo(Width-IfThen(FArrow2, FArrowFactor), Start);
203227
bgra.CanvasBGRA.Pen.Width:= 1;
204228

205229
if FArrow1 then begin
206-
//Flecha hacia izquierda
230+
//Left Arrow
207231
p1:=Point(0,start);
208232
p2:=Point(FArrowFactor,Start-FArrowFactor);
209233
p3:=Point(FArrowFactor,Start+FArrowFactor);
210234
bgra.CanvasBGRA.Polygon([p1,p2,p3]);
211235
end;
212236

213237
if FArrow2 then begin
214-
//Flecha hacia derecha
238+
//Right Arrow
215239
p1:=Point(Width-1, Start);
216240
p2:=Point(Width-(FArrowFactor+1),Start-FArrowFactor);
217241
p3:=Point(Width-(FArrowFactor+1),Start+FArrowFactor);
@@ -221,22 +245,22 @@ procedure TShapeLineBGRA.Paint;
221245

222246
drUpDown:
223247
begin
224-
start := (Width - FLineWidth) div 2;
248+
start := (Width -1) div 2;
225249
bgra.CanvasBGRA.Pen.Width:= FLineWidth;
226250
bgra.CanvasBGRA.MoveTo(start, IfThen(FArrow1, FArrowFactor));
227251
bgra.CanvasBGRA.LineTo(start, Height-IfThen(FArrow2, FArrowFactor));
228252
bgra.CanvasBGRA.Pen.Width:= 1;
229253

230254
if FArrow1 then begin
231-
//Flecha hacia arriba
255+
//Up Arrow
232256
p1:=Point(start,0);
233257
p2:=Point(Start-FArrowFactor,FArrowFactor);
234258
p3:=Point(Start+FArrowFactor,FArrowFactor);
235259
bgra.CanvasBGRA.Polygon([p1,p2,p3]);
236260
end;
237261

238262
if FArrow2 then begin
239-
//Flecha hacia abajo
263+
//Down Arrow
240264
p1:=Point(start,Height-1);
241265
p2:=Point(Start-FArrowFactor,Height-(FArrowFactor+1));
242266
p3:=Point(Start+FArrowFactor,Height-(FArrowFactor+1));
@@ -259,7 +283,7 @@ procedure TShapeLineBGRA.Paint;
259283
bgra.CanvasBGRA.Pen.Width:= 1;
260284

261285
if FArrow1 and(Width>0)then begin
262-
//Flecha hacia arriba
286+
//Up Arrow
263287
H0:=Round((FArrowFactor+1)*Sin(Alfa));
264288
W0:=Round((FArrowFactor+1)*Cos(Alfa));
265289

@@ -285,7 +309,7 @@ procedure TShapeLineBGRA.Paint;
285309

286310

287311
if FArrow2 and(Width>0)then begin
288-
//Flecha hacia abajo
312+
//Down Arrow
289313
H0:=Round((FArrowFactor+1)*Sin(Alfa));
290314
W0:=Round((FArrowFactor+1)*Cos(Alfa));
291315

@@ -393,7 +417,10 @@ procedure TShapeLineBGRA.Paint;
393417
end;
394418

395419
bgra.Draw(Canvas, 0, 0, False);
396-
bgra.Free;
420+
421+
finally
422+
bgra.Free;
423+
end;
397424
end;
398425

399426
end.

bcbutton.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ destructor TCustomBCButton.Destroy;
20582058
FBGRANormal.Free;
20592059
FBGRAHover.Free;
20602060
FBGRAClick.Free;
2061-
{$IFDEF FPC}FreeThenNil(FGlyph);{$ELSE}FreeAndNil(FGlyph);{$ENDIF}
2061+
FreeAndNil(FGlyph);
20622062
FRounding.Free;
20632063
FRoundingDropDown.Free;
20642064
inherited Destroy;

bcbuttonfocus.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,7 @@ destructor TCustomBCButtonFocus.Destroy;
18571857
FBGRANormal.Free;
18581858
FBGRAHover.Free;
18591859
FBGRAClick.Free;
1860-
{$IFDEF FPC}FreeThenNil{$ELSE}FreeAndNil{$ENDIF}(FGlyph);
1860+
FreeAndNil(FGlyph);
18611861
FRounding.Free;
18621862
FRoundingDropDown.Free;
18631863
inherited Destroy;

0 commit comments

Comments
 (0)