Repository navigation
Expand file tree
/
Copy pathSCStdControls.pas
More file actions
14245 lines (11952 loc) · 347 KB
/
Copy pathSCStdControls.pas
File metadata and controls
14245 lines (11952 loc) · 347 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 SCStdControls;
{$I SweetControls.inc}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ImgList, SCConsts, SCResStrs, SCCommon, SCControl, Clipbrd, Menus;
type
TSCButtonBase = class;
TSCButtonActionLink = class(TWinControlActionLink)
protected
FClient: TSCButtonBase;
procedure AssignClient(AClient: TObject); override;
function IsCheckedLinked: Boolean; override;
procedure SetChecked(Value: Boolean); override;
end;
TSCButtonActionLinkClass = class of TSCButtonActionLink;
TSCButtonBase = class(TSCCustomControl)
private
FDblClicked: Boolean;
FEndEllipsis: Boolean;
procedure SetEndEllipsis(Value: Boolean);
function IsCheckedStored: Boolean;
protected
procedure CaptureChanged(Captured: Boolean); override;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
function GetActionLinkClass: TControlActionLinkClass; override;
function GetChecked: Boolean; virtual;
procedure SetChecked(Value: Boolean); virtual;
procedure DoMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
property DblClicked: Boolean read FDblClicked;
property Checked: Boolean read GetChecked write SetChecked stored IsCheckedStored default False;
property EndEllipsis: Boolean read FEndEllipsis write SetEndEllipsis default True;
public
constructor Create(AOwner: TComponent); override;
end;
TSCCustomButton = class(TSCButtonBase)
private
FAllowAllUp: Boolean;
FArrowColor: TColor;
FCancel: Boolean;
FCenter: Boolean;
FDefault: Boolean;
FDown: Boolean;
FDropdownMenu: TPopupMenu;
FGradient: TSCButtonGradient;
FGroupIndex: Integer;
FHighlightColor: TColor;
FHottrackColor: TColor;
FLayout: TSCButtonLayout;
FPopupArrow: Boolean;
FRepeatClick: Boolean;
FRepeatInterval: Integer;
FRoundColor: TColor;
FRounded: Boolean;
FRoundWithParentColor: Boolean;
FShowCaption: Boolean;
FShowFocus: Boolean;
FStyle: TSCButtonStyle;
FModalResult: TModalResult;
FMultiline: Boolean;
FFontColor: TColor;
FPopArrowColor: TColor;
FInnerRect: TRect;
FImgOffset: TPoint;
FTxtOffset: TPoint;
FPopOffset: TPoint;
FSpaceDown: Boolean;
FMousePressed: Boolean;
FRepeating: Boolean;
FRepeatTimer: Integer;
FOnStateChange: TNotifyEvent;
procedure SetAllowAllUp(Value: Boolean);
procedure SetArrowColor(Value: TColor);
procedure SetCenter(Value: Boolean);
procedure SetDefault(Value: Boolean);
procedure SetDown(Value: Boolean);
procedure SetDropdownMenu(Value: TPopupMenu);
procedure SetGradient(Value: TSCButtonGradient);
procedure SetGroupIndex(Value: Integer);
procedure SetHighlightColor(Value: TColor);
procedure SetHottrackColor(Value: TColor);
procedure SetLayout(Value: TSCButtonLayout);
procedure SetPopupArrow(Value: Boolean);
procedure SetRepeatClick(Value: Boolean);
procedure SetRepeatInterval(Value: Integer);
procedure SetRoundColor(Value: TColor);
procedure SetRounded(Value: Boolean);
procedure SetRoundWithParentColor(Value: Boolean);
procedure SetShowCaption(Value: Boolean);
procedure SetShowFocus(Value: Boolean);
procedure SetStyle(Value: TSCButtonStyle);
procedure SetMultiline(Value: Boolean);
procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY;
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
procedure CMButtonPressed(var Message: TMessage); message CM_BUTTONPRESSED;
procedure CMFocusChanged(var Message: TCMFocusChanged); message CM_FOCUSCHANGED;
procedure CNCommand(var Message: TWMCommand); message CN_COMMAND;
procedure CMParentColorChanged(var Message: TMessage); message CM_PARENTCOLORCHANGED;
procedure WMTimer(var Message: TWMTimer); message WM_TIMER;
function CanDoUp: Boolean;
procedure UpdateGroupDown;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure CreateWnd; override;
procedure Paint; override;
function PopupDropdownMenu: Boolean;
function CheckMenuDropdown: Boolean;
procedure StopTracking; override;
procedure MouseInControlChanged; override;
procedure SpacingChanged; override;
procedure EnabledChanged; override;
procedure StartRepeat;
procedure StopRepeat;
function CanRepeat: Boolean;
function Repeating: Boolean;
function RepeatPaused: Boolean;
procedure PauseRepeat;
procedure ResumeRepeat;
function GetGradientShadow(AColor: TColor): TColor;
function GetGradientDark(AColor: TColor): TColor;
function GetGradientLight(AColor: TColor): TColor;
function GetGradientExDark(AColor: TColor): TColor;
function GetGradientExLight(AColor: TColor): TColor;
function GetGradientPeal(AColor: TColor): TColor;
function GetGradientPreDark(AColor: TColor): TColor;
function GetGradientPreLight(AColor: TColor): TColor;
function GetGradientHighLight(AColor: TColor): TColor;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
procedure DrawPopupArrow(R: TRect; AColor: TColor = clNone);
procedure DrawImageAndText(var R: TRect; CR: TRect; FontColor: TColor = clNone);
procedure DoDrawCorel;
procedure DoDrawFlatMacSpeed;
procedure DoDrawHower;
procedure DoDrawMacSpeed;
procedure DoDrawNew;
procedure DoDrawOfficeXP;
procedure DoDrawRaisedShadow;
procedure DoDrawSpeed;
procedure DoDrawWin2k;
procedure DoDrawXP;
procedure DoDrawOffice12;
procedure DoDrawOffice2003;
procedure DoDrawDarkling;
procedure DoDrawMetal;
property AllowAllUp: Boolean read FAllowAllUp write SetAllowAllUp default False;
property ArrowColor: TColor read FArrowColor write SetArrowColor default clBtnText;
property Cancel: Boolean read FCancel write FCancel default False;
property Center: Boolean read FCenter write SetCenter default True;
property Color default clBtnFace;
property Default: Boolean read FDefault write SetDefault default False;
property Gradient: TSCButtonGradient read FGradient write SetGradient default scbgTopToBottom;
property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0;
property Down: Boolean read FDown write SetDown default False;
property DropdownMenu: TPopupMenu read FDropdownMenu write SetDropdownMenu;
property HighlightColor: TColor read FHighlightColor write SetHighlightColor default SC_HighlightColor;
property HottrackColor: TColor read FHottrackColor write SetHottrackColor default SC_HottrackColor;
property Layout: TSCButtonLayout read FLayout write SetLayout default scblLeft;
property ModalResult: TModalResult read FModalResult write FModalResult default 0;
property Multiline: Boolean read FMultiline write SetMultiline default False;
property ParentColor default False;
property PopupArrow: Boolean read FPopupArrow write SetPopupArrow default False;
property RepeatClick: Boolean read FRepeatClick write SetRepeatClick default False;
property RepeatInterval: Integer read FRepeatInterval write SetRepeatInterval default 50;
property RoundColor: TColor read FRoundColor write SetRoundColor default clBtnFace;
property Rounded: Boolean read FRounded write SetRounded default True;
property RoundWithParentColor: Boolean read FRoundWithParentColor write SetRoundWithParentColor default True;
property ShowCaption: Boolean read FShowCaption write SetShowCaption default True;
property ShowFocus: Boolean read FShowFocus write SetShowFocus default True;
property Style: TSCButtonStyle read FStyle write SetStyle default scbsWin2k;
property TabStop default True;
property OnStateChange: TNotifyEvent read FOnStateChange write FOnStateChange;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure Click; override;
function UseRightToLeftAlignment: Boolean; override;
end;
TSCButton = class(TSCCustomButton)
published
property Action;
property Align;
property AllowAllUp;
property Anchors;
property ArrowColor;
property BiDiMode;
property Cancel;
property Caption;
property Center;
property Color;
property Constraints;
property Cursor;
property Default;
property DragCursor;
property DragKind;
property DragMode;
property DropdownMenu;
property Enabled;
property EndEllipsis;
property Font;
property Gradient;
property GroupIndex;
property Down;
property HighlightColor;
property HottrackColor;
property Images;
property ImageIndex;
property Indent;
property Layout;
property ModalResult;
property Multiline;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupArrow;
property RepeatClick;
property RepeatInterval;
property RoundColor;
property Rounded;
property RoundWithParentColor;
property ShowCaption;
property ShowFocus;
property ShowHint;
property Spacing;
property Style;
property TabOrder;
property TabStop;
property Transparent;
property Visible;
property OnCanResize;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
property OnStateChange;
end;
TSCCustomSpinButton = class;
TSCSpinButtonColors = class(TPersistent)
private
FOwner: TSCCustomSpinButton;
FActiveColor: TColor;
FDefaultColor: TColor;
FDisabledColor: TColor;
FDownColor: TColor;
FHotColor: TColor;
procedure SetActiveColor(Value: TColor);
procedure SetDefaultColor(Value: TColor);
procedure SetDisabledColor(Value: TColor);
procedure SetDownColor(Value: TColor);
procedure SetHotColor(Value: TColor);
protected
function GetOwner: TPersistent; override;
procedure DoChange;
public
constructor Create(AOwner: TSCCustomSpinButton); virtual;
procedure Assign(Source: TPersistent); override;
property Owner: TSCCustomSpinButton read FOwner;
published
property ActiveColor: TColor read FActiveColor write SetActiveColor default clBtnFace;
property DefaultColor: TColor read FDefaultColor write SetDefaultColor default clBtnFace;
property DisabledColor: TColor read FDisabledColor write SetDisabledColor default clBtnFace;
property DownColor: TColor read FDownColor write SetDownColor default clBtnFace;
property HotColor: TColor read FHotColor write SetHotColor default clBtnFace;
end;
TSCSpinButtonIconColors = class(TSCSpinButtonColors)
public
constructor Create(AOwner: TSCCustomSpinButton); override;
published
property ActiveColor default clBtnText;
property DefaultColor default clBtnText;
property DisabledColor default clBtnShadow;
property DownColor default clBtnText;
property HotColor default clBtnText;
end;
TSCSpinButtonOrient = (scsoHorizontal, scsoVertical);
TSCSpinButtonPart = (scsbpNone, scsbpUpButton, scsbpDownButton);
TSCSpinDirection = (scsdUpDown, scsdLeftRight);
TSCSpinButtonStyle = (scsbsOfficeXP, scsbsWindows, scsbsWindowsEx,
scsbsWindowsFlat, scsbsWindowsFlatEx, scsbsMac, scsbsMetal, scsbsWindowsXP);
TSCCustomSpinButton = class(TSCButtonBase)
private
FButtonColors: TSCSpinButtonColors;
FDirection: TSCSpinDirection;
FIconColors: TSCSpinButtonColors;
FIncrement: Integer;
FInterval: Integer;
FMax: Integer;
FMin: Integer;
FOrientation: TSCSpinButtonOrient;
FPosition: Integer;
FStyle: TSCSpinButtonStyle;
FPressedPart: TSCSpinButtonPart;
FHotPart: TSCSpinButtonPart;
FScrolling: Boolean;
FScrollTimer: Integer;
FWrap: Boolean;
procedure SetButtonColors(Value: TSCSpinButtonColors);
procedure SetDirection(Value: TSCSpinDirection);
procedure SetIconColors(Value: TSCSpinButtonColors);
procedure SetIncrement(Value: Integer);
procedure SetInterval(Value: Integer);
procedure SetMax(Value: Integer);
procedure SetMin(Value: Integer);
procedure SetOrientation(Value: TSCSpinButtonOrient);
procedure SetPosition(Value: Integer);
procedure SetStyle(Value: TSCSpinButtonStyle);
procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL;
procedure WMTimer(var Message: TWMTimer); message WM_TIMER;
procedure StartScrolling;
procedure ScrollControl;
procedure StopScrolling;
protected
procedure Paint; override;
procedure Loaded; override;
procedure Click; override;
procedure DblClick; override;
procedure StopTracking; override;
procedure MouseInControlChanged; override;
function GetBlendValue: Word; override;
procedure EnabledChanged; 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 ProcessScrollKey(var Key: Word; IsKeyPress: Boolean);
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
function GetUpBtnColor: TColor;
function GetUpBtnIconColor: TColor;
function GetDownBtnColor: TColor;
function GetDownBtnIconColor: TColor;
function IsUpButtonDefault: Boolean;
function IsDownButtonDefault: Boolean;
procedure DoDrawXPBtn(C: TCanvas; R: TRect; Cl: TColor; IsDown, IsHot: Boolean); virtual;
procedure DoDrawUpButton(C: TCanvas; R: TRect); virtual;
procedure DoDrawDownButton(C: TCanvas; R: TRect); virtual;
function GetUpButtonRect: TRect; dynamic;
function GetDownButtonRect: TRect; dynamic;
property ButtonColors: TSCSpinButtonColors read FButtonColors write SetButtonColors;
property ClickFocus default False;
property Direction: TSCSpinDirection read FDirection write SetDirection default scsdUpDown;
property IconColors: TSCSpinButtonColors read FIconColors write SetIconColors;
property Increment: Integer read FIncrement write SetIncrement default 1;
property Interval: Integer read FInterval write SetInterval default 100;
property Max: Integer read FMax write SetMax default 100;
property Min: Integer read FMin write SetMin default 0;
property Orientation: TSCSpinButtonOrient read FOrientation write SetOrientation default scsoVertical;
property Position: Integer read FPosition write SetPosition default 0;
property Style: TSCSpinButtonStyle read FStyle write SetStyle default scsbsWindows;
property Wrap: Boolean read FWrap write FWrap default False;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
function CanScroll(AsUp: Boolean): Boolean;
function Scrolling: Boolean;
function ScrollPaused: Boolean;
procedure PauseScrolling;
procedure ResumeScrolling;
function GetPartAtPos(X, Y: Integer): TSCSpinButtonPart;
end;
TSCSpinButton = class(TSCCustomSpinButton)
published
property Align;
property Anchors;
property BorderProps;
property ButtonColors;
property ClickFocus;
property Constraints;
property Cursor;
property Direction;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property IconColors;
property Increment;
property Interval;
property Max;
property Min;
property Orientation;
property ParentShowHint;
property Position;
property ShowHint;
property Style;
property TabOrder;
property TabStop;
property Transparent;
property Visible;
property Wrap;
property OnCanResize;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
end;
TSCCheckboxStyle = (sccsCorel, sccsFlat, sccsFlatFrame, sccsFlatEx,
sccsFlatDouble, sccsImage, sccsMac, sccsMetal, sccsOfficeXP, sccsWin2k, sccsXP);
TSCCheckboxLayout = (scclBottom, scclMiddle, scclTop);
TSCCustomCheckbox = class(TSCButtonBase)
private
FAlignment: TLeftRight;
FAllowGrayed: Boolean;
FBoxCheckedColor: TColor;
FBoxDisabledColor: TColor;
FBoxFrameColor: TColor;
FBoxGrayedColor: TColor;
FBoxToggleColor: TColor;
FBoxUncheckedColor: TColor;
FGradient: TSCGradient;
FGradientEnd: TColor;
FHighlightColor: TColor;
FHottrackColor: TColor;
FImageChecked: TImageIndex;
FImageDisabled: TImageIndex;
FImageGrayed: TImageIndex;
FImageToggle: TImageIndex;
FImageUnchecked: TImageIndex;
FImageMark: TImageIndex;
FImageMarkDisabled: TImageIndex;
FImageMarkGrayed: TImageIndex;
FLayout: TSCCheckboxLayout;
FMarkColor: TColor;
FMarkDisabledColor: TColor;
FMarkGrayedColor: TColor;
FMultiline: Boolean;
FShowCheckMark: Boolean;
FShowFocus: Boolean;
FState: TSCCheckState;
FStyle: TSCCheckboxStyle;
FInnerRect: TRect;
FOfficeMarkColor: TColor;
FSpaceDown: Boolean;
FStateChanging: Integer;
FMousePressed: Boolean;
procedure SetAlignment(Value: TLeftRight);
procedure SetAllowGrayed(Value: Boolean);
procedure SetBoxCheckedColor(Value: TColor);
procedure SetBoxDisabledColor(Value: TColor);
procedure SetBoxFrameColor(Value: TColor);
procedure SetBoxGrayedColor(Value: TColor);
procedure SetBoxToggleColor(Value: TColor);
procedure SetBoxUncheckedColor(Value: TColor);
procedure SetGradient(Value: TSCGradient);
procedure SetGradientEnd(Value: TColor);
procedure SetHighlightColor(Value: TColor);
procedure SetHottrackColor(Value: TColor);
procedure SetImageChecked(Value: TImageIndex);
procedure SetImageDisabled(Value: TImageIndex);
procedure SetImageGrayed(Value: TImageIndex);
procedure SetImageToggle(Value: TImageIndex);
procedure SetImageUnchecked(Value: TImageIndex);
procedure SetImageMark(Value: TImageIndex);
procedure SetImageMarkDisabled(Value: TImageIndex);
procedure SetImageMarkGrayed(Value: TImageIndex);
procedure SetLayout(Value: TSCCheckboxLayout);
procedure SetMarkColor(Value: TColor);
procedure SetMarkDisabledColor(Value: TColor);
procedure SetMarkGrayedColor(Value: TColor);
procedure SetMultiline(Value: Boolean);
procedure SetShowCheckMark(Value: Boolean);
procedure SetShowFocus(Value: Boolean);
procedure SetState(Value: TSCCheckState);
procedure SetStyle(Value: TSCCheckboxStyle);
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CNCommand(var Message: TWMCommand); message CN_COMMAND;
function GetBoxWidth: Integer;
function GetBoxHeight: Integer;
function GetBoxFaceColor: TColor;
function SwitchGrayed: Boolean;
protected
procedure Paint; override;
procedure Click; override;
procedure TransparentChanged; override;
procedure StopTracking; override;
procedure FocusChanged; override;
procedure MouseInControlChanged; override;
procedure SpacingChanged; override;
procedure EnabledChanged; override;
function GetAdjustedRect(NewWidth, NewHeight: Integer): TRect; override;
procedure AdjustBounds; override;
function GetBlendValue: Word; override;
procedure DoMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
function CanUpdateState(Value: TSCCheckState): TSCCheckState; virtual;
function GetChecked: Boolean; override;
procedure SetChecked(Value: Boolean); override;
function InToggle: Boolean; virtual;
procedure Toggle; virtual;
function SwitchState(S: TSCCheckState): TSCCheckState; virtual;
function GetDrawState: TSCCheckState; virtual;
procedure StateChanged; virtual;
procedure DoDrawMark(R: TRect; AColor: TColor = clNone);
procedure DoDrawText(var R: TRect; CalcRect: Boolean = False);
procedure DoDrawCorelCb;
procedure DoDrawFlatCb;
procedure DoDrawImageCb;
procedure DoDrawMacCb;
procedure DoDrawOfficeXPCb;
procedure DoDrawWin2kCb;
procedure DoDrawXPCb;
procedure DoDrawMetalCb;
property Alignment: TLeftRight read FAlignment write SetAlignment default taRightJustify;
property AllowGrayed: Boolean read FAllowGrayed write SetAllowGrayed default False;
property State: TSCCheckState read FState write SetState default sccbUnchecked;
property BoxCheckedColor: TColor read FBoxCheckedColor write SetBoxCheckedColor default clWindow;
property BoxDisabledColor: TColor read FBoxDisabledColor write SetBoxDisabledColor default clBtnFace;
property BoxFrameColor: TColor read FBoxFrameColor write SetBoxFrameColor default clBtnShadow;
property BoxGrayedColor: TColor read FBoxGrayedColor write SetBoxGrayedColor default clBtnFace;
property BoxToggleColor: TColor read FBoxToggleColor write SetBoxToggleColor default clBtnFace;
property BoxUncheckedColor: TColor read FBoxUncheckedColor write SetBoxUncheckedColor default clWindow;
property Checked default False;
property Color nodefault;
property Gradient: TSCGradient read FGradient write SetGradient default scgNone;
property GradientEnd: TColor read FGradientEnd write SetGradientEnd default clBlue;
property HighlightColor: TColor read FHighlightColor write SetHighlightColor default SC_HighlightColor;
property HottrackColor: TColor read FHottrackColor write SetHottrackColor default SC_HottrackColor;
property ImageChecked: TImageIndex read FImageChecked write SetImageChecked default -1;
property ImageDisabled: TImageIndex read FImageDisabled write SetImageDisabled default -1;
property ImageGrayed: TImageIndex read FImageGrayed write SetImageGrayed default -1;
property ImageToggle: TImageIndex read FImageToggle write SetImageToggle default -1;
property ImageUnchecked: TImageIndex read FImageUnchecked write SetImageUnchecked default -1;
property ImageMark: TImageIndex read FImageMark write SetImageMark default -1;
property ImageMarkDisabled: TImageIndex read FImageMarkDisabled write SetImageMarkDisabled default -1;
property ImageMarkGrayed: TImageIndex read FImageMarkGrayed write SetImageMarkGrayed default -1;
property Layout: TSCCheckboxLayout read FLayout write SetLayout default scclMiddle;
property MarkColor: TColor read FMarkColor write SetMarkColor default clWindowText;
property MarkDisabledColor: TColor read FMarkDisabledColor write SetMarkDisabledColor default clGrayText;
property MarkGrayedColor: TColor read FMarkGrayedColor write SetMarkGrayedColor default clGrayText;
property Multiline: Boolean read FMultiline write SetMultiline default False;
property ParentColor default True;
property ShowCheckMark: Boolean read FShowCheckMark write SetShowCheckMark default True;
property ShowFocus: Boolean read FShowFocus write SetShowFocus default True;
property Style: TSCCheckboxStyle read FStyle write SetStyle default sccsWin2k;
property TabStop default True;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
end;
TSCCheckbox = class(TSCCustomCheckbox)
published
property Action;
property Align;
property Alignment;
property AllowGrayed;
property Anchors;
property AutoSize;
property State;
property BiDiMode;
property BorderProps;
property BoxCheckedColor;
property BoxDisabledColor;
property BoxFrameColor;
property BoxGrayedColor;
property BoxToggleColor;
property BoxUncheckedColor;
property Caption;
property Checked;
property Color;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property EndEllipsis;
property Font;
property Gradient;
property GradientEnd;
property HighlightColor;
property HottrackColor;
property Images;
property ImageChecked;
property ImageDisabled;
property ImageGrayed;
property ImageToggle;
property ImageUnchecked;
property ImageMark;
property ImageMarkGrayed;
property Indent;
property Layout;
property MarkColor;
property MarkDisabledColor;
property MarkGrayedColor;
property Multiline;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property Picture;
property PictureProps;
property ShowCheckMark;
property ShowFocus;
property ShowHint;
property Spacing;
property Style;
property TabOrder;
property TabStop;
property Transparent;
property Visible;
property OnCanResize;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
end;
TSCRadioStyle = (scrsCorel, scrsFlat, scrsFlatFrame, scrsImage, scrsMac,
scrsMetal, scrsOfficeXP, scrsWin2k, scrsXP);
TSCRadioLayout = (scrlBottom, scrlMiddle, scrlTop);
TSCCustomRadioButton = class(TSCButtonBase)
private
FAlignment: TLeftRight;
FAsCheckbox: Boolean;
FBoxCheckedColor: TColor;
FBoxDisabledColor: TColor;
FBoxFrameColor: TColor;
FBoxToggleColor: TColor;
FBoxUncheckedColor: TColor;
FChecked: Boolean;
FGradient: TSCGradient;
FGradientEnd: TColor;
FHighlightColor: TColor;
FHottrackColor: TColor;
FImageChecked: TImageIndex;
FImageDisabled: TImageIndex;
FImageToggle: TImageIndex;
FImageUnchecked: TImageIndex;
FImageMark: TImageIndex;
FImageMarkDisabled: TImageIndex;
FLayout: TSCRadioLayout;
FMarkColor: TColor;
FMarkDisabledColor: TColor;
FMultiline: Boolean;
FShowCheckMark: Boolean;
FShowFocus: Boolean;
FStyle: TSCRadioStyle;
FMouseKeysDown: Boolean;
FInnerRect: TRect;
FOfficeMarkColor: TColor;
FSpaceDown: Boolean;
FMousePressed: Boolean;
procedure SetAlignment(Value: TLeftRight);
procedure SetAsCheckbox(Value: Boolean);
procedure SetBoxCheckedColor(Value: TColor);
procedure SetBoxDisabledColor(Value: TColor);
procedure SetBoxFrameColor(Value: TColor);
procedure SetBoxToggleColor(Value: TColor);
procedure SetBoxUncheckedColor(Value: TColor);
procedure SetGradient(Value: TSCGradient);
procedure SetGradientEnd(Value: TColor);
procedure SetHighlightColor(Value: TColor);
procedure SetHottrackColor(Value: TColor);
procedure SetImageChecked(Value: TImageIndex);
procedure SetImageDisabled(Value: TImageIndex);
procedure SetImageToggle(Value: TImageIndex);
procedure SetImageUnchecked(Value: TImageIndex);
procedure SetImageMark(Value: TImageIndex);
procedure SetImageMarkDisabled(Value: TImageIndex);
procedure SetLayout(Value: TSCRadioLayout);
procedure SetMarkColor(Value: TColor);
procedure SetMarkDisabledColor(Value: TColor);
procedure SetMultiline(Value: Boolean);
procedure SetShowCheckMark(Value: Boolean);
procedure SetShowFocus(Value: Boolean);
procedure SetStyle(Value: TSCRadioStyle);
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY;
procedure CNCommand(var Message: TWMCommand); message CN_COMMAND;
procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS;
function GetBoxWidth: Integer;
function GetBoxHeight: Integer;
function GetBoxFaceColor: TColor;
protected
procedure Paint; override;
procedure FocusChanged; override;
procedure TransparentChanged; override;
procedure StopTracking; override;
procedure MouseInControlChanged; override;
procedure SpacingChanged; override;
procedure EnabledChanged; override;
function GetChecked: Boolean; override;
procedure SetChecked(Value: Boolean); override;
procedure DoMouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure DoMouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
function GetAdjustedRect(NewWidth, NewHeight: Integer): TRect; override;
procedure AdjustBounds; override;
function GetBlendValue: Word; override;
function InToggle: Boolean; virtual;
procedure Toggle; virtual;
procedure GenerateOctPoints(Rc: TRect; RoundBy: Integer; var Pts: array of TPoint);
procedure DrawXPRb(X, Y: Integer; FrmColor, InnerColor, OutterColor, TrackColor,
CheckColor: TColor);
procedure DrawWin2kRb(X, Y: Integer; InnerColor, CheckColor: TColor);
procedure DrawFlatRb(X, Y: Integer; FrmColor, InnerColor, CheckColor: TColor);
procedure DrawFlatFrameRb(X, Y: Integer; InnerColor, CheckColor: TColor);
procedure DrawMacRb(X, Y: Integer; FrmColor, InnerColor, OutterColor,
CheckColor: TColor; Pressed: Boolean);
procedure DoDrawMark(R: TRect; AColor: TColor = clNone);
procedure DoDrawText(var R: TRect; CalcRect: Boolean = False);
procedure DoDrawAsRadio;
procedure DoDrawCorelCb;
procedure DoDrawFlatCb;
procedure DoDrawImageCb;
procedure DoDrawMacCb;
procedure DoDrawOfficeXPCb;
procedure DoDrawWin2kCb;
procedure DoDrawXPCb;
procedure DoDrawMetalCb;
property Alignment: TLeftRight read FAlignment write SetAlignment default taRightJustify;
property AsCheckbox: Boolean read FAsCheckbox write SetAsCheckbox default False;
property BoxCheckedColor: TColor read FBoxCheckedColor write SetBoxCheckedColor default clWindow;
property BoxDisabledColor: TColor read FBoxDisabledColor write SetBoxDisabledColor default clBtnFace;
property BoxFrameColor: TColor read FBoxFrameColor write SetBoxFrameColor default clBtnShadow;
property BoxToggleColor: TColor read FBoxToggleColor write SetBoxToggleColor default clBtnFace;
property BoxUncheckedColor: TColor read FBoxUncheckedColor write SetBoxUncheckedColor default clWindow;
property Checked default False;
property Color nodefault;
property Gradient: TSCGradient read FGradient write SetGradient default scgNone;
property GradientEnd: TColor read FGradientEnd write SetGradientEnd default clBlue;
property HighlightColor: TColor read FHighlightColor write SetHighlightColor default SC_HighlightColor;
property HottrackColor: TColor read FHottrackColor write SetHottrackColor default SC_HottrackColor;
property ImageChecked: TImageIndex read FImageChecked write SetImageChecked default -1;
property ImageDisabled: TImageIndex read FImageDisabled write SetImageDisabled default -1;
property ImageToggle: TImageIndex read FImageToggle write SetImageToggle default -1;
property ImageUnchecked: TImageIndex read FImageUnchecked write SetImageUnchecked default -1;
property ImageMark: TImageIndex read FImageMark write SetImageMark default -1;
property ImageMarkDisabled: TImageIndex read FImageMarkDisabled write SetImageMarkDisabled default -1;
property Layout: TSCRadioLayout read FLayout write SetLayout default scrlMiddle;
property MarkColor: TColor read FMarkColor write SetMarkColor default clWindowText;
property MarkDisabledColor: TColor read FMarkDisabledColor write SetMarkDisabledColor default clGrayText;
property Multiline: Boolean read FMultiline write SetMultiline default False;
property ParentBiDiMode;
property ParentColor default True;
property ShowCheckMark: Boolean read FShowCheckMark write SetShowCheckMark default True;
property ShowFocus: Boolean read FShowFocus write SetShowFocus default True;
property Style: TSCRadioStyle read FStyle write SetStyle default scrsWin2k;
property TabStop default False;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
end;
TSCRadioButton = class(TSCCustomRadioButton)
published
property Action;
property Align;
property Alignment;
property Anchors;
property AsCheckbox;
property AutoSize;
property BiDiMode;
property BorderProps;
property BoxCheckedColor;
property BoxDisabledColor;
property BoxFrameColor;
property BoxToggleColor;
property BoxUncheckedColor;
property Caption;
property Checked;
property Color;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property EndEllipsis;
property Font;
property Gradient;
property GradientEnd;
property HighlightColor;
property HottrackColor;
property Images;
property ImageChecked;
property ImageDisabled;
property ImageToggle;
property ImageUnchecked;
property ImageMark;
property ImageMarkDisabled;
property Indent;
property Layout;
property MarkColor;
property MarkDisabledColor;
property Multiline;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property Picture;
property PictureProps;
property ShowCheckMark;
property ShowFocus;
property ShowHint;
property Spacing;
property Style;
property TabOrder;
property TabStop;
property Transparent;
property Visible;
property OnCanResize;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
end;
TSCCustomLabel = class(TSCCustomControl)
private
FAlignment: TAlignment;
FEllipsisMode: TSCEllipsis;
FFocusControl: TWinControl;
FGradient: TSCGradient;
FGradientEnd: TColor;
FGradientMid: TColor;
FGradientUsesMid: Boolean;
FHighlightColor: TColor;
FHotImage: TImageIndex;
FHottrack: Boolean;
FHottrackColor: TColor;
FHotUnderline: Boolean;
FImageLayout: TSCImageLayout;
FLayout: TSCLayout;
FMultiline: Boolean;
FRotation: TSCRotation;
FShowAccelChar: Boolean;
FShowFocus: Boolean;
FMousePressed: Boolean;
FIndentVert: Integer;
procedure SetAlignment(Value: TAlignment);
procedure SetEllipsisMode(Value: TSCEllipsis);
procedure SetFocusControl(Value: TWinControl);
procedure SetGradient(Value: TSCGradient);
procedure SetGradientEnd(Value: TColor);
procedure SetGradientMid(Value: TColor);
procedure SetGradientUsesMid(Value: Boolean);
procedure SetHighlightColor(Value: TColor);
procedure SetHotImage(Value: TImageIndex);