-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathIFSI_Dialogs.pas
948 lines (830 loc) · 35.1 KB
/
IFSI_Dialogs.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
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
unit IFSI_Dialogs;
{
This file has been generated by UnitParser v0.5, written by M. Knight
and updated by NP. v/d Spek.
Source Code from Carlo Kok has been used to implement various sections of
UnitParser. Components of ifps3 are used in the construction of UnitParser,
code implementing the class wrapper is taken from Carlo Kok''s conv unility
}
interface
uses
uPSCompiler, uPSRuntime, uPSUtils;
{ compile-time registration functions }
procedure SIRegister_TReplaceDialog(CL: TPSPascalCompiler);
procedure SIRegister_TFindDialog(CL: TPSPascalCompiler);
procedure SIRegister_TPrintDialog(CL: TPSPascalCompiler);
procedure SIRegister_TPrinterSetupDialog(CL: TPSPascalCompiler);
procedure SIRegister_TFontDialog(CL: TPSPascalCompiler);
procedure SIRegister_TColorDialog(CL: TPSPascalCompiler);
procedure SIRegister_TSaveDialog(CL: TPSPascalCompiler);
procedure SIRegister_TOpenDialog(CL: TPSPascalCompiler);
procedure SIRegister_TCommonDialog(CL: TPSPascalCompiler);
procedure SIRegister_Dialogs(CL: TPSPascalCompiler);
{ run-time registration functions }
procedure RIRegister_Dialogs_Routines(S: TPSExec);
procedure RIRegister_TReplaceDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TFindDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPrintDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPrinterSetupDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TFontDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TColorDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TSaveDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TOpenDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_TCommonDialog(CL: TPSRuntimeClassImporter);
procedure RIRegister_Dialogs(CL: TPSRuntimeClassImporter);
implementation
uses
Windows, SysUtils, Classes, Messages, CommDlg, Graphics, Controls, Forms,
StdCtrls, Dialogs;
{ compile-time importer function }
(*----------------------------------------------------------------------------
Sometimes the CL.AddClassN() fails to correctly register a class,
for unknown (at least to me) reasons
So, you may use the below RegClassS() replacing the CL.AddClassN()
of the various SIRegister_XXXX calls
----------------------------------------------------------------------------*)
function RegClassS(CL: TPSPascalCompiler;
const InheritsFrom, ClassName: string): TIFPSCompileTimeClass;
begin
Result := CL.FindClass(ClassName);
if Result = nil then
Result := CL.AddClassN(CL.FindClass(InheritsFrom), ClassName)
else
Result.ClassInheritsFrom := CL.FindClass(InheritsFrom);
end;
(* === compile-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure SIRegister_TReplaceDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TFindDialog', 'TReplaceDialog') do
with CL.AddClassN(CL.FindClass('TFindDialog'), 'TReplaceDialog') do
begin
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TFindDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCommonDialog', 'TFindDialog') do
with CL.AddClassN(CL.FindClass('TCommonDialog'), 'TFindDialog') do
begin
RegisterMethod('function Execute: Boolean;');
RegisterMethod('Procedure CloseDialog');
RegisterProperty('Left', 'Integer', iptrw);
RegisterProperty('Position', 'TPoint', iptrw);
RegisterProperty('Top', 'Integer', iptrw);
RegisterProperty('FindText', 'string', iptrw);
RegisterProperty('Options', 'TFindOptions', iptrw);
RegisterProperty('OnFind', 'TNotifyEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPrintDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCommonDialog', 'TPrintDialog') do
with CL.AddClassN(CL.FindClass('TCommonDialog'), 'TPrintDialog') do
begin
RegisterMethod('function Execute: Boolean;');
RegisterProperty('Collate', 'Boolean', iptrw);
RegisterProperty('Copies', 'Integer', iptrw);
RegisterProperty('FromPage', 'Integer', iptrw);
RegisterProperty('MinPage', 'Integer', iptrw);
RegisterProperty('MaxPage', 'Integer', iptrw);
RegisterProperty('Options', 'TPrintDialogOptions', iptrw);
RegisterProperty('PrintToFile', 'Boolean', iptrw);
RegisterProperty('PrintRange', 'TPrintRange', iptrw);
RegisterProperty('ToPage', 'Integer', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPrinterSetupDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCommonDialog', 'TPrinterSetupDialog') do
with CL.AddClassN(CL.FindClass('TCommonDialog'), 'TPrinterSetupDialog') do
begin
RegisterMethod('function Execute: Boolean;');
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TFontDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCommonDialog', 'TFontDialog') do
with CL.AddClassN(CL.FindClass('TCommonDialog'), 'TFontDialog') do
begin
RegisterMethod('function Execute: Boolean;');
RegisterProperty('Font', 'TFont', iptrw);
RegisterProperty('Device', 'TFontDialogDevice', iptrw);
RegisterProperty('MinFontSize', 'Integer', iptrw);
RegisterProperty('MaxFontSize', 'Integer', iptrw);
RegisterProperty('Options', 'TFontDialogOptions', iptrw);
RegisterProperty('OnApply', 'TFDApplyEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TColorDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCommonDialog', 'TColorDialog') do
with CL.AddClassN(CL.FindClass('TCommonDialog'), 'TColorDialog') do
begin
RegisterMethod('function Execute: Boolean;');
RegisterProperty('Color', 'TColor', iptrw);
RegisterProperty('CustomColors', 'TStrings', iptrw);
RegisterProperty('Options', 'TColorDialogOptions', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TSaveDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TOpenDialog', 'TSaveDialog') do
with CL.AddClassN(CL.FindClass('TOpenDialog'), 'TSaveDialog') do
begin
RegisterMethod('function Execute: Boolean;');
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TOpenDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCommonDialog', 'TOpenDialog') do
with CL.AddClassN(CL.FindClass('TCommonDialog'), 'TOpenDialog') do
begin
RegisterMethod('function Execute: Boolean;');
RegisterProperty('FileEditStyle', 'TFileEditStyle', iptrw);
RegisterProperty('Files', 'TStrings', iptr);
RegisterProperty('HistoryList', 'TStrings', iptrw);
RegisterProperty('DefaultExt', 'string', iptrw);
RegisterProperty('FileName', 'TFileName', iptrw);
RegisterProperty('Filter', 'string', iptrw);
RegisterProperty('FilterIndex', 'Integer', iptrw);
RegisterProperty('InitialDir', 'string', iptrw);
RegisterProperty('Options', 'TOpenOptions', iptrw);
RegisterProperty('Title', 'string', iptrw);
RegisterProperty('OnCanClose', 'TCloseQueryEvent', iptrw);
RegisterProperty('OnFolderChange', 'TNotifyEvent', iptrw);
RegisterProperty('OnSelectionChange', 'TNotifyEvent', iptrw);
RegisterProperty('OnTypeChange', 'TNotifyEvent', iptrw);
// RegisterProperty('OnIncludeItem', 'TIncludeItemEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TCommonDialog(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TComponent', 'TCommonDialog') do
with CL.AddClassN(CL.FindClass('TComponent'), 'TCommonDialog') do
begin
RegisterMethod('function Execute: Boolean;');
RegisterProperty('Handle', 'HWnd', iptr);
RegisterProperty('Ctl3D', 'Boolean', iptrw);
RegisterProperty('HelpContext', 'THelpContext', iptrw);
RegisterProperty('OnClose', 'TNotifyEvent', iptrw);
RegisterProperty('OnShow', 'TNotifyEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_Dialogs(CL: TPSPascalCompiler);
begin
CL.AddConstantN('MaxCustomColors', 'LongInt').SetInt(16);
SIRegister_TCommonDialog(CL);
CL.AddTypeS('TOpenOption', '( ofReadOnly, ofOverwritePrompt, ofHideReadOnly, ' +
'ofNoChangeDir, ofShowHelp, ofNoValidate, ofAllowMultiSelect, ofExtensionDi' +
'fferent, ofPathMustExist, ofFileMustExist, ofCreatePrompt, ofShareAware, o' +
'fNoReadOnlyReturn, ofNoTestFileCreate, ofNoNetworkButton, ofNoLongNames, o' +
'fOldStyleDialog, ofNoDereferenceLinks, ofEnableIncludeNotify, ofEnableSizi'
+ 'ng )');
CL.AddTypeS('TOpenOptions', 'set of TOpenOption');
CL.AddTypeS('TFileEditStyle', '( fsEdit, fsComboBox )');
// CL.AddTypeS('TIncludeItemEvent', 'Procedure ( const OFN : TOFNotifyEx; var In'
// +'clude : Boolean)');
SIRegister_TOpenDialog(CL);
SIRegister_TSaveDialog(CL);
CL.AddTypeS('TColorDialogOption', '( cdFullOpen, cdPreventFullOpen, cdShowHel' +
'p, cdSolidColor, cdAnyColor )');
CL.AddTypeS('TColorDialogOptions', 'set of TColorDialogOption');
SIRegister_TColorDialog(CL);
CL.AddTypeS('TFontDialogOption', '( fdAnsiOnly, fdTrueTypeOnly, fdEffects, fd' +
'FixedPitchOnly, fdForceFontExist, fdNoFaceSel, fdNoOEMFonts, fdNoSimulatio' +
'ns, fdNoSizeSel, fdNoStyleSel, fdNoVectorFonts, fdShowHelp, fdWysiwyg, fdL' +
'imitSize, fdScalableOnly, fdApplyButton )');
CL.AddTypeS('TFontDialogOptions', 'set of TFontDialogOption');
CL.AddTypeS('TFontDialogDevice', '( fdScreen, fdPrinter, fdBoth )');
CL.AddTypeS('TFDApplyEvent', 'Procedure ( Sender : TObject; Wnd : HWND)');
SIRegister_TFontDialog(CL);
SIRegister_TPrinterSetupDialog(CL);
CL.AddTypeS('TPrintRange', '( prAllPages, prSelection, prPageNums )');
CL.AddTypeS('TPrintDialogOption', '( poPrintToFile, poPageNums, poSelection, ' +
'poWarning, poHelp, poDisablePrintToFile )');
CL.AddTypeS('TPrintDialogOptions', 'set of TPrintDialogOption');
SIRegister_TPrintDialog(CL);
CL.AddTypeS('TFindOption', '( frDown, frFindNext, frHideMatchCase, frHideWhol' +
'eWord, frHideUpDown, frMatchCase, frDisableMatchCase, frDisableUpDown, frD' +
'isableWholeWord, frReplace, frReplaceAll, frWholeWord, frShowHelp )');
CL.AddTypeS('TFindOptions', 'set of TFindOption');
SIRegister_TFindDialog(CL);
SIRegister_TReplaceDialog(CL);
CL.AddTypeS('TMsgDlgType', '( mtWarning, mtError, mtInformation, mtConfirmati' +
'on, mtCustom )');
CL.AddTypeS('TMsgDlgBtn', '( mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, m' +
'bIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp )');
CL.AddTypeS('TMsgDlgButtons', 'set of TMsgDlgBtn');
CL.AddConstantN('mbYesNoCancel', 'LongInt').Value.ts32 :=
Ord(mbYes) or Ord(mbNo) or Ord(mbCancel);
CL.AddConstantN('mbOKCancel', 'LongInt').Value.ts32 := Ord(mbOK) or Ord(mbCancel);
CL.AddConstantN('mbAbortRetryIgnore', 'LongInt').Value.ts32 :=
Ord(mbAbort) or Ord(mbRetry) or Ord(mbIgnore);
CL.AddDelphiFunction(
'Function CreateMessageDialog( const Msg : string; DlgType : TMsgDlgType; Buttons : TMsgDlgButtons) : TForm');
CL.AddDelphiFunction(
'Function MessageDlg( const Msg : string; DlgType : TMsgDlgType; Buttons : TMsgDlgButtons; HelpCtx : Longint) : Integer');
CL.AddDelphiFunction(
'Function MessageDlgPos( const Msg : string; DlgType : TMsgDlgType; Buttons : TMsgDlgButtons; HelpCtx : Longint; X, Y : Integer) : Integer');
CL.AddDelphiFunction(
'Function MessageDlgPosHelp( const Msg : string; DlgType : TMsgDlgType; Buttons : TMsgDlgButtons; HelpCtx : Longint; X, Y : Integer; const HelpFileName : string) : Integer');
CL.AddDelphiFunction('Procedure ShowMessage( const Msg : string)');
CL.AddDelphiFunction('Procedure ShowMessagePos( const Msg : string; X, Y : Integer)');
CL.AddDelphiFunction(
'Function InputBox( const ACaption, APrompt, ADefault : string) : string');
CL.AddDelphiFunction(
'Function InputQuery( const ACaption, APrompt : string; var Value : string) : Boolean');
end;
(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure TFindDialogOnFind_W(Self: TFindDialog; const T: TNotifyEvent);
begin
Self.OnFind := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogOnFind_R(Self: TFindDialog; var T: TNotifyEvent);
begin
T := Self.OnFind;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogOptions_W(Self: TFindDialog; const T: TFindOptions);
begin
Self.Options := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogOptions_R(Self: TFindDialog; var T: TFindOptions);
begin
T := Self.Options;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogFindText_W(Self: TFindDialog; const T: string);
begin
Self.FindText := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogFindText_R(Self: TFindDialog; var T: string);
begin
T := Self.FindText;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogTop_W(Self: TFindDialog; const T: integer);
begin
Self.Top := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogTop_R(Self: TFindDialog; var T: integer);
begin
T := Self.Top;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogPosition_W(Self: TFindDialog; const T: TPoint);
begin
Self.Position := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogPosition_R(Self: TFindDialog; var T: TPoint);
begin
T := Self.Position;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogLeft_W(Self: TFindDialog; const T: integer);
begin
Self.Left := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFindDialogLeft_R(Self: TFindDialog; var T: integer);
begin
T := Self.Left;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogToPage_W(Self: TPrintDialog; const T: integer);
begin
Self.ToPage := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogToPage_R(Self: TPrintDialog; var T: integer);
begin
T := Self.ToPage;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogPrintRange_W(Self: TPrintDialog; const T: TPrintRange);
begin
Self.PrintRange := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogPrintRange_R(Self: TPrintDialog; var T: TPrintRange);
begin
T := Self.PrintRange;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogPrintToFile_W(Self: TPrintDialog; const T: boolean);
begin
Self.PrintToFile := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogPrintToFile_R(Self: TPrintDialog; var T: boolean);
begin
T := Self.PrintToFile;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogOptions_W(Self: TPrintDialog; const T: TPrintDialogOptions);
begin
Self.Options := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogOptions_R(Self: TPrintDialog; var T: TPrintDialogOptions);
begin
T := Self.Options;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogMaxPage_W(Self: TPrintDialog; const T: integer);
begin
Self.MaxPage := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogMaxPage_R(Self: TPrintDialog; var T: integer);
begin
T := Self.MaxPage;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogMinPage_W(Self: TPrintDialog; const T: integer);
begin
Self.MinPage := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogMinPage_R(Self: TPrintDialog; var T: integer);
begin
T := Self.MinPage;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogFromPage_W(Self: TPrintDialog; const T: integer);
begin
Self.FromPage := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogFromPage_R(Self: TPrintDialog; var T: integer);
begin
T := Self.FromPage;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogCopies_W(Self: TPrintDialog; const T: integer);
begin
Self.Copies := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogCopies_R(Self: TPrintDialog; var T: integer);
begin
T := Self.Copies;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogCollate_W(Self: TPrintDialog; const T: boolean);
begin
Self.Collate := T;
end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogCollate_R(Self: TPrintDialog; var T: boolean);
begin
T := Self.Collate;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogOnApply_W(Self: TFontDialog; const T: TFDApplyEvent);
begin
Self.OnApply := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogOnApply_R(Self: TFontDialog; var T: TFDApplyEvent);
begin
T := Self.OnApply;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogOptions_W(Self: TFontDialog; const T: TFontDialogOptions);
begin
Self.Options := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogOptions_R(Self: TFontDialog; var T: TFontDialogOptions);
begin
T := Self.Options;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogMaxFontSize_W(Self: TFontDialog; const T: integer);
begin
Self.MaxFontSize := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogMaxFontSize_R(Self: TFontDialog; var T: integer);
begin
T := Self.MaxFontSize;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogMinFontSize_W(Self: TFontDialog; const T: integer);
begin
Self.MinFontSize := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogMinFontSize_R(Self: TFontDialog; var T: integer);
begin
T := Self.MinFontSize;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogDevice_W(Self: TFontDialog; const T: TFontDialogDevice);
begin
Self.Device := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogDevice_R(Self: TFontDialog; var T: TFontDialogDevice);
begin
T := Self.Device;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogFont_W(Self: TFontDialog; const T: TFont);
begin
Self.Font := T;
end;
(*----------------------------------------------------------------------------*)
procedure TFontDialogFont_R(Self: TFontDialog; var T: TFont);
begin
T := Self.Font;
end;
(*----------------------------------------------------------------------------*)
procedure TColorDialogOptions_W(Self: TColorDialog; const T: TColorDialogOptions);
begin
Self.Options := T;
end;
(*----------------------------------------------------------------------------*)
procedure TColorDialogOptions_R(Self: TColorDialog; var T: TColorDialogOptions);
begin
T := Self.Options;
end;
(*----------------------------------------------------------------------------*)
procedure TColorDialogCustomColors_W(Self: TColorDialog; const T: TStrings);
begin
Self.CustomColors := T;
end;
(*----------------------------------------------------------------------------*)
procedure TColorDialogCustomColors_R(Self: TColorDialog; var T: TStrings);
begin
T := Self.CustomColors;
end;
(*----------------------------------------------------------------------------*)
procedure TColorDialogColor_W(Self: TColorDialog; const T: TColor);
begin
Self.Color := T;
end;
(*----------------------------------------------------------------------------*)
procedure TColorDialogColor_R(Self: TColorDialog; var T: TColor);
begin
T := Self.Color;
end;
(*----------------------------------------------------------------------------*)
//procedure TOpenDialogOnIncludeItem_W(Self: TOpenDialog; const T: TIncludeItemEvent);
//begin Self.OnIncludeItem := T; end;
(*----------------------------------------------------------------------------*)
//procedure TOpenDialogOnIncludeItem_R(Self: TOpenDialog; var T: TIncludeItemEvent);
//begin T := Self.OnIncludeItem; end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnTypeChange_W(Self: TOpenDialog; const T: TNotifyEvent);
begin
Self.OnTypeChange := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnTypeChange_R(Self: TOpenDialog; var T: TNotifyEvent);
begin
T := Self.OnTypeChange;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnSelectionChange_W(Self: TOpenDialog; const T: TNotifyEvent);
begin
Self.OnSelectionChange := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnSelectionChange_R(Self: TOpenDialog; var T: TNotifyEvent);
begin
T := Self.OnSelectionChange;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnFolderChange_W(Self: TOpenDialog; const T: TNotifyEvent);
begin
Self.OnFolderChange := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnFolderChange_R(Self: TOpenDialog; var T: TNotifyEvent);
begin
T := Self.OnFolderChange;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnCanClose_W(Self: TOpenDialog; const T: TCloseQueryEvent);
begin
Self.OnCanClose := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnCanClose_R(Self: TOpenDialog; var T: TCloseQueryEvent);
begin
T := Self.OnCanClose;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogTitle_W(Self: TOpenDialog; const T: string);
begin
Self.Title := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogTitle_R(Self: TOpenDialog; var T: string);
begin
T := Self.Title;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOptions_W(Self: TOpenDialog; const T: TOpenOptions);
begin
Self.Options := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOptions_R(Self: TOpenDialog; var T: TOpenOptions);
begin
T := Self.Options;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogInitialDir_W(Self: TOpenDialog; const T: string);
begin
Self.InitialDir := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogInitialDir_R(Self: TOpenDialog; var T: string);
begin
T := Self.InitialDir;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFilterIndex_W(Self: TOpenDialog; const T: integer);
begin
Self.FilterIndex := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFilterIndex_R(Self: TOpenDialog; var T: integer);
begin
T := Self.FilterIndex;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFilter_W(Self: TOpenDialog; const T: string);
begin
Self.Filter := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFilter_R(Self: TOpenDialog; var T: string);
begin
T := Self.Filter;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFileName_W(Self: TOpenDialog; const T: TFileName);
begin
Self.FileName := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFileName_R(Self: TOpenDialog; var T: TFileName);
begin
T := Self.FileName;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogDefaultExt_W(Self: TOpenDialog; const T: string);
begin
Self.DefaultExt := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogDefaultExt_R(Self: TOpenDialog; var T: string);
begin
T := Self.DefaultExt;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogHistoryList_W(Self: TOpenDialog; const T: TStrings);
begin
Self.HistoryList := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogHistoryList_R(Self: TOpenDialog; var T: TStrings);
begin
T := Self.HistoryList;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFiles_R(Self: TOpenDialog; var T: TStrings);
begin
T := Self.Files;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFileEditStyle_W(Self: TOpenDialog; const T: TFileEditStyle);
begin
Self.FileEditStyle := T;
end;
(*----------------------------------------------------------------------------*)
procedure TOpenDialogFileEditStyle_R(Self: TOpenDialog; var T: TFileEditStyle);
begin
T := Self.FileEditStyle;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogOnShow_W(Self: TCommonDialog; const T: TNotifyEvent);
begin
Self.OnShow := T;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogOnShow_R(Self: TCommonDialog; var T: TNotifyEvent);
begin
T := Self.OnShow;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogOnClose_W(Self: TCommonDialog; const T: TNotifyEvent);
begin
Self.OnClose := T;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogOnClose_R(Self: TCommonDialog; var T: TNotifyEvent);
begin
T := Self.OnClose;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogHelpContext_W(Self: TCommonDialog; const T: THelpContext);
begin
Self.HelpContext := T;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogHelpContext_R(Self: TCommonDialog; var T: THelpContext);
begin
T := Self.HelpContext;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogCtl3D_W(Self: TCommonDialog; const T: boolean);
begin
Self.Ctl3D := T;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogCtl3D_R(Self: TCommonDialog; var T: boolean);
begin
T := Self.Ctl3D;
end;
(*----------------------------------------------------------------------------*)
procedure TCommonDialogHandle_R(Self: TCommonDialog; var T: HWnd);
begin
T := Self.Handle;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_Dialogs_Routines(S: TPSExec);
begin
S.RegisterDelphiFunction(@CreateMessageDialog, 'CreateMessageDialog', cdRegister);
S.RegisterDelphiFunction(@MessageDlg, 'MessageDlg', cdRegister);
S.RegisterDelphiFunction(@MessageDlgPos, 'MessageDlgPos', cdRegister);
S.RegisterDelphiFunction(@MessageDlgPosHelp, 'MessageDlgPosHelp', cdRegister);
S.RegisterDelphiFunction(@ShowMessage, 'ShowMessage', cdRegister);
S.RegisterDelphiFunction(@ShowMessagePos, 'ShowMessagePos', cdRegister);
S.RegisterDelphiFunction(@InputBox, 'InputBox', cdRegister);
S.RegisterDelphiFunction(@InputQuery, 'InputQuery', cdRegister);
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TReplaceDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TReplaceDialog) do
begin
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TFindDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFindDialog) do
begin
RegisterMethod(@TFindDialog.Execute, 'Execute');
RegisterMethod(@TFindDialog.CloseDialog, 'CloseDialog');
RegisterPropertyHelper(@TFindDialogLeft_R, @TFindDialogLeft_W, 'Left');
RegisterPropertyHelper(@TFindDialogPosition_R, @TFindDialogPosition_W, 'Position');
RegisterPropertyHelper(@TFindDialogTop_R, @TFindDialogTop_W, 'Top');
RegisterPropertyHelper(@TFindDialogFindText_R, @TFindDialogFindText_W, 'FindText');
RegisterPropertyHelper(@TFindDialogOptions_R, @TFindDialogOptions_W, 'Options');
RegisterPropertyHelper(@TFindDialogOnFind_R, @TFindDialogOnFind_W, 'OnFind');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TPrintDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TPrintDialog) do
begin
RegisterMethod(@TPrintDialog.Execute, 'Execute');
RegisterPropertyHelper(@TPrintDialogCollate_R, @TPrintDialogCollate_W, 'Collate');
RegisterPropertyHelper(@TPrintDialogCopies_R, @TPrintDialogCopies_W, 'Copies');
RegisterPropertyHelper(@TPrintDialogFromPage_R, @TPrintDialogFromPage_W, 'FromPage');
RegisterPropertyHelper(@TPrintDialogMinPage_R, @TPrintDialogMinPage_W, 'MinPage');
RegisterPropertyHelper(@TPrintDialogMaxPage_R, @TPrintDialogMaxPage_W, 'MaxPage');
RegisterPropertyHelper(@TPrintDialogOptions_R, @TPrintDialogOptions_W, 'Options');
RegisterPropertyHelper(@TPrintDialogPrintToFile_R, @TPrintDialogPrintToFile_W,
'PrintToFile');
RegisterPropertyHelper(@TPrintDialogPrintRange_R, @TPrintDialogPrintRange_W,
'PrintRange');
RegisterPropertyHelper(@TPrintDialogToPage_R, @TPrintDialogToPage_W, 'ToPage');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TPrinterSetupDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TPrinterSetupDialog) do
begin
RegisterMethod(@TPrinterSetupDialog.Execute, 'Execute');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TFontDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFontDialog) do
begin
RegisterMethod(@TFontDialog.Execute, 'Execute');
RegisterPropertyHelper(@TFontDialogFont_R, @TFontDialogFont_W, 'Font');
RegisterPropertyHelper(@TFontDialogDevice_R, @TFontDialogDevice_W, 'Device');
RegisterPropertyHelper(@TFontDialogMinFontSize_R, @TFontDialogMinFontSize_W,
'MinFontSize');
RegisterPropertyHelper(@TFontDialogMaxFontSize_R, @TFontDialogMaxFontSize_W,
'MaxFontSize');
RegisterPropertyHelper(@TFontDialogOptions_R, @TFontDialogOptions_W, 'Options');
RegisterPropertyHelper(@TFontDialogOnApply_R, @TFontDialogOnApply_W, 'OnApply');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TColorDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TColorDialog) do
begin
RegisterMethod(@TColorDialog.Execute, 'Execute');
RegisterPropertyHelper(@TColorDialogColor_R, @TColorDialogColor_W, 'Color');
RegisterPropertyHelper(@TColorDialogCustomColors_R, @TColorDialogCustomColors_W,
'CustomColors');
RegisterPropertyHelper(@TColorDialogOptions_R, @TColorDialogOptions_W, 'Options');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TSaveDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TSaveDialog) do
begin
RegisterMethod(@TSaveDialog.Execute, 'Execute');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TOpenDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TOpenDialog) do
begin
RegisterMethod(@TOpenDialog.Execute, 'Execute');
RegisterPropertyHelper(@TOpenDialogFileEditStyle_R, @TOpenDialogFileEditStyle_W,
'FileEditStyle');
RegisterPropertyHelper(@TOpenDialogFiles_R, nil, 'Files');
RegisterPropertyHelper(@TOpenDialogHistoryList_R, @TOpenDialogHistoryList_W,
'HistoryList');
RegisterPropertyHelper(@TOpenDialogDefaultExt_R, @TOpenDialogDefaultExt_W,
'DefaultExt');
RegisterPropertyHelper(@TOpenDialogFileName_R, @TOpenDialogFileName_W, 'FileName');
RegisterPropertyHelper(@TOpenDialogFilter_R, @TOpenDialogFilter_W, 'Filter');
RegisterPropertyHelper(@TOpenDialogFilterIndex_R, @TOpenDialogFilterIndex_W,
'FilterIndex');
RegisterPropertyHelper(@TOpenDialogInitialDir_R, @TOpenDialogInitialDir_W,
'InitialDir');
RegisterPropertyHelper(@TOpenDialogOptions_R, @TOpenDialogOptions_W, 'Options');
RegisterPropertyHelper(@TOpenDialogTitle_R, @TOpenDialogTitle_W, 'Title');
RegisterPropertyHelper(@TOpenDialogOnCanClose_R, @TOpenDialogOnCanClose_W,
'OnCanClose');
RegisterPropertyHelper(@TOpenDialogOnFolderChange_R,
@TOpenDialogOnFolderChange_W, 'OnFolderChange');
RegisterPropertyHelper(@TOpenDialogOnSelectionChange_R,
@TOpenDialogOnSelectionChange_W, 'OnSelectionChange');
RegisterPropertyHelper(@TOpenDialogOnTypeChange_R, @TOpenDialogOnTypeChange_W,
'OnTypeChange');
// RegisterPropertyHelper(@TOpenDialogOnIncludeItem_R,@TOpenDialogOnIncludeItem_W,'OnIncludeItem');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TCommonDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TCommonDialog) do
begin
RegisterMethod(@TCommonDialog.Execute, 'Execute');
RegisterPropertyHelper(@TCommonDialogHandle_R, nil, 'Handle');
RegisterPropertyHelper(@TCommonDialogCtl3D_R, @TCommonDialogCtl3D_W, 'Ctl3D');
RegisterPropertyHelper(@TCommonDialogHelpContext_R, @TCommonDialogHelpContext_W,
'HelpContext');
RegisterPropertyHelper(@TCommonDialogOnClose_R, @TCommonDialogOnClose_W, 'OnClose');
RegisterPropertyHelper(@TCommonDialogOnShow_R, @TCommonDialogOnShow_W, 'OnShow');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_Dialogs(CL: TPSRuntimeClassImporter);
begin
RIRegister_TCommonDialog(CL);
RIRegister_TOpenDialog(CL);
RIRegister_TSaveDialog(CL);
RIRegister_TColorDialog(CL);
RIRegister_TFontDialog(CL);
RIRegister_TPrinterSetupDialog(CL);
RIRegister_TPrintDialog(CL);
RIRegister_TFindDialog(CL);
RIRegister_TReplaceDialog(CL);
end;
end.