forked from zsdwxm/KernowSoftwareFMX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ksTableView.pas
9274 lines (8001 loc) · 276 KB
/
ksTableView.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
{*******************************************************************************
* *
* TksTableView - High-Performance Mobile Scrolling List Component *
* *
* https://github.com/gmurt/KernowSoftwareFMX *
* *
* Copyright 2015 Graham Murt *
* *
* email: [email protected] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License forthe specific language governing permissions and *
* limitations under the License. *
* *
*******************************************************************************}
// Contributors
// ------------
//
// Thank you to the following for their contribution to this project:
//
// Simon Farmer
// Harry James
//
{ *** HTML SUPPORT - PLEASE READ ***
In order to use the HTML formatting within ksListView, you will need to have the
TMS Pack for FireMonkey installed.
You can get this from the following link...
http://www.tmssoftware.com/site/tmsfmxpack.asp
Once installed, simply uncomment the conditional define in ksComponents.inc }
unit ksTableView;
interface
{$I ksComponents.inc}
uses Classes, FMX.Controls, FMX.Layouts, FMX.Types, System.Types, System.Generics.Collections,
FMX.Graphics, FMX.Objects, FMX.InertialMovement, System.UITypes, System.TypInfo,
System.UIConsts, System.Rtti, FMX.DateTimeCtrls, FMX.StdCtrls, FMX.Utils,
FMX.Styles, FMX.Styles.Objects, FMX.Edit, FMX.SearchBox, FMX.ListBox, FMX.Effects,
ksTypes;
const
C_TABLEVIEW_DEFAULT_ITEM_HEIGHT = 44;
C_TABLEVIEW_DEFAULT_HEADER_HEIGHT = 32;
C_TABLEVIEW_DEFAULT_WIDTH = 200;
C_TABLEVIEW_DEFAULT_HEIGHT = 300;
C_TABLEVIEW_DEFAULT_SELECTED_COLOR = $FFD6EFF9;
C_TABLEVIEW_DEFAULT_FONT_SIZE = 13;
C_TABLEVIEW_DEFAULT_HEADER_COLOR = $FFF0F0F0;
C_TABLEVIEW_DEFAULT_INDICATOR_WIDTH = 6;
C_TABLEVIEW_DEFAULT_INDICATOR_HEIGHT = 0;
// default which stretches to row height
C_TABLEVIEW_DEFAULT_IMAGE_SIZE = 24;
C_TABLEVIEW_DEFAULT_SELECT_DURATION = 200;
C_TABlEVIEW_SCROLL_THRESHOLD = 10;
C_TABLEVIEW_REMOVEITEM_SIZE = 20;
C_TABLEVIEW_ACCESSORY_KEEPCOLOR = $20000000;
{$IFDEF MSWINDOWS}
C_SCROLL_BAR_WIDTH = 8;
{$ELSE}
C_SCROLL_BAR_WIDTH = 8;
{$ENDIF}
{$IFDEF ANDROID}
C_TABLEVIEW_PAGE_SIZE = 50;
{$ELSE}
C_TABLEVIEW_PAGE_SIZE = 50;
{$ENDIF}
type
TksTableViewItem = class;
TksTableViewItemObject = class;
TksTableView = class;
TksTableViewItems = class;
TksTableViewActionButtons = class;
TksTableViewActionButton = class;
TksTableViewItemSwitch = class;
TksTableViewItemTable = class;
TksTableViewItemEmbeddedBaseEdit = class;
TksTableViewItemEmbeddedEdit = class;
TksTableViewItemButton = class;
TksTableViewSelectionOptions = class;
TksTableViewItemEmbeddedDateEdit = class;
// TksTableViewItemBadge = class;
TksTableItemAlign = (Leading, Center, Trailing, Fit);
TksSwipeDirection = (ksSwipeUnknown, ksSwipeLeftToRight, ksSwipeRightToLeft, ksSwipeTopToBottom, ksSwipeBottomToTop);
TksTableViewShape = (ksRectangle, ksSquare, ksRoundRect, ksEllipse);
TksTableViewItemPurpose = (None, Header);
TksTableViewCheckMarks = (cmNone, cmSingleSelect, cmMultiSelect);
TksTableViewCheckMarkPosition = (cmpLeft, cmpRight);
TksTableViewChatBubblePosition = (ksCbpLeft, ksCbpRight);
TksTableViewCheckMarkCheckArea = (caWholeRow, caCheckMarkRect);
TksTableViewActionButtonAlignment = (abLeftActionButtons, abRightActionButtons);
TksImageDrawMode = (ksDrawModeStretch, ksDrawModeFit);
TksTableViewButtonStyle = (ksButtonDefault, ksButtonSegmentLeft, ksButtonSegmentMiddle, ksButtonSegmentRight);
TksTableViewButtonState = (ksPressed, ksUnpressed);
TksTableViewItemAppearance = ( iaNormal, iaTile_Image, iaTile_TitleImage, iaTile_ImageTitle, iaTile_TitleImageSubTitle, iaTile_SubTitleImageTitle );
TksTableItemSelector = (NoSelector, DateSelector, ItemPicker);
TksTableViewOverlaySelectorPosition = (ksSelectorLeft, ksSelectorRight );
TksTableViewOverlaySelectorStyle = (ksBlankSpace, ksArrow, ksSemiCircle);
TksTableViewHeaderButtonType = (hbtNone, hbtJumpToHeader);
TksEmbeddedEditStyle = (ksEditNormal, ksEditClearing, ksEditCombo, ksEditTransparent);
TksClearCacheType = (ksClearCacheAll, ksClearCacheNonVisible);
TksTableViewRowSelectAnimation = (ksRowSelectAniNone, ksRowSelectAniFromLeft, ksRowSelectAniFromRight);
TksTableViewRowIndicatorAlign = (ksRowIndicatorLeft, ksRowIndicatorRight);
TksTableBeginRowCacheEvent = procedure(Sender: TObject; ARow:TksTableViewItem) of object;
TksTableViewRowCacheEvent = procedure(Sender: TObject; ACanvas: TCanvas; ARow: TksTableViewItem; ARect: TRectF) of object;
TksTableViewDeletingItemEvent = procedure(Sender: TObject; AItem: TksTableViewItem; var ACanDelete: Boolean) of object;
TksTableViewDeleteItemEvent = procedure(Sender: TObject; AItem: TksTableViewItem) of object;
TksTableViewItemClickEvent = procedure(Sender: TObject; x, y: single; AItem: TksTableViewItem; AId: string; ARowObj: TksTableViewItemObject) of object;
TksItemSwipeEvent = procedure(Sender: TObject; ARow: TksTableViewItem; ASwipeDirection: TksSwipeDirection; AButtons: TksTableViewActionButtons) of object;
TksItemActionButtonClickEvent = procedure(Sender: TObject; ARow: TksTableViewItem; AButton: TksTableViewActionButton) of object;
TksTableViewItemSwitchEvent = procedure(Sender: TObject; AItem: TksTableViewItem; ASwitch: TksTableViewItemSwitch; ARowID: string) of object;
TksTableViewItemButtonEvent = procedure(Sender: TObject; AItem: TksTableViewItem; AButton: TksTableViewItemButton; ARowID: string) of object;
TksItemChecMarkChangedEvent = procedure(Sender: TObject; ARow: TksTableViewItem; AChecked: Boolean) of object;
TksTableViewSelectDateEvent = procedure(Sender: TObject; AItem: TksTableViewItem; ASelectedDate: TDateTime; var AAllow: Boolean) of object;
TksTableViewSelectPickerItem = procedure(Sender: TObject; AItem: TksTableViewItem; ASelected: string; var AAllow: Boolean) of object;
TksTableViewSelectPickerItemExt = procedure(Sender: TObject; AItem: TksTableViewItem; ASelected: string; AIndex: integer; var AAllow: Boolean) of object;
TksTableViewEmbeddedEditChange = procedure(Sender: TObject; ARow: TksTableViewItem; AEdit: TksTableViewItemEmbeddedBaseEdit; AText: string) of object;
TksTableViewEmbeddedDateEditChange = procedure(Sender: TObject; ARow: TksTableViewItem; ADateEdit: TksTableViewItemEmbeddedDateEdit; ADate: TDateTime) of object;
TksTableViewScrollChangeEvent = procedure(Sender: TObject; AScrollPos, AMaxScrollLimit: single) of object;
TksTableViewCanDragItemEvent = procedure(Sender: TObject; ADragRow: TksTableViewItem; var AllowDrag: Boolean) of object;
TksTableViewCanDropItemEvent = procedure(Sender: TObject; ADragRow, ADropRow: TksTableViewItem; var AllowDrop: Boolean) of object;
TksTableViewDropItemEvent = procedure(Sender: TObject; ADragRow, ADropRow: TksTableViewItem; var AllowMove: Boolean) of object;
TksTableViewSearchFilterChange = procedure(Sender: TObject; ASearchText: string) of object;
TksTableViewStickyHeaderChange = procedure(Sender: TObject; AFromStickHeader, AToStickHeader: TksTableViewItem) of object;
TksTableViewRowIndicatorExpandEvent = procedure(Sender: TObject; AItem: TksTableViewItem; ABackground: TAlphaColor; var AForeground: TAlphaColor) of object;
//---------------------------------------------------------------------------------------
// TksTableViewActionButton
TksTableViewActionButton = class
strict private
FWidth: integer;
FIcon: TBitmap;
FTextColor: TAlphaColor;
FColor: TAlphaColor;
FText: string;
FIsDeleteButton: Boolean;
FAccessory: TksAccessoryType;
procedure SetAccessory(const Value: TksAccessoryType);
public
constructor Create(AIsDelete: Boolean);
destructor Destroy; override;
procedure Render(ACanvas: TCanvas; ARect: TRectF);
property Accessory: TksAccessoryType read FAccessory write SetAccessory;
property Text: string read FText write FText;
property TextColor: TAlphaColor read FTextColor write FTextColor default claWhite;
property Color: TAlphaColor read FColor write FColor;
property Width: integer read FWidth write FWidth default 80;
property IsDeleteButton: Boolean read FIsDeleteButton write FIsDeleteButton;
end;
//---------------------------------------------------------------------------------------
// TksTableViewActionButtons
TksTableViewActionButtons = class(TObjectList<TksTableViewActionButton>)
strict private
[weak]FTableItem: TksTableviewItem;
[weak]FTableView: TksTableView;
FPercentWidth: integer;
FAlignment: TksTableViewActionButtonAlignment;
FAnimating: Boolean;
private
procedure SetPercentWidth(const Value: integer);
function GetVisible: Boolean;
procedure ShowButtons(AItem: TKsTableViewItem);
procedure HideButtons;
function TotalWidth: integer;
property PercentWidth: integer read FPercentWidth write SetPercentWidth;
property Visible: Boolean read GetVisible;
procedure Render(ACanvas: TCanvas; ARect: TRectF);
function ButtonFromXY(x, y: single): TksTableViewActionButton;
function AddDeleteButton: TksTableViewActionButton;
public
constructor Create(AOwner: TksTableView);
function AddButton(AText: string; AColor, ATextColor: TAlphaColor;
const AIcon: TksAccessoryType = atNone; const AWidth: integer = 60): TksTableViewActionButton;
property TableItem: TKsTableviewItem read FTableItem;
property Alignment: TksTableViewActionButtonAlignment read FAlignment write FAlignment;
end;
//---------------------------------------------------------------------------------------
// TksTableViewActionButtons
TksTableViewItemObject = class
private
[weak]FTableItem: TksTableViewItem;
[weak]FPositionRelativeTo : TksTableViewItemObject;
FAlign: TksTableItemAlign;
FVertAlign: TksTableItemAlign;
FID: string;
FSelected: Boolean;
FWidth: single;
FHeight: single;
FPlaceOffset: TPointF;
FHitTest: Boolean;
FOffsetX: single;
FOffsetY: single;
FShowSelection: Boolean;
FMouseDown: Boolean;
FMargins: TBounds;
FHeightPercentange : Single;
FWidthPercentange : Single;
FVisible: Boolean;
FItemRect: TRectF;
procedure SetHeight(const Value: single);
procedure SetWidth(const Value: single);
procedure SetHeightPercentange(const Value: single);
procedure SetWidthPercentange(const Value: single);
procedure SetPositionRelativeTo(const Value: TksTableViewItemObject);
procedure SetHitTest(const Value: Boolean);
procedure SetOffsetX(const Value: single);
procedure SetOffsetY(const Value: single);
procedure SetShowSelection(const Value: Boolean);
procedure SetSelected(const Value: Boolean);
procedure SetVisible(const Value: Boolean);
protected
function ConsumesClick: Boolean; virtual;
function GetItemRect: TRectF;
function GetObjectRect: TRectF; virtual;
procedure Changed;
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); virtual;
procedure SetAlign(Value: TksTableItemAlign);
procedure SetVertAlign(Value: TksTableItemAlign);
procedure SetID(Value: string);
property ObjectRect: TRectF read GetObjectRect;
procedure Deselect;
public
constructor Create(ATableItem: TksTableViewItem); virtual;
destructor Destroy; override;
procedure MouseDown(x, y: single); virtual;
procedure MouseUp(x, y: single); virtual;
property Align: TksTableItemAlign read FAlign write SetAlign;
property Height: single read FHeight write SetHeight;
property HitTest: Boolean read FHitTest write SetHitTest default True;
property ID: string read FID write SetID;
property Margins: TBounds read FMargins write FMargins;
property OffsetX: single read FOffsetX write SetOffsetX;
property OffsetY: single read FOffsetY write SetOffsetY;
property TableItem: TksTableViewItem read FTableItem;
property VertAlign: TksTableItemAlign read FVertAlign write SetVertAlign;
property Width: single read FWidth write SetWidth;
property ShowSelection: Boolean read FShowSelection write SetShowSelection default False;
property HeightPercentange: single read FHeightPercentange write SetHeightPercentange;
property WidthPercentange: single read FWidthPercentange write SetWidthPercentange;
property PositionRelativeTo: TksTableViewItemObject read FPositionRelativeTo write SetPositionRelativeTo;
property Selected: Boolean read FSelected write SetSelected default False;
property Visible: Boolean read FVisible write SetVisible default True;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewItemEmbeddedControl }
TksTableViewItemEmbeddedControl = class(TksTableViewItemObject)
private
FFocused: Boolean;
FCached: TBitmap;
procedure DoExitControl(Sender: TObject);
procedure ApplyStyle(AControl: TFmxObject);
protected
FControl: TStyledControl;
function CanFocus: Boolean; virtual;
function CreateControl: TStyledControl; virtual; abstract;
function GetControlBitmap(AForceRecreate: Boolean): TBitmap;
procedure InitializeControl; virtual;
procedure FocusControl; virtual;
procedure HideControl; virtual;
function ConsumesClick: Boolean; override;
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
procedure EnableEvents; virtual; abstract;
procedure DisableEvents; virtual; abstract;
public
constructor Create(ATableItem: TksTableViewItem); override;
destructor Destroy; override;
procedure MouseDown(x, y: single); override;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewItemEmbeddedBaseEdit }
TksTableViewItemEmbeddedBaseEdit = class(TksTableViewItemEmbeddedControl)
private
FStyle: TksEmbeddedEditStyle;
function GetCustomEdit: TCustomEdit;
procedure DoEditChange(Sender: TObject);
procedure SetStyle(const Value: TksEmbeddedEditStyle);
protected
function CanFocus: Boolean; override;
function GetText: string; virtual; abstract;
procedure SetText(const Value: string); virtual; abstract;
property CustomEdit: TCustomEdit read GetCustomEdit;
procedure FocusControl; override;
procedure HideControl; override;
procedure EnableEvents; override;
procedure DisableEvents; override;
property Text: string read GetText write SetText;
property Style: TksEmbeddedEditStyle read FStyle write SetStyle;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewItemEmbeddedEdit }
TksTableViewItemEmbeddedEdit = class(TksTableViewItemEmbeddedBaseEdit)
private
function GetEditControl: TEdit;
protected
function GetText: string; override;
procedure SetText(const Value: string); override;
function CreateControl: TStyledControl; override;
public
property Style;
property Text;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemEmbeddedDateEdit
TksTableViewItemEmbeddedDateEdit = class(TksTableViewItemEmbeddedControl)
private
function GetEditControl: TDateEdit;
procedure DoDateChanged(Sender: TObject);
protected
function GetDate: TDateTime;
procedure SetDate(const Value: TDateTime);
function CreateControl: TStyledControl; override;
procedure EnableEvents; override;
procedure DisableEvents; override;
public
property Date: TDateTime read GetDate write SetDate;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewItemButton }
TksTableViewItemButton = class(TksTableViewItemEmbeddedControl)
private
function GetButton: TSpeedButton;
function GetTintColor: TAlphaColor;
procedure SetTintColor(const Value: TAlphaColor);
function GetText: string;
procedure SetText(const Value: string);
procedure DoButtonClicked(Sender: TObject);
function GetStyleLookup: string;
procedure SetStyleLookup(const Value: string);
protected
function CreateControl: TStyledControl; override;
procedure EnableEvents; override;
procedure DisableEvents; override;
public
property TintColor: TAlphaColor read GetTintColor write SetTintColor;
property Text: string read GetText write SetText;
property StyleLookup: string read GetStyleLookup write SetStyleLookup;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewItemSwitch }
TksTableViewItemSwitch = class(TksTableViewItemEmbeddedControl)
private
FClickDelay: TFmxHandle;
function GetSwitch: TSwitch;
function GetChecked: Boolean;
procedure SetChecked(const Value: Boolean);
procedure DoSwitchClickedDelayed;
procedure DoSwitchClicked(Sender: TObject);
protected
function CreateControl: TStyledControl; override;
procedure EnableEvents; override;
procedure DisableEvents; override;
public
property Checked: Boolean read GetChecked write SetChecked;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewItemText }
TksTableViewItemText = class(TksTableViewItemObject)
private
FBackground: TAlphaColor;
FText: string;
FFont: TFont;
FTextColor: TAlphaColor;
FTextAlign: TTextAlign;
FTextVertAlign: TTextAlign;
FWordWrap: Boolean;
FTrimming: TTextTrimming;
FIsHtmlText: Boolean;
procedure SetText(const Value: string);
procedure SetFont(const Value: TFont);
procedure SetTextColor(const Value: TAlphaColor);
procedure SetTextAlign(const Value: TTextAlign);
procedure SetTextVertAlign(const Value: TTextAlign);
procedure SetWordWrap(const Value: Boolean);
procedure SetTrimming(const Value: TTextTrimming);
procedure SetBackground(const Value: TAlphaColor);
procedure FontChanged(Sender: TObject);
procedure SetIsHtmlText(const Value: Boolean);
protected
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
public
constructor Create(ATableItem: TksTableViewItem); override;
destructor Destroy; override;
function CalculateSize: TSizeF;
procedure Assign(ASource: TksTableViewItemText);
property Background: TAlphaColor read FBackground write SetBackground default claNull;
property Font: TFont read FFont write SetFont;
property Text: string read FText write SetText;
property TextColor: TAlphaColor read FTextColor write SetTextColor default claBlack;
property TextAlignment: TTextAlign read FTextAlign write SetTextAlign default TTextAlign.Leading;
property TextVertAlign: TTextAlign read FTextVertAlign write SetTextVertAlign default TTextAlign.Leading;
property Trimming: TTextTrimming read FTrimming write SetTrimming default TTextTrimming.Character;
property WordWrap: Boolean read FWordWrap write SetWordWrap default False;
property IsHtmlText: Boolean read FIsHtmlText write SetIsHtmlText;
end;
//---------------------------------------------------------------------------------------
{ TksTableViewShadow }
TksTableViewShadow = class(TPersistent)
private
FColor: TAlphaColor;
FOffset: integer ;
FVisible: Boolean;
public
constructor Create; virtual;
procedure Assign(ASource: TPersistent); override;
procedure SetVisible(const Value: Boolean);
property Color: TAlphaColor read FColor write FColor default claSilver;
property Offset: integer read FOffset write FOffset default 2;
property Visible: Boolean read FVisible write SetVisible default True;
end;
//---------------------------------------------------------------------------------------
{ TksListItemRowTableCell }
TksListItemRowTableCell = class(TPersistent)
private
[weak]FTable: TksTableViewItemTable;
FRow, FCol: integer;
FTextSettings: TTextSettings;
FFill: TBrush;
FStroke: TStrokeBrush;
FText: string;
FWidth: single;
FHeight: single;
FPadding: TBounds;
FVisible: Boolean;
FSides: TSides;
procedure SetText(const Value: string);
procedure SetTextSettings(const Value: TTextSettings);
procedure SetVisible(const Value: Boolean);
procedure Changed;
function GetShadow: TksTableViewShadow;
public
constructor Create(ATable: TksTableViewItemTable); virtual;
destructor Destroy; override;
function IsFixedCell: Boolean;
procedure DrawToCanvas(x, y: single; ACanvas: TCanvas; ACol, ARow: integer; AShadow: TksTableViewShadow; AText: Boolean);
property Fill: TBrush read FFill;
property Stroke: TStrokeBrush read FStroke;
property TextSettings: TTextSettings read FTextSettings write SetTextSettings;
property Text: string read FText write SetText;
property Width: single read FWidth write FWidth;
property Height: single read FHeight write FHeight;
property Padding: TBounds read FPadding write FPadding;
property Shadow: TksTableViewShadow read GetShadow;
property Sides: TSides read FSides write FSides;
property Visible: Boolean read FVisible write SetVisible default True;
end;
TksListItemRowTableRow = array of TksListItemRowTableCell;
//---------------------------------------------------------------------------------------
// TksListItemRowTableBanding
TksListItemRowTableBanding = class(TPersistent)
private
FActive: Boolean;
FColor2: TAlphaColor;
FColor1: TAlphaColor;
procedure SetActive(const Value: Boolean);
public
constructor Create; virtual;
procedure Assign(ASource: TPersistent); override;
property Color1: TAlphaColor read FColor1 write FColor1 default claNull;
property Color2: TAlphaColor read FColor2 write FColor2 default claNull;
property Active: Boolean read FActive write SetActive;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemTable
TksTableViewItemTable = class(TksTableViewItemObject)
private
FBackground: TAlphaColor;
FBorderColor: TAlphaColor;
FRows: array of TksListItemRowTableRow;
FRowCount: integer;
FColCount: integer;
FDefaultRowHeight: single;
FDefaultColWidth: single;
FShadow: TksTableViewShadow;
FFixedCellColor: TAlphaColor;
FFixedRows: integer;
FFixedCols: integer;
FBanding: TksListItemRowTableBanding;
procedure SetColCount(const Value: integer);
procedure SetRowCount(const Value: integer);
procedure SetBackgroundColor(const Value: TAlphaColor);
procedure SetBorderColor(const Value: TAlphaColor);
procedure SetDefaultColWidth(const Value: single);
procedure SetDefaultRowHeight(const Value: single);
procedure ResizeTable;
function GetColWidths(ACol: integer): single;
procedure SetColWidths(ACol: integer; const Value: single);
function GetCells(ACol, ARow: integer): TksListItemRowTableCell;
function GetTableSize: TSizeF;
procedure RenderTableContents(ACanvas: TCanvas; AText: Boolean);
procedure SetFixedCellColor(const Value: TAlphaColor);
procedure SetBanding(const Value: TksListItemRowTableBanding);
protected
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
public
constructor Create(ARow: TKsTableViewItem); override;
destructor Destroy; override;
procedure Clear;
procedure MergeRowCells(x, y, AMergeCount: integer);
procedure SetRowColor(ARow: integer; AColor: TAlphaColor);
procedure SetColColor(ACol: integer; AColor: TAlphaColor);
procedure SetRowFont(ARow: integer; AFontName: TFontName; AColor: TAlphaColor; ASize: integer; AStyle: TFontStyles);
procedure SetColFont(ACol: integer; AFontName: TFontName; AColor: TAlphaColor; ASize: integer; AStyle: TFontStyles);
property Background: TAlphaColor read FBackground write SetBackgroundColor default claWhite;
property Banding: TksListItemRowTableBanding read FBanding write SetBanding;
property BorderColor: TAlphaColor read FBorderColor write SetBorderColor default claBlack;
property FixCellColor: TAlphaColor read FFixedCellColor write SetFixedCellColor default claGainsboro;
property FixedRows: integer read FFixedRows write FFixedRows default 1;
property FixedCols: integer read FFixedCols write FFixedCols default 1;
property Cells[ACol, ARow: integer]: TksListItemRowTableCell read GetCells;
property ColCount: integer read FColCount write SetColCount;
property RowCount: integer read FRowCount write SetRowCount;
property DefaultRowHeight: single read FDefaultRowHeight write SetDefaultRowHeight;
property DefaultColWidth: single read FDefaultColWidth write SetDefaultColWidth;
property ColWidths[ACol: integer]: single read GetColWidths write SetColWidths;
property Shadow: TksTableViewShadow read FShadow;
property TableSize: TSizeF read GetTableSize;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemBaseImage
TksTableViewItemBaseImage = class(TksTableViewItemObject)
strict private
FBitmap: TBitmap;
FDrawMode: TksImageDrawMode;
FShadow: TksTableViewShadow;
FHighQuality: Boolean;
FBadgeValue: integer;
FBadgeColor: TAlphaColor;
FBadgeTextColor: TAlphaColor;
[weak]FExternalBitmap: TBitmap;
private
FOwnsBitmap: Boolean;
procedure SetBitmap(const Value: TBitmap);
function GetBitmap: TBitmap;
procedure SetOwnsBitmap(const Value: Boolean);
procedure SetShadow(const Value: TksTableViewShadow);
procedure SetDrawMode(const Value: TksImageDrawMode);
procedure SetHighQuality(const Value: Boolean);
procedure SetBadgeValue(const Value: integer);
procedure SetBadgeColor(const Value: TAlphaColor);
procedure SetBadgeTextColor(const Value: TAlphaColor);
protected
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
procedure Clear;
procedure DoBeforeRenderBitmap(ABmp: TBitmap); virtual;
property Bitmap: TBitmap read GetBitmap write SetBitmap;
property Shadow: TksTableViewShadow read FShadow write SetShadow;
property OwnsBitmap: Boolean read FOwnsBitmap write SetOwnsBitmap default False;
property DrawMode: TksImageDrawMode read FDrawMode write SetDrawMode default ksDrawModeStretch;
property HighQuality: Boolean read FHighQuality write SetHighQuality default False;
property BadgeValue: integer read FBadgeValue write SetBadgeValue;
property BadgeColor: TAlphaColor read FBadgeColor write SetBadgeColor default claRed;
property BadgeTextColor: TAlphaColor read FBadgeTextColor write SetBadgeTextColor default claWhite;
public
constructor Create(ATableItem: TksTableViewItem); override;
destructor Destroy; override;
procedure Assign(ASource: TksTableViewItemBaseImage);
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemImage
TksTableViewItemImage = class(TksTableViewItemBaseImage)
public
property Bitmap;
property Shadow;
property DrawMode;
property OwnsBitmap;
property HighQuality;
property BadgeValue;
property BadgeColor;
property BadgeTextColor;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemShape
TksTableViewBaseItemShape = class(TksTableViewItemObject)
private
FStroke: TStrokeBrush;
FFill: TBrush;
FShape: TksTableViewShape;
FCornerRadius: single;
procedure SetCornerRadius(const Value: single);
procedure SetFill(const Value: TBrush);
procedure SetShape(const Value: TksTableViewShape);
procedure SetStroke(const Value: TStrokeBrush);
protected
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
property Stroke: TStrokeBrush read FStroke write SetStroke;
property Fill: TBrush read FFill write SetFill;
property Shape: TksTableViewShape read FShape write SetShape;
property CornerRadius: single read FCornerRadius write SetCornerRadius;
public
constructor Create(ATableItem: TksTableViewItem); override;
destructor Destroy; override;
end;
TksTableViewItemShape = class(TksTableViewBaseItemShape)
public
property Stroke;
property Fill;
property Shape;
property CornerRadius;
end;
TksTableViewChatBubble = class(TksTableViewItemShape)
private
FText: string;
FFont: TFont;
FTextColor: TAlphaColor;
FPosition: TksTableViewChatBubblePosition;
procedure SetFont(const Value: TFont);
procedure SetText(const Value: string);
procedure SetTextColor(const Value: TAlphaColor);
protected
procedure RecalculateSize;
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
public
constructor Create(ATableItem: TksTableViewItem); override;
destructor Destroy; override;
property Text: string read FText write SetText;
property Font: TFont read FFont write SetFont;
property TextColor: TAlphaColor read FTextColor write SetTextColor;
property Position: TksTableViewChatBubblePosition read FPosition write FPosition;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemTileBackground
TksTableViewItemTileBackground = class(TksTableViewItemShape)
private
FPadding: TBounds;
public
constructor Create(ATableItem: TksTableViewItem); override;
destructor Destroy; override;
procedure Assign(ASource: TksTableViewItemTileBackground);
property Padding: TBounds read FPadding write FPadding;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemAccessory
TksTableViewItemAccessory = class(TksTableViewItemImage)
strict private
FColor: TAlphaColor;
private
FAccessory: TksAccessoryType;
procedure RedrawAccessory;
protected
procedure DoBeforeRenderBitmap(ABmp: TBitmap); override;
procedure SetAccessory(const Value: TksAccessoryType);
procedure SetColor(const Value: TAlphaColor);
procedure Render(AItemRect: TRectF; ACanvas: TCanvas); override;
public
constructor Create(ATableItem: TksTableViewItem); override;
property Accessory: TksAccessoryType read FAccessory write SetAccessory;
property Color: TAlphaColor read FColor write SetColor default claNull;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItemObjects
TksTableViewItemObjects = class(TObjectList<TksTableViewItemObject>)
private
[weak]FTableView: TksTableView;
function GetObjectByID(AId: string): TksTableViewItemObject;
function GetImageByID(AId: string): TksTableViewItemImage;
function GetTextByID(AId: string): TksTableViewItemText;
public
constructor Create(ATableView: TksTableView); virtual;
property ObjectByID[AId: string]: TksTableViewItemObject read GetObjectByID;
property ImageByID[AId: string]: TksTableViewItemImage read GetImageByID;
property TextByID[AId: string]: TksTableViewItemText read GetTextByID;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItem
TksTableViewItem = class
private
[weak]FTableView: TksTableView;
[weak]FCheckMarkAccessory: TksTableViewItemAccessory;
[weak]FTagObject: TObject;
[weak]FOwner: TksTableViewItems;
FData: TDictionary<string, TValue>;
FID: string;
FAbsoluteIndex: integer;
FIndicator: TksTableViewItemShape;
FTileBackground: TksTableViewItemTileBackground;
FImage: TksTableViewItemImage;
FTitle: TksTableViewItemText;
FSubTitle: TksTableViewItemText;
FDetail: TksTableViewItemText;
FAccessory: TksTableViewItemAccessory;
FHeight: single;
FHeightPercentage: single;
FHeaderHeight: single;
FIsStickyHeader: boolean;
FItemRect: TRectF;
FCached: Boolean;
FCaching: Boolean;
_FBitmap: TBitmap;
FIndex: integer;
FSearchIndex: string;
FSearchFilter: string;
FChecked: Boolean;
FUpdating: Boolean;
FPurpose: TksTableViewItemPurpose;
FObjects: TksTableViewItemObjects;
FSelectionValue: Variant;
FFont: TFont;
FTextColor: TAlphaColor;
FCanSelect: Boolean;
FTagString: string;
FTagInteger: integer;
FSelector: TksTableItemSelector;
FPickerItems: TStrings;
FColCount: integer;
FIsFirstCol : Boolean;
FIsLastCol : Boolean;
FIsFirstRow : Boolean;
FIsLastRow : Boolean;
FIsFixedHeader : Boolean;
FIsFixedFooter : Boolean;
FAppearance : TksTableViewItemAppearance;
FDragging: Boolean;
FFill : TBrush;
FCheckmarkAllowed: Boolean;
FHidden: Boolean;
FDeleting: Boolean;
FForegroundColor: TAlphaColor;
function MatchesSearch(AFilter: string): Boolean;
function IsVisible(AViewport: TRectF): Boolean;
function GetInternalRect: TRectF;
//procedure SetSearchIndex(const Value: string);
procedure SetItemRect(const Value: TRectF);
procedure SetIndex(const Value: integer);
procedure SetAppearance(const Value: TksTableViewItemAppearance);
procedure SetHidden(const Value: Boolean);
procedure Changed;
procedure RealignStandardObjects;
procedure SetHeight(const Value: single);
procedure SetHeightPercentage(const Value: single);
procedure SetCached(const Value: Boolean);
procedure SetPurpose(const Value: TksTableViewItemPurpose);
procedure SetColCount(const Value: Integer);
procedure SetFont(const Value: TFont);
procedure SetTextColor(const Value: TAlphaColor);
procedure SetChecked(const Value: Boolean);
function CheckMarkClicked(x, y: single) : Boolean;
procedure DoClick(x, y: single);
function GetIndicatorColor: TAlphaColor;
procedure SetIndicatorColor(const Value: TAlphaColor);
procedure DoSwipe(ADirecton: TksSwipeDirection);
procedure SetPickerItems(const Value: TStrings);
procedure PickerItemsChanged(Sender: TObject);
function GetItemData(const AIndex: string): TValue;
procedure SetItemData(const AIndex: string; const Value: TValue);
function GetHasData(const AIndex: string): Boolean;
procedure DeselectObjects;
procedure SetFill(const Value: TBrush);
procedure SelectFirstEmbeddedEdit;
function IsHeader: Boolean;
procedure Invalidate;
function GetImageByID(AID: string): TksTableViewItemImage;
function GetTextByID(AID: string): TksTableViewItemText;
procedure SetSearchFilter(const Value: string);
protected
function Render(ACanvas: TCanvas; AScrollPos: single): TRectF;
procedure CacheItem(const AForceCache: Boolean = False);
procedure UpdateSearchIndex;
public
constructor Create(ATableView: TksTableView); reintroduce; virtual;
destructor Destroy; override;
function TimeToCacheItem: integer;
function ObjectAtPos(x, y: single): TksTableViewItemObject;
function IsLastItem: Boolean;
//procedure RecreateCache;
procedure ClearCache;
procedure ExpandIndicatorToWidth;
// image functions...
function DrawBitmap(ABmp: TBitmap; ARect: TRectF; const AVertAlign: TksTableItemAlign = Center): TksTableViewItemImage; overload;
function DrawBitmap(ABmp: TBitmap; x, AWidth, AHeight: single; const AVertAlign: TksTableItemAlign = Center): TksTableViewItemImage; overload;
function DrawBitmap(ABmp: TBitmap; x, y, AWidth, AHeight: single; const AVertAlign: TksTableItemAlign = Center): TksTableViewItemImage overload;
// text functions...
function TextWidth(AText: string; AIsHtml: Boolean): single;
function TextHeight(AText: string; AWordWrap, AIsHtml: Boolean; ATrimming: TTextTrimming; const AMaxWidth: single): single;
procedure SetItemFontStyle(AFontStyle: TFontStyles);
procedure SetItemTextColor(AColor: TAlphaColor);
function TextOut(AText: string; x: single; const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center; const AWordWrap: Boolean = False): TksTableViewItemText; overload;
function TextOut(AText: string; x, AWidth: single; const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center; const AWordWrap: Boolean = False): TksTableViewItemText; overload;
function TextOut(AText: string; x, y, AWidth: single; const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center; const AWordWrap: Boolean = False): TksTableViewItemText; overload;
function TextBox(AText: string; ARect: TRectF; ATextAlign: TTextAlign; ATextLayout: TTextAlign; const ABackground: TAlphaColor = claNull): TksTableViewItemText; overload;
function TextBoxHtml(AText: string; ARect: TRectF): TksTableViewItemText;
function TextOutRight(AText: string; y, AWidth: single; AXOffset: single; const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center): TksTableViewItemText; overload;
// shape functions...
function DrawChatBubble(AText: string; APosition: TksTableViewChatBubblePosition; AColor, ATextColor: TAlphaColor): TksTableViewChatBubble;
function DrawRect(x, y, AWidth, AHeight: single; AStroke, AFill: TAlphaColor; const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center): TksTableViewItemShape; overload;
function DrawRect(ARect: TRectF; AStroke, AFill: TAlphaColor; const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center): TksTableViewItemShape; overload;
function AddButton(AWidth: integer; AText: string;
const ATintColor: TAlphaColor = claNull;
const AVertAlign: TksTableItemAlign = TksTableItemAlign.Center;
const AYPos: integer = 0): TksTableViewItemButton; overload;
function AddButton(AStyle: TksTableViewButtonStyle; const ATintColor: TAlphaColor = claNull): TksTableViewItemButton; overload;
function AddEdit(AX, AY, AWidth: single; AText: string; const AStyle: TksEmbeddedEditStyle = TksEmbeddedEditStyle.ksEditNormal): TksTableViewItemEmbeddedEdit;
function AddDateEdit(AX, AY, AWidth: single; ADate: TDateTime): TksTableViewItemEmbeddedDateEdit;
function AddSwitch(x: single; AIsChecked: Boolean; const AAlign: TksTableItemAlign = TksTableItemAlign.Trailing): TksTableViewItemSwitch;
function AddTable(AX, AY, AColWidth, ARowHeight: single; AColCount, ARowCount: integer): TksTableViewItemTable;
property AbsoluteIndex: integer read FAbsoluteIndex;
property Accessory: TksTableViewItemAccessory read FAccessory;
property CheckMarkAccessory: TksTableViewItemAccessory read FCheckMarkAccessory;
property CanSelect: Boolean read FCanSelect write FCanSelect default True;
property Checked: Boolean read FChecked write SetChecked default False;
property Data[const AIndex: string]: TValue read GetItemData write SetItemData;
property Font: TFont read FFont write SetFont;
property HasData[const AIndex: string]: Boolean read GetHasData;
property Height: single read FHeight write SetHeight;
property HeightPercentage: single read FHeightPercentage write SetHeightPercentage;
property ItemRect: TRectF read FItemRect write SetItemRect;
property IndicatorColor: TAlphaColor read GetIndicatorColor write SetIndicatorColor;
property ID: string read FID write FID;
property TileBackground : TksTableViewItemTileBackground read FTileBackground;
property Image: TksTableViewItemImage read FImage;
property Title: TksTableViewItemText read FTitle;
property SubTitle: TksTableViewItemText read FSubTitle;
property TextColor: TAlphaColor read FTextColor write SetTextColor default claBlack;
property Detail: TksTableViewItemText read FDetail;
property Index: integer read FIndex write SetIndex;
//property SearchIndex: string read GetSearchIndex;
property SearchFilter: string read FSearchFilter write SetSearchFilter;
property Objects: TksTableViewItemObjects read FObjects;
property ImageByID[AID: string]: TksTableViewItemImage read GetImageByID;
property TextByID[AID: string]: TksTableViewItemText read GetTextByID;
property Cached: Boolean read FCached write SetCached default False;
property PickerItems: TStrings read FPickerItems write SetPickerItems;
property Purpose: TksTableViewItemPurpose read FPurpose write SetPurpose default None;
property Selector: TksTableItemSelector read FSelector write FSelector;
property TableView: TksTableView read FTableView;
property TagString: string read FTagString write FTagString;
property TagInteger: integer read FTagInteger write FTagInteger default 0;
property TagObject: TObject read FTagObject write FTagObject;
property ColCount: integer read FColCount write SetColCount default 0;
property IsFirstCol: Boolean read FIsFirstCol;
property IsLastCol: Boolean read FIsLastCol;
property IsFirstRow: Boolean read FIsFirstRow;
property IsLastRow: Boolean read FIsLastRow;
property Appearance: TksTableViewItemAppearance read FAppearance write SetAppearance default iaNormal;
property Fill: TBrush read FFill write SetFill;
property IsStickyHeader: Boolean read FIsStickyHeader;
property Hidden: Boolean read FHidden write SetHidden default false;
end;
//---------------------------------------------------------------------------------------
// TksTableViewItems
TksTableViewItems = class(TObjectList<TksTableViewItem>)
private
FCachedCount: integer;
{$IFNDEF VER310}
[weak]FTableView: TksTableView;
procedure UpdateIndexes;
{$ENDIF}
function GetLastItem: TksTableViewItem;
function GetFirstItem: TksTableViewItem;
function GetItemByID(AID: string): TksTableViewItem;
protected
{$IFDEF VER310}
[weak]FTableView: TksTableView;
procedure UpdateIndexes;
{$ENDIF}
function GetTotalItemHeight: single;
public
constructor Create(ATableView: TksTableView; AOwnsObjects: Boolean); virtual;
procedure Move(CurIndex, NewIndex: Integer); overload;
function AddHeader(AText: string): TksTableViewItem;
function AddItem(AText: string; const AAccessory: TksAccessoryType = atNone): TksTableViewItem; overload;
function AddItem(AText, ADetail: string; const AAccessory: TksAccessoryType = atNone): TksTableViewItem; overload;
function AddItem(AText, ASubTitle, ADetail: string; const AAccessory: TksAccessoryType = atNone): TksTableViewItem; overload;
function AddChatBubble(AText: string; APosition: TksTableViewChatBubblePosition; AColor, ATextColor: TAlphaColor; const AUserImage: TBitmap): TksTableViewChatBubble;
function AddDateSelector(AText: string; ADate: TDateTime): TksTableViewItem;
function AddItemSelector(AText, ASelected: string; AItems: TStrings): TksTableViewItem; overload;
function AddItemSelector(AText, ASelected: string; AItems: array of string): TksTableViewItem; overload;
function AddItemWithSwitch(AText: string; AChecked: Boolean; AID: string): TksTableViewItem;
property ItemByID[AID: string]: TksTableViewItem read GetItemByID;
function GetCheckedCount: integer;
procedure Delete(AIndex: integer; const AAnimate: Boolean = True); reintroduce;
procedure DeleteItem(AItem: TksTableViewItem; const AAnimate: Boolean = True);
property FirstItem: TksTableViewItem read GetFirstItem;
property LastItem: TksTableViewItem read GetLastItem;
property CachedCount: integer read FCachedCount;
end;
//---------------------------------------------------------------------------------------
// TksTableViewBackgroundText
TksTableViewBackgroundText = class(TPersistent)
private
FFont: TFont;
FTextColor: TAlphaColor;
FText: string;
FEnabled: Boolean;
procedure SetFont(const Value: TFont);
procedure SetText(const Value: string);
procedure SetTextColor(const Value: TAlphaColor);
procedure SetEnabled(const Value: Boolean);
public
constructor Create; virtual;
destructor Destroy; override;
procedure Assign(ASource: TPersistent); override;
published