source: trunk/Packages/bgracontrols/bctypes.pas

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 21.3 KB
Line 
1{ Common types for BGRA Controls package
2
3 Copyright (C) 2011 Krzysztof Dibowski dibowski at interia.pl
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version with the following modification:
9
10 As a special exception, the copyright holders of this library give you
11 permission to link this library with independent modules to produce an
12 executable, regardless of the license terms of these independent modules,and
13 to copy and distribute the resulting executable under terms of your choice,
14 provided that you also meet, for each linked independent module, the terms
15 and conditions of the license of that module. An independent module is a
16 module which is not derived from or based on this library. If you modify
17 this library, you may extend this exception to your version of the library,
18 but you are not obligated to do so. If you do not wish to do so, delete this
19 exception statement from your version.
20
21 This program is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
24 for more details.
25
26 You should have received a copy of the GNU Library General Public License
27 along with this library; if not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29}
30unit BCTypes;
31
32{$mode objfpc}{$H+}
33
34interface
35
36uses
37 Classes, Controls, BGRABitmap, BGRABitmapTypes, Graphics, BCBasectrls;
38
39type
40 TBCMouseState = (msNone, msHover, msClicked);
41 TBCAlignment = (bcaLeftTop, bcaLeftCenter, bcaLeftBottom,
42 bcaCenterTop, bcaCenter, bcaCenterBottom, bcaRightTop, bcaRightCenter,
43 bcaRightBottom);
44 TBCBackgroundStyle = (bbsClear, bbsColor, bbsGradient);
45 TBCBorderStyle = (bboNone, bboSolid);
46 TBCArrowDirection = (badLeft, badRight, badUp, badDown);
47 TBGRATextAlign = (btaLeft, btaCenter, btaRight); // deprecated
48 TBGRATextVAlign = (btvaTop, btvaCenter, btvaBottom); // deprecated
49 TBGRARedrawEvent = procedure(Sender: TObject; Bitmap: TBGRABitmap) of object;
50
51type
52 { TBCGradient }
53
54 TBCGradient = class(TBCProperty)
55 private
56 FColorCorrection: boolean;
57 FDrawMode: TDrawMode;
58 FGradientType: TGradientType;
59 FEndColor: TColor;
60 FEndColorOpacity: byte;
61 FPoint1XPercent: single;
62 FPoint1YPercent: single;
63 FPoint2XPercent: single;
64 FPoint2YPercent: single;
65 FSinus: boolean;
66 FStartColor: TColor;
67 FStartColorOpacity: byte;
68 procedure SetColorCorrection(const AValue: boolean);
69 procedure SetDrawMode(const AValue: TDrawMode);
70 procedure SetEndColor(const AValue: TColor);
71 procedure SetEndColorOpacity(const AValue: byte);
72 procedure SetGradientType(const AValue: TGradientType);
73 procedure SetPoint1XPercent(const AValue: single);
74 procedure SetPoint1YPercent(const AValue: single);
75 procedure SetPoint2XPercent(const AValue: single);
76 procedure SetPoint2YPercent(const AValue: single);
77 procedure SetSinus(const AValue: boolean);
78 procedure SetStartColor(const AValue: TColor);
79 procedure SetStartColorOpacity(const AValue: byte);
80 public
81 constructor Create(AControl: TControl); override;
82
83 procedure Assign(Source: TPersistent); override;
84 published
85 property StartColor: TColor Read FStartColor Write SetStartColor;
86 property StartColorOpacity: byte Read FStartColorOpacity
87 Write SetStartColorOpacity;
88 property DrawMode: TDrawMode Read FDrawMode Write SetDrawMode;
89 property EndColor: TColor Read FEndColor Write SetEndColor;
90 property EndColorOpacity: byte Read FEndColorOpacity
91 Write SetEndColorOpacity;
92 property ColorCorrection: boolean Read FColorCorrection
93 Write SetColorCorrection;
94 property GradientType: TGradientType Read FGradientType
95 Write SetGradientType;
96 property Point1XPercent: single Read FPoint1XPercent Write SetPoint1XPercent;
97 property Point1YPercent: single Read FPoint1YPercent Write SetPoint1YPercent;
98 property Point2XPercent: single Read FPoint2XPercent Write SetPoint2XPercent;
99 property Point2YPercent: single Read FPoint2YPercent Write SetPoint2YPercent;
100 property Sinus: boolean Read FSinus Write SetSinus;
101 end;
102
103 { TBCFont }
104
105 TBCFont = class(TBCProperty)
106 private
107 FColor: TColor;
108 FEndEllipsis: Boolean;
109 FFontQuality: TBGRAFontQuality;
110 FHeight: Integer;
111 FName: String;
112 FShadow: Boolean;
113 FShadowColor: TColor;
114 FShadowColorOpacity: Byte;
115 FShadowOffsetX: ShortInt;
116 FShadowOffsetY: ShortInt;
117 FShadowRadius: Byte;
118 FSingleLine: Boolean;
119 FStyle: TFontStyles;
120 FTextAlignment: TBCAlignment;
121 FWordBreak: Boolean;
122 function IsNamStored: Boolean;
123 procedure SetColor(AValue: TColor);
124 procedure SetEndEllipsis(AValue: Boolean);
125 procedure SetFontQuality(AValue: TBGRAFontQuality);
126 procedure SetHeight(AValue: Integer);
127 procedure SetName(AValue: String);
128 procedure SetShadow(AValue: Boolean);
129 procedure SetShadowColor(AValue: TColor);
130 procedure SetShadowColorOpacity(AValue: Byte);
131 procedure SetShadowOffsetX(AValue: ShortInt);
132 procedure SetShadowOffsetY(AValue: ShortInt);
133 procedure SetShadowRadius(AValue: Byte);
134 procedure SetSingleLine(AValue: Boolean);
135 procedure SetStyle(AValue: TFontStyles);
136 procedure SetTextAlignment(AValue: TBCAlignment);
137 procedure SetWordBreak(AValue: Boolean);
138 public
139 constructor Create(AControl: TControl); override;
140 procedure Assign(Source: TPersistent); override;
141 published
142 property Color: TColor read FColor write SetColor;
143 property EndEllipsis: Boolean read FEndEllipsis write SetEndEllipsis;
144 property FontQuality: TBGRAFontQuality
145 read FFontQuality write SetFontQuality;
146 property Height: Integer read FHeight write SetHeight;
147 property Name: String read FName write SetName stored IsNamStored;
148 property SingleLine: Boolean read FSingleLine write SetSingleLine;
149 property Shadow: Boolean read FShadow write SetShadow;
150 property ShadowColor: TColor
151 read FShadowColor write SetShadowColor;
152 property ShadowColorOpacity: Byte read FShadowColorOpacity write SetShadowColorOpacity;
153 property ShadowRadius: Byte
154 read FShadowRadius write SetShadowRadius;
155 property ShadowOffsetX: ShortInt
156 read FShadowOffsetX write SetShadowOffsetX;
157 property ShadowOffsetY: ShortInt
158 read FShadowOffsetY write SetShadowOffsetY;
159 property Style: TFontStyles read FStyle write SetStyle;
160 property TextAlignment: TBCAlignment
161 read FTextAlignment write SetTextAlignment;
162 property WordBreak: Boolean read FWordBreak write SetWordBreak;
163 end;
164
165 { TBCBackground }
166
167 TBCBackground = class(TBCProperty)
168 private
169 FColor: TColor;
170 FColorOpacity: byte;
171 FGradient1: TBCGradient;
172 FGradient1EndPercent: single;
173 FGradient2: TBCGradient;
174 FStyle: TBCBackgroundStyle;
175 procedure OnChangeChildProperty(Sender: TObject; AData: PtrInt);
176 procedure SetColor(AValue: TColor);
177 procedure SetColorOpacity(AValue: byte);
178 procedure SetGradient1(AValue: TBCGradient);
179 procedure SetGradient1EndPercent(AValue: single);
180 procedure SetGradient2(AValue: TBCGradient);
181 procedure SetStyle(AValue: TBCBackgroundStyle);
182 public
183 constructor Create(AControl: TControl); override;
184 destructor Destroy; override;
185
186 procedure Assign(Source: TPersistent); override;
187 published
188 property Color: TColor read FColor write SetColor;
189 property ColorOpacity: byte read FColorOpacity write SetColorOpacity;
190 property Gradient1: TBCGradient read FGradient1 write SetGradient1;
191 property Gradient2: TBCGradient read FGradient2 write SetGradient2;
192 property Gradient1EndPercent: single read FGradient1EndPercent
193 write SetGradient1EndPercent;
194 property Style: TBCBackgroundStyle read FStyle write SetStyle;
195 end;
196
197 { TBCBorder }
198
199 TBCBorder = class(TBCProperty)
200 private
201 FColor: TColor;
202 FColorOpacity: byte;
203 FLightColor: TColor;
204 FLightOpacity: byte;
205 FLightWidth: integer;
206 FStyle: TBCBorderStyle;
207 FWidth: Integer;
208 procedure SetColor(AValue: TColor);
209 procedure SetColorOpacity(AValue: byte);
210 procedure SetLightColor(AValue: TColor);
211 procedure SetLightOpacity(AValue: byte);
212 procedure SetLightWidth(AValue: integer);
213 procedure SetStyle(AValue: TBCBorderStyle);
214 procedure SetWidth(AValue: Integer);
215 public
216 constructor Create(AControl: TControl); override;
217 procedure Assign(Source: TPersistent); override;
218 published
219 property Color: TColor read FColor write SetColor;
220 property ColorOpacity: byte read FColorOpacity
221 write SetColorOpacity;
222 property LightColor: TColor read FLightColor write SetLightColor;
223 property LightOpacity: byte read FLightOpacity write SetLightOpacity;
224 property LightWidth: integer read FLightWidth write SetLightWidth;
225 property Style: TBCBorderStyle read FStyle write SetStyle;
226 property Width: Integer read FWidth write SetWidth;
227 end;
228
229 { TBCRounding }
230
231 TBCRounding = class(TBCProperty)
232 private
233 FRoundOptions: TRoundRectangleOptions;
234 FRoundX: Byte;
235 FRoundY: Byte;
236 procedure SetRoundOptions(AValue: TRoundRectangleOptions);
237 procedure SetRoundX(AValue: Byte);
238 procedure SetRoundY(AValue: Byte);
239 public
240 constructor Create(AControl: TControl); override;
241 procedure Assign(Source: TPersistent); override;
242 published
243 property RoundX: Byte read FRoundX write SetRoundX;
244 property RoundY: Byte read FRoundY write SetRoundY;
245 property RoundOptions: TRoundRectangleOptions
246 read FRoundOptions write SetRoundOptions;
247 end;
248
249
250{const
251 DEF_START_COL = $00EFE6D2;
252 DEF_END_COL = $00C87511;
253 DEF_BORD_COL = $00AB713B;
254 DEF_BORD_COL_HOVER = $00D7B697;
255 DEF_FONT_COLOR = $0072412A; }
256
257implementation
258
259{ TBCRounding }
260
261procedure TBCRounding.SetRoundOptions(AValue: TRoundRectangleOptions);
262begin
263 if FRoundOptions = AValue then Exit;
264 FRoundOptions := AValue;
265
266 Change;
267end;
268
269procedure TBCRounding.SetRoundX(AValue: Byte);
270begin
271 if FRoundX = AValue then Exit;
272 FRoundX := AValue;
273
274 Change;
275end;
276
277procedure TBCRounding.SetRoundY(AValue: Byte);
278begin
279 if FRoundY = AValue then Exit;
280 FRoundY := AValue;
281
282 Change;
283end;
284
285constructor TBCRounding.Create(AControl: TControl);
286begin
287 inherited Create(AControl);
288
289 FRoundX := 1;
290 FRoundY := 1;
291 FRoundOptions := [];
292end;
293
294procedure TBCRounding.Assign(Source: TPersistent);
295begin
296 if Source is TBCRounding then
297 begin
298 FRoundX := TBCRounding(Source).FRoundX;
299 FRoundY := TBCRounding(Source).FRoundY;
300 FRoundOptions := TBCRounding(Source).FRoundOptions;
301 end
302 else
303 inherited Assign(Source);
304end;
305
306{ TBCGradient }
307
308procedure TBCGradient.SetColorCorrection(const AValue: boolean);
309begin
310 if FColorCorrection = AValue then
311 exit;
312 FColorCorrection := AValue;
313
314 Change;
315end;
316
317procedure TBCGradient.SetDrawMode(const AValue: TDrawMode);
318begin
319 if FDrawMode = AValue then
320 exit;
321 FDrawMode := AValue;
322
323 Change;
324end;
325
326procedure TBCGradient.SetEndColor(const AValue: TColor);
327begin
328 if FEndColor = AValue then
329 exit;
330 FEndColor := AValue;
331
332 Change;
333end;
334
335procedure TBCGradient.SetEndColorOpacity(const AValue: byte);
336begin
337 if FEndColorOpacity = AValue then
338 exit;
339 FEndColorOpacity := AValue;
340
341 Change;
342end;
343
344procedure TBCGradient.SetGradientType(const AValue: TGradientType);
345begin
346 if FGradientType = AValue then
347 exit;
348 FGradientType := AValue;
349
350 Change;
351end;
352
353procedure TBCGradient.SetPoint1XPercent(const AValue: single);
354begin
355 if FPoint1XPercent = AValue then
356 exit;
357 FPoint1XPercent := AValue;
358
359 Change;
360end;
361
362procedure TBCGradient.SetPoint1YPercent(const AValue: single);
363begin
364 if FPoint1YPercent = AValue then
365 exit;
366 FPoint1YPercent := AValue;
367
368 Change;
369end;
370
371procedure TBCGradient.SetPoint2XPercent(const AValue: single);
372begin
373 if FPoint2XPercent = AValue then
374 exit;
375 FPoint2XPercent := AValue;
376
377 Change;
378end;
379
380procedure TBCGradient.SetPoint2YPercent(const AValue: single);
381begin
382 if FPoint2YPercent = AValue then
383 exit;
384 FPoint2YPercent := AValue;
385
386 Change;
387end;
388
389procedure TBCGradient.SetSinus(const AValue: boolean);
390begin
391 if FSinus = AValue then
392 exit;
393 FSinus := AValue;
394
395 Change;
396end;
397
398procedure TBCGradient.SetStartColor(const AValue: TColor);
399begin
400 if FStartColor = AValue then
401 exit;
402 FStartColor := AValue;
403
404 Change;
405end;
406
407procedure TBCGradient.SetStartColorOpacity(const AValue: byte);
408begin
409 if FStartColorOpacity = AValue then
410 exit;
411 FStartColorOpacity := AValue;
412
413 Change;
414end;
415
416constructor TBCGradient.Create(AControl: TControl);
417begin
418 FStartColor := clWhite;
419 FStartColorOpacity := 255;
420 FDrawMode := dmSet;
421 FEndColor := clBlack;
422 FEndColorOpacity := 255;
423 FGradientType := gtLinear;
424 FColorCorrection := True;
425 FSinus := False;
426
427 FPoint1XPercent := 0;
428 FPoint1YPercent := 0;
429 FPoint2XPercent := 0;
430 FPoint2YPercent := 100;
431
432 inherited Create(AControl);
433end;
434
435procedure TBCGradient.Assign(Source: TPersistent);
436begin
437 if Source is TBCGradient then
438 begin
439 FStartColor := TBCGradient(Source).FStartColor;
440 FStartColorOpacity := TBCGradient(Source).FStartColorOpacity;
441 FDrawMode := TBCGradient(Source).FDrawMode;
442 FEndColor := TBCGradient(Source).FEndColor;
443 FEndColorOpacity := TBCGradient(Source).FEndColorOpacity;
444 FColorCorrection := TBCGradient(Source).FColorCorrection;
445 FGradientType := TBCGradient(Source).FGradientType;
446 FPoint1XPercent := TBCGradient(Source).FPoint1XPercent;
447 FPoint1YPercent := TBCGradient(Source).FPoint1YPercent;
448 FPoint2XPercent := TBCGradient(Source).FPoint2XPercent;
449 FPoint2YPercent := TBCGradient(Source).FPoint2YPercent;
450 FSinus := TBCGradient(Source).FSinus;
451
452 Change;
453 end
454 else
455 inherited Assign(Source);
456end;
457
458{ TBCFont }
459
460function TBCFont.IsNamStored: Boolean;
461begin
462 Result := DefFontData.Name <> Name;
463end;
464
465procedure TBCFont.SetColor(AValue: TColor);
466begin
467 if FColor = AValue then Exit;
468 FColor := AValue;
469
470 Change;
471end;
472
473procedure TBCFont.SetEndEllipsis(AValue: Boolean);
474begin
475 if FEndEllipsis = AValue then Exit;
476 FEndEllipsis := AValue;
477
478 Change;
479end;
480
481procedure TBCFont.SetFontQuality(AValue: TBGRAFontQuality);
482begin
483 if FFontQuality = AValue then Exit;
484 FFontQuality := AValue;
485
486 Change;
487end;
488
489procedure TBCFont.SetHeight(AValue: Integer);
490begin
491 if FHeight = AValue then Exit;
492 FHeight := AValue;
493
494 Change;
495end;
496
497procedure TBCFont.SetName(AValue: String);
498begin
499 if FName = AValue then Exit;
500 FName := AValue;
501 if FName='' then
502 FName := 'default';
503 Change;
504end;
505
506procedure TBCFont.SetShadow(AValue: Boolean);
507begin
508 if FShadow = AValue then Exit;
509 FShadow := AValue;
510
511 Change;
512end;
513
514procedure TBCFont.SetShadowColor(AValue: TColor);
515begin
516 if FShadowColor = AValue then Exit;
517 FShadowColor := AValue;
518
519 Change;
520end;
521
522procedure TBCFont.SetShadowColorOpacity(AValue: Byte);
523begin
524 if FShadowColorOpacity = AValue then Exit;
525 FShadowColorOpacity := AValue;
526
527 Change;
528end;
529
530procedure TBCFont.SetShadowOffsetX(AValue: ShortInt);
531begin
532 if FShadowOffsetX = AValue then Exit;
533 FShadowOffsetX := AValue;
534
535 Change;
536end;
537
538procedure TBCFont.SetShadowOffsetY(AValue: ShortInt);
539begin
540 if FShadowOffsetY = AValue then Exit;
541 FShadowOffsetY := AValue;
542
543 Change;
544end;
545
546procedure TBCFont.SetShadowRadius(AValue: Byte);
547begin
548 if FShadowRadius = AValue then Exit;
549 FShadowRadius := AValue;
550
551 Change;
552end;
553
554procedure TBCFont.SetSingleLine(AValue: Boolean);
555begin
556 if FSingleLine = AValue then Exit;
557 FSingleLine := AValue;
558
559 if FSingleLine then
560 FWordBreak := False;
561
562 Change;
563end;
564
565procedure TBCFont.SetStyle(AValue: TFontStyles);
566begin
567 if FStyle = AValue then Exit;
568 FStyle := AValue;
569
570 Change;
571end;
572
573procedure TBCFont.SetTextAlignment(AValue: TBCAlignment);
574begin
575 if FTextAlignment = AValue then Exit;
576 FTextAlignment := AValue;
577
578 Change;
579end;
580
581procedure TBCFont.SetWordBreak(AValue: Boolean);
582begin
583 if FWordBreak = AValue then Exit;
584 FWordBreak := AValue;
585
586 if FWordBreak then
587 FSingleLine := False;
588
589 Change;
590end;
591
592constructor TBCFont.Create(AControl: TControl);
593begin
594 inherited Create(AControl);
595
596 // That is temporary. BGRABitmap draw some yellow background when fqSystemClearType.
597 // This problem is reported
598 {$IFDEF LCLGTK2}
599 FFontQuality := fqFineAntialiasing;
600 {$ELSE}
601 FFontQuality := fqSystemClearType;
602 {$ENDIF}
603 FShadow := False;
604 FShadowColor := clBlack;
605 FShadowColorOpacity := 255;
606 FShadowRadius := 5;
607 FShadowOffsetX := 5;
608 FShadowOffsetY := 5;
609 FHeight := 0;
610 FTextAlignment := bcaCenter;
611 FStyle := [];
612 FName := DefFontData.Name;
613 FColor := clDefault;
614 FWordBreak := False;
615 FSingleLine := True;
616 FEndEllipsis := False;
617end;
618
619procedure TBCFont.Assign(Source: TPersistent);
620begin
621 if Source is TBCFont then
622 begin
623 FColor := TBCFont(Source).FColor;
624 FEndEllipsis := TBCFont(Source).FEndEllipsis;
625 FFontQuality := TBCFont(Source).FFontQuality;
626 FHeight := TBCFont(Source).FHeight;
627 FName := TBCFont(Source).FName;
628 FSingleLine := TBCFont(Source).FSingleLine;
629 FShadow := TBCFont(Source).FShadow;
630 FShadowColor := TBCFont(Source).FShadowColor;
631 FShadowColorOpacity := TBCFont(Source).FShadowColorOpacity;
632 FShadowRadius := TBCFont(Source).FShadowRadius;
633 FShadowOffsetX := TBCFont(Source).FShadowOffsetX;
634 FShadowOffsetY := TBCFont(Source).FShadowOffsetY;
635 FStyle := TBCFont(Source).FStyle;
636 FTextAlignment := TBCFont(Source).FTextAlignment;
637 FWordBreak := TBCFont(Source).FWordBreak;
638
639 Change;
640 end
641 else
642 inherited Assign(Source);
643end;
644
645{ TBCBackground }
646
647procedure TBCBackground.SetStyle(AValue: TBCBackgroundStyle);
648begin
649 if FStyle = AValue then Exit;
650 FStyle := AValue;
651
652 Change;
653end;
654
655constructor TBCBackground.Create(AControl: TControl);
656begin
657 FStyle := bbsColor;
658 FColorOpacity := 255;
659 FGradient1 := TBCGradient.Create(AControl);
660 FGradient2 := TBCGradient.Create(AControl);
661 FGradient1EndPercent := 35;
662
663 FGradient1.OnChange := @OnChangeChildProperty;
664 FGradient2.OnChange := @OnChangeChildProperty;
665 inherited Create(AControl);
666end;
667
668destructor TBCBackground.Destroy;
669begin
670 FGradient1.Free;
671 FGradient2.Free;
672 inherited Destroy;
673end;
674
675procedure TBCBackground.Assign(Source: TPersistent);
676begin
677 if Source is TBCBackground then
678 begin
679 FColor := TBCBackground(Source).FColor;
680 FColorOpacity := TBCBackground(Source).FColorOpacity;
681 FGradient1EndPercent := TBCBackground(Source).FGradient1EndPercent;
682 FStyle := TBCBackground(Source).FStyle;
683 FGradient1.Assign(TBCBackground(Source).FGradient1);
684 FGradient2.Assign(TBCBackground(Source).FGradient2);
685 end
686 else
687 inherited Assign(Source);
688end;
689
690procedure TBCBackground.SetGradient1(AValue: TBCGradient);
691begin
692 if FGradient1 = AValue then Exit;
693 FGradient1 := AValue;
694
695 Change;
696end;
697
698procedure TBCBackground.OnChangeChildProperty(Sender: TObject; AData: PtrInt);
699begin
700 Change(AData);
701end;
702
703procedure TBCBackground.SetColor(AValue: TColor);
704begin
705 if FColor = AValue then Exit;
706 FColor := AValue;
707
708 Change;
709end;
710
711procedure TBCBackground.SetColorOpacity(AValue: byte);
712begin
713 if FColorOpacity = AValue then Exit;
714 FColorOpacity := AValue;
715
716 Change;
717end;
718
719procedure TBCBackground.SetGradient1EndPercent(AValue: single);
720begin
721 if FGradient1EndPercent = AValue then Exit;
722 FGradient1EndPercent := AValue;
723
724 Change;
725end;
726
727procedure TBCBackground.SetGradient2(AValue: TBCGradient);
728begin
729 if FGradient2 = AValue then Exit;
730 FGradient2 := AValue;
731
732 Change;
733end;
734
735{ TBCBorder }
736
737procedure TBCBorder.SetLightColor(AValue: TColor);
738begin
739 if FLightColor = AValue then Exit;
740 FLightColor := AValue;
741
742 Change;
743end;
744
745procedure TBCBorder.SetColor(AValue: TColor);
746begin
747 if FColor = AValue then Exit;
748 FColor := AValue;
749
750 Change;
751end;
752
753procedure TBCBorder.SetColorOpacity(AValue: byte);
754begin
755 if FColorOpacity = AValue then Exit;
756 FColorOpacity := AValue;
757
758 Change;
759end;
760
761procedure TBCBorder.SetLightOpacity(AValue: byte);
762begin
763 if FLightOpacity = AValue then Exit;
764 FLightOpacity := AValue;
765
766 Change;
767end;
768
769procedure TBCBorder.SetLightWidth(AValue: integer);
770begin
771 if FLightWidth = AValue then Exit;
772 FLightWidth := AValue;
773
774 Change;
775end;
776
777procedure TBCBorder.SetStyle(AValue: TBCBorderStyle);
778begin
779 if FStyle = AValue then Exit;
780 FStyle := AValue;
781
782 Change;
783end;
784
785procedure TBCBorder.SetWidth(AValue: Integer);
786begin
787 if FWidth = AValue then Exit;
788 FWidth := AValue;
789
790 Change;
791end;
792
793constructor TBCBorder.Create(AControl: TControl);
794begin
795 FColor := clBlack;
796 FColorOpacity := 255;
797 FLightWidth := 0;
798 FLightOpacity := 255;
799 FLightColor := clWhite;
800 FStyle := bboSolid;
801 FWidth := 1;
802 inherited Create(AControl);
803end;
804
805procedure TBCBorder.Assign(Source: TPersistent);
806begin
807 if Source is TBCBorder then
808 begin
809 FColor := TBCBorder(Source).FColor;
810 FColorOpacity := TBCBorder(Source).FColorOpacity;
811 FLightColor := TBCBorder(Source).FLightColor;
812 FLightOpacity := TBCBorder(Source).FLightOpacity;
813 FLightWidth := TBCBorder(Source).FLightWidth;
814 FStyle := TBCBorder(Source).FStyle;
815 FWidth := TBCBorder(Source).FWidth;
816 end
817 else
818 inherited Assign(Source);
819end;
820
821end.
Note: See TracBrowser for help on using the repository browser.