This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/
TGradientTabSet.pas
426 lines (426 loc) · 16.5 KB
/
TGradientTabSet.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
type
TGradientTabSet=class(TCustomControl)
private
FTabList :TStringList;
FTabIndex :Integer;
FLeftOffset :Integer;
FImages :TCustomImageList;
FImageChangeLink :TChangeLink;
FOnChange :TNotifyEvent;
FOnTabChanging :TTabChangingEvent;
FOnGetImageIndex :TTabGetImageEvent;
FOnGetOverlayImageIndex:TTabGetImageEvent;
FOnGetHint :TTabGetHintEvent;
FMemBitmap :TBitmap;
FTabPositions :TObjectList;
FDrawer :TGradientTabDrawer;
FScroller :TTabScroller;
FTabPositionsValid :Boolean;
FCanvas :TCanvas;
FAlignControlList :TList;
FAlignLevel :Word;
FBevelEdges :TBevelEdges;
FBevelInner :TBevelCut;
FBevelOuter :TBevelCut;
FBevelKind :TBevelKind;
FBevelWidth :TBevelWidth;
FBorderWidth :TBorderWidth;
FPadding :TPadding;
FBrush :TBrush;
FDockClients :TList;
FDockManager :IDockManager;
FImeMode :TImeMode;
FImeName :TImeName;
FParentWindow :HWND;
FTabList :TList;
FControls :TList;
FWinControls :TList;
FTabOrder :Integer;
FTabStop :Boolean;
FCtl3D :Boolean;
FShowing :Boolean;
FUseDockManager :Boolean;
FDockSite :Boolean;
FParentCtl3D :Boolean;
FParentDoubleBuffered:Boolean;
FPerformingShowingChanged:Boolean;
FOnDockDrop :TDockDropEvent;
FOnDockOver :TDockOverEvent;
FOnEnter :TNotifyEvent;
FOnExit :TNotifyEvent;
FOnGetSiteInfo :TGetSiteInfoEvent;
FOnKeyDown :TKeyEvent;
FOnKeyPress :TKeyPressEvent;
FOnKeyUp :TKeyEvent;
FOnUnDock :TUnDockEvent;
FOnAlignInsertBefore:TAlignInsertBeforeEvent;
FOnAlignPosition :TAlignPositionEvent;
FMouseInClient :Boolean;
FMouseControl :TControl;
FTouchControl :TControl;
FDefWndProc :Pointer;
FHandle :HWND;
FObjectInstance :Pointer;
FParent :TWinControl;
FWindowProc :TWndMethod;
FLeft :Integer;
FTop :Integer;
FWidth :Integer;
FHeight :Integer;
FControlStyle :TControlStyle;
FControlState :TControlState;
FDesktopFont :Boolean;
FVisible :Boolean;
FEnabled :Boolean;
FParentFont :Boolean;
FParentColor :Boolean;
FAlign :TAlign;
FAutoSize :Boolean;
FDragMode :TDragMode;
FIsControl :Boolean;
FBiDiMode :TBiDiMode;
FParentBiDiMode :Boolean;
FAnchors :TAnchors;
FFont :TFont;
FActionLink :TControlActionLink;
FColor :TColor;
FConstraints :TSizeConstraints;
FMargins :TMargins;
FCursor :TCursor;
FDragCursor :TCursor;
FPopupMenu :TPopupMenu;
FHint :string;
FFontHeight :Integer;
FScalingFlags :TScalingFlags;
FShowHint :Boolean;
FParentShowHint :Boolean;
FDragKind :TDragKind;
FDockOrientation :TDockOrientation;
FHostDockSite :TWinControl;
FWheelAccumulator :Integer;
FUndockWidth :Integer;
FUndockHeight :Integer;
FLRDockWidth :Integer;
FTBDockHeight :Integer;
FFloatingDockSiteClass:TWinControlClass;
FTouchManager :TTouchManager;
FOnCanResize :TCanResizeEvent;
FOnConstrainedResize:TConstrainedResizeEvent;
FOnMouseDown :TMouseEvent;
FOnMouseMove :TMouseMoveEvent;
FOnMouseUp :TMouseEvent;
FOnDragDrop :TDragDropEvent;
FOnDragOver :TDragOverEvent;
FOnResize :TNotifyEvent;
FOnStartDock :TStartDockEvent;
FOnEndDock :TEndDragEvent;
FOnStartDrag :TStartDragEvent;
FOnEndDrag :TEndDragEvent;
FOnClick :TNotifyEvent;
FOnDblClick :TNotifyEvent;
FOnContextPopup :TContextPopupEvent;
FOnMouseActivate :TMouseActivateEvent;
FOnMouseLeave :TNotifyEvent;
FOnMouseEnter :TNotifyEvent;
FOnMouseWheel :TMouseWheelEvent;
FOnMouseWheelDown :TMouseWheelUpDownEvent;
FOnMouseWheelUp :TMouseWheelUpDownEvent;
FOnGesture :TGestureEvent;
FHelpType :THelpType;
FHelpKeyword :string;
FHelpContext :THelpContext;
FCustomHint :TCustomHint;
FParentCustomHint :Boolean;
FText :PWideChar;
FOwner :TComponent;
FName :TComponentName;
FTag :NativeInt;
FComponents :TList;
FFreeNotifies :TList;
FDesignInfo :Integer;
FComponentState :TComponentState;
FVCLComObject :Pointer;
FObservers :TObservers;
FSortedComponents :TList;
function GetTabInfo(const Index: Integer): TTabInfo;
function GetDockClients(Index: Integer): TControl;
function GetControl(Index: Integer): TControl;
function GetComponent(AIndex: Integer): TComponent;
protected
FDoubleBuffered :Boolean;
FInImeComposition :Boolean;
FDesignSize :TPoint;
FAnchorMove :Boolean;
FAnchorRules :TPoint;
FAnchorOrigin :TPoint;
FOriginalParentSize :TPoint;
FExplicitLeft :Integer;
FExplicitTop :Integer;
FExplicitWidth :Integer;
FExplicitHeight :Integer;
FReserved :Pointer;
FComponentStyle :TComponentStyle;
public
constructor Create(AOwner: TComponent);
class destructor Destroy;
function ItemAtPos(const Pos: TPoint): Integer;
function ItemAtPos(const X: Integer; const Y: Integer): Integer;
function ItemRect(const Index: Integer): TRect;
procedure SelectNext(GoForward: Boolean);
function GetFirstShownIndex: Integer;
function GetLastShownIndex: Integer;
procedure BeginUpdate;
procedure EndUpdate;
constructor Create(AOwner: TComponent);
class destructor Destroy;
constructor Create(AOwner: TComponent);
constructor CreateParented(ParentWindow: HWND);
class function CreateParentedControl(ParentWindow: HWND): TWinControl;
class destructor Destroy;
procedure Broadcast(var Message);
function CanFocus: Boolean;
function ContainsControl(Control: TControl): Boolean;
function ControlAtPos(const Pos: TPoint; AllowDisabled: Boolean; AllowWinControls: Boolean; AllLevels: Boolean): TControl;
procedure DefaultHandler(var Message);
procedure DisableAlign;
procedure DockDrop(Source: TDragDockObject; X: Integer; Y: Integer);
procedure EnableAlign;
function FindChildControl(const ControlName: string): TControl;
procedure FlipChildren(AllLevels: Boolean);
function Focused: Boolean;
procedure GetChildren(Proc: TGetChildProc = procedure(Child: TComponent) of object; Root: TComponent);
procedure GetTabControlList(List: TList);
procedure GetTabOrderList(List: TList);
function HandleAllocated: Boolean;
procedure HandleNeeded;
procedure InsertControl(AControl: TControl);
procedure Invalidate;
procedure PaintTo(DC: HDC; X: Integer; Y: Integer);
procedure PaintTo(Canvas: TCanvas; X: Integer; Y: Integer);
function PreProcessMessage(var Msg: tagMSG): Boolean;
procedure RemoveControl(AControl: TControl);
procedure Realign;
procedure Repaint;
procedure ScaleBy(M: Integer; D: Integer);
procedure ScrollBy(DeltaX: Integer; DeltaY: Integer);
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer);
procedure SetDesignVisible(Value: Boolean);
procedure SetFocus;
procedure Update;
procedure UpdateControlState;
constructor Create(AOwner: TComponent);
class destructor Destroy;
procedure BeginDrag(Immediate: Boolean; Threshold: Integer);
procedure BringToFront;
function ClientToScreen(const Point: TPoint): TPoint;
function ClientToParent(const Point: TPoint; AParent: TWinControl): TPoint;
procedure Dock(NewDockSite: TWinControl; ARect: TRect);
function Dragging: Boolean;
procedure DragDrop(Source: TObject; X: Integer; Y: Integer);
function DrawTextBiDiModeFlags(Flags: Integer): Integer;
function DrawTextBiDiModeFlagsReadingOnly: Integer;
procedure EndDrag(Drop: Boolean);
function GetControlsAlignment: TAlignment;
function GetParentComponent: TComponent;
function HasParent: Boolean;
procedure Hide;
procedure InitiateAction;
procedure Invalidate;
procedure MouseWheelHandler(var Message: TMessage);
function IsRightToLeft: Boolean;
function ManualDock(NewDockSite: TWinControl; DropControl: TControl; ControlSide: TAlign): Boolean;
function ManualFloat(ScreenPos: TRect): Boolean;
function Perform(Msg: Cardinal; WParam: NativeUInt; LParam: NativeInt): NativeInt;
procedure Refresh;
procedure Repaint;
function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl; DropControl: TControl; ControlSide: TAlign): Boolean;
function ScreenToClient(const Point: TPoint): TPoint;
function ParentToClient(const Point: TPoint; AParent: TWinControl): TPoint;
procedure SendToBack;
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer);
procedure SetDesignVisible(Value: Boolean);
procedure SetParentComponent(Value: TComponent);
procedure Show;
procedure Update;
function UseRightToLeftAlignment: Boolean;
function UseRightToLeftReading: Boolean;
function UseRightToLeftScrollBar: Boolean;
procedure DefaultHandler(var Message);
function GetTextBuf(Buffer: PWideChar; BufSize: Integer): Integer;
function GetTextLen: Integer;
function Perform(Msg: Cardinal; WParam: NativeUInt; LParam: PWideChar): NativeInt;
function Perform(Msg: Cardinal; WParam: NativeUInt; var LParam: TRect): NativeInt;
procedure SetTextBuf(Buffer: PWideChar);
constructor Create(AOwner: TComponent);
class destructor Destroy;
procedure BeforeDestruction;
procedure DestroyComponents;
procedure Destroying;
function ExecuteAction(Action: TBasicAction): Boolean;
function FindComponent(const AName: string): TComponent;
procedure FreeNotification(AComponent: TComponent);
procedure RemoveFreeNotification(AComponent: TComponent);
procedure FreeOnRelease;
function GetEnumerator: TComponentEnumerator;
function GetParentComponent: TComponent;
function GetNamePath: string;
function HasParent: Boolean;
procedure InsertComponent(AComponent: TComponent);
procedure RemoveComponent(AComponent: TComponent);
procedure SetSubComponent(IsSubComponent: Boolean);
function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HRESULT;
function UpdateAction(Action: TBasicAction): Boolean;
function IsImplementorOf(const I: IInterface): Boolean;
function ReferenceInterface(const I: IInterface; Operation: TOperation): Boolean;
class destructor Destroy;
procedure Assign(Source: TPersistent);
function GetNamePath: string;
constructor Create;
procedure Free;
class function InitInstance(Instance: Pointer): TObject;
procedure CleanupInstance;
function ClassType: TClass;
class function ClassName: string;
class function ClassNameIs(const Name: string): Boolean;
class function ClassParent: TClass;
class function ClassInfo: Pointer;
class function InstanceSize: Integer;
class function InheritsFrom(AClass: TClass): Boolean;
class function MethodAddress(const Name: ShortString): Pointer;
class function MethodAddress(const Name: string): Pointer;
class function MethodName(Address: Pointer): string;
class function QualifiedClassName: string;
function FieldAddress(const Name: ShortString): Pointer;
function FieldAddress(const Name: string): Pointer;
function GetInterface(const IID: TGUID; out Obj): Boolean;
class function GetInterfaceEntry(const IID: TGUID): PInterfaceEntry;
class function GetInterfaceTable: PInterfaceTable;
class function UnitName: string;
class function UnitScope: string;
function Equals(Obj: TObject): Boolean;
function GetHashCode: Integer;
function ToString: string;
function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HRESULT;
procedure AfterConstruction;
procedure BeforeDestruction;
procedure Dispatch(var Message);
procedure DefaultHandler(var Message);
class function NewInstance: TObject;
procedure FreeInstance;
class destructor Destroy;
property MouseCapture: Boolean;
property DockClientCount: Integer;
property DockSite: Boolean;
property DockManager: IDockManager;
property DoubleBuffered: Boolean;
property AlignDisabled: Boolean;
property MouseInClient: Boolean;
property VisibleDockClientCount: Integer;
property Brush: TBrush;
property ControlCount: Integer;
property Handle: HWND;
property Padding: TPadding;
property ParentDoubleBuffered: Boolean;
property ParentWindow: HWND;
property Showing: Boolean;
property TabOrder: TTabOrder;
property TabStop: Boolean;
property UseDockManager: Boolean;
property Enabled: Boolean;
property Action: TBasicAction;
property Align: TAlign;
property Anchors: TAnchors;
property BiDiMode: TBiDiMode;
property BoundsRect: TRect;
property ClientHeight: Integer;
property ClientOrigin: TPoint;
property ClientRect: TRect;
property ClientWidth: Integer;
property Constraints: TSizeConstraints;
property ControlState: TControlState;
property ControlStyle: TControlStyle;
property DockOrientation: TDockOrientation;
property ExplicitLeft: Integer;
property ExplicitTop: Integer;
property ExplicitWidth: Integer;
property ExplicitHeight: Integer;
property Floating: Boolean;
property FloatingDockSiteClass: TWinControlClass;
property HostDockSite: TWinControl;
property LRDockWidth: Integer;
property ShowHint: Boolean;
property TBDockHeight: Integer;
property Touch: TTouchManager;
property UndockHeight: Integer;
property UndockWidth: Integer;
property Visible: Boolean;
property WindowProc: TWndMethod;
property Parent: TWinControl;
property OnGesture: TGestureEvent;
property ComObject: IInterface;
property ComponentCount: Integer;
property ComponentIndex: Integer;
property ComponentState: TComponentState;
property ComponentStyle: TComponentStyle;
property DesignInfo: Integer;
property Owner: TComponent;
property VCLComObject: Pointer;
property Observers: TObservers;
published
property Align: TAlign;
property Anchors: TAnchors;
property Constraints: TSizeConstraints;
property DragCursor: TCursor;
property DragKind: TDragKind;
property DragMode: TDragMode;
property Enabled: Boolean;
property Font: TFont;
property Images: TCustomImageList;
property ParentBackground: Boolean;
property ParentShowHint: Boolean;
property PopupMenu: TPopupMenu;
property Scroller: TTabScroller;
property ShowHint: Boolean;
property Items: TStrings;
property TabColors: TTabColors;
property TabIndex: Integer;
property Visible: Boolean;
property OnAlignInsertBefore: TAlignInsertBeforeEvent;
property OnAlignPosition: TAlignPositionEvent;
property OnClick: TNotifyEvent;
property OnDblClick: TNotifyEvent;
property OnChange: TNotifyEvent;
property OnChanging: TTabChangingEvent;
property OnGetHint: TTabGetHintEvent;
property OnDragDrop: TDragDropEvent;
property OnDragOver: TDragOverEvent;
property OnEndDock: TEndDragEvent;
property OnEndDrag: TEndDragEvent;
property OnEnter: TNotifyEvent;
property OnExit: TNotifyEvent;
property OnGetImageIndex: TTabGetImageEvent;
property OnGetOverlayImageIndex: TTabGetImageEvent;
property OnMouseActivate: TMouseActivateEvent;
property OnMouseDown: TMouseEvent;
property OnMouseMove: TMouseMoveEvent;
property OnMouseUp: TMouseEvent;
property OnStartDock: TStartDockEvent;
property OnStartDrag: TStartDragEvent;
property FirstShownIndex: Integer;
property LastShownIndex: Integer;
property AlignWithMargins: Boolean;
property Left: Integer;
property Top: Integer;
property Width: Integer;
property Height: Integer;
property Cursor: TCursor;
property Hint: string;
property HelpType: THelpType;
property HelpKeyword: string;
property HelpContext: THelpContext;
property Margins: TMargins;
property CustomHint: TCustomHint;
property ParentCustomHint: Boolean;
property Name: TComponentName;
property Tag: NativeInt;
end;