-
Notifications
You must be signed in to change notification settings - Fork 0
/
uPSC_forms.pas
271 lines (249 loc) · 11.5 KB
/
uPSC_forms.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
{ Compiletime Forms support }
unit uPSC_forms;
{$I PascalScript.inc}
interface
uses
uPSCompiler, uPSUtils;
procedure SIRegister_Forms_TypesAndConsts(Cl: TPSPascalCompiler);
procedure SIRegisterTCONTROLSCROLLBAR(Cl: TPSPascalCompiler);
procedure SIRegisterTSCROLLINGWINCONTROL(Cl: TPSPascalCompiler);
procedure SIRegisterTSCROLLBOX(Cl: TPSPascalCompiler);
procedure SIRegisterTFORM(Cl: TPSPascalCompiler);
procedure SIRegisterTAPPLICATION(Cl: TPSPascalCompiler);
procedure SIRegister_Forms(Cl: TPSPascalCompiler);
implementation
procedure SIRegisterTCONTROLSCROLLBAR(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TPERSISTENT'), 'TCONTROLSCROLLBAR') do
begin
RegisterProperty('KIND', 'TSCROLLBARKIND', iptr);
RegisterProperty('SCROLLPOS', 'INTEGER', iptr);
RegisterProperty('MARGIN', 'WORD', iptrw);
RegisterProperty('INCREMENT', 'TSCROLLBARINC', iptrw);
RegisterProperty('RANGE', 'INTEGER', iptrw);
RegisterProperty('POSITION', 'INTEGER', iptrw);
RegisterProperty('TRACKING', 'BOOLEAN', iptrw);
RegisterProperty('VISIBLE', 'BOOLEAN', iptrw);
end;
end;
procedure SIRegisterTSCROLLINGWINCONTROL(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TWINCONTROL'), 'TSCROLLINGWINCONTROL') do
begin
RegisterMethod('procedure SCROLLINVIEW(ACONTROL:TCONTROL)');
RegisterProperty('HORZSCROLLBAR', 'TCONTROLSCROLLBAR', iptrw);
RegisterProperty('VERTSCROLLBAR', 'TCONTROLSCROLLBAR', iptrw);
end;
end;
procedure SIRegisterTSCROLLBOX(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TSCROLLINGWINCONTROL'), 'TSCROLLBOX') do
begin
RegisterProperty('BORDERSTYLE', 'TBORDERSTYLE', iptrw);
RegisterProperty('COLOR', 'TCOLOR', iptrw);
RegisterProperty('FONT', 'TFONT', iptrw);
RegisterProperty('AUTOSCROLL', 'BOOLEAN', iptrw);
RegisterProperty('PARENTCOLOR', 'BOOLEAN', iptrw);
RegisterProperty('PARENTFONT', 'BOOLEAN', iptrw);
RegisterProperty('ONCLICK', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONDBLCLICK', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONENTER', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONEXIT', 'TNOTIFYEVENT', iptrw);
{$IFNDEF PS_MINIVCL}
RegisterProperty('ONRESIZE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('DRAGCURSOR', 'TCURSOR', iptrw);
RegisterProperty('DRAGMODE', 'TDRAGMODE', iptrw);
RegisterProperty('PARENTSHOWHINT', 'BOOLEAN', iptrw);
RegisterProperty('POPUPMENU', 'TPOPUPMENU', iptrw);
RegisterProperty('CTL3D', 'BOOLEAN', iptrw);
RegisterProperty('PARENTCTL3D', 'BOOLEAN', iptrw);
RegisterProperty('ONDRAGDROP', 'TDRAGDROPEVENT', iptrw);
RegisterProperty('ONDRAGOVER', 'TDRAGOVEREVENT', iptrw);
RegisterProperty('ONENDDRAG', 'TENDDRAGEVENT', iptrw);
RegisterProperty('ONMOUSEDOWN', 'TMOUSEEVENT', iptrw);
RegisterProperty('ONMOUSEMOVE', 'TMOUSEMOVEEVENT', iptrw);
RegisterProperty('ONMOUSEUP', 'TMOUSEEVENT', iptrw);
{$ENDIF}
end;
end;
procedure SIRegisterTFORM(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TSCROLLINGWINCONTROL'), 'TFORM') do
begin
{$IFDEF DELPHI4UP}
RegisterMethod('constructor CREATENEW(AOWNER:TCOMPONENT; Dummy: Integer)');
{$ELSE}
RegisterMethod('constructor CREATENEW(AOWNER:TCOMPONENT)');
{$ENDIF}
RegisterMethod('procedure CLOSE');
RegisterMethod('procedure HIDE');
RegisterMethod('procedure SHOW');
RegisterMethod('function SHOWMODAL:INTEGER');
RegisterMethod('procedure RELEASE');
RegisterProperty('ACTIVE', 'BOOLEAN', iptr);
RegisterProperty('ACTIVECONTROL', 'TWINCONTROL', iptrw);
RegisterProperty('BORDERICONS', 'TBorderIcons', iptrw);
RegisterProperty('BORDERSTYLE', 'TFORMBORDERSTYLE', iptrw);
RegisterProperty('CAPTION', 'NativeString', iptrw);
RegisterProperty('AUTOSCROLL', 'BOOLEAN', iptrw);
RegisterProperty('COLOR', 'TCOLOR', iptrw);
RegisterProperty('FONT', 'TFONT', iptrw);
RegisterProperty('FORMSTYLE', 'TFORMSTYLE', iptrw);
RegisterProperty('KEYPREVIEW', 'BOOLEAN', iptrw);
RegisterProperty('POSITION', 'TPOSITION', iptrw);
RegisterProperty('ONACTIVATE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONCLICK', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONDBLCLICK', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONCLOSE', 'TCLOSEEVENT', iptrw);
RegisterProperty('ONCLOSEQUERY', 'TCLOSEQUERYEVENT', iptrw);
RegisterProperty('ONCREATE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONDESTROY', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONDEACTIVATE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONHIDE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONKEYDOWN', 'TKEYEVENT', iptrw);
RegisterProperty('ONKEYPRESS', 'TKEYPRESSEVENT', iptrw);
RegisterProperty('ONKEYUP', 'TKEYEVENT', iptrw);
RegisterProperty('ONRESIZE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONSHOW', 'TNOTIFYEVENT', iptrw);
{$IFNDEF PS_MINIVCL}
{$IFNDEF CLX}
RegisterMethod('procedure ARRANGEICONS');
// RegisterMethod('function GETFORMIMAGE:TBITMAP');
RegisterMethod('procedure PRINT');
RegisterMethod('procedure SENDCANCELMODE(SENDER:TCONTROL)');
RegisterProperty('ACTIVEOLECONTROL', 'TWINCONTROL', iptrw);
RegisterProperty('OLEFORMOBJECT', 'TOLEFORMOBJECT', iptrw);
RegisterProperty('CLIENTHANDLE', 'LONGINT', iptr);
RegisterProperty('TILEMODE', 'TTILEMODE', iptrw);
{$ENDIF}
RegisterMethod('procedure CASCADE');
RegisterMethod('function CLOSEQUERY:BOOLEAN');
RegisterMethod('procedure DEFOCUSCONTROL(CONTROL:TWINCONTROL;REMOVING:BOOLEAN)');
RegisterMethod('procedure FOCUSCONTROL(CONTROL:TWINCONTROL)');
RegisterMethod('procedure NEXT');
RegisterMethod('procedure PREVIOUS');
RegisterMethod('function SETFOCUSEDCONTROL(CONTROL:TWINCONTROL):BOOLEAN');
RegisterMethod('procedure TILE');
RegisterProperty('ACTIVEMDICHILD', 'TFORM', iptr);
RegisterProperty('CANVAS', 'TCANVAS', iptr);
RegisterProperty('DROPTARGET', 'BOOLEAN', iptrw);
RegisterProperty('MODALRESULT', 'Longint', iptrw);
RegisterProperty('MDICHILDCOUNT', 'INTEGER', iptr);
RegisterProperty('MDICHILDREN', 'TFORM INTEGER', iptr);
RegisterProperty('ICON', 'TICON', iptrw);
RegisterProperty('MENU', 'TMAINMENU', iptrw);
RegisterProperty('OBJECTMENUITEM', 'TMENUITEM', iptrw);
RegisterProperty('PIXELSPERINCH', 'INTEGER', iptrw);
RegisterProperty('PRINTSCALE', 'TPRINTSCALE', iptrw);
RegisterProperty('SCALED', 'BOOLEAN', iptrw);
RegisterProperty('WINDOWSTATE', 'TWINDOWSTATE', iptrw);
RegisterProperty('WINDOWMENU', 'TMENUITEM', iptrw);
RegisterProperty('CTL3D', 'BOOLEAN', iptrw);
RegisterProperty('POPUPMENU', 'TPOPUPMENU', iptrw);
RegisterProperty('ONDRAGDROP', 'TDRAGDROPEVENT', iptrw);
RegisterProperty('ONDRAGOVER', 'TDRAGOVEREVENT', iptrw);
RegisterProperty('ONMOUSEDOWN', 'TMOUSEEVENT', iptrw);
RegisterProperty('ONMOUSEMOVE', 'TMOUSEMOVEEVENT', iptrw);
RegisterProperty('ONMOUSEUP', 'TMOUSEEVENT', iptrw);
RegisterProperty('ONPAINT', 'TNOTIFYEVENT', iptrw);
{$ENDIF}
end;
end;
procedure SIRegisterTAPPLICATION(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TCOMPONENT'), 'TAPPLICATION') do
begin
RegisterMethod('procedure BRINGTOFRONT');
{$IFDEF PS_PANSICHAR}
RegisterMethod('function MESSAGEBOX(TEXT,CAPTION:PANSICHAR;FLAGS:WORD):INTEGER');
{$ELSE}
RegisterMethod('function MESSAGEBOX(TEXT,CAPTION:PCHAR;FLAGS:WORD):INTEGER');
{$ENDIF}
RegisterMethod('procedure MINIMIZE');
RegisterMethod('procedure PROCESSMESSAGES');
RegisterMethod('procedure RESTORE');
RegisterMethod('procedure TERMINATE');
RegisterProperty('ACTIVE', 'BOOLEAN', iptr);
RegisterProperty('EXENAME', 'NativeString', iptr);
{$IFNDEF CLX}
RegisterProperty('HANDLE', 'LONGINT', iptrw);
RegisterProperty('UPDATEFORMATSETTINGS', 'BOOLEAN', iptrw);
{$ENDIF}
RegisterProperty('HINT', 'NativeString', iptrw);
RegisterProperty('MAINFORM', 'TFORM', iptr);
RegisterProperty('SHOWHINT', 'BOOLEAN', iptrw);
RegisterProperty('SHOWMAINFORM', 'BOOLEAN', iptrw);
RegisterProperty('TERMINATED', 'BOOLEAN', iptr);
RegisterProperty('TITLE', 'NativeString', iptrw);
RegisterProperty('ONACTIVATE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONDEACTIVATE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONIDLE', 'TIDLEEVENT', iptrw);
RegisterProperty('ONHINT', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONMINIMIZE', 'TNOTIFYEVENT', iptrw);
RegisterProperty('ONRESTORE', 'TNOTIFYEVENT', iptrw);
{$IFNDEF PS_MINIVCL}
RegisterMethod('procedure CONTROLDESTROYED(CONTROL:TCONTROL)');
RegisterMethod('procedure CANCELHINT');
RegisterMethod('procedure HANDLEEXCEPTION(SENDER:TOBJECT)');
RegisterMethod('procedure HANDLEMESSAGE');
RegisterMethod('procedure HIDEHINT');
// RegisterMethod('procedure HINTMOUSEMESSAGE(CONTROL:TCONTROL;var MESSAGE:TMESSAGE)');
RegisterMethod('procedure INITIALIZE');
RegisterMethod('procedure NORMALIZETOPMOSTS');
RegisterMethod('procedure RESTORETOPMOSTS');
RegisterMethod('procedure RUN');
// RegisterMethod('procedure SHOWEXCEPTION(E:EXCEPTION)');
{$IFNDEF CLX}
RegisterMethod('function HELPCOMMAND(COMMAND:INTEGER;DATA:LONGINT):BOOLEAN');
RegisterMethod('function HELPCONTEXT(CONTEXT:THELPCONTEXT):BOOLEAN');
RegisterMethod('function HELPJUMP(JUMPID:NativeString):BOOLEAN');
RegisterProperty('DIALOGHANDLE', 'LONGINT', iptrw);
RegisterMethod('procedure CREATEHANDLE');
// RegisterMethod('procedure HOOKMAINWINDOW(HOOK:TWINDOWHOOK)');
// RegisterMethod('procedure UNHOOKMAINWINDOW(HOOK:TWINDOWHOOK)');
{$ENDIF}
RegisterProperty('HELPFILE', 'NativeString', iptrw);
RegisterProperty('HINTCOLOR', 'TCOLOR', iptrw);
RegisterProperty('HINTPAUSE', 'INTEGER', iptrw);
RegisterProperty('HINTSHORTPAUSE', 'INTEGER', iptrw);
RegisterProperty('HINTHIDEPAUSE', 'INTEGER', iptrw);
RegisterProperty('ICON', 'TICON', iptrw);
RegisterProperty('ONHELP', 'THELPEVENT', iptrw);
{$ENDIF}
end;
end;
procedure SIRegister_Forms_TypesAndConsts(Cl: TPSPascalCompiler);
begin
Cl.AddTypeS('TIdleEvent', 'procedure (Sender: TObject; var Done: Boolean)');
cl.AddTypeS('TScrollBarKind', '(sbHorizontal, sbVertical)');
cl.AddTypeS('TScrollBarInc', 'SmallInt');
cl.AddTypeS('TFormBorderStyle', '(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)');
cl.AddTypeS('TBorderStyle', 'TFormBorderStyle');
cl.AddTypeS('TWindowState', '(wsNormal, wsMinimized, wsMaximized)');
cl.AddTypeS('TFormStyle', '(fsNormal, fsMDIChild, fsMDIForm, fsStayOnTop)');
cl.AddTypeS('TPosition', '(poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter)');
cl.AddTypeS('TPrintScale', '(poNone, poProportional, poPrintToFit)');
cl.AddTypeS('TCloseAction', '(caNone, caHide, caFree, caMinimize)');
cl.AddTypeS('TCloseEvent' ,'procedure(Sender: TObject; var Action: TCloseAction)');
cl.AddTypeS('TCloseQueryEvent' ,'procedure(Sender: TObject; var CanClose: Boolean)');
cl.AddTypeS('TBorderIcon' ,'(biSystemMenu, biMinimize, biMaximize, biHelp)');
cl.AddTypeS('TBorderIcons', 'set of TBorderIcon');
cl.AddTypeS('THELPCONTEXT', 'Longint');
end;
procedure SIRegister_Forms(Cl: TPSPascalCompiler);
begin
SIRegister_Forms_TypesAndConsts(cl);
{$IFNDEF PS_MINIVCL}
SIRegisterTCONTROLSCROLLBAR(cl);
{$ENDIF}
SIRegisterTScrollingWinControl(cl);
{$IFNDEF PS_MINIVCL}
SIRegisterTSCROLLBOX(cl);
{$ENDIF}
SIRegisterTForm(Cl);
{$IFNDEF PS_MINIVCL}
SIRegisterTApplication(Cl);
{$ENDIF}
end;
// PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl)
end.