Repository navigation
Expand file tree
/
Copy pathSCColorControls.pas
More file actions
6971 lines (5903 loc) · 172 KB
/
Copy pathSCColorControls.pas
File metadata and controls
6971 lines (5903 loc) · 172 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 SCColorControls;
{$I SweetControls.inc}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ImgList, SCConsts, SCControl, SCCommon, SCBitmap, SCResStrs;
const
crSCCPalettePicker = -8914;
type
TSC3DSunkenBorderProps = class(TSCControlBorderProps)
public
constructor Create(AOwner: TSCCustomControl); override;
published
property Border default sccb3DLowered;
property ExDraw;
property FlatColor;
property FlatInnerColor;
property InnerBorder;
property Width;
end;
TSCColorCells = class;
TSCCustomColorPalette = class;
TSCColorCell = class(TCollectionItem)
private
FAutoColor: Boolean;
FColor: TColor;
FText: string;
FImageIndex: TImageIndex;
FVisible: Boolean;
FEnabled: Boolean;
FHint: String;
procedure SetAutoColor(Value: Boolean);
procedure SetColor(Value: TColor);
procedure SetEnabled(Value: Boolean);
procedure SetImageIndex(Value: TImageIndex);
function GetFocused: Boolean;
function GetBack: Boolean;
function GetFore: Boolean;
procedure SetVisible(Value: Boolean);
procedure SetText(const Value: string);
protected
function GetDisplayName: string; override;
function OwnerPalette: TSCCustomColorPalette;
function OwnerState: TComponentState;
function GetImages: TCustomImageList;
public
constructor Create(Collection: TCollection); override;
procedure Assign(Source: TPersistent); override;
property Focused: Boolean read GetFocused;
property IsBack: Boolean read GetBack;
property IsFore: Boolean read GetFore;
published
property AutoColor: Boolean read FAutoColor write SetAutoColor default False;
property Color: TColor read FColor write SetColor default clNone;
property Enabled: Boolean read FEnabled write SetEnabled default True;
property Hint: String read FHint write FHint;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1;
property Text: string read FText write SetText;
property Visible: Boolean read FVisible write SetVisible default True;
end;
TSCColorCells = class(TCollection)
private
FPalette: TSCCustomColorPalette;
function GetItem(Index: Integer): TSCColorCell;
procedure SetItem(Index: Integer; Value: TSCColorCell);
protected
function GetOwner: TPersistent; override;
procedure Update(Item: TCollectionItem); override;
public
constructor Create(Palette: TSCCustomColorPalette);
function Add: TSCColorCell;
{$IFDEF SC_DELPHI5_AND_EARLY}
property Owner: TSCCustomColorPalette read FPalette;
{$ENDIF}
property Items[Index: Integer]: TSCColorCell read GetItem write SetItem; default;
end;
TSCColorPalStyle = (scpsNone, scpsDefault, scpsSunkenFlat, scpsFlat, scpsExtraFlat,
scpsRaisedFlat, scpsRaised, scpsMac, scpsMetal, scpsXP);
TSCColorScheme = (scCustomScheme, scWin16Scheme, scGrayScheme, scWin256Scheme,
scNetscape1Scheme, scNetscape2Scheme, scNetscape3Scheme, scIEScheme,
scGradientScheme);
TSCCPalScrollStyle = (scpssNone, scpssUp, scpssDown);
TSCCPalHintStyle = (scphHex, scphRGB, scphHexAndRGB, scphRGBAndHex);
TSCCPalClickEvent = procedure(Sender: TObject; Index: Integer) of object;
TSCCPalMouseEvent = procedure(Sender: TObject; Index: Integer;
Button: TMouseButton; Shift: TShiftState) of object;
TSCCustomColorPalette = class(TSCCustomControl)
private
FBackColor: TColor;
FCanSelectBackColor: Boolean;
FCellBorderColor: TColor;
FCells: TSCColorCells;
FCellSpace: Integer;
FCellWidth: Integer;
FClickedCell: Integer;
FCursorChange: Boolean;
FDefaultCursor: TCursor;
FFlatButtons: Boolean;
FFocusedCell: Integer;
FFocusedColor: TColor;
FForeColor: TColor;
FGradientStart: TColor;
FGradientStop: TColor;
FGradientStep: Integer;
FHintHexCaption: String;
FHintStyle: TSCCPalHintStyle;
FInternalDraw: Boolean;
FMouseIsDown: Boolean;
FOrientation: TSCOrientation;
FPickerCursor: TCursor;
FScrollArrowColor: TColor;
FScrollBtnColor: TColor;
FScrollClick: TSCCPalScrollStyle;
FScrolling: Boolean;
FScrollPos: Integer;
FScrollSize: Integer;
FScrollTimer: Integer;
FSelectionColor: TColor;
FScheme: TSCColorScheme;
FShowBackColor: Boolean;
FShowButtons: Boolean;
FShowFocused: Boolean;
FShowForeColor: Boolean;
FStyle: TSCColorPalStyle;
FTopIndent: Integer;
FUpdatingScheme: Boolean;
FVisibleCount: Integer;
// Events
FDblClicked: Boolean;
FOldClickedCell: Integer;
FOnCellClick: TSCCPalClickEvent;
FOnCellDblClick: TSCCPalClickEvent;
FOnCellMouseDown: TSCCPalMouseEvent;
FOnCellMouseUp: TSCCPalMouseEvent;
FOnFocusChange: TNotifyEvent;
FOnBkColorChange: TNotifyEvent;
FOnForeColorChange: TNotifyEvent;
// Private procedures
procedure SetBackColor(Value: TColor);
procedure SetCellBorderColor(Value: TColor);
procedure SetCells(Value: TSCColorCells);
procedure SetCellSpace(Value: Integer);
procedure SetCellWidth(Value: Integer);
procedure SetFlatButtons(Value: Boolean);
procedure SetFocusedCell(Value: Integer);
procedure SetFocusedColor(Value: TColor);
procedure SetOrientation(Value: TSCOrientation);
procedure SetPickerCursor(Value: TCursor);
procedure SetScrollArrowColor(Value: TColor);
procedure SetScrollBtnColor(Value: TColor);
procedure SetForeColor(Value: TColor);
procedure SetGradientStart(Value: TColor);
procedure SetGradientStop(Value: TColor);
procedure SetGradientStep(Value: Integer);
procedure SetSelectionColor(Value: TColor);
procedure SetScheme(Value: TSCColorScheme);
procedure SetShowBackColor(Value: Boolean);
procedure SetShowFocused(Value: Boolean);
procedure SetShowForeColor(Value: Boolean);
procedure SetShowButtons(Value: Boolean);
procedure SetStyle(Value: TSCColorPalStyle);
procedure SetTopIndent(Value: Integer);
procedure CMCancelMode(var Message: TCMCancelMode); message CM_CANCELMODE;
procedure CMCursorChanged(var Message: TMessage); message CM_CURSORCHANGED;
procedure CMHintShow(var Msg: TMessage); message CM_HINTSHOW;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL;
procedure WMTimer(var Message: TWMTimer); message WM_TIMER;
procedure ResetCursor(ACursor: TCursor);
procedure UpdatePaletteScheme;
function CountVisibleCells: Integer;
procedure UpdateVisibleCount(Value: Integer);
procedure UpdateScrollPos(Value: Integer);
procedure RefreshScrollSize;
procedure StartScrolling;
procedure ScrollPalette;
procedure StopScrolling;
function GetGradientColor(Index: Integer): TColor;
procedure DoCellClick(Index: Integer);
procedure DoCellDblClick(Index: Integer);
procedure DoCellMouseDown(Index: Integer; Button: TMouseButton; Shift: TShiftState);
procedure DoCellMouseUp(Index: Integer; Button: TMouseButton; Shift: TShiftState);
protected
procedure Paint; override;
procedure Loaded; override;
procedure SetIndent(Value: Integer); override;
procedure IndentChanged; 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 UpdateCell(Index: Integer); virtual;
procedure UpdateCells; dynamic;
procedure UpdateFocusedCell;
function CanScrollVertically(UpDir: Boolean): Boolean;
function CanScrollHorizontally(LeftDir: Boolean): Boolean;
function GetBtnRect(const Up: Boolean): TRect;
function GetCellHint(ACell: TSCColorCell): String; virtual;
procedure DrawScrollButtons(ACanvas: TCanvas; X, Y: Integer);
procedure DrawFrame(C: TCanvas; Index: Integer; R: TRect;
Cl: TColor; Selected: Boolean; IsBack: Boolean = False);
procedure DrawOnCanvas(ACanvas: TCanvas; X, Y: Integer); virtual;
property BackColor: TColor read FBackColor write SetBackColor default -1;
property CanSelectBackColor: Boolean read FCanSelectBackColor write FCanSelectBackColor default False;
property CellBorderColor: TColor read FCellBorderColor write SetCellBorderColor default clWindowFrame;
property Cells: TSCColorCells read FCells write SetCells;
property CellSpace: Integer read FCellSpace write SetCellSpace default 2;
property CellWidth: Integer read FCellWidth write SetCellWidth default 16;
property HintHexCaption: String read FHintHexCaption write FHintHexCaption;
property HintStyle: TSCCPalHintStyle read FHintStyle write FHintStyle default scphHex;
property FlatButtons: Boolean read FFlatButtons write SetFlatButtons default False;
property ForeColor: TColor read FForeColor write SetForeColor default clNone;
property GradientStart: TColor read FGradientStart write SetGradientStart default clLime;
property GradientStop: TColor read FGradientStop write SetGradientStop default clBlue;
property GradientStep: Integer read FGradientStep write SetGradientStep default 256;
property Orientation: TSCOrientation read FOrientation write SetOrientation default scoVertical;
property PickerCursor: TCursor read FPickerCursor write SetPickerCursor default crSCCPalettePicker;
property ScrollArrowColor: TColor read FScrollArrowColor write SetScrollArrowColor default clWindowFrame;
property ScrollBtnColor: TColor read FScrollBtnColor write SetScrollBtnColor default clBtnFace;
property SelectionColor: TColor read FSelectionColor write SetSelectionColor default clHighlight;
property Scheme: TSCColorScheme read FScheme write SetScheme default scCustomScheme;
property ShowBackColor: Boolean read FShowBackColor write SetShowBackColor default False;
property ShowButtons: Boolean read FShowButtons write SetShowButtons default True;
property ShowFocused: Boolean read FShowFocused write SetShowFocused default True;
property ShowForeColor: Boolean read FShowForeColor write SetShowForeColor default True;
property Style: TSCColorPalStyle read FStyle write SetStyle default scpsDefault;
property TopIndent: Integer read FTopIndent write SetTopIndent default 0;
property OnBkColorChange: TNotifyEvent read FOnBkColorChange write FOnBkColorChange;
property OnCellClick: TSCCPalClickEvent read FOnCellClick write FOnCellClick;
property OnCellDblClick: TSCCPalClickEvent read FOnCellDblClick write FOnCellDblClick;
property OnCellMouseDown: TSCCPalMouseEvent read FOnCellMouseDown write FOnCellMouseDown;
property OnCellMouseUp: TSCCPalMouseEvent read FOnCellMouseUp write FOnCellMouseUp;
property OnFocusChange: TNotifyEvent read FOnFocusChange write FOnFocusChange;
property OnForeColorChange: TNotifyEvent read FOnForeColorChange write FOnForeColorChange;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
function GetScrollStyleOf(P: TPoint): TSCCPalScrollStyle;
function CanScroll(AsUp: Boolean): Boolean;
function Scrolling: Boolean;
function ScrollPaused: Boolean;
procedure PauseScrolling;
procedure ResumeScrolling;
procedure ArrangeScrolling;
function CellAtPos(P: TPoint): Integer;
function GetCellRect(Index: Integer): TRect;
function GetCellsBounds: TRect;
function CellsClientRect: TRect;
property FocusedColor: TColor read FFocusedColor default -1;
property ClickedCell: Integer read FClickedCell;
property FocusedCell: Integer read FFocusedCell;
property VisibleCount: Integer read FVisibleCount;
property ScrollPos: Integer read FScrollPos write UpdateScrollPos;
property ScrollSize: Integer read FScrollSize;
end;
TSCColorPalette = class(TSCCustomColorPalette)
published
property Align;
property Anchors;
property BackColor;
property BorderProps;
property CanSelectBackColor;
property CellBorderColor;
property Cells;
property CellSpace;
property CellWidth;
property Color;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Height;
property HintHexCaption;
property HintStyle;
property FlatButtons;
property Font;
property ForeColor;
property GradientStart;
property GradientStop;
property GradientStep;
property Hint;
property Images;
property Indent;
property Orientation;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PickerCursor;
property PopupMenu;
property ScrollArrowColor;
property ScrollBtnColor;
property SelectionColor;
property Scheme;
property ShowBackColor;
property ShowButtons;
property ShowFocused;
property ShowForeColor;
property ShowHint;
property Style;
property TabOrder;
property TabStop;
property TopIndent;
property Visible;
property Width;
property OnBkColorChange;
property OnCanResize;
property OnCellClick;
property OnCellDblClick;
property OnCellMouseDown;
property OnCellMouseUp;
property OnChange;
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 OnFocusChange;
property OnForeColorChange;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnMouseWheel;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCColorSelectorPart = (sccpNone, sccpClient, sccpBackColor, sccpForeColor);
TSCColorSelectorLayout = (scclFrontBack, sccLeftRight, scclTopBottom);
TSCCustomColorSelectBox = class(TSCCustomControl)
private
FAutoSized: Boolean;
FBackColor: TColor;
FCellBorderColor: TColor;
FCellWidth: Integer;
FClickSwaps: Boolean;
FDblClickSwaps: Boolean;
FForeColor: TColor;
FLayout: TSCColorSelectorLayout;
FNoneColor: TColor;
FNoneDiagonal: TColor;
FNoneStyle: TSCNoneColorStyle;
FStyle: TSCColorPalStyle;
procedure SetAutoSized(Value: Boolean);
procedure SetBackColor(Value: TColor);
procedure SetCellBorderColor(Value: TColor);
procedure SetCellWidth(Value: Integer);
procedure SetClickSwaps(Value: Boolean);
procedure SetDblClickSwaps(Value: Boolean);
procedure SetForeColor(Value: TColor);
procedure SetLayout(Value: TSCColorSelectorLayout);
procedure SetNoneColor(Value: TColor);
procedure SetNoneDiagonal(Value: TColor);
procedure SetNoneStyle(Value: TSCNoneColorStyle);
procedure SetStyle(Value: TSCColorPalStyle);
protected
procedure Paint; override;
function GetBorderPropsClass: TSCControlBorderPropsClass; override;
function GetBlendValue: Word; override;
procedure Click; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure SetSpacing(Value: Integer); override;
function GetForeCell: TRect;
function GetBackCell: TRect;
function GetCellWidth: Integer;
function GetFrameBorderSize: Integer;
procedure DrawDiagonal(C: TCanvas; InR: TRect);
procedure DrawFrame(C: TCanvas; R: TRect; Cl: TColor; IsFore: Boolean = True);
procedure DrawOnCanvas(ACanvas: TCanvas; X, Y: Integer); virtual;
property AutoSized: Boolean read FAutoSized write SetAutoSized default True;
property BackColor: TColor read FBackColor write SetBackColor default clNone;
property BlendColor default False;
property CellBorderColor: TColor read FCellBorderColor write SetCellBorderColor default cl3DDkShadow;
property CellWidth: Integer read FCellWidth write SetCellWidth default 20;
property ClickSwaps: Boolean read FClickSwaps write SetClickSwaps default False;
property DblClickSwaps: Boolean read FDblClickSwaps write SetDblClickSwaps default False;
property ForeColor: TColor read FForeColor write SetForeColor default clNone;
property Indent default 4;
property Layout: TSCColorSelectorLayout read FLayout write SetLayout default scclFrontBack;
property NoneColor: TColor read FNoneColor write SetNoneColor default clNone;
property NoneDiagonal: TColor read FNoneDiagonal write SetNoneDiagonal default clRed;
property NoneStyle: TSCNoneColorStyle read FNoneStyle write SetNoneStyle default scncNone;
property Spacing default 4;
property Style: TSCColorPalStyle read FStyle write SetStyle default scpsRaised;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
procedure SwapColors;
function PartAtPos(X, Y: Integer): TSCColorSelectorPart;
end;
TSCColorSelectBox = class(TSCCustomColorSelectBox)
published
property Align;
property Anchors;
property AutoSized;
property BackColor;
property BlendColor;
property BorderProps;
property CellBorderColor;
property CellWidth;
property Color;
property Constraints;
property Cursor;
property ClickSwaps;
property DblClickSwaps;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Font;
property ForeColor;
property Height;
property Hint;
property Indent;
property Layout;
property NoneColor;
property NoneDiagonal;
property NoneStyle;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Spacing;
property Style;
property TabOrder;
property TabStop;
property Visible;
property Width;
property OnCanResize;
property OnChange;
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 OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnMouseWheel;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCColorPointerType = (scptSquare, scptFlippedSquare, scptCircle, scptCross);
TSCCustomGradient = class(TSCCustomControl)
private
FColorCount: Integer;
FColorPointer: TSCColorPointerType;
FGradientBmp: TSCBitmap;
FNeedSizeUpdate: Boolean;
FNeedUpdate: Boolean;
FLockUpdate: Boolean;
FSelectedColor: TColor;
FSelectedPoint: TPoint;
procedure SetColorPointer(Value: TSCColorPointerType);
protected
function GetBorderPropsClass: TSCControlBorderPropsClass; override;
procedure SetSelectedPoint(X, Y: Integer); virtual;
procedure SetColorCount(Value: Integer); virtual;
function GetSelectedColor: TColor; virtual;
procedure SetSelectedColor(Value: TColor); virtual;
function GetGradientBmp: TSCBitmap; virtual;
procedure UpdateGradientBmp(WithSize: Boolean = True); virtual;
procedure DrawSelectionPointer; virtual;
procedure CreateWnd; override;
procedure Loaded; override;
procedure Paint; override;
procedure BoundsChanged; dynamic;
procedure DoUpdateChange(NeedUpdate: Boolean = True); dynamic;
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;
property Border default sccb3DLowered;
property ColorCount: Integer read FColorCount write SetColorCount;
property ColorPointer: TSCColorPointerType read FColorPointer write SetColorPointer default scptSquare;
property SelectedColor: TColor read GetSelectedColor write SetSelectedColor default -1;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
property BorderEx;
property OnChange;
end;
TSCCustomCornerGradient = class(TSCCustomGradient)
private
FCLeftTop: TColor;
FCLeftBottom: TColor;
FCRightTop: TColor;
FCRightBottom: TColor;
procedure SetLeftTop(Value: TColor);
procedure SetLeftBottom(Value: TColor);
procedure SetRightTop(Value: TColor);
procedure SetRightBottom(Value: TColor);
protected
procedure SetColorValues(ALeftTop, ALeftBottom, ARightTop,
ARightBottom: TColor; AColorCount: Integer);
procedure UpdateGradientBmp(WithSize: Boolean = True); override;
procedure DrawSelectionPointer; override;
property LeftTop: TColor read FCLeftTop write SetLeftTop;
property LeftBottom: TColor read FCLeftBottom write SetLeftBottom;
property RightTop: TColor read FCRightTop write SetRightTop;
property RightBottom: TColor read FCRightBottom write SetRightBottom;
property BlendColor default False;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
end;
TSCColorGradient = class;
TSCGradientColors = class(TPersistent)
private
FOwner: TSCColorGradient;
function GetColorCount: Integer;
procedure SetColorCount(Value: Integer);
function GetLeftTop: TColor;
procedure SetLeftTop(Value: TColor);
function GetLeftBottom: TColor;
procedure SetLeftBottom(Value: TColor);
function GetRightTop: TColor;
procedure SetRightTop(Value: TColor);
function GetRightBottom: TColor;
procedure SetRightBottom(Value: TColor);
public
constructor Create(AOwner: TSCColorGradient); virtual;
procedure Assign(Source: TPersistent); override;
published
property ColorCount: Integer read GetColorCount write SetColorCount default 80;
property LeftTop: TColor read GetLeftTop write SetLeftTop default clBlack;
property LeftBottom: TColor read GetLeftBottom write SetLeftBottom default clGray;
property RightTop: TColor read GetRightTop write SetRightTop default clRed;
property RightBottom: TColor read GetRightBottom write SetRightBottom default clWhite;
end;
TSCColorGradient = class(TSCCustomCornerGradient)
private
FColors: TSCGradientColors;
procedure SetColors(Value: TSCGradientColors);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property Align;
property Anchors;
property BorderProps;
property Color;
property ColorPointer;
property Colors: TSCGradientColors read FColors write SetColors;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Height;
property Hint;
property ParentColor;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property Width;
property OnCanResize;
property OnChange;
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 OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnMouseWheel;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCCustomHSVGradient = class(TSCCustomCornerGradient)
private
FReverse: Boolean;
procedure SetReverse(Value: Boolean);
procedure CalcSelectedPoint(S, V: Word);
protected
procedure BoundsChanged; override;
procedure SetSelectedColor(Value: TColor); override;
procedure SetSelectedPoint(X, Y: Integer); override;
procedure Loaded; override;
property BlendColor default False;
property ColorCount default 80;
property Reverse: Boolean read FReverse write SetReverse default False;
property RightTop default clRed;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
property SelectedColor;
end;
TSCHSVGradient = class(TSCCustomHSVGradient)
published
property Align;
property Anchors;
property BlendColor;
property BorderProps;
property Color;
property ColorCount;
property ColorPointer;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Height;
property Hint;
property ParentColor;
property ParentShowHint;
property PopupMenu;
property Reverse;
property RightTop;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property Width;
property OnCanResize;
property OnChange;
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 OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnMouseWheel;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCRGBRoller = class(TSCCustomGradient)
private
FShowBlackWhite: Boolean;
procedure SetShowBlackWhite(Value: Boolean);
protected
procedure SetSelectedPoint(X, Y: Integer); override;
procedure UpdateGradientBmp(WithSize: Boolean = True); override;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
property SelectedColor default clWhite;
published
property Align;
property Anchors;
property BorderProps;
property Constraints;
property Cursor default crSCCPalettePicker;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Height;
property Hint;
property ParentShowHint;
property PopupMenu;
property ShowBlackWhite: Boolean read FShowBlackWhite write SetShowBlackWhite default True;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property Width;
property OnCanResize;
property OnChange;
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 OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnMouseWheel;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCColorSliderOrientation = (scsoHorizontal, scsoVertical);
TSCSliderThumbType = (scsttDown, scsttUp, scsttBoth);
TSCCustomColorSlider = class(TSCCustomControl)
private
FMin: Integer;
FMax: Integer;
FOrientation: TSCColorSliderOrientation;
FPosition: Integer;
FProgressBorder: TSCControlBorder;
FSelectedColor: TColor;
FThumbStyle: TSCThumbStyle;
FThumbType: TSCSliderThumbType;
FTopIndent: Integer;
FOnChange: TNotifyEvent;
FColorBmp: TSCBitmap;
FClearBack: Boolean;
FNeedUpdate: Boolean;
FNeedSizeUpdate: Boolean;
procedure SetMin(Value: Integer);
procedure SetMax(Value: Integer);
procedure SetOrientation(Value: TSCColorSliderOrientation);
procedure SetProgressBorder(Value: TSCControlBorder);
procedure SetThumbStyle(Value: TSCThumbStyle);
procedure SetThumbType(Value: TSCSliderThumbType);
procedure SetCursorPos(X, Y: Integer);
procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL;
protected
procedure SetTopIndent(Value: Integer); virtual;
procedure TopIndentChanged; dynamic;
procedure SetIndent(Value: Integer); override;
procedure IndentChanged; override;
procedure Loaded; override;
procedure CreateWnd; override;
procedure Paint; override;
procedure ProcessTrackKey(Key: Word);
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: Char); override;
function GetThumbHeight: Integer; dynamic;
function GetThumbWidth: Integer; dynamic;
function GetThumbDownRect: TRect; dynamic;
function GetThumbUpRect: TRect; dynamic;
function GetProgressRect: TRect; dynamic;
procedure SetPosition(Value: Integer); virtual;
function GetSelectedColor: TColor; virtual;
procedure SetSelectedColor(Value: TColor); virtual;
procedure DoUpdateChange(NeedUpdate, TriggerEvent: Boolean); virtual;
procedure UpdateColorBmp(UpdateSize: Boolean = False); virtual;
procedure DrawProgress; virtual;
procedure DrawDownSlider(P: TPoint; W, H: Integer);
procedure DrawUpSlider(P: TPoint; W, H: Integer);
procedure DrawThumb; virtual;
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;
property Min: Integer read FMin write SetMin default 0;
property Max: Integer read FMax write SetMax default 255;
property Orientation: TSCColorSliderOrientation read FOrientation write SetOrientation default scsoHorizontal;
property Position: Integer read FPosition write SetPosition default 0;
property ProgressBorder: TSCControlBorder read FProgressBorder write SetProgressBorder default sccb3DLowered;
property SelectedColor: TColor read GetSelectedColor write SetSelectedColor default clBlack;
property ThumbStyle: TSCThumbStyle read FThumbStyle write SetThumbStyle default sctsMac;
property ThumbType: TSCSliderThumbType read FThumbType write SetThumbType default scsttDown;
property TopIndent: Integer read FTopIndent write SetTopIndent default 0;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
TSCHueSlider = class(TSCCustomColorSlider)
private
FHSVGradient: TSCCustomHSVGradient;
procedure SetHSVGradient(Value: TSCCustomHSVGradient);
protected
procedure SetPosition(Value: Integer); override;
procedure SetSelectedColor(Value: TColor); override;
procedure UpdateColorBmp(UpdateSize: Boolean = False); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
property SelectedColor default clRed;
published
property Align;
property Anchors;
property BorderProps;
property Color;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Height;
property Hint;
property HSVGradient: TSCCustomHSVGradient read FHSVGradient write SetHSVGradient;
property Indent;
property Orientation;
property ParentColor;
property ParentShowHint;
property PopupMenu;
property Position;
property ProgressBorder;
property ShowHint;
property TabOrder;
property TabStop;
property ThumbStyle;
property ThumbType;
property TopIndent;
property Visible;
property Width;
property OnCanResize;
property OnChange;
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 OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnMouseWheel;
property OnStartDock;
property OnStartDrag;
property OnUnDock;
end;
TSCLumSlider = class(TSCCustomColorSlider)
protected
procedure UpdateColorBmp(UpdateSize: Boolean = False); override;
public
constructor Create(AOwner: TComponent); override;
property SelectedColor default clRed;
published
property Align;
property Anchors;
property BorderProps;
property Color;
property Constraints;
property Cursor;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Height;
property Hint;
property Indent;
property Orientation;
property ParentColor;
property ParentShowHint;
property PopupMenu;
property Position;
property ProgressBorder;
property ShowHint;
property TabOrder;
property TabStop;
property ThumbStyle;
property ThumbType;
property TopIndent;
property Visible;
property Width;
property OnCanResize;
property OnChange;
property OnClick;
property OnConstrainedResize;
property OnContextPopup;
property OnDockDrop;
property OnDockOver;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;