-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbcleatheme.pas
2482 lines (2202 loc) · 81.3 KB
/
bcleatheme.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
*****************************************************************************
See the file COPYING.modifiedLGPL.txt, included in this distribution,
for details about the license.
*****************************************************************************
Author: Boban Spasic
Credits to: alpine from Lazarus forum
}
unit BCLeaTheme;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
laz2_dom, laz2_xmlwrite, laz2_xmlread, StrUtils, LCLIntf,
BGRABitmapTypes, BGRABitmap, BGRAGradients, BCLeaTypes;
type
TBCLeaThemeCommon = class(TPersistent)
public
//Common
FLightSourceIntensity: single;
FLightSourceDistanceTerm: single;
FLightSourceDistanceFactor: single;
FLightDestFactor: single;
FLightColor: TColor;
FSpecularFactor: single;
FSpecularIndex: single;
FAmbientFactor: single;
FDiffusionFactor: single;
FNegativeDiffusionFactor: single;
FDiffuseSaturation: boolean;
FLightPositionX: integer;
FLightPositionY: integer;
FLightPositionZ: integer;
end;
TBCLeaThemeLCD = class(TPersistent)
public
//BLCDDisplay
FFrameColor: TColor;
FBoardColor: TColor;
FDotColorOn: TColor;
FFrameStyle: TZStyle;
FFrameHeight: integer;
FFrameAltitude: integer;
FFrameSize: integer;
FDotShape: TDotShape;
FDotSize: integer;
FDotsSpace: integer;
FDotBlend: boolean;
FDotBlendOperation: TBlendOperation;
FDotBlur: boolean;
FDotBlurRadius: single;
FBoardShadow: TBoardShadow;
end;
TBCLeaThemeLED = class(TPersistent)
public
//BCLeaLED
FColorOn: TColor;
FColorOff: TColor;
FBkgColor: TColor;
FStyle: TZStyle;
FSize: integer;
FAltitude: integer;
end;
TBCLeaThemeQLED = class(TPersistent)
public
//BCLeaQLED
FColorOn: TColor;
FColorOff: TColor;
FBkgColor: TColor;
FStyle: TZStyle;
FSize: integer;
FAltitude: integer;
FRounding: integer;
end;
TBCLeaThemeSelector = class(TPersistent)
public
//BSelector
FLineColor: TColor;
FLineBkgColor: TColor;
FLineWidth: integer;
FFontShadowColor: TColor;
FFontShadowOffsetX: integer;
FFontShadowOffsetY: integer;
FFontShadowRadius: integer;
FBkgColor: TColor;
FPointerSize: integer;
FStyle: TZStyle;
FDrawTextPhong: boolean;
FAltitude: integer;
end;
TBCLeaThemeRingSlider = class(TPersistent)
public
//BRingSlider
FLineColor: TColor;
FLineBkgColor: TColor;
FLineWidth: integer;
FFontShadowColor: TColor;
FFontShadowOffsetX: integer;
FFontShadowOffsetY: integer;
FFontShadowRadius: integer;
FBkgColor: TColor;
FPointerSize: integer;
FPointerColor: TColor;
FStyle: TZStyle;
FDrawTextPhong: boolean;
FAltitude: integer;
end;
TBCLeaThemeBoard = class(TPersistent)
public
FFrameColor: TColor;
FBoardColor: TColor;
FBkgColor: TColor;
FFrameStyle: TZStyle;
FBoardStyle: TZStyle;
FFrameHeight: integer;
FFrameDistance: integer;
FAltitude: integer;
FRounding: integer;
end;
TBCLeaTheme = class(TComponent)
private
FThemeSetCommon: TBCLeaThemeCommon;
FThemeSetLCD: TBCLeaThemeLCD;
FThemeSetLED: TBCLeaThemeLED;
FThemeSetSelector: TBCLeaThemeSelector;
FThemeSetRingSlider: TBCLeaThemeRingSlider;
FThemeSetQLED: TBCLeaThemeQLED;
FThemeSetBoard: TBCLeaThemeBoard;
FOnChange: TNotifyEvent;
procedure DoChange;
//Common
procedure SetLightSourceIntensity(const AValue: single);
procedure SetLightSourceDistanceTerm(const AValue: single);
procedure SetLightSourceDistanceFactor(const AValue: single);
procedure SetLightDestFactor(const AValue: single);
procedure SetLightColor(const AValue: TColor);
procedure SetSpecularFactor(const AValue: single);
procedure SetSpecularIndex(const AValue: single);
procedure SetAmbientFactor(const AValue: single);
procedure SetDiffusionFactor(const AValue: single);
procedure SetNegativeDiffusionFactor(const AValue: single);
procedure SetDiffuseSaturation(const AValue: boolean);
procedure SetLightPositionX(const AValue: integer);
procedure SetLightPositionY(const AValue: integer);
procedure SetLightPositionZ(const AValue: integer);
function GetLightSourceIntensity: single;
function GetLightSourceDistanceTerm: single;
function GetLightSourceDistanceFactor: single;
function GetLightDestFactor: single;
function GetLightColor: TColor;
function GetSpecularFactor: single;
function GetSpecularIndex: single;
function GetAmbientFactor: single;
function GetDiffusionFactor: single;
function GetNegativeDiffusionFactor: single;
function GetDiffuseSaturation: boolean;
function GetLightPositionX: integer;
function GetLightPositionY: integer;
function GetLightPositionZ: integer;
//BCLeaLCDDisplay
procedure SetBLCDFrameColor(const AValue: TColor);
procedure SetBLCDBoardColor(const AValue: TColor);
procedure SetBLCDDotColorOn(const AValue: TColor);
procedure SetBLCDFrameAltitude(const AValue: integer);
procedure SetBLCDFrameHeight(const AValue: integer);
procedure SetBLCDFrameSize(const AValue: integer);
procedure SetBLCDFrameStyle(const AValue: TZStyle);
procedure SetBLCDDotShape(const AValue: TDotShape);
procedure SetBLCDDotSize(const AValue: integer);
procedure SetBLCDDotsSpace(const AValue: integer);
procedure SetBLCDDotBlend(const AValue: boolean);
procedure SetBLCDDotBlendOperation(const AValue: TBlendOperation);
procedure SetBLCDDotBlur(const AValue: boolean);
procedure SetBLCDDotBlurRadius(const AValue: single);
procedure SetBLCDBoardShadow(const AValue: TBoardShadow);
function GetBLCDFrameColor: TColor;
function GetBLCDBoardColor: TColor;
function GetBLCDDotColorOn: TColor;
function GetBLCDFrameAltitude: integer;
function GetBLCDFrameHeight: integer;
function GetBLCDFrameSize: integer;
function GetBLCDFrameStyle: TZStyle;
function GetBLCDDotShape: TDotShape;
function GetBLCDDotSize: integer;
function GetBLCDDotsSpace: integer;
function GetBLCDDotBlend: boolean;
function GetBLCDDotBlendOperation: TBlendOperation;
function GetBLCDDotBlur: boolean;
function GetBLCDDotBlurRadius: single;
function GetBLCDBoardShadow: TBoardShadow;
//BCLeaLED
procedure SetBCLeaLEDColorOn(AValue: TColor);
procedure SetBCLeaLEDColorOff(AValue: TColor);
procedure SetBCLeaLEDBkgColor(AValue: TColor);
procedure SetBCLeaLEDStyle(AValue: TZStyle);
procedure SetBCLeaLEDSize(AValue: integer);
procedure SetBCLeaLEDAltitude(AValue: integer);
function GetBCLeaLEDColorOn: TColor;
function GetBCLeaLEDColorOff: TColor;
function GetBCLeaLEDBkgColor: TColor;
function GetBCLeaLEDStyle: TZStyle;
function GetBCLeaLEDSize: integer;
function GetBCLeaLEDAltitude: integer;
//BCLeaQLED
procedure SetBCLeaQLEDColorOn(AValue: TColor);
procedure SetBCLeaQLEDColorOff(AValue: TColor);
procedure SetBCLeaQLEDBkgColor(AValue: TColor);
procedure SetBCLeaQLEDStyle(AValue: TZStyle);
procedure SetBCLeaQLEDSize(AValue: integer);
procedure SetBCLeaQLEDAltitude(AValue: integer);
procedure SetBCLeaQLEDRounding(AValue: integer);
function GetBCLeaQLEDColorOn: TColor;
function GetBCLeaQLEDColorOff: TColor;
function GetBCLeaQLEDBkgColor: TColor;
function GetBCLeaQLEDStyle: TZStyle;
function GetBCLeaQLEDSize: integer;
function GetBCLeaQLEDAltitude: integer;
function GetBCLeaQLEDRounding: integer;
//BCLeaSelector
procedure SetBSELLineColor(AValue: TColor);
procedure SetBSELLineBkgColor(AValue: TColor);
procedure SetBSELLineWidth(AValue: integer);
procedure SetBSELFontShadowColor(AValue: TColor);
procedure SetBSELFontShadowOffsetX(AValue: integer);
procedure SetBSELFontShadowOffsetY(AValue: integer);
procedure SetBSELFontShadowRadius(AValue: integer);
procedure SetBSELBkgColor(AValue: TColor);
procedure SetBSELPointerSize(AValue: integer);
procedure SetBSELStyle(AValue: TZStyle);
procedure SetBSELDrawTextPhong(AValue: boolean);
procedure SetBSELAltitude(AValue: integer);
function GetBSELLineColor: TColor;
function GetBSELLineBkgColor: TColor;
function GetBSELLineWidth: integer;
function GetBSELFontShadowColor: TColor;
function GetBSELFontShadowOffsetX: integer;
function GetBSELFontShadowOffsetY: integer;
function GetBSELFontShadowRadius: integer;
function GetBSELBkgColor: TColor;
function GetBSELPointerSize: integer;
function GetBSELStyle: TZStyle;
function GetBSELDrawTextPhong: boolean;
function GetBSELAltitude: integer;
//BCLeaRingSlider
procedure SetBRSLineColor(AValue: TColor);
procedure SetBRSLineBkgColor(AValue: TColor);
procedure SetBRSLineWidth(AValue: integer);
procedure SetBRSFontShadowColor(AValue: TColor);
procedure SetBRSFontShadowOffsetX(AValue: integer);
procedure SetBRSFontShadowOffsetY(AValue: integer);
procedure SetBRSFontShadowRadius(AValue: integer);
procedure SetBRSBkgColor(AValue: TColor);
procedure SetBRSPointerSize(AValue: integer);
procedure SetBRSPointerColor(AValue: TColor);
procedure SetBRSStyle(AValue: TZStyle);
procedure SetBRSDrawTextPhong(AValue: boolean);
procedure SetBRSAltitude(AValue: integer);
function GetBRSLineColor: TColor;
function GetBRSLineBkgColor: TColor;
function GetBRSLineWidth: integer;
function GetBRSFontShadowColor: TColor;
function GetBRSFontShadowOffsetX: integer;
function GetBRSFontShadowOffsetY: integer;
function GetBRSFontShadowRadius: integer;
function GetBRSBkgColor: TColor;
function GetBRSPointerSize: integer;
function GetBRSPointerColor: TColor;
function GetBRSStyle: TZStyle;
function GetBRSDrawTextPhong: boolean;
function GetBRSAltitude: integer;
//BCLeaBoard
procedure SetBRDFrameColor(AValue: TColor);
procedure SetBRDBoardColor(AValue: TColor);
procedure SetBRDBkgColor(AValue: TColor);
procedure SetBRDFrameStyle(AValue: TZStyle);
procedure SetBRDBoardStyle(AValue: TZStyle);
procedure SetBRDFrameHeight(AValue: integer);
procedure SetBRDFrameDistance(AValue: integer);
procedure SetBRDAltitude(AValue: integer);
procedure SetBRDRounding(AValue: integer);
function GetBRDFrameColor: TColor;
function GetBRDBoardColor: TColor;
function GetBRDBkgColor: TColor;
function GetBRDFrameStyle: TZStyle;
function GetBRDBoardStyle: TZStyle;
function GetBRDFrameHeight: integer;
function GetBRDFrameDistance: integer;
function GetBRDAltitude: integer;
function GetBRDRounding: integer;
protected
public
TestPanelColor: TColor;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
//load default theme
procedure Initialize;
//do not use direct, please use the procedures of the parent component
procedure SaveThemeToFile(AFileName: string);
//do not use direct, please use the procedures of the parent component
procedure LoadThemeFromFile(AFileName: string);
published
property OnChange: TNotifyEvent read FOnChange write FOnChange;
//BLCDDisplay
property LCD_FrameColor: TColor read GetBLCDFrameColor write SetBLCDFrameColor default clBtnFace;
property LCD_BoardColor: TColor read GetBLCDBoardColor write SetBLCDBoardColor default clBlack;
property LCD_DotColorOn: TColor read GetBLCDDotColorOn write SetBLCDDotColorOn default clSkyBlue;
property LCD_FrameAltitude: integer read GetBLCDFrameAltitude write SetBLCDFrameAltitude default 2;
property LCD_FrameHeight: integer read GetBLCDFrameHeight write SetBLCDFrameHeight default 8;
property LCD_FrameSize: integer read GetBLCDFrameSize write SetBLCDFrameSize default 8;
property LCD_FrameStyle: TZStyle read GetBLCDFrameStyle write SetBLCDFrameStyle default zsRaised;
property LCD_DotShape: TDotShape read GetBLCDDotShape write SetBLCDDotShape default stSquare;
property LCD_DotSize: integer read GetBLCDDotSize write SetBLCDDotSize default 4;
property LCD_DotsSpace: integer read GetBLCDDotsSpace write SetBLCDDotsSpace default 1;
property LCD_DotBlend: boolean read GetBLCDDotBlend write SetBLCDDotBlend default False;
property LCD_DotBlendOperation: TBlendOperation read GetBLCDDotBlendOperation write SetBLCDDotBlendOperation default boGlow;
property LCD_DotBlur: boolean read GetBLCDDotBlur write SetBLCDDotBlur default False;
property LCD_DotBlurRadius: single read GetBLCDDotBlurRadius write SetBLCDDotBlurRadius default 0.8;
property LCD_BoardShadow: TBoardShadow read GetBLCDBoardShadow write SetBLCDBoardShadow default bsFrame;
property COM_LightSourceIntensity: single read GetLightSourceIntensity write SetLightSourceIntensity default 500;
property COM_LightSourceDistanceTerm: single read GetLightSourceDistanceTerm write SetLightSourceDistanceTerm default 150;
property COM_LightSourceDistanceFactor: single read GetLightSourceDistanceFactor write SetLightSourceDistanceFactor default 1.0;
property COM_LightDestFactor: single read GetLightDestFactor write SetLightDestFactor default 1.0;
property COM_LightColor: TColor read GetLightColor write SetLightColor default clWhite;
property COM_SpecularFactor: single read GetSpecularFactor write SetSpecularFactor default 0.6;
property COM_SpecularIndex: single read GetSpecularIndex write SetSpecularIndex default 10;
property COM_AmbientFactor: single read GetAmbientFactor write SetAmbientFactor default 0.3;
property COM_DiffusionFactor: single read GetDiffusionFactor write SetDiffusionFactor default 0.9;
property COM_NegativeDiffusionFactor: single read GetNegativeDiffusionFactor write SetNegativeDiffusionFactor default 0.1;
property COM_DiffuseSaturation: boolean read GetDiffuseSaturation write SetDiffuseSaturation default False;
property COM_LightPositionX: integer read GetLightPositionX write SetLightPositionX default -100;
property COM_LightPositionY: integer read GetLightPositionY write SetLightPositionY default -100;
property COM_LightPositionZ: integer read GetLightPositionZ write SetLightPositionZ default 100;
property LED_ColorOn: TColor read GetBCLeaLEDColorOn write SetBCLeaLEDColorOn default TColor($00FF9C15);
property LED_ColorOff: TColor read GetBCLeaLEDColorOff write SetBCLeaLEDColorOff default TColor($009E5A00);
property LED_BkgColor: TColor read GetBCLeaLEDBkgColor write SetBCLeaLEDBkgColor default clBtnFace;
property LED_Style: TZStyle read GetBCLeaLEDStyle write SetBCLeaLEDStyle default zsRaised;
property LED_Size: integer read GetBCLeaLEDSize write SetBCLeaLEDSize default 15;
property LED_Altitude: integer read GetBCLeaLEDAltitude write SetBCLeaLEDAltitude default 2;
property QLED_ColorOn: TColor read GetBCLeaQLEDColorOn write SetBCLeaQLEDColorOn default TColor($00FF9C15);
property QLED_ColorOff: TColor read GetBCLeaQLEDColorOff write SetBCLeaQLEDColorOff default TColor($009E5A00);
property QLED_BkgColor: TColor read GetBCLeaQLEDBkgColor write SetBCLeaQLEDBkgColor default clBtnFace;
property QLED_Style: TZStyle read GetBCLeaQLEDStyle write SetBCLeaQLEDStyle default zsRaised;
property QLED_Size: integer read GetBCLeaQLEDSize write SetBCLeaQLEDSize default 20;
property QLED_Altitude: integer read GetBCLeaQLEDAltitude write SetBCLeaQLEDAltitude default 2;
property QLED_Rounding: integer read GetBCLeaQLEDRounding write SetBCLeaQLEDRounding default 3;
property SEL_LineColor: TColor read GetBSELLineColor write SetBSELLineColor default TColor($009E5A00);
property SEL_LineBkgColor: TColor read GetBSELLineBkgColor write SetBSELLineBkgColor default TColor($00D3D3D3);
property SEL_LineWidth: integer read GetBSELLineWidth write SetBSELLineWidth default 0;
property SEL_FontShadowColor: TColor read GetBSELFontShadowColor write SetBSELFontShadowColor default clBlack;
property SEL_FontShadowOffsetX: integer read GetBSELFontShadowOffsetX write SetBSELFontShadowOffsetX default 2;
property SEL_FontShadowOffsetY: integer read GetBSELFontShadowOffsetY write SetBSELFontShadowOffsetY default 2;
property SEL_FontShadowRadius: integer read GetBSELFontShadowRadius write SetBSELFontShadowRadius default 4;
property SEL_BkgColor: TColor read GetBSELBkgColor write SetBSELBkgColor default clBtnFace;
property SEL_PointerSize: integer read GetBSELPointerSize write SetBSELPointerSize default 2;
property SEL_Style: TZStyle read GetBSELStyle write SetBSELStyle default zsRaised;
property SEL_DrawTextPhong: boolean read GetBSELDrawTextPhong write SetBSELDrawTextPhong default False;
property SEL_Altitude: integer read GetBSELAltitude write SetBSELAltitude default 2;
property RS_LineColor: TColor read GetBRSLineColor write SetBRSLineColor default TColor($009E5A00);
property RS_LineBkgColor: TColor read GetBRSLineBkgColor write SetBRSLineBkgColor default TColor($00D3D3D3);
property RS_LineWidth: integer read GetBRSLineWidth write SetBRSLineWidth default 0;
property RS_FontShadowColor: TColor read GetBRSFontShadowColor write SetBRSFontShadowColor default clBlack;
property RS_FontShadowOffsetX: integer read GetBRSFontShadowOffsetX write SetBRSFontShadowOffsetX default 2;
property RS_FontShadowOffsetY: integer read GetBRSFontShadowOffsetY write SetBRSFontShadowOffsetY default 2;
property RS_FontShadowRadius: integer read GetBRSFontShadowRadius write SetBRSFontShadowRadius default 4;
property RS_BkgColor: TColor read GetBRSBkgColor write SetBRSBkgColor default clBtnFace;
property RS_PointerSize: integer read GetBRSPointerSize write SetBRSPointerSize default 2;
property RS_PointerColor: TColor read GetBRSPointerColor write SetBRSPointerColor default TColor($00FF9C15);
property RS_Style: TZStyle read GetBRSStyle write SetBRSStyle default zsRaised;
property RS_DrawTextPhong: boolean read GetBRSDrawTextPhong write SetBRSDrawTextPhong default False;
property RS_Altitude: integer read GetBRSAltitude write SetBRSAltitude default 2;
property BRD_FrameColor: TColor read GetBRDFrameColor write SetBRDFrameColor default clBtnFace;
property BRD_BoardColor: TColor read GetBRDBoardColor write SetBRDBoardColor default clBtnFace;
property BRD_BkgColor: TColor read GetBRDBkgColor write SetBRDBkgColor default clBtnFace;
property BRD_FrameStyle: TZStyle read GetBRDFrameStyle write SetBRDFrameStyle default zsRaised;
property BRD_BoardStyle: TZStyle read GetBRDBoardStyle write SetBRDBoardStyle default zsFlat;
property BRD_FrameHeight: integer read GetBRDFrameHeight write SetBRDFrameHeight default 10;
property BRD_FrameDistance: integer read GetBRDFrameDistance write SetBRDFrameDistance default 3;
property BRD_Altitude: integer read GetBRDAltitude write SetBRDAltitude default 2;
property BRD_Rounding: integer read GetBRDRounding write SetBRDRounding default 10;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('BGRA Controls', [TBCLeaTheme]);
end;
constructor TBCLeaTheme.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FThemeSetCommon := TBCLeaThemeCommon.Create;
FThemeSetLCD := TBCLeaThemeLCD.Create;
FThemeSetLED := TBCLeaThemeLED.Create;
FThemeSetSelector := TBCLeaThemeSelector.Create;
FThemeSetRingSlider := TBCLeaThemeRingSlider.Create;
FThemeSetQLED := TBCLeaThemeQLED.Create;
FThemeSetBoard := TBCLeaThemeBoard.Create;
Initialize;
TestPanelColor := clBtnFace;
end;
destructor TBCLeaTheme.Destroy;
begin
FreeAndNil(FThemeSetCommon);
FreeAndNil(FThemeSetLCD);
FreeAndNil(FThemeSetLED);
FreeAndNil(FThemeSetSelector);
FreeAndNil(FThemeSetRingSlider);
FreeAndNil(FThemeSetQLED);
FreeAndNil(FThemeSetBoard);
inherited Destroy;
end;
procedure TBCLeaTheme.DoChange;
begin
if Assigned(FOnChange) then FOnChange(self);
end;
function TBCLeaTheme.GetLightSourceIntensity: single;
begin
Result := FThemeSetCommon.FLightSourceIntensity;
end;
function TBCLeaTheme.GetLightSourceDistanceTerm: single;
begin
Result := FThemeSetCommon.FLightSourceDistanceTerm;
end;
function TBCLeaTheme.GetLightSourceDistanceFactor: single;
begin
Result := FThemeSetCommon.FLightSourceDistanceFactor;
end;
function TBCLeaTheme.GetLightDestFactor: single;
begin
Result := FThemeSetCommon.FLightDestFactor;
end;
function TBCLeaTheme.GetLightColor: TColor;
begin
Result := FThemeSetCommon.FLightColor;
end;
function TBCLeaTheme.GetSpecularFactor: single;
begin
Result := FThemeSetCommon.FSpecularFactor;
end;
function TBCLeaTheme.GetSpecularIndex: single;
begin
Result := FThemeSetCommon.FSpecularIndex;
end;
function TBCLeaTheme.GetAmbientFactor: single;
begin
Result := FThemeSetCommon.FAmbientFactor;
end;
function TBCLeaTheme.GetDiffusionFactor: single;
begin
Result := FThemeSetCommon.FDiffusionFactor;
end;
function TBCLeaTheme.GetNegativeDiffusionFactor: single;
begin
Result := FThemeSetCommon.FNegativeDiffusionFactor;
end;
function TBCLeaTheme.GetDiffuseSaturation: boolean;
begin
Result := FThemeSetCommon.FDiffuseSaturation;
end;
function TBCLeaTheme.GetLightPositionX: integer;
begin
Result := FThemeSetCommon.FLightPositionX;
end;
function TBCLeaTheme.GetLightPositionY: integer;
begin
Result := FThemeSetCommon.FLightPositionY;
end;
function TBCLeaTheme.GetLightPositionZ: integer;
begin
Result := FThemeSetCommon.FLightPositionZ;
end;
function TBCLeaTheme.GetBLCDFrameColor: TColor;
begin
Result := FThemeSetLCD.FFrameColor;
end;
function TBCLeaTheme.GetBLCDBoardColor: TColor;
begin
Result := FThemeSetLCD.FBoardColor;
end;
function TBCLeaTheme.GetBLCDDotColorOn: TColor;
begin
Result := FThemeSetLCD.FDotColorOn;
end;
function TBCLeaTheme.GetBLCDFrameAltitude: integer;
begin
Result := FThemeSetLCD.FFrameAltitude;
end;
function TBCLeaTheme.GetBLCDFrameHeight: integer;
begin
Result := FThemeSetLCD.FFrameHeight;
end;
function TBCLeaTheme.GetBLCDFrameSize: integer;
begin
Result := FThemeSetLCD.FFrameSize;
end;
function TBCLeaTheme.GetBLCDFrameStyle: TZStyle;
begin
Result := FThemeSetLCD.FFrameStyle;
end;
function TBCLeaTheme.GetBLCDDotShape: TDotShape;
begin
Result := FThemeSetLCD.FDotShape;
end;
function TBCLeaTheme.GetBLCDDotSize: integer;
begin
Result := FThemeSetLCD.FDotSize;
end;
function TBCLeaTheme.GetBLCDDotsSpace: integer;
begin
Result := FThemeSetLCD.FDotsSpace;
end;
function TBCLeaTheme.GetBLCDDotBlend: boolean;
begin
Result := FThemeSetLCD.FDotBlend;
end;
function TBCLeaTheme.GetBLCDDotBlendOperation: TBlendOperation;
begin
Result := FThemeSetLCD.FDotBlendOperation;
end;
function TBCLeaTheme.GetBLCDDotBlur: boolean;
begin
Result := FThemeSetLCD.FDotBlur;
end;
function TBCLeaTheme.GetBLCDDotBlurRadius: single;
begin
Result := FThemeSetLCD.FDotBlurRadius;
end;
function TBCLeaTheme.GetBLCDBoardShadow: TBoardShadow;
begin
Result := FThemeSetLCD.FBoardShadow;
end;
function TBCLeaTheme.GetBCLeaLEDColorOn: TColor;
begin
Result := FThemeSetLED.FColorOn;
end;
function TBCLeaTheme.GetBCLeaLEDColorOff: TColor;
begin
Result := FThemeSetLED.FColorOff;
end;
function TBCLeaTheme.GetBCLeaLEDBkgColor: TColor;
begin
Result := FThemeSetLED.FBkgColor;
end;
function TBCLeaTheme.GetBCLeaLEDStyle: TZStyle;
begin
Result := FThemeSetLED.FStyle;
end;
function TBCLeaTheme.GetBCLeaLEDSize: integer;
begin
Result := FThemeSetLED.FSize;
end;
function TBCLeaTheme.GetBCLeaLEDAltitude: integer;
begin
Result := FThemeSetLED.FAltitude;
end;
function TBCLeaTheme.GetBCLeaQLEDColorOn: TColor;
begin
Result := FThemeSetQLED.FColorOn;
end;
function TBCLeaTheme.GetBCLeaQLEDColorOff: TColor;
begin
Result := FThemeSetQLED.FColorOff;
end;
function TBCLeaTheme.GetBCLeaQLEDBkgColor: TColor;
begin
Result := FThemeSetQLED.FBkgColor;
end;
function TBCLeaTheme.GetBCLeaQLEDStyle: TZStyle;
begin
Result := FThemeSetQLED.FStyle;
end;
function TBCLeaTheme.GetBCLeaQLEDSize: integer;
begin
Result := FThemeSetQLED.FSize;
end;
function TBCLeaTheme.GetBCLeaQLEDAltitude: integer;
begin
Result := FThemeSetQLED.FAltitude;
end;
function TBCLeaTheme.GetBCLeaQLEDRounding: integer;
begin
Result := FThemeSetQLED.FRounding;
end;
function TBCLeaTheme.GetBSELLineColor: TColor;
begin
Result := FThemeSetSelector.FLineColor;
end;
function TBCLeaTheme.GetBSELLineBkgColor: TColor;
begin
Result := FThemeSetSelector.FLineBkgColor;
end;
function TBCLeaTheme.GetBSELLineWidth: integer;
begin
Result := FThemeSetSelector.FLineWidth;
end;
function TBCLeaTheme.GetBSELFontShadowColor: TColor;
begin
Result := FThemeSetSelector.FFontShadowColor;
end;
function TBCLeaTheme.GetBSELFontShadowOffsetX: integer;
begin
Result := FThemeSetSelector.FFontShadowOffsetX;
end;
function TBCLeaTheme.GetBSELFontShadowOffsetY: integer;
begin
Result := FThemeSetSelector.FFontShadowOffsetY;
end;
function TBCLeaTheme.GetBSELFontShadowRadius: integer;
begin
Result := FThemeSetSelector.FFontShadowRadius;
end;
function TBCLeaTheme.GetBSELBkgColor: TColor;
begin
Result := FThemeSetSelector.FBkgColor;
end;
function TBCLeaTheme.GetBSELPointerSize: integer;
begin
Result := FThemeSetSelector.FPointerSize;
end;
function TBCLeaTheme.GetBSELStyle: TZStyle;
begin
Result := FThemeSetSelector.FStyle;
end;
function TBCLeaTheme.GetBSELDrawTextPhong: boolean;
begin
Result := FThemeSetSelector.FDrawTextPhong;
end;
function TBCLeaTheme.GetBSELAltitude: integer;
begin
Result := FThemeSetSelector.FAltitude;
end;
function TBCLeaTheme.GetBRSLineColor: TColor;
begin
Result := FThemeSetRingSlider.FLineColor;
end;
function TBCLeaTheme.GetBRSLineBkgColor: TColor;
begin
Result := FThemeSetRingSlider.FLineBkgColor;
end;
function TBCLeaTheme.GetBRSLineWidth: integer;
begin
Result := FThemeSetRingSlider.FLineWidth;
end;
function TBCLeaTheme.GetBRSFontShadowColor: TColor;
begin
Result := FThemeSetRingSlider.FFontShadowColor;
end;
function TBCLeaTheme.GetBRSFontShadowOffsetX: integer;
begin
Result := FThemeSetRingSlider.FFontShadowOffsetX;
end;
function TBCLeaTheme.GetBRSFontShadowOffsetY: integer;
begin
Result := FThemeSetRingSlider.FFontShadowOffsetY;
end;
function TBCLeaTheme.GetBRSFontShadowRadius: integer;
begin
Result := FThemeSetRingSlider.FFontShadowRadius;
end;
function TBCLeaTheme.GetBRSBkgColor: TColor;
begin
Result := FThemeSetRingSlider.FBkgColor;
end;
function TBCLeaTheme.GetBRSPointerSize: integer;
begin
Result := FThemeSetRingSlider.FPointerSize;
end;
function TBCLeaTheme.GetBRSPointerColor: TColor;
begin
Result := FThemeSetRingSlider.FPointerColor;
end;
function TBCLeaTheme.GetBRSStyle: TZStyle;
begin
Result := FThemeSetRingSlider.FStyle;
end;
function TBCLeaTheme.GetBRSDrawTextPhong: boolean;
begin
Result := FThemeSetRingSlider.FDrawTextPhong;
end;
function TBCLeaTheme.GetBRSAltitude: integer;
begin
Result := FThemeSetRingSlider.FAltitude;
end;
function TBCLeaTheme.GetBRDFrameColor: TColor;
begin
Result := FThemeSetBoard.FFrameColor;
end;
function TBCLeaTheme.GetBRDBoardColor: TColor;
begin
Result := FThemeSetBoard.FBoardColor;
end;
function TBCLeaTheme.GetBRDBkgColor: TColor;
begin
Result := FThemeSetBoard.FBkgColor;
end;
function TBCLeaTheme.GetBRDFrameStyle: TZStyle;
begin
Result := FThemeSetBoard.FFrameStyle;
end;
function TBCLeaTheme.GetBRDBoardStyle: TZStyle;
begin
Result := FThemeSetBoard.FBoardStyle;
end;
function TBCLeaTheme.GetBRDFrameHeight: integer;
begin
Result := FThemeSetBoard.FFrameHeight;
end;
function TBCLeaTheme.GetBRDFrameDistance: integer;
begin
Result := FThemeSetBoard.FFrameDistance;
end;
function TBCLeaTheme.GetBRDAltitude: integer;
begin
Result := FThemeSetBoard.FAltitude;
end;
function TBCLeaTheme.GetBRDRounding: integer;
begin
Result := FThemeSetBoard.FRounding;
end;
//============================================================================
procedure TBCLeaTheme.SetLightSourceIntensity(const AValue: single);
begin
if AValue = FThemeSetCommon.FLightSourceIntensity then
Exit;
FThemeSetCommon.FLightSourceIntensity := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightSourceDistanceTerm(const AValue: single);
begin
if AValue = FThemeSetCommon.FLightSourceDistanceTerm then
Exit;
FThemeSetCommon.FLightSourceDistanceTerm := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightSourceDistanceFactor(const AValue: single);
begin
if AValue = FThemeSetCommon.FLightSourceDistanceFactor then
Exit;
FThemeSetCommon.FLightSourceDistanceFactor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightDestFactor(const AValue: single);
begin
if AValue = FThemeSetCommon.FLightDestFactor then
Exit;
FThemeSetCommon.FLightDestFactor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightColor(const AValue: TColor);
begin
if AValue = FThemeSetCommon.FLightColor then
Exit;
FThemeSetCommon.FLightColor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetSpecularFactor(const AValue: single);
begin
if AValue = FThemeSetCommon.FSpecularFactor then
Exit;
FThemeSetCommon.FSpecularFactor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetSpecularIndex(const AValue: single);
begin
if AValue = FThemeSetCommon.FSpecularIndex then
Exit;
FThemeSetCommon.FSpecularIndex := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetAmbientFactor(const AValue: single);
begin
if AValue = FThemeSetCommon.FAmbientFactor then
Exit;
FThemeSetCommon.FAmbientFactor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetDiffusionFactor(const AValue: single);
begin
if AValue = FThemeSetCommon.FDiffusionFactor then
Exit;
FThemeSetCommon.FDiffusionFactor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetNegativeDiffusionFactor(const AValue: single);
begin
if AValue = FThemeSetCommon.FNegativeDiffusionFactor then
Exit;
FThemeSetCommon.FNegativeDiffusionFactor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetDiffuseSaturation(const AValue: boolean);
begin
if AValue = FThemeSetCommon.FDiffuseSaturation then
Exit;
FThemeSetCommon.FDiffuseSaturation := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightPositionX(const AValue: integer);
begin
if AValue = FThemeSetCommon.FLightPositionX then
Exit;
FThemeSetCommon.FLightPositionX := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightPositionY(const AValue: integer);
begin
if AValue = FThemeSetCommon.FLightPositionY then
Exit;
FThemeSetCommon.FLightPositionY := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetLightPositionZ(const AValue: integer);
begin
if AValue = FThemeSetCommon.FLightPositionZ then
Exit;
FThemeSetCommon.FLightPositionZ := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDFrameColor(const AValue: TColor);
begin
if AValue = FThemeSetLCD.FFrameColor then
Exit;
FThemeSetLCD.FFrameColor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDBoardColor(const AValue: TColor);
begin
if AValue = FThemeSetLCD.FBoardColor then
Exit;
FThemeSetLCD.FBoardColor := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDDotColorOn(const AValue: TColor);
begin
if AValue = FThemeSetLCD.FDotColorOn then
Exit;
FThemeSetLCD.FDotColorOn := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDFrameAltitude(const AValue: integer);
begin
if AValue = FThemeSetLCD.FFrameAltitude then
Exit;
FThemeSetLCD.FFrameAltitude := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDFrameHeight(const AValue: integer);
begin
if AValue = FThemeSetLCD.FFrameHeight then
Exit;
FThemeSetLCD.FFrameHeight := AValue;
if FThemeSetLCD.FFrameSize < FThemeSetLCD.FFrameHeight then FThemeSetLCD.FFrameSize := FThemeSetLCD.FFrameHeight;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDFrameSize(const AValue: integer);
begin
if AValue = FThemeSetLCD.FFrameSize then
Exit;
FThemeSetLCD.FFrameSize := AValue;
if FThemeSetLCD.FFrameSize < FThemeSetLCD.FFrameHeight then FThemeSetLCD.FFrameHeight := FThemeSetLCD.FFrameSize;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDFrameStyle(const AValue: TZStyle);
begin
if AValue = FThemeSetLCD.FFrameStyle then
Exit;
FThemeSetLCD.FFrameStyle := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDDotShape(const AValue: TDotShape);
begin
if AValue = FThemeSetLCD.FDotShape then
Exit;
FThemeSetLCD.FDotShape := AValue;
DoChange;
end;
procedure TBCLeaTheme.SetBLCDDotSize(const AValue: integer);
begin
if AValue = FThemeSetLCD.FDotSize then
Exit;
FThemeSetLCD.FDotSize := AValue;
DoChange;