Repository navigation
Expand file tree
/
Copy pathSCPanels.pas
More file actions
11493 lines (9698 loc) · 281 KB
/
Copy pathSCPanels.pas
File metadata and controls
11493 lines (9698 loc) · 281 KB
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
{*******************************************************}
{ }
{ CA SweetControls Component Library }
{ }
{ Copyright (c) 1996,2004 CodeAccelerate Corporation }
{ }
{*******************************************************}
unit SCPanels;
{$I SweetControls.inc}
interface
uses
Windows, Messages, SysUtils, Consts, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, StdActns, ActnList, Menus, SCCommon, SCConsts, SCControl;
type
TSCCustomGroup = class;
TSCCustomAdvGroup = class;
TSCAdvPanelPictureProps = class(TSCPictureProps);
TSCAdvPanelStyle = (scasCustom, scasExplorerBar, scasMXBar,
scasOfficeXP, scasOutlookBar, scasOutlookBar2k, scasOutlookBarXP,
scasTaskList, scasAdvXPBar, scasXPBar);
TSCCustomGroup = class(TSCCustomScrollControl)
private
FBevel: TSCControlBevel;
FBevelColor: TColor;
FBevelDotted: Boolean;
FBevelEx: Boolean;
FBevelWidth: Integer;
FEndColor: TColor;
FGradient: TSCGradient;
FStyle: TSCAdvPanelStyle;
FUseExGradient: Boolean;
FAutoSizeDocking: Boolean;
FSettingStyle: Boolean;
FInStyleChange: Boolean;
FIsMouseDown: Boolean;
FIsMouseInControl: Boolean;
procedure SetBevel(Value: TSCControlBevel);
procedure SetBevelColor(Value: TColor);
procedure SetBevelDotted(Value: Boolean);
procedure SetBevelEx(Value: Boolean);
procedure SetBevelWidth(Value: Integer);
procedure SetEndColor(Value: TColor);
procedure SetGradient(Value: TSCGradient);
procedure SetStyle(Value: TSCAdvPanelStyle);
procedure SetUseExGradient(Value: Boolean);
procedure CMDockClient(var Message: TCMDockClient); message CM_DOCKCLIENT;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message WM_ERASEBKGND;
protected
procedure Paint; override;
procedure AdjustClientRect(var Rect: TRect); override;
function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;
function GetPicturePropsClass: TSCCustomPicturePropsClass; override;
function CanGetFocus: Boolean; override;
function GetBlendValue: Word; override;
procedure UpdateTracking; dynamic;
procedure ApplyStyle(S: TSCAdvPanelStyle; DoUpdate: Boolean); dynamic;
procedure UpdateCaptionFont(F: TFont); virtual;
function GetPanelCaption: String; virtual;
procedure DoDrawCaptionText(Cnv: TCanvas; var R: TRect; CalcRect: Boolean = False); virtual;
function IsOutlookStyle: Boolean;
function BevelSize: Integer; dynamic;
function HasGradient: Boolean;
property InStyleChange: Boolean read FInStyleChange;
property SettingStyle: Boolean read FSettingStyle;
property Bevel: TSCControlBevel read FBevel write SetBevel default sccbFlat;
property BevelColor: TColor read FBevelColor write SetBevelColor default clBtnHighlight;
property BevelDotted: Boolean read FBevelDotted write SetBevelDotted default False;
property BevelEx: Boolean read FBevelEx write SetBevelEx default True;
property BevelWidth: Integer read FBevelWidth write SetBevelWidth default 0;
property Color default clBtnFace;
property EndColor: TColor read FEndColor write SetEndColor default clBtnHighlight;
property Gradient: TSCGradient read FGradient write SetGradient default scgNone;
property IsMouseInControl: Boolean read FIsMouseInControl;
property IsMouseDown: Boolean read FIsMouseDown;
property ParentColor default False;
property UseExGradient: Boolean read FUseExGradient write SetUseExGradient default False;
property Style: TSCAdvPanelStyle read FStyle write SetStyle default scasCustom;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
end;
TSCAdvGroupButtons = class(TPersistent)
private
FOwner: TSCCustomAdvGroup;
FColor: TColor;
FDisabledColor: TColor;
FDownColor: TColor;
FFrameColor: TColor;
FHotColor: TColor;
FIconColor: TColor;
FIconDisabledColor: TColor;
FIconDownColor: TColor;
FIconHotColor: TColor;
FOnChange: TNotifyEvent;
procedure SetColor(Value: TColor);
procedure SetDisabledColor(Value: TColor);
procedure SetDownColor(Value: TColor);
procedure SetFrameColor(Value: TColor);
procedure SetHotColor(Value: TColor);
procedure SetIconColor(Value: TColor);
procedure SetIconDisabledColor(Value: TColor);
procedure SetIconDownColor(Value: TColor);
procedure SetIconHotColor(Value: TColor);
protected
procedure DoChange; dynamic;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
public
constructor Create(AOwner: TSCCustomAdvGroup); virtual;
procedure Assign(Source: TPersistent); override;
property Owner: TSCCustomAdvGroup read FOwner;
published
property Color: TColor read FColor write SetColor default clWindow;
property DisabledColor: TColor read FDisabledColor write SetDisabledColor default clWindow;
property DownColor: TColor read FDownColor write SetDownColor default clWindow;
property FrameColor: TColor read FFrameColor write SetFrameColor default clBtnShadow;
property HotColor: TColor read FHotColor write SetHotColor default clWindow;
property IconColor: TColor read FIconColor write SetIconColor default clHighlight;
property IconDisabledColor: TColor read FIconDisabledColor write SetIconDisabledColor default clBtnShadow;
property IconDownColor: TColor read FIconDownColor write SetIconDownColor default clIconDownColor;
property IconHotColor: TColor read FIconHotColor write SetIconHotColor default clIconHotColor;
end;
TSCAdvGroupCaption = class(TPersistent)
private
FOwner: TSCCustomAdvGroup;
FCloseButton: TImageIndex;
FColor: TColor;
FEndColor: TColor;
FGradient: TSCGradient;
FIcon: TImageIndex;
FLineColor: TColor;
FDownButton: TImageIndex;
FUpButton: TImageIndex;
FUnderline: Boolean;
FLockChange: Boolean;
FOnChange: TNotifyEvent;
procedure SetCloseButton(Value: TImageIndex);
procedure SetColor(Value: TColor);
procedure SetEndColor(Value: TColor);
procedure SetGradient(Value: TSCGradient);
procedure SetIcon(Value: TImageIndex);
procedure SetLineColor(Value: TColor);
procedure SetDownButton(Value: TImageIndex);
procedure SetUpButton(Value: TImageIndex);
procedure SetUnderline(Value: Boolean);
protected
procedure LockChange;
procedure UnlockChange;
procedure DoChange; dynamic;
function GetOwner: TPersistent; override;
function GetImages: TCustomImageList;
function GetIcons: TCustomImageList;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
public
constructor Create(AOwner: TSCCustomAdvGroup); virtual;
procedure Assign(Source: TPersistent); override;
property Owner: TSCCustomAdvGroup read FOwner;
published
property CloseButton: TImageIndex read FCloseButton write SetCloseButton default -1;
property Color: TColor read FColor write SetColor default clBtnHighlight;
property EndColor: TColor read FEndColor write SetEndColor default clBtnFace;
property Gradient: TSCGradient read FGradient write SetGradient default scgLeftToRight;
property Icon: TImageIndex read FIcon write SetIcon default -1;
property LineColor: TColor read FLineColor write SetLineColor default clHighlight;
property DownButton: TImageIndex read FDownButton write SetDownButton default -1;
property UpButton: TImageIndex read FUpButton write SetUpButton default -1;
property Underline: Boolean read FUnderline write SetUnderline default False;
end;
TSCCaptionPart = (sccpNone, sccpCaption, sccpIcon, sccpClose, sccpRoll);
TSCAdvGroupButton = (scgbClose, scgbDown, scgbUp);
TSCGroupCaptionStyle = (scgcNone, scgcFlat, scgcRaised, scgc3DRaised,
scgcSoft3D, scgcSoftRaised, scgcSoftFlat);
TSCAdvGroupCaptionSettings = class(TPersistent)
private
FOwner: TSCCustomAdvGroup;
function GetButtonColors: TSCAdvGroupButtons;
procedure SetButtonColors(Value: TSCAdvGroupButtons);
function GetCursor: TCursor;
procedure SetCursor(Value: TCursor);
function GetDefaultButtons: Boolean;
procedure SetDefaultButtons(Value: Boolean);
function GetDefaultIcon: Boolean;
procedure SetDefaultIcon(Value: Boolean);
function GetDefaultProps: TSCAdvGroupCaption;
procedure SetDefaultProps(Value: TSCAdvGroupCaption);
function GetDisabledFontColor: TColor;
procedure SetDisabledFontColor(Value: TColor);
function GetDisabledProps: TSCAdvGroupCaption;
procedure SetDisabledProps(Value: TSCAdvGroupCaption);
function GetDownFontColor: TColor;
procedure SetDownFontColor(Value: TColor);
function GetFont: TFont;
procedure SetFont(Value: TFont);
function GetHeight: Integer;
procedure SetHeight(Value: Integer);
function GetHint: String;
procedure SetHint(const Value: String);
function GetHotFontColor: TColor;
procedure SetHotFontColor(Value: TColor);
function GetHotProps: TSCAdvGroupCaption;
procedure SetHotProps(Value: TSCAdvGroupCaption);
function GetHottrack: Boolean;
procedure SetHottrack(Value: Boolean);
function GetHottrackButtons: Boolean;
procedure SetHottrackButtons(Value: Boolean);
function GetImages: TCustomImageList;
procedure SetImages(Value: TCustomImageList);
function GetStyle: TSCGroupCaptionStyle;
procedure SetStyle(Value: TSCGroupCaptionStyle);
protected
function GetOwner: TPersistent; override;
public
constructor Create(AOwner: TSCCustomAdvGroup); virtual;
procedure Assign(Source: TPersistent); override;
property Owner: TSCCustomAdvGroup read FOwner;
published
property ButtonColors: TSCAdvGroupButtons read GetButtonColors write SetButtonColors;
property Cursor: TCursor read GetCursor write SetCursor default crHandPoint;
property DefaultButtons: Boolean read GetDefaultButtons write SetDefaultButtons default True;
property DefaultIcon: Boolean read GetDefaultIcon write SetDefaultIcon default True;
property DefaultProps: TSCAdvGroupCaption read GetDefaultProps write SetDefaultProps;
property DisabledFontColor: TColor read GetDisabledFontColor write SetDisabledFontColor default clPanelDisabledColor;
property DisabledProps: TSCAdvGroupCaption read GetDisabledProps write SetDisabledProps;
property DownFontColor: TColor read GetDownFontColor write SetDownFontColor default clPanelDownColor;
property Font: TFont read GetFont write SetFont;
property Height: Integer read GetHeight write SetHeight default -1;
property Hint: String read GetHint write SetHint;
property HotFontColor: TColor read GetHotFontColor write SetHotFontColor default clPanelHotColor;
property HotProps: TSCAdvGroupCaption read GetHotProps write SetHotProps;
property Hottrack: Boolean read GetHottrack write SetHottrack default True;
property HottrackButtons: Boolean read GetHottrackButtons write SetHottrackButtons default True;
property Images: TCustomImageList read GetImages write SetImages;
property Style: TSCGroupCaptionStyle read GetStyle write SetStyle default scgcNone;
end;
TSCGroupCaptionEvent = procedure(Sender: TObject; X, Y: Integer;
Part: TSCCaptionPart) of object;
TSCGroupCaptionMouseEvent = procedure(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer; Part: TSCCaptionPart) of object;
TSCGroupCaptionMouseMoveEvent = procedure(Sender: TObject;
Shift: TShiftState; X, Y: Integer; Part: TSCCaptionPart) of object;
TSCCustomAdvGroup = class(TSCCustomGroup)
private
FCanRoll: Boolean;
FCaptionButtonColors: TSCAdvGroupButtons;
FCaptionCursor: TCursor;
FCaptionDisabledFontColor: TColor;
FCaptionDownFontColor: TColor;
FCaptionFont: TFont;
FCaptionHint: String;
FCaptionHeight: Integer;
FCaptionHotFontColor: TColor;
FCaptionProps: TSCAdvGroupCaption;
FCaptionStyle: TSCGroupCaptionStyle;
FCaptionSettings: TSCAdvGroupCaptionSettings;
FDefaultButtons: Boolean;
FDefaultIcon: Boolean;
FDisabledCaptionProps: TSCAdvGroupCaption;
FExpanded: Boolean;
FExpandedHeight: Integer;
FHotCaptionProps: TSCAdvGroupCaption;
FHottrack: Boolean;
FHottrackButtons: Boolean;
FIcons: TCustomImageList;
FIconChangeLink: TChangeLink;
FIsCaptionHot: Boolean;
FMxDefaultButtons: Boolean;
FRectDefaultButtons: Boolean;
FRounded: Boolean;
FShowCaption: Boolean;
FShowCaptionHint: Boolean;
FShowCaptionLine: Boolean;
FShowClose: Boolean;
FShowIcon: Boolean;
FShowRoller: Boolean;
FShowCaptionUpLine: Boolean;
FExpanding: Boolean;
FDefaultCursor: TCursor;
FUpdatingCursor: Boolean;
FIsCaptionDown: Boolean;
FRoundChanging: Boolean;
FLastCaptionHeight: Integer;
FOnExpand: TNotifyEvent;
FOnCaptionClick: TSCGroupCaptionEvent;
FOnCaptionMouseDown: TSCGroupCaptionMouseEvent;
FOnCaptionMouseMove: TSCGroupCaptionMouseMoveEvent;
FOnCaptionMouseUp: TSCGroupCaptionMouseEvent;
procedure SetCaptionButtonColors(Value: TSCAdvGroupButtons);
procedure SetCaptionCursor(Value: TCursor);
procedure SetCaptionDisabledFontColor(Value: TColor);
procedure SetCaptionDownFontColor(Value: TColor);
procedure SetCaptionFont(Value: TFont);
procedure SetCaptionHeight(Value: Integer);
procedure SetCaptionHotFontColor(Value: TColor);
procedure SetCaptionProps(Value: TSCAdvGroupCaption);
procedure SetCaptionStyle(Value: TSCGroupCaptionStyle);
procedure SetCaptionSettings(Value: TSCAdvGroupCaptionSettings);
procedure SetDefaultButtons(Value: Boolean);
procedure SetDefaultIcon(Value: Boolean);
procedure SetDisabledCaptionProps(Value: TSCAdvGroupCaption);
procedure SetExpanded(Value: Boolean);
procedure SetExpandedHeight(Value: Integer);
procedure SetHotCaptionProps(Value: TSCAdvGroupCaption);
procedure SetHottrack(Value: Boolean);
procedure SetHottrackButtons(Value: Boolean);
procedure SetIcons(Value: TCustomImageList);
procedure SetMxDefaultButtons(Value: Boolean);
procedure SetRectDefaultButtons(Value: Boolean);
procedure SetRounded(Value: Boolean);
procedure SetShowCaption(Value: Boolean);
procedure SetShowCaptionLine(Value: Boolean);
procedure SetShowCaptionUpLine(Value: Boolean);
procedure SetShowClose(Value: Boolean);
procedure SetShowIcon(Value: Boolean);
procedure SetShowRoller(Value: Boolean);
procedure DoDrawClose(Cnv: TCanvas; C: TColor; R: TRect);
procedure DoDrawDown(Cnv: TCanvas; C: TColor; R: TRect);
procedure DoDrawUp(Cnv: TCanvas; C: TColor; R: TRect);
procedure DoDrawIcon(Cnv: TCanvas; C: TColor; R: TRect);
procedure CMCursorChanged(var Message: TMessage); message CM_CURSORCHANGED;
procedure CMHintShow(var Message: TMessage); message CM_HINTSHOW;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure WMSize(var Message: TWMSize); message WM_SIZE;
protected
procedure Paint; override;
procedure Loaded; override;
procedure CreateWnd; override;
procedure PaintWindow(DC: HDC); override;
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
procedure AdjustClientRect(var Rect: TRect); override;
procedure TransparentChanged; override;
function GetPictureRect(P: TPicture): TRect; override;
procedure ImageListChange(Sender: TObject); override;
procedure CaptureChanged(Captured: Boolean); override;
procedure StopTracking; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure PaintCaption(DC: HDC); virtual;
procedure DoDrawDefButton(Cnv: TCanvas; R: TRect; Button: TSCAdvGroupButton); virtual;
procedure DoDrawCaption(Cnv: TCanvas); virtual;
procedure DoDrawBevel(Cnv: TCanvas); virtual;
procedure UpdateBorderRegion(UpdatePaint: Boolean = True);
function CaptionRoundation(R: TRect): Integer;
function CreateBorderRgn(R: TRect): HRGN;
procedure ApplyStyle(S: TSCAdvPanelStyle; DoUpdate: Boolean); override;
procedure UpdateCaptionFont(F: TFont); override;
procedure TrackCaption(X, Y: Integer);
procedure UpdateTracking; override;
function GetCurrentCursor: TCursor; dynamic;
procedure UpdateCursor(UpTrack: Boolean);
function CanCollapse: Boolean; dynamic;
function CanExpand: Boolean; dynamic;
procedure ButtonsChanged(Sender: TObject); dynamic;
procedure CaptionChanged(Sender: TObject); dynamic;
procedure IconsChanged(Sender: TObject); dynamic;
function CloseBtnHeight: Integer; dynamic;
function CloseBtnWidth: Integer; dynamic;
function IconHeight: Integer; dynamic;
function IconWidth: Integer; dynamic;
function RollBtnHeight: Integer; dynamic;
function RollBtnWidth: Integer; dynamic;
function GetIsButtonsHot: Boolean; dynamic;
function GetIsCaptionHot: Boolean; dynamic;
function CloseIndex: Integer;
function IconIndex: Integer;
function RollupIndex: Integer;
function RolldownIndex: Integer;
function IsValidIcon(Index: Integer): Boolean;
function RoundSize(Ch: Integer = -1): Integer; dynamic;
function CaptionFrameSize: Integer; dynamic;
function GetCaptionHeight: Integer; virtual;
function GetCollapsedHeight: Integer; virtual;
function GetExpandedHeight: Integer; virtual;
function GetCaptionRect(VisiblePart: Boolean): TRect; virtual;
function GetCaptionPart(X, Y: Integer): TSCCaptionPart; dynamic;
property ShowCaption: Boolean read FShowCaption write SetShowCaption default True;
property ShowCaptionLine: Boolean read FShowCaptionLine write SetShowCaptionLine default True;
property ShowCaptionUpLine: Boolean read FShowCaptionUpLine write SetShowCaptionUpLine default False;
property CanRoll: Boolean read FCanRoll write FCanRoll default True;
property CaptionButtonColors: TSCAdvGroupButtons read FCaptionButtonColors write SetCaptionButtonColors;
property CaptionCursor: TCursor read FCaptionCursor write SetCaptionCursor default crHandPoint;
property CaptionDisabledFontColor: TColor read FCaptionDisabledFontColor write SetCaptionDisabledFontColor default clPanelDisabledColor;
property CaptionDownFontColor: TColor read FCaptionDownFontColor write SetCaptionDownFontColor default clPanelDownColor;
property CaptionFont: TFont read FCaptionFont write SetCaptionFont;
property CaptionHeight: Integer read FCaptionHeight write SetCaptionHeight default -1;
property CaptionHint: String read FCaptionHint write FCaptionHint;
property CaptionHotFontColor: TColor read FCaptionHotFontColor write SetCaptionHotFontColor default clPanelHotColor;
property CaptionProps: TSCAdvGroupCaption read FCaptionProps write SetCaptionProps;
property CaptionStyle: TSCGroupCaptionStyle read FCaptionStyle write SetCaptionStyle default scgcNone;
property CaptionSettings: TSCAdvGroupCaptionSettings read FCaptionSettings write SetCaptionSettings;
property DefaultButtons: Boolean read FDefaultButtons write SetDefaultButtons default True;
property DefaultIcon: Boolean read FDefaultIcon write SetDefaultIcon default True;
property DisabledCaptionProps: TSCAdvGroupCaption read FDisabledCaptionProps write SetDisabledCaptionProps;
property Expanded: Boolean read FExpanded write SetExpanded default True;
property ExpandedHeight: Integer read GetExpandedHeight write SetExpandedHeight default 165;
property HotCaptionProps: TSCAdvGroupCaption read FHotCaptionProps write SetHotCaptionProps;
property Hottrack: Boolean read FHottrack write SetHottrack default True;
property HottrackButtons: Boolean read FHottrackButtons write SetHottrackButtons default True;
property Icons: TCustomImageList read FIcons write SetIcons;
property MxDefaultButtons: Boolean read FMxDefaultButtons write SetMxDefaultButtons default False;
property RectDefaultButtons: Boolean read FRectDefaultButtons write SetRectDefaultButtons default False;
property Rounded: Boolean read FRounded write SetRounded default True;
property ShowCaptionHint: Boolean read FShowCaptionHint write FShowCaptionHint default False;
property ShowClose: Boolean read FShowClose write SetShowClose default True;
property ShowIcon: Boolean read FShowIcon write SetShowIcon default True;
property ShowRoller: Boolean read FShowRoller write SetShowRoller default True;
property LastCaptionHeight: Integer read FLastCaptionHeight;
property OnCaptionClick: TSCGroupCaptionEvent read FOnCaptionClick write FOnCaptionClick;
property OnCaptionMouseDown: TSCGroupCaptionMouseEvent read FOnCaptionMouseDown write FOnCaptionMouseDown;
property OnCaptionMouseMove: TSCGroupCaptionMouseMoveEvent read FOnCaptionMouseMove write FOnCaptionMouseMove;
property OnCaptionMouseUp: TSCGroupCaptionMouseEvent read FOnCaptionMouseUp write FOnCaptionMouseUp;
property OnExpand: TNotifyEvent read FOnExpand write FOnExpand;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure UpdateCaption(DoRegionUpdate: Boolean);
end;
TSCAdvPanel = class(TSCCustomAdvGroup)
published
property ShowCaption;
property ShowCaptionLine;
property ShowCaptionUpLine;
property Align;
property Anchors;
property Bevel;
property BevelColor;
property BevelDotted;
property BevelEx;
property BevelWidth;
property BorderProps;
property CanRoll;
property Caption;
property CaptionSettings;
property Color;
property Constraints;
property UseDockManager;
property DockSite;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property EndColor;
property Expanded;
property ExpandedHeight;
property Gradient;
property Icons;
property IsMouseInControl;
property ParentColor;
property ParentFont;
property ParentShowHint;
property Picture;
property PictureProps;
property PopupMenu;
property MxDefaultButtons;
property RectDefaultButtons;
property Rounded;
property ShowCaptionHint;
property ShowClose;
property ShowHint;
property ShowIcon;
property ShowRoller;
property TabOrder;
property TabStop;
property Transparent;
property UseExGradient;
property Style;
property Visible;
property OnCanResize;
property OnCaptionClick;
property OnCaptionMouseDown;
property OnCaptionMouseMove;
property OnCaptionMouseUp;
property OnClick;
property OnConstrainedResize;
property OnContextPopup;
property OnDockDrop;
property OnDockOver;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnExpand;
property OnGetSiteInfo;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCGroupScrollBarView = (scsbShow, scsbHide);
TSCGroupContainerScrollbar = class(TSCControlScrollbar)
private
function GetWidth: Integer;
procedure SetWidth(Value: Integer);
function GetStyle: TSCScrollbarStyle;
procedure SetStyle(Value: TSCScrollbarStyle);
function GetButtonsLayout: TSCScrollButtonLayout;
procedure SetButtonsLayout(Value: TSCScrollButtonLayout);
function GetThumbLines: TSCScrollThumbline;
procedure SetThumbLines(Value: TSCScrollThumbline);
function GetType: TSCScrollbarType;
procedure SetType(Value: TSCScrollbarType);
function GetShowState: TSCGroupScrollBarView;
procedure SetShowState(Value: TSCGroupScrollBarView);
public
procedure Assign(Source: TPersistent); override;
published
property Background;
property ButtonColors;
property ButtonsLayout: TSCScrollButtonLayout read GetButtonsLayout write SetButtonsLayout default scsbDefault;
property Icons;
property Thumb;
property ScrollbarType: TSCScrollbarType read GetType write SetType default scsbtSweet;
property ShowState: TSCGroupScrollBarView read GetShowState write SetShowState default scsbShow;
property SlideLine;
property Style: TSCScrollbarStyle read GetStyle write SetStyle default scssDefault;
property ThumbLines: TSCScrollThumbline read GetThumbLines write SetThumbLines default sctlNone;
property Width: Integer read GetWidth write SetWidth default -1;
end;
TSCGroupBorderProps = class(TSCControlBorderProps)
public
constructor Create(AOwner: TSCCustomControl); override;
published
property Border default sccbLowered;
property ExDraw;
property FlatColor;
property FlatInnerColor;
property InnerBorder;
property Width;
end;
TSCGroupContainer = class(TSCCustomGroup)
private
FAutoScroll: Boolean;
FExpandToTop: Boolean;
FScrollBarView: TSCGroupScrollBarView;
FLoaded: Boolean;
FLockPosUpdate: Boolean;
FScrolling: Boolean;
FScrollPosition: Integer;
FScrollPosChanging: Boolean;
FScrollbarChanging: Boolean;
function GetScrollbar: TSCGroupContainerScrollbar;
procedure SetScrollbar(Value: TSCGroupContainerScrollbar);
procedure SetExpandToTop(Value: Boolean);
procedure SetScrollBarView(Value: TSCGroupScrollBarView);
procedure CMFocusChanged(var Message: TCMFocusChanged); message CM_FOCUSCHANGED;
procedure CMControlChange(var Message: TMessage); message CM_CONTROLCHANGE;
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL;
procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL;
procedure WMSize(var Message: TWMSize); message WM_SIZE;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure Loaded; override;
procedure AdjustClientRect(var Rect: TRect); override;
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
function GetBorderPropsClass: TSCControlBorderPropsClass; override;
procedure DoScrollerPositionChanged(Kind: TSCScrollbarKind); override;
procedure ApplyStyle(S: TSCAdvPanelStyle; DoUpdate: Boolean); override;
procedure IndentChanged; override;
procedure SpacingChanged; override;
procedure SetScrollPosition(Value: Integer); virtual;
procedure ExpandChanged(P: TSCCustomAdvGroup); dynamic;
function GetScrollbarClass: TSCCustomControlScrollbarClass; override;
function GetDefaultScrollInfo(Kind: TSCScrollbarKind): TScrollInfo; override;
function GetGroupIndent: Integer; virtual;
function GetSpacing: Integer; virtual;
function CanShowScrollbar: Boolean; dynamic;
function GetScrollHeight: Integer;
function IsScrollBarVisible: Boolean;
procedure ScrollInView(C: TControl);
procedure ScrollControls(Delta: Integer);
procedure ShowPanel(P: TSCCustomAdvGroup);
function NormalizeScrollPos(DoAlign: Boolean = True): Boolean; virtual;
function UpdateScrollBar: Boolean; virtual;
procedure RepositionPanels(LockPos: Boolean);
property ScrollHeight: Integer read GetScrollHeight;
property ScrollBarView: TSCGroupScrollBarView read FScrollBarView write SetScrollBarView default scsbShow;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
function IsLastControl(C: TControl): Boolean;
property ScrollPosition: Integer read FScrollPosition write SetScrollPosition;
published
property Align default alLeft;
property Anchors;
property AutoScroll: Boolean read FAutoScroll write FAutoScroll default True;
property BorderProps;
property Color default clBtnShadow;
property Constraints;
property UseDockManager default True;
property DockSite;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property EndColor default cl3DDkShadow;
property ExpandToTop: Boolean read FExpandToTop write SetExpandToTop default False;
property Gradient default scgTopToBottom;
property Indent default 8;
property ParentColor default False;
property ParentFont;
property ParentShowHint;
property Picture;
property PictureProps;
property PopupMenu;
property Scrollbar: TSCGroupContainerScrollbar read GetScrollbar write SetScrollbar;
property ShowHint;
property Spacing default 8;
property TabOrder;
property TabStop;
property UseExGradient;
property Style;
property Visible;
property OnCanResize;
property OnClick;
property OnConstrainedResize;
property OnContextPopup;
property OnDockDrop;
property OnDockOver;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnGetSiteInfo;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
{ TSCListGroup }
TSCListGroup = class;
TSCListGroupStyle = class;
TSCListGroupStyleNotifier = class;
TSCAlphaBlend = 0..255;
TSCListGroupStyleEx = class(TPersistent)
private
FOwner: TSCListGroupStyle;
FDisabledColor: TColor;
FDisabledFontColor: TColor;
FHotColor: TColor;
FHotFontColor: TColor;
FHottrack: Boolean;
FHotUnderline: Boolean;
procedure SetDisabledColor(Value: TColor);
procedure SetDisabledFontColor(Value: TColor);
procedure SetHotColor(Value: TColor);
procedure SetHotFontColor(Value: TColor);
procedure SetHottrack(Value: Boolean);
procedure SetHotUnderline(Value: Boolean);
protected
procedure DoChange;
public
constructor Create(AOwner: TSCListGroupStyle); virtual;
procedure Assign(Source: TPersistent); override;
property Owner: TSCListGroupStyle read FOwner;
published
property DisabledColor: TColor read FDisabledColor write SetDisabledColor default clNone;
property DisabledFontColor: TColor read FDisabledFontColor write SetDisabledFontColor default clNone;
property Hottrack: Boolean read FHottrack write SetHottrack default True;
property HotColor: TColor read FHotColor write SetHotColor default clNone;
property HotFontColor: TColor read FHotFontColor write SetHotFontColor default clBlue;
property HotUnderline: Boolean read FHotUnderline write SetHotUnderline default True;
end;
TSCListGroupStyle = class(TComponent)
private
FAlphaBlend: TSCAlphaBlend;
FColor: TColor;
FEndColor: TColor;
FExStyle: TSCListGroupStyleEx;
FFont: TFont;
FGradient: TSCGradient;
FImageIndex: TImageIndex;
FLargeImageIndex: TImageIndex;
FImages: TCustomImageList;
FLargeImages: TCustomImageList;
FImageChangeLink: TChangeLink;
FLargeImageChangeLink: TChangeLink;
FChanged: Boolean;
FUpdateCount: Integer;
FNotifications: TList;
procedure SetAlphaBlend(Value: TSCAlphaBlend);
procedure SetColor(Value: TColor);
procedure SetEndColor(Value: TColor);
procedure SetExStyle(Value: TSCListGroupStyleEx);
procedure SetFont(Value: TFont);
procedure SetGradient(Value: TSCGradient);
procedure SetImageIndex(Value: TImageIndex);
procedure SetImages(Value: TCustomImageList);
procedure SetLargeImageIndex(Value: TImageIndex);
procedure SetLargeImages(Value: TCustomImageList);
procedure Destroying;
protected
procedure Changed(Sender: TObject);
procedure RegisterNotifier(N: TSCListGroupStyleNotifier);
procedure UnregisterNotifier(N: TSCListGroupStyleNotifier);
property AlphaBlend: TSCAlphaBlend read FAlphaBlend write SetAlphaBlend default 255; // for future
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure BeginUpdate;
procedure EndUpdate;
function IsValidImage(Index: Integer): Boolean;
published
property Color: TColor read FColor write SetColor default clNone;
property EndColor: TColor read FEndColor write SetEndColor default clNone;
property ExStyle: TSCListGroupStyleEx read FExStyle write SetExStyle;
property Font: TFont read FFont write SetFont;
property Gradient: TSCGradient read FGradient write SetGradient default scgLeftToRight;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1;
property Images: TCustomImageList read FImages write SetImages;
property LargeImageIndex: TImageIndex read FLargeImageIndex write SetLargeImageIndex default -1;
property LargeImages: TCustomImageList read FLargeImages write SetLargeImages;
end;
TSCListGroupItem = class;
TSCListGroupActionLink = class(TSCCollectionActionLink)
protected
FClient: TSCListGroupItem;
procedure AssignClient(AClient: TObject); override;
function IsCaptionLinked: Boolean; override;
function IsCheckedLinked: Boolean; override;
function IsEnabledLinked: Boolean; override;
function IsHintLinked: Boolean; override;
function IsImageIndexLinked: Boolean; override;
function IsVisibleLinked: Boolean; override;
function IsOnExecuteLinked: Boolean; override;
procedure SetCaption(const Value: string); override;
procedure SetChecked(Value: Boolean); override;
procedure SetEnabled(Value: Boolean); override;
procedure SetHint(const Value: string); override;
procedure SetImageIndex(Value: Integer); override;
procedure SetVisible(Value: Boolean); override;
procedure SetOnExecute(Value: TNotifyEvent); override;
end;
TSCListGroupActionLinkClass = class of TSCListGroupActionLink;
TSCListGroupStyleNotifier = class(TObject)
private
FOwner: TObject;
FStyle: TSCListGroupStyle;
FOnChange: TNotifyEvent;
FOnDestroy: TNotifyEvent;
FData: Pointer;
public
constructor Create(AOwner: TObject); virtual;
property Data: Pointer read FData write FData;
property Owner: TObject read FOwner;
property Style: TSCListGroupStyle read FStyle;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
end;
TSCGroupItemViewStyle = (scvsLabel, scvsButton);
TSCGroupItemLine = (scglNone, scglFlatLine, scglLoweredLine, scglRaisedLine);
TSCListGroupItemStyle = class(TPersistent)
private
FOwner: TSCListGroupItem;
FDisabledColor: TColor;
FDisabledFontColor: TColor;
FHotColor: TColor;
FHotFontColor: TColor;
FHottrack: Boolean;
FHotUnderline: Boolean;
procedure SetDisabledColor(Value: TColor);
procedure SetDisabledFontColor(Value: TColor);
procedure SetHotColor(Value: TColor);
procedure SetHotFontColor(Value: TColor);
procedure SetHottrack(Value: Boolean);
procedure SetHotUnderline(Value: Boolean);
protected
procedure DoChange;
public
constructor Create(AOwner: TSCListGroupItem); virtual;
procedure Assign(Source: TPersistent); override;
property Owner: TSCListGroupItem read FOwner;
published
property DisabledColor: TColor read FDisabledColor write SetDisabledColor default clNone;
property DisabledFontColor: TColor read FDisabledFontColor write SetDisabledFontColor default clNone;
property Hottrack: Boolean read FHottrack write SetHottrack default True;
property HotColor: TColor read FHotColor write SetHotColor default clNone;
property HotFontColor: TColor read FHotFontColor write SetHotFontColor default clBlue;
property HotUnderline: Boolean read FHotUnderline write SetHotUnderline default True;
end;
TSCListGroupItem = class(TSCCollectionItem)
private
FAlignment: TAlignment;
FCaption: string;
FColor: TColor;
FData: TObject;
FEnabled: Boolean;
FExStyle: TSCListGroupItemStyle;
FHint: String;
FImageIndex: TImageIndex;
FIndent: Integer;
FLine: TSCGroupItemLine;
FLineColor: TColor;
FLargeImageIndex: TImageIndex;
FSelected: Boolean;
FStyle: TSCListGroupStyle;
FViewStyle: TSCGroupItemViewStyle;
FVisible: Boolean;
FOnClick: TNotifyEvent;
FOnDblClick: TNotifyEvent;
FOnHottrack: TNotifyEvent;
FOnMouseDown: TNotifyEvent;
FOnMouseUp: TNotifyEvent;
FOnSelect: TNotifyEvent;
FActionLink: TSCListGroupActionLink;
FDestroying: Boolean;
FNotifier: TSCListGroupStyleNotifier;
function GetAction: TBasicAction;
procedure SetAction(const Value: TBasicAction);
procedure SetAlignment(Value: TAlignment);
procedure SetCaption(const Value: string);
procedure SetColor(Value: TColor);
procedure SetEnabled(Value: Boolean);
procedure SetExStyle(Value: TSCListGroupItemStyle);
procedure SetImageIndex(Value: TImageIndex);
procedure SetIndent(Value: Integer);
procedure SetLine(Value: TSCGroupItemLine);
procedure SetLineColor(Value: TColor);
procedure SetLargeImageIndex(Value: TImageIndex);
procedure SetSelected(Value: Boolean);
procedure SetStyle(Value: TSCListGroupStyle);
procedure SetViewStyle(Value: TSCGroupItemViewStyle);
procedure SetVisible(Value: Boolean);
procedure SelectionChanged;
procedure RegisterTo(S: TSCListGroupStyle);
procedure UnregisterFrom(S: TSCListGroupStyle);
protected
function GetDisplayName: string; override;
function IsCaptionStored: Boolean;
function IsEnabledStored: Boolean;
function IsHintStored: Boolean;
function IsImageIndexStored: Boolean;
function IsOnClickStored: Boolean;
function IsVisibleStored: Boolean;
procedure DoActionChange(Sender: TObject);
function GetListGroup: TSCListGroup;
function OwnerState: TComponentState;
function GetImages: TCustomImageList;
function GetLargeImages: TCustomImageList;
function GetActionLinkClass: TSCListGroupActionLinkClass; dynamic;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic;
procedure DoChanged(FullRefresh: Boolean);
procedure StyleChanged(Sender: TObject); dynamic;
procedure StyleDestroyed(Sender: TObject); dynamic;
property ActionLink: TSCListGroupActionLink read FActionLink write FActionLink;
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; // for future
public
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
property Destroying: Boolean read FDestroying;
property Data: TObject read FData write FData;
published
property Action: TBasicAction read GetAction write SetAction;
property Caption: string read FCaption write SetCaption stored IsCaptionStored;
property Color: TColor read FColor write SetColor default clNone;
property Enabled: Boolean read FEnabled write SetEnabled stored IsEnabledStored default True;
property ExStyle: TSCListGroupItemStyle read FExStyle write SetExStyle;
property Hint: String read FHint write FHint stored IsHintStored;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex stored IsImageIndexStored default -1;
property Indent: Integer read FIndent write SetIndent default 0;
property Line: TSCGroupItemLine read FLine write SetLine default scglNone;
property LineColor: TColor read FLineColor write SetLineColor default clBlack;
property LargeImageIndex: TImageIndex read FLargeImageIndex write SetLargeImageIndex default -1;
property Selected: Boolean read FSelected write SetSelected default False;
property Style: TSCListGroupStyle read FStyle write SetStyle;
property ViewStyle: TSCGroupItemViewStyle read FViewStyle write SetViewStyle default scvsButton;
property Visible: Boolean read FVisible write SetVisible stored IsVisibleStored default True;
property OnClick: TNotifyEvent read FOnClick write FOnClick stored IsOnClickStored;
property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
property OnHottrack: TNotifyEvent read FOnHottrack write FOnHottrack;
property OnMouseDown: TNotifyEvent read FOnMouseDown write FOnMouseDown;
property OnMouseUp: TNotifyEvent read FOnMouseUp write FOnMouseUp;
property OnSelect: TNotifyEvent read FOnSelect write FOnSelect;
end;
TSCListGroupItems = class(TCollection)
private
FOwner: TSCListGroup;
function GetItem(Index: Integer): TSCListGroupItem;
procedure SetItem(Index: Integer; Value: TSCListGroupItem);
protected
function GetOwner: TPersistent; override;
procedure Update(Item: TCollectionItem); override;
public
constructor Create(ListGroup: TSCListGroup);
function Add: TSCListGroupItem;
{$IFDEF SC_DELPHI5_AND_EARLY}