-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuPSC_forms.pas
327 lines (301 loc) · 14.1 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
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
{ Compiletime Forms support }
unit uPSC_forms;
{$I PascalScript.inc}
interface
uses
uPSCompiler, uPSUtils;
procedure SIRegister_Forms_TypesAndConsts(Cl: TPSPascalCompiler);
procedure SIRegister_Forms_MoreConsts(C1: 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
uses
Windows, Controls;
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
{$IFDEF DELPHI4UP}
RegisterProperty('Anchors', 'TAnchors', iptrw);
RegisterProperty('Constraints', 'TSizeConstraints', iptrw);
{$ENDIF}
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);
{$IFDEF DELPHI4UP}
RegisterProperty('Anchors', 'TAnchors', iptrw);
RegisterProperty('Constraints', 'TSizeConstraints', iptrw);
{$ENDIF}
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}
{$IFDEF UNICODE}
RegisterMethod('function MessageBox(Text,Caption: string; Flags: Word): Integer');
{$ELSE}
RegisterMethod('function MessageBox(Text,Caption: PChar; Flags: Word): Integer');
{$ENDIF}
{$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_MoreConsts(C1: TPSPascalCompiler);
begin
C1.AddConstantN('mrNone', 'integer').Value.ts32 := mrNone;
C1.AddConstantN('mrOk', 'integer').Value.ts32 := mrOk;
C1.AddConstantN('mrCancel', 'integer').Value.ts32 := mrCancel;
C1.AddConstantN('mrAbort', 'integer').Value.ts32 := mrAbort;
C1.AddConstantN('mrRetry', 'integer').Value.ts32 := mrRetry;
C1.AddConstantN('mrIgnore', 'integer').Value.ts32 := mrIgnore;
C1.AddConstantN('mrYes', 'integer').Value.ts32 := mrYes;
C1.AddConstantN('mrNo', 'integer').Value.ts32 := mrNo;
C1.AddConstantN('mrAll', 'integer').Value.ts32 := mrAll;
C1.AddConstantN('mrNoToAll', 'integer').Value.ts32 := mrNoToAll;
C1.AddConstantN('mrYesToAll', 'integer').Value.ts32 := mrYesToAll;
C1.AddConstantN('IDOK', 'integer').Value.ts32 := idOk;
C1.AddConstantN('ID_OK', 'integer').Value.ts32 := ID_OK;
C1.AddConstantN('IDCANCEL', 'integer').Value.ts32 := idCancel;
C1.AddConstantN('ID_CANCEL', 'integer').Value.ts32 := ID_CANCEL;
C1.AddConstantN('IDABORT', 'integer').Value.ts32 := idAbort;
C1.AddConstantN('ID_ABORT', 'integer').Value.ts32 := ID_ABORT;
C1.AddConstantN('IDRETRY', 'integer').Value.ts32 := idRetry;
C1.AddConstantN('ID_RETRY', 'integer').Value.ts32 := ID_RETRY;
C1.AddConstantN('IDIGNORE', 'integer').Value.ts32 := idIgnore;
C1.AddConstantN('ID_IGNORE', 'integer').Value.ts32 := ID_IGNORE;
C1.AddConstantN('IDYES', 'integer').Value.ts32 := idYes;
C1.AddConstantN('ID_YES', 'integer').Value.ts32 := ID_YES;
C1.AddConstantN('IDNO', 'integer').Value.ts32 := idNo;
C1.AddConstantN('ID_NO', 'integer').Value.ts32 := ID_NO;
C1.AddConstantN('IDCLOSE', 'integer').Value.ts32 := IDCLOSE;
C1.AddConstantN('ID_CLOSE', 'integer').Value.ts32 := ID_CLOSE;
C1.AddConstantN('IDHELP', 'integer').Value.ts32 := IDHELP;
C1.AddConstantN('ID_HELP', 'integer').Value.ts32 := ID_HELP;
C1.AddConstantN('IDTRYAGAIN', 'integer').Value.ts32 := IDTRYAGAIN;
C1.AddConstantN('IDCONTINUE', 'integer').Value.ts32 := IDCONTINUE;
end;
procedure SIRegister_Forms(Cl: TPSPascalCompiler);
begin
SIRegister_Forms_TypesAndConsts(cl);
SIRegister_Forms_MoreConsts(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.