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
| ///////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2015 by Charta Software B.V. //
// All rights reserved //
// //
// Version: 1.7.0.83525 //
// Web site: https://pascal.chartasoftware.com/ //
// //
// This code and information are provided "as is" without warranty of //
// any kind. Dissemination of this information or reproduction of //
// this material is strictly forbidden unless prior written permission //
// is obtained from Charta Software B.V.. //
// //
///////////////////////////////////////////////////////////////////////////
unit Windows.Gdi.Cursor;
interface
uses
Windows.Api.UserInterface,
Windows.Gdi.Object_;
type
TCursor = class(TGraphicsObject);
TSystemCursor = class(TCursor)
public
constructor Create(Name: TCursorIdentifier); virtual;
end;
TCursorManager = class(TObject)
private
FArrow: TCursor;
FText: TCursor;
FWait: TCursor;
FDrag: TCursor;
FDropMove: TCursor;
FDropSwap: TCursor;
FNo: TCursor;
FHorizontalSplit: TCursor;
FVerticalSplit: TCursor;
FSizeHorizontal: TCursor;
FSize45Backward: TCursor;
FCrosshair: TCursor;
FApplicationStarting: TCursor;
FHand: TCursor;
FSizeAll: TCursor;
FSize45Forward: TCursor;
FSizeVertical: TCursor;
FUpArrow: TCursor;
FHelp: TCursor;
public
constructor Create(); virtual;
destructor Destroy(); override;
property ApplicationStarting: TCursor read FApplicationStarting;
property Arrow: TCursor read FArrow;
property Crosshair: TCursor read FCrosshair;
property Hand: TCursor read FHand;
property Help: TCursor read FHelp;
property Text: TCursor read FText;
property Wait: TCursor read FWait;
property HorizontalSplit: TCursor read FHorizontalSplit;
property VerticalSplit: TCursor read FVerticalSplit;
property Drag: TCursor read FDrag;
property DropMove: TCursor read FDropMove;
property DropSwap: TCursor read FDropSwap;
property No: TCursor read FNo;
property SizeAll: TCursor read FSizeAll;
property Size45Forward: TCursor read FSize45Forward;
property SizeHorizontal: TCursor read FSizeHorizontal;
property Size45Backward: TCursor read FSize45Backward;
property SizeVertical: TCursor read FSizeVertical;
property UpArrow: TCursor read FUpArrow;
end;
var
CursorManager: TCursorManager;
implementation
{ TSystemCursor }
constructor TSystemCursor.Create(Name: TCursorIdentifier);
begin
inherited Create();
FHandle := LoadCursor(0, Name);
end;
{ TCursorManager }
constructor TCursorManager.Create();
begin
inherited Create();
FArrow := TSystemCursor.Create(IDC_ARROW);
FText := TSystemCursor.Create(IDC_IBEAM);
FWait := TSystemCursor.Create(IDC_WAIT);
FDrag := TSystemCursor.Create(IDC_ARROW);
FDropMove := TSystemCursor.Create(IDC_HAND);
FDropSwap := TSystemCursor.Create(IDC_SIZEWE);
FApplicationStarting := TSystemCursor.Create(IDC_APPSTARTING);
FCrosshair := TSystemCursor.Create(IDC_CROSS);
FHand := TSystemCursor.Create(IDC_HAND);
FHelp := TSystemCursor.Create(IDC_HELP);
FNo := TSystemCursor.Create(IDC_NO);
FSizeAll := TSystemCursor.Create(IDC_SIZEALL);
FSize45Forward := TSystemCursor.Create(IDC_SIZENESW);
FSizeHorizontal := TSystemCursor.Create(IDC_SIZEWE);
FSize45Backward := TSystemCursor.Create(IDC_SIZENWSE);
FSizeVertical := TSystemCursor.Create(IDC_SIZENS);
FUpArrow := TSystemCursor.Create(IDC_UPARROW);
FHorizontalSplit := TSystemCursor.Create(IDC_SIZEWE);
FVerticalSplit := TSystemCursor.Create(IDC_SIZENS);
end;
destructor TCursorManager.Destroy();
begin
FArrow.Free();
FText.Free();
FWait.Free();
FDrag.Free();
FDropMove.Free();
FDropSwap.Free();
FHorizontalSplit.Free();
FVerticalSplit.Free();
FApplicationStarting.Free();
FCrosshair.Free();
FHand.Free();
FHelp.Free();
FNo.Free();
FSizeAll.Free();
FSize45Forward.Free();
FSizeHorizontal.Free();
FSize45Backward.Free();
FSizeVertical.Free();
FUpArrow.Free();
inherited Destroy();
end;
initialization
CursorManager := TCursorManager.Create();
finalization
CursorManager.Free();
end.
|