better x64 support: use class helpers for registration properties and methods

This commit is contained in:
evgeny-k 2023-11-17 13:27:50 +03:00
parent d5057bb2c6
commit f5da34521d
20 changed files with 10740 additions and 1700 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,11 @@
unit uROPSImports;
{$IFDEF MSWINDOWS}
{$I ..\..\Source\PascalScript.inc}
{$ELSE}
{$I ../../Source/PascalScript.inc}
{$ENDIF}
interface
uses
@ -86,7 +92,36 @@ begin
T := Self.LIBRARYNAME;
end; }
procedure TROBINMESSAGEUSECOMPRESSION_W(Self: TROBINMESSAGE; const T: boolean);
{$IFDEF DELPHI10UP}{$REGION 'TROBinMessage'}{$ENDIF}
{$IFDEF class_helper_present}
type
TROBinMessage_PSHelper = class helper for TROBinMessage
public
procedure USECOMPRESSION_W(const T: boolean);
procedure USECOMPRESSION_R(var T: boolean);
end;
procedure TROBinMessage_PSHelper.USECOMPRESSION_W(const T: boolean);
begin
Self.USECOMPRESSION := T;
end;
procedure TROBinMessage_PSHelper.USECOMPRESSION_R(var T: boolean);
begin
T := Self.USECOMPRESSION;
end;
procedure RIRegisterTROBINMESSAGE(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROBINMESSAGE) do
begin
RegisterPropertyHelper(@TROBINMESSAGE.USECOMPRESSION_R,
@TROBINMESSAGE.USECOMPRESSION_W, 'USECOMPRESSION');
end;
end;
{$ELSE}
procedure TROBINMESSAGEUSECOMPRESSION_W(Self: TROBinMessage; const T: boolean);
begin
Self.USECOMPRESSION := T;
end;
@ -96,7 +131,48 @@ begin
T := Self.USECOMPRESSION;
end;
procedure TROINDYHTTPCHANNELTARGETURL_W(Self: TROINDYHTTPCHANNEL; const T: string);
procedure RIRegisterTROBINMESSAGE(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROBINMESSAGE) do
begin
RegisterPropertyHelper(@TROBINMESSAGEUSECOMPRESSION_R,
@TROBINMESSAGEUSECOMPRESSION_W, 'USECOMPRESSION');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TROIndyHTTPChannel'}{$ENDIF}
{$IFDEF class_helper_present}
type
TROIndyHTTPChannel_PSHelper = class helper for TROIndyHTTPChannel
public
procedure TARGETURL_W(const T: string);
procedure TARGETURL_R(var T: string);
end;
procedure TROIndyHTTPChannel_PSHelper.TARGETURL_W(const T: string);
begin
Self.TARGETURL := T;
end;
procedure TROIndyHTTPChannel_PSHelper.TARGETURL_R(var T: string);
begin
T := Self.TARGETURL;
end;
procedure RIRegisterTROINDYHTTPCHANNEL(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROINDYHTTPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYHTTPCHANNEL.TARGETURL_R,
@TROINDYHTTPCHANNEL.TARGETURL_W, 'TARGETURL');
end;
end;
{$ELSE}
procedure TROINDYHTTPCHANNELTARGETURL_W(Self: TROIndyHTTPChannel; const T: string);
begin
Self.TARGETURL := T;
end;
@ -106,31 +182,152 @@ begin
T := Self.TARGETURL;
end;
procedure TROINDYTCPCHANNELINDYCLIENT_R(Self: TROINDYTCPCHANNEL; var T: TIdTCPClientBaseClass);
procedure RIRegisterTROINDYHTTPCHANNEL(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROINDYHTTPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYHTTPCHANNELTARGETURL_R,
@TROINDYHTTPCHANNELTARGETURL_W, 'TARGETURL');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TROIndyTCPChannel'}{$ENDIF}
{$IFDEF class_helper_present}
type
TROIndyTCPChannel_PSHelper = class helper for TROIndyTCPChannel
public
procedure INDYCLIENT_R(var T: TIdTCPClientBaseClass);
end;
procedure TROIndyTCPChannel_PSHelper.INDYCLIENT_R(var T: TIdTCPClientBaseClass);
begin
T := Self.INDYCLIENT;
end;
procedure TIDTCPCLIENTPORT_W(Self: TIDTCPCLIENT; const T: integer);
procedure RIRegisterTROINDYTCPCHANNEL(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROINDYTCPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYTCPCHANNEL.INDYCLIENT_R, nil, 'INDYCLIENT');
end;
end;
{$ELSE}
procedure TROINDYTCPCHANNELINDYCLIENT_R(Self: TROIndyTCPChannel; var T: TIdTCPClientBaseClass);
begin
T := Self.INDYCLIENT;
end;
procedure RIRegisterTROINDYTCPCHANNEL(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROINDYTCPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYTCPCHANNELINDYCLIENT_R, nil, 'INDYCLIENT');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TIdTCPClientBaseClass'}{$ENDIF}
{$IFDEF class_helper_present}
type
TIdTCPClientBaseClass_PSHelper = class helper for TIdTCPClientBaseClass
public
// procedure BOUNDIP_R(var T: string);
// procedure BOUNDIP_W(const T: string);
// procedure BOUNDPORT_R(var T: integer);
// procedure BOUNDPORT_W(const T: integer);
// procedure BOUNDPORTMAX_R(var T: integer);
// procedure BOUNDPORTMAX_W(const T: integer);
// procedure BOUNDPORTMIN_R(var T: integer);
// procedure BOUNDPORTMIN_W(const T: integer);
procedure HOST_R(var T: string);
procedure HOST_W(const T: string);
procedure PORT_R(var T: integer);
procedure PORT_W(const T: integer);
end;
{procedure TIdTCPClientBaseClass_PSHelper.BOUNDPORT_W(const T: integer);
begin
Self.BOUNDPORT := T;
end;
procedure TIdTCPClientBaseClass_PSHelper.BOUNDPORT_R(var T: integer);
begin
T := Self.BOUNDPORT;
end;
procedure TIdTCPClientBaseClass_PSHelper.BOUNDIP_W(const T: string);
begin
Self.BOUNDIP := T;
end;
procedure TIdTCPClientBaseClass_PSHelper.BOUNDIP_R(var T: string);
begin
T := Self.BOUNDIP;
end;]
procedure TIdTCPClientBaseClass_PSHelper.BOUNDPORTMIN_W(const T: integer);
begin
Self.BOUNDPORTMIN := T;
end;
procedure TIdTCPClientBaseClass_PSHelper.BOUNDPORTMIN_R(var T: integer);
begin
T := Self.BOUNDPORTMIN;
end;
procedure TIdTCPClientBaseClass_PSHelper.BOUNDPORTMAX_W(const T: integer);
begin
Self.BOUNDPORTMAX := T;
end;
procedure TIdTCPClientBaseClass_PSHelper.BOUNDPORTMAX_R(var T: integer);
begin
T := Self.BOUNDPORTMAX;
end; }
procedure TIdTCPClientBaseClass_PSHelper.PORT_W(const T: integer);
begin
Self.PORT := T;
end;
procedure TIDTCPCLIENTPORT_R(Self: TIdTCPClientBaseClass; var T: integer);
procedure TIdTCPClientBaseClass_PSHelper.PORT_R(var T: integer);
begin
T := TIdIndy10HackClient(Self).PORT;
end;
procedure TIDTCPCLIENTHOST_W(Self: TIdTCPClientBaseClass; const T: string);
procedure TIdTCPClientBaseClass_PSHelper.HOST_W(const T: string);
begin
TIdIndy10HackClient(Self).HOST := T;
end;
procedure TIDTCPCLIENTHOST_R(Self: TIdTCPClientBaseClass; var T: string);
procedure TIdTCPClientBaseClass_PSHelper.HOST_R(var T: string);
begin
T := TIdIndy10HackClient(Self).HOST;
end;
procedure RIRegisterTIDTCPCLIENT(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TIdTCPClientBaseClass) do
begin
{RegisterPropertyHelper(@TIdTCPClientBaseClass.BOUNDPORTMAX_R, @TIdTCPClientBaseClass.BOUNDPORTMAX_W,
'BOUNDPORTMAX');
RegisterPropertyHelper(@TIdTCPClientBaseClass.BOUNDPORTMIN_R, @TIdTCPClientBaseClass.BOUNDPORTMIN_W,
'BOUNDPORTMIN');
RegisterPropertyHelper(@TIdTCPClientBaseClass.BOUNDIP_R, @TIdTCPClientBaseClass.BOUNDIP_W, 'BOUNDIP');
RegisterPropertyHelper(@TIdTCPClientBaseClass.BOUNDPORT_R, @TIdTCPClientBaseClass.BOUNDPORT_W,
'BOUNDPORT');}
RegisterPropertyHelper(@TIdTCPClientBaseClass.HOST_R, @TIdTCPClientBaseClass.HOST_W, 'HOST');
RegisterPropertyHelper(@TIdTCPClientBaseClass.PORT_R, @TIdTCPClientBaseClass.PORT_W, 'PORT');
end;
end;
{$ELSE}
{procedure TIDTCPCLIENTBOUNDPORT_W(Self: TIdTCPClientBaseClass; const T: integer);
begin
Self.BOUNDPORT := T;
@ -169,45 +366,26 @@ end;
procedure TIDTCPCLIENTBOUNDPORTMAX_R(Self: TIdTCPClientBaseClass; var T: integer);
begin
T := Self.BOUNDPORTMAX;
end;
{procedure RIRegisterTROSOAPMESSAGE(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROSOAPMESSAGE) do
begin
RegisterPropertyHelper(@TROSOAPMESSAGELIBRARYNAME_R, @TROSOAPMESSAGELIBRARYNAME_W,
'LIBRARYNAME');
RegisterPropertyHelper(@TROSOAPMESSAGECUSTOMLOCATION_R,
@TROSOAPMESSAGECUSTOMLOCATION_W, 'CUSTOMLOCATION');
RegisterPropertyHelper(@TROSOAPMESSAGESERIALIZATIONOPTIONS_R,
@TROSOAPMESSAGESERIALIZATIONOPTIONS_W, 'SERIALIZATIONOPTIONS');
end;
end; }
procedure RIRegisterTROBINMESSAGE(Cl: TIFPSRuntimeClassImporter);
procedure TIDTCPCLIENTPORT_W(Self: TIdTCPClient; const T: integer);
begin
with Cl.Add(TROBINMESSAGE) do
begin
RegisterPropertyHelper(@TROBINMESSAGEUSECOMPRESSION_R,
@TROBINMESSAGEUSECOMPRESSION_W, 'USECOMPRESSION');
end;
Self.PORT := T;
end;
procedure RIRegisterTROINDYHTTPCHANNEL(Cl: TIFPSRuntimeClassImporter);
procedure TIDTCPCLIENTPORT_R(Self: TIdTCPClientBaseClass; var T: integer);
begin
with Cl.Add(TROINDYHTTPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYHTTPCHANNELTARGETURL_R,
@TROINDYHTTPCHANNELTARGETURL_W, 'TARGETURL');
end;
T := TIdIndy10HackClient(Self).PORT;
end;
procedure RIRegisterTROINDYTCPCHANNEL(Cl: TIFPSRuntimeClassImporter);
procedure TIDTCPCLIENTHOST_W(Self: TIdTCPClientBaseClass; const T: string);
begin
with Cl.Add(TROINDYTCPCHANNEL) do
begin
RegisterPropertyHelper(@TROINDYTCPCHANNELINDYCLIENT_R, nil, 'INDYCLIENT');
end;
TIdIndy10HackClient(Self).HOST := T;
end;
procedure TIDTCPCLIENTHOST_R(Self: TIdTCPClientBaseClass; var T: string);
begin
T := TIdIndy10HackClient(Self).HOST;
end;
procedure RIRegisterTIDTCPCLIENT(Cl: TIFPSRuntimeClassImporter);
@ -225,6 +403,22 @@ begin
RegisterPropertyHelper(@TIDTCPCLIENTPORT_R, @TIDTCPCLIENTPORT_W, 'PORT');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{procedure RIRegisterTROSOAPMESSAGE(Cl: TIFPSRuntimeClassImporter);
begin
with Cl.Add(TROSOAPMESSAGE) do
begin
RegisterPropertyHelper(@TROSOAPMESSAGELIBRARYNAME_R, @TROSOAPMESSAGELIBRARYNAME_W,
'LIBRARYNAME');
RegisterPropertyHelper(@TROSOAPMESSAGECUSTOMLOCATION_R,
@TROSOAPMESSAGECUSTOMLOCATION_W, 'CUSTOMLOCATION');
RegisterPropertyHelper(@TROSOAPMESSAGESERIALIZATIONOPTIONS_R,
@TROSOAPMESSAGESERIALIZATIONOPTIONS_W, 'SERIALIZATIONOPTIONS');
end;
end; }
procedure RIRegisterRODLImports(CL: TIFPSRuntimeClassImporter);
begin

View File

@ -1,5 +1,11 @@
unit uROPSServerLink;
{$IFDEF MSWINDOWS}
{$I ..\..\Source\PascalScript.inc}
{$ELSE}
{$I ../../Source/PascalScript.inc}
{$ENDIF}
interface
uses
{$IFDEF WIN32}Windows,{$ELSE}Types,{$ENDIF}
@ -85,7 +91,40 @@ With cl.AddClassN(cl.FindClass('TComponent'),'TROMESSAGE') do
end;
end;
procedure TROMESSAGEINTERFACENAME_W(Self: TROMESSAGE; const T: STRING);
{$IFDEF DELPHI10UP}{$REGION 'TROMessage'}{$ENDIF}
{$IFDEF class_helper_present}
type
TROMessage_PSHelper = class helper for TROMessage
public
procedure INTERFACENAME_R(var T: STRING);
procedure INTERFACENAME_W(const T: STRING);
procedure MESSAGENAME_R(var T: STRING);
procedure MESSAGENAME_W(const T: STRING);
end;
procedure TROMessage_PSHelper.INTERFACENAME_W(const T: STRING);
begin Self.INTERFACENAME := T; end;
procedure TROMessage_PSHelper.INTERFACENAME_R(var T: STRING);
begin T := Self.INTERFACENAME; end;
procedure TROMessage_PSHelper.MESSAGENAME_W(const T: STRING);
begin Self.MESSAGENAME := T; end;
procedure TROMessage_PSHelper.MESSAGENAME_R(var T: STRING);
begin T := Self.MESSAGENAME; end;
procedure RIRegisterTROMESSAGE(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TROMessage) do
begin
RegisterVirtualConstructor(@TROMessage.CREATE, 'CREATE');
RegisterPropertyHelper(@TROMessage.MESSAGENAME_R,@TROMessage.MESSAGENAME_W,'MESSAGENAME');
RegisterPropertyHelper(@TROMessage.INTERFACENAME_R,@TROMessage.INTERFACENAME_W,'INTERFACENAME');
end;
end;
{$ELSE}
procedure TROMESSAGEINTERFACENAME_W(Self: TROMessage; const T: STRING);
begin Self.INTERFACENAME := T; end;
procedure TROMESSAGEINTERFACENAME_R(Self: TROMESSAGE; var T: STRING);
@ -97,14 +136,6 @@ begin Self.MESSAGENAME := T; end;
procedure TROMESSAGEMESSAGENAME_R(Self: TROMESSAGE; var T: STRING);
begin T := Self.MESSAGENAME; end;
procedure RIRegisterTROTRANSPORTCHANNEL(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TROTRANSPORTCHANNEL) do
begin
RegisterVirtualConstructor(@TROTRANSPORTCHANNEL.CREATE, 'CREATE');
end;
end;
procedure RIRegisterTROMESSAGE(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TROMESSAGE) do
@ -114,7 +145,16 @@ with Cl.Add(TROMESSAGE) do
RegisterPropertyHelper(@TROMESSAGEINTERFACENAME_R,@TROMESSAGEINTERFACENAME_W,'INTERFACENAME');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegisterTROTRANSPORTCHANNEL(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TROTRANSPORTCHANNEL) do
begin
RegisterVirtualConstructor(@TROTRANSPORTCHANNEL.CREATE, 'CREATE');
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TROBinaryMemoryStream(CL: TPSPascalCompiler);
@ -143,6 +183,53 @@ begin
end;
(* === run-time registration functions === *)
{$IFDEF DELPHI10UP}{$REGION 'TROBinaryMemoryStream'}{$ENDIF}
{$IFDEF class_helper_present}
type
TROBinaryMemoryStream_PSHelper = class helper for TROBinaryMemoryStream
public
Function Create2_P(CreateNewInstance: Boolean; const iString : Ansistring):TObject;
Function Create_P(CreateNewInstance: Boolean):TObject;
procedure CapacityIncrement_R(var T: integer);
procedure CapacityIncrement_W(const T: integer);
end;
(*----------------------------------------------------------------------------*)
procedure TROBinaryMemoryStream_PSHelper.CapacityIncrement_W(const T: integer);
begin Self.CapacityIncrement := T; end;
(*----------------------------------------------------------------------------*)
procedure TROBinaryMemoryStream_PSHelper.CapacityIncrement_R(var T: integer);
begin T := Self.CapacityIncrement; end;
(*----------------------------------------------------------------------------*)
Function TROBinaryMemoryStream_PSHelper.Create_P(CreateNewInstance: Boolean):TObject;
Begin Result := TROBinaryMemoryStream.Create; END;
(*----------------------------------------------------------------------------*)
Function TROBinaryMemoryStream_PSHelper.Create2_P(CreateNewInstance: Boolean; const iString : Ansistring):TObject;
Begin Result := TROBinaryMemoryStream.Create(iString); END;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TROBinaryMemoryStream(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TROBinaryMemoryStream) do
begin
RegisterConstructor(@TROBinaryMemoryStream.Create2_P, 'Create2');
RegisterConstructor(@TROBinaryMemoryStream.Create_P, 'Create');
RegisterMethod(@TROBinaryMemoryStream.Assign, 'Assign');
RegisterMethod(@TROBinaryMemoryStream.Clone, 'Clone');
RegisterMethod(@TROBinaryMemoryStream.LoadFromString, 'LoadFromString');
RegisterMethod(@TROBinaryMemoryStream.LoadFromHexString, 'LoadFromHexString');
RegisterMethod(@TROBinaryMemoryStream.ToString, 'ToString');
RegisterMethod(@TROBinaryMemoryStream.ToHexString, 'ToHexString');
RegisterMethod(@TROBinaryMemoryStream.ToReadableString, 'ToReadableString');
RegisterMethod(@TROBinaryMemoryStream.WriteAnsiString, 'WriteAnsiString');
RegisterPropertyHelper(@TROBinaryMemoryStream.CapacityIncrement_R,@TROBinaryMemoryStream.CapacityIncrement_W,'CapacityIncrement');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TROBinaryMemoryStreamCapacityIncrement_W(Self: TROBinaryMemoryStream; const T: integer);
begin Self.CapacityIncrement := T; end;
@ -178,6 +265,10 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
(*----------------------------------------------------------------------------*)
procedure RIRegister_uROClasses(CL: TPSRuntimeClassImporter);
begin
@ -185,7 +276,6 @@ begin
end;
(*----------------------------------------------------------------------------*)
type

View File

@ -64,3 +64,11 @@ Defines:
{$IFDEF FPC}
{$I PascalScriptFPC.inc}
{$ENDIF}
{$IFDEF DELPHI2005UP}
{$DEFINE class_helper_present}
{$ENDIF}
{$IFDEF FPC}
{$DEFINE class_helper_present}
{$ENDIF}

View File

@ -6,6 +6,13 @@ 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
}
{$IFDEF MSWINDOWS}
{$I ..\PascalScript.inc}
{$ELSE}
{$I ../PascalScript.inc}
{$ENDIF}
interface
uses
@ -215,6 +222,85 @@ begin
CL.AddDelphiFunction('function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean');
end;
{$IFDEF DELPHI10UP}{$REGION 'TFindDialog'}{$ENDIF}
{$IFDEF class_helper_present}
type
TFindDialog_PSHelper = class helper for TFindDialog
public
procedure OnFind_W(const T: TNotifyEvent);
procedure OnFind_R(var T: TNotifyEvent);
procedure Options_W(const T: TFindOptions);
procedure Options_R(var T: TFindOptions);
procedure FindText_W(const T: string);
procedure FindText_R(var T: string);
procedure Top_W(const T: Integer);
procedure Top_R(var T: Integer);
procedure Position_W(const T: TPoint);
procedure Position_R(var T: TPoint);
procedure Left_W(const T: Integer);
procedure Left_R(var T: Integer);
end;
procedure TFindDialog_PSHelper.OnFind_W(const T: TNotifyEvent);
begin Self.OnFind := T; end;
procedure TFindDialog_PSHelper.OnFind_R(var T: TNotifyEvent);
begin T := Self.OnFind; end;
procedure TFindDialog_PSHelper.Options_W(const T: TFindOptions);
begin Self.Options := T; end;
procedure TFindDialog_PSHelper.Options_R(var T: TFindOptions);
begin T := Self.Options; end;
procedure TFindDialog_PSHelper.FindText_W(const T: string);
begin Self.FindText := T; end;
procedure TFindDialog_PSHelper.FindText_R(var T: string);
begin T := Self.FindText; end;
procedure TFindDialog_PSHelper.Top_W(const T: Integer);
begin Self.Top := T; end;
procedure TFindDialog_PSHelper.Top_R(var T: Integer);
begin T := Self.Top; end;
procedure TFindDialog_PSHelper.Position_W(const T: TPoint);
begin Self.Position := T; end;
procedure TFindDialog_PSHelper.Position_R(var T: TPoint);
begin T := Self.Position; end;
procedure TFindDialog_PSHelper.Left_W(const T: Integer);
begin Self.Left := T; end;
procedure TFindDialog_PSHelper.Left_R(var T: Integer);
begin T := Self.Left; end;
procedure RIRegister_TFindDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFindDialog) do
begin
RegisterMethod(@TFindDialog.CloseDialog, 'CloseDialog');
RegisterPropertyHelper(@TFindDialog.Left_R,@TFindDialog.Left_W,'Left');
RegisterPropertyHelper(@TFindDialog.Position_R,@TFindDialog.Position_W,'Position');
RegisterPropertyHelper(@TFindDialog.Top_R,@TFindDialog.Top_W,'Top');
RegisterPropertyHelper(@TFindDialog.FindText_R,@TFindDialog.FindText_W,'FindText');
RegisterPropertyHelper(@TFindDialog.Options_R,@TFindDialog.Options_W,'Options');
RegisterPropertyHelper(@TFindDialog.OnFind_R,@TFindDialog.OnFind_W,'OnFind');
end;
end;
{$ELSE}
(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure TFindDialogOnFind_W(Self: TFindDialog; const T: TNotifyEvent);
@ -264,6 +350,136 @@ begin Self.Left := T; end;
procedure TFindDialogLeft_R(Self: TFindDialog; var T: Integer);
begin T := Self.Left; end;
procedure RIRegister_TFindDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFindDialog) do
begin
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;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPrintDialog'}{$ENDIF}
{$IFDEF class_helper_present}
type
TPrintDialog_PSHelper = class helper for TPrintDialog
public
procedure ToPage_W(const T: Integer);
procedure ToPage_R(var T: Integer);
procedure PrintRange_W(const T: TPrintRange);
procedure PrintRange_R(var T: TPrintRange);
procedure PrintToFile_W(const T: Boolean);
procedure PrintToFile_R(var T: Boolean);
procedure Options_W(const T: TPrintDialogOptions);
procedure Options_R(var T: TPrintDialogOptions);
procedure MaxPage_W(const T: Integer);
procedure MaxPage_R(var T: Integer);
procedure MinPage_W(const T: Integer);
procedure MinPage_R(var T: Integer);
procedure FromPage_W(const T: Integer);
procedure FromPage_R(var T: Integer);
procedure Copies_W(const T: Integer);
procedure Copies_R(var T: Integer);
procedure Collate_W(const T: Boolean);
procedure Collate_R(var T: Boolean);
end;
procedure TPrintDialog_PSHelper.ToPage_W(const T: Integer);
begin Self.ToPage := T; end;
procedure TPrintDialog_PSHelper.ToPage_R(var T: Integer);
begin T := Self.ToPage; end;
procedure TPrintDialog_PSHelper.PrintRange_W(const T: TPrintRange);
begin Self.PrintRange := T; end;
procedure TPrintDialog_PSHelper.PrintRange_R(var T: TPrintRange);
begin T := Self.PrintRange; end;
procedure TPrintDialog_PSHelper.PrintToFile_W(const T: Boolean);
begin Self.PrintToFile := T; end;
procedure TPrintDialog_PSHelper.PrintToFile_R(var T: Boolean);
begin T := Self.PrintToFile; end;
procedure TPrintDialog_PSHelper.Options_W(const T: TPrintDialogOptions);
begin Self.Options := T; end;
procedure TPrintDialog_PSHelper.Options_R(var T: TPrintDialogOptions);
begin T := Self.Options; end;
procedure TPrintDialog_PSHelper.MaxPage_W(const T: Integer);
begin Self.MaxPage := T; end;
procedure TPrintDialog_PSHelper.MaxPage_R(var T: Integer);
begin T := Self.MaxPage; end;
procedure TPrintDialog_PSHelper.MinPage_W(const T: Integer);
begin Self.MinPage := T; end;
procedure TPrintDialog_PSHelper.MinPage_R(var T: Integer);
begin T := Self.MinPage; end;
procedure TPrintDialog_PSHelper.FromPage_W(const T: Integer);
begin Self.FromPage := T; end;
procedure TPrintDialog_PSHelper.FromPage_R(var T: Integer);
begin T := Self.FromPage; end;
procedure TPrintDialog_PSHelper.Copies_W(const T: Integer);
begin Self.Copies := T; end;
procedure TPrintDialog_PSHelper.Copies_R(var T: Integer);
begin T := Self.Copies; end;
procedure TPrintDialog_PSHelper.Collate_W(const T: Boolean);
begin Self.Collate := T; end;
procedure TPrintDialog_PSHelper.Collate_R(var T: Boolean);
begin T := Self.Collate; end;
procedure RIRegister_TPrintDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TPrintDialog) do
begin
RegisterPropertyHelper(@TPrintDialog.Collate_R,@TPrintDialog.Collate_W,'Collate');
RegisterPropertyHelper(@TPrintDialog.Copies_R,@TPrintDialog.Copies_W,'Copies');
RegisterPropertyHelper(@TPrintDialog.FromPage_R,@TPrintDialog.FromPage_W,'FromPage');
RegisterPropertyHelper(@TPrintDialog.MinPage_R,@TPrintDialog.MinPage_W,'MinPage');
RegisterPropertyHelper(@TPrintDialog.MaxPage_R,@TPrintDialog.MaxPage_W,'MaxPage');
RegisterPropertyHelper(@TPrintDialog.Options_R,@TPrintDialog.Options_W,'Options');
RegisterPropertyHelper(@TPrintDialog.PrintToFile_R,@TPrintDialog.PrintToFile_W,'PrintToFile');
RegisterPropertyHelper(@TPrintDialog.PrintRange_R,@TPrintDialog.PrintRange_W,'PrintRange');
RegisterPropertyHelper(@TPrintDialog.ToPage_R,@TPrintDialog.ToPage_W,'ToPage');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TPrintDialogToPage_W(Self: TPrintDialog; const T: Integer);
begin Self.ToPage := T; end;
@ -335,7 +551,104 @@ begin Self.Collate := T; end;
(*----------------------------------------------------------------------------*)
procedure TPrintDialogCollate_R(Self: TPrintDialog; var T: Boolean);
begin T := Self.Collate; end;
procedure RIRegister_TPrintDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TPrintDialog) do
begin
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;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TFontDialog'}{$ENDIF}
{$IFDEF class_helper_present}
type
TFontDialog_PSHelper = class helper for TFontDialog
public
procedure OnApply_W(const T: TFDApplyEvent);
procedure OnApply_R(var T: TFDApplyEvent);
procedure Options_W(const T: TFontDialogOptions);
procedure Options_R(var T: TFontDialogOptions);
procedure MaxFontSize_W(const T: Integer);
procedure MaxFontSize_R(var T: Integer);
procedure MinFontSize_W(const T: Integer);
procedure MinFontSize_R(var T: Integer);
procedure Device_W(const T: TFontDialogDevice);
procedure Device_R(var T: TFontDialogDevice);
procedure Font_W(const T: TFont);
procedure Font_R(var T: TFont);
end;
procedure TFontDialog_PSHelper.OnApply_W(const T: TFDApplyEvent);
begin Self.OnApply := T; end;
procedure TFontDialog_PSHelper.OnApply_R(var T: TFDApplyEvent);
begin T := Self.OnApply; end;
procedure TFontDialog_PSHelper.Options_W(const T: TFontDialogOptions);
begin Self.Options := T; end;
procedure TFontDialog_PSHelper.Options_R(var T: TFontDialogOptions);
begin T := Self.Options; end;
procedure TFontDialog_PSHelper.MaxFontSize_W(const T: Integer);
begin Self.MaxFontSize := T; end;
procedure TFontDialog_PSHelper.MaxFontSize_R(var T: Integer);
begin T := Self.MaxFontSize; end;
procedure TFontDialog_PSHelper.MinFontSize_W(const T: Integer);
begin Self.MinFontSize := T; end;
procedure TFontDialog_PSHelper.MinFontSize_R(var T: Integer);
begin T := Self.MinFontSize; end;
procedure TFontDialog_PSHelper.Device_W(const T: TFontDialogDevice);
begin Self.Device := T; end;
procedure TFontDialog_PSHelper.Device_R(var T: TFontDialogDevice);
begin T := Self.Device; end;
procedure TFontDialog_PSHelper.Font_W(const T: TFont);
begin Self.Font := T; end;
procedure TFontDialog_PSHelper.Font_R(var T: TFont);
begin T := Self.Font; end;
procedure RIRegister_TFontDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFontDialog) do
begin
RegisterPropertyHelper(@TFontDialog.Font_R,@TFontDialog.Font_W,'Font');
RegisterPropertyHelper(@TFontDialog.Device_R,@TFontDialog.Device_W,'Device');
RegisterPropertyHelper(@TFontDialog.MinFontSize_R,@TFontDialog.MinFontSize_W,'MinFontSize');
RegisterPropertyHelper(@TFontDialog.MaxFontSize_R,@TFontDialog.MaxFontSize_W,'MaxFontSize');
RegisterPropertyHelper(@TFontDialog.Options_R,@TFontDialog.Options_W,'Options');
RegisterPropertyHelper(@TFontDialog.OnApply_R,@TFontDialog.OnApply_W,'OnApply');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TFontDialogOnApply_W(Self: TFontDialog; const T: TFDApplyEvent);
begin Self.OnApply := T; end;
@ -384,6 +697,68 @@ begin Self.Font := T; end;
procedure TFontDialogFont_R(Self: TFontDialog; var T: TFont);
begin T := Self.Font; end;
procedure RIRegister_TFontDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFontDialog) do
begin
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;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TColorDialog'}{$ENDIF}
{$IFDEF class_helper_present}
type
TColorDialog_PSHelper = class helper for TColorDialog
public
procedure Options_W(const T: TColorDialogOptions);
procedure Options_R(var T: TColorDialogOptions);
procedure CustomColors_W(const T: TStrings);
procedure CustomColors_R(var T: TStrings);
procedure Color_W(const T: TColor);
procedure Color_R(var T: TColor);
end;
procedure TColorDialog_PSHelper.Options_W(const T: TColorDialogOptions);
begin Self.Options := T; end;
procedure TColorDialog_PSHelper.Options_R(var T: TColorDialogOptions);
begin T := Self.Options; end;
procedure TColorDialog_PSHelper.CustomColors_W(const T: TStrings);
begin Self.CustomColors := T; end;
procedure TColorDialog_PSHelper.CustomColors_R(var T: TStrings);
begin T := Self.CustomColors; end;
procedure TColorDialog_PSHelper.Color_W(const T: TColor);
begin Self.Color := T; end;
procedure TColorDialog_PSHelper.Color_R(var T: TColor);
begin T := Self.Color; end;
procedure RIRegister_TColorDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TColorDialog) do
begin
RegisterPropertyHelper(@TColorDialog.Color_R,@TColorDialog.Color_W,'Color');
RegisterPropertyHelper(@TColorDialog.CustomColors_R,@TColorDialog.CustomColors_W,'CustomColors');
RegisterPropertyHelper(@TColorDialog.Options_R,@TColorDialog.Options_W,'Options');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TColorDialogOptions_W(Self: TColorDialog; const T: TColorDialogOptions);
begin Self.Options := T; end;
@ -408,6 +783,192 @@ begin Self.Color := T; end;
procedure TColorDialogColor_R(Self: TColorDialog; var T: TColor);
begin T := Self.Color; end;
procedure RIRegister_TColorDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TColorDialog) do
begin
RegisterPropertyHelper(@TColorDialogColor_R,@TColorDialogColor_W,'Color');
RegisterPropertyHelper(@TColorDialogCustomColors_R,@TColorDialogCustomColors_W,'CustomColors');
RegisterPropertyHelper(@TColorDialogOptions_R,@TColorDialogOptions_W,'Options');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TOpenDialog'}{$ENDIF}
{$IFDEF class_helper_present}
type
TOpenDialog_PSHelper = class helper for TOpenDialog
public
procedure OnIncludeItem_W( const T: TIncludeItemEvent);
procedure OnIncludeItem_R( var T: TIncludeItemEvent);
procedure OnTypeChange_W( const T: TNotifyEvent);
procedure OnTypeChange_R( var T: TNotifyEvent);
procedure OnSelectionChange_W( const T: TNotifyEvent);
procedure OnSelectionChange_R( var T: TNotifyEvent);
procedure OnFolderChange_W( const T: TNotifyEvent);
procedure OnFolderChange_R( var T: TNotifyEvent);
procedure OnCanClose_W( const T: TCloseQueryEvent);
procedure OnCanClose_R( var T: TCloseQueryEvent);
procedure Title_W( const T: string);
procedure Title_R( var T: string);
procedure Options_W( const T: TOpenOptions);
procedure Options_R( var T: TOpenOptions);
procedure InitialDir_W( const T: string);
procedure InitialDir_R( var T: string);
procedure FilterIndex_W( const T: Integer);
procedure FilterIndex_R( var T: Integer);
procedure Filter_W( const T: string);
procedure Filter_R( var T: string);
procedure FileName_W( const T: TFileName);
procedure FileName_R( var T: TFileName);
procedure DefaultExt_W( const T: string);
procedure DefaultExt_R( var T: string);
procedure HistoryList_W( const T: TStrings);
procedure HistoryList_R( var T: TStrings);
procedure Files_R( var T: TStrings);
procedure FileEditStyle_W( const T: TFileEditStyle);
procedure FileEditStyle_R( var T: TFileEditStyle);
end;
procedure TOpenDialog_PSHelper.OnIncludeItem_W( const T: TIncludeItemEvent);
begin Self.OnIncludeItem := T; end;
procedure TOpenDialog_PSHelper.OnIncludeItem_R( var T: TIncludeItemEvent);
begin T := Self.OnIncludeItem; end;
procedure TOpenDialog_PSHelper.OnTypeChange_W( const T: TNotifyEvent);
begin Self.OnTypeChange := T; end;
procedure TOpenDialog_PSHelper.OnTypeChange_R( var T: TNotifyEvent);
begin T := Self.OnTypeChange; end;
procedure TOpenDialog_PSHelper.OnSelectionChange_W( const T: TNotifyEvent);
begin Self.OnSelectionChange := T; end;
procedure TOpenDialog_PSHelper.OnSelectionChange_R( var T: TNotifyEvent);
begin T := Self.OnSelectionChange; end;
procedure TOpenDialog_PSHelper.OnFolderChange_W( const T: TNotifyEvent);
begin Self.OnFolderChange := T; end;
procedure TOpenDialog_PSHelper.OnFolderChange_R( var T: TNotifyEvent);
begin T := Self.OnFolderChange; end;
procedure TOpenDialog_PSHelper.OnCanClose_W( const T: TCloseQueryEvent);
begin Self.OnCanClose := T; end;
procedure TOpenDialog_PSHelper.OnCanClose_R( var T: TCloseQueryEvent);
begin T := Self.OnCanClose; end;
procedure TOpenDialog_PSHelper.Title_W( const T: string);
begin Self.Title := T; end;
procedure TOpenDialog_PSHelper.Title_R( var T: string);
begin T := Self.Title; end;
procedure TOpenDialog_PSHelper.Options_W( const T: TOpenOptions);
begin Self.Options := T; end;
procedure TOpenDialog_PSHelper.Options_R( var T: TOpenOptions);
begin T := Self.Options; end;
procedure TOpenDialog_PSHelper.InitialDir_W( const T: string);
begin Self.InitialDir := T; end;
procedure TOpenDialog_PSHelper.InitialDir_R( var T: string);
begin T := Self.InitialDir; end;
procedure TOpenDialog_PSHelper.FilterIndex_W( const T: Integer);
begin Self.FilterIndex := T; end;
procedure TOpenDialog_PSHelper.FilterIndex_R( var T: Integer);
begin T := Self.FilterIndex; end;
procedure TOpenDialog_PSHelper.Filter_W( const T: string);
begin Self.Filter := T; end;
procedure TOpenDialog_PSHelper.Filter_R( var T: string);
begin T := Self.Filter; end;
procedure TOpenDialog_PSHelper.FileName_W( const T: TFileName);
begin Self.FileName := T; end;
procedure TOpenDialog_PSHelper.FileName_R( var T: TFileName);
begin T := Self.FileName; end;
procedure TOpenDialog_PSHelper.DefaultExt_W( const T: string);
begin Self.DefaultExt := T; end;
procedure TOpenDialog_PSHelper.DefaultExt_R( var T: string);
begin T := Self.DefaultExt; end;
procedure TOpenDialog_PSHelper.HistoryList_W( const T: TStrings);
begin Self.HistoryList := T; end;
procedure TOpenDialog_PSHelper.HistoryList_R( var T: TStrings);
begin T := Self.HistoryList; end;
procedure TOpenDialog_PSHelper.Files_R( var T: TStrings);
begin T := Self.Files; end;
procedure TOpenDialog_PSHelper.FileEditStyle_W( const T: TFileEditStyle);
begin Self.FileEditStyle := T; end;
procedure TOpenDialog_PSHelper.FileEditStyle_R( var T: TFileEditStyle);
begin T := Self.FileEditStyle; end;
procedure RIRegister_TOpenDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TOpenDialog) do
begin
RegisterPropertyHelper(@TOpenDialog.FileEditStyle_R,@TOpenDialog.FileEditStyle_W,'FileEditStyle');
RegisterPropertyHelper(@TOpenDialog.Files_R,nil,'Files');
RegisterPropertyHelper(@TOpenDialog.HistoryList_R,@TOpenDialog.HistoryList_W,'HistoryList');
RegisterPropertyHelper(@TOpenDialog.DefaultExt_R,@TOpenDialog.DefaultExt_W,'DefaultExt');
RegisterPropertyHelper(@TOpenDialog.FileName_R,@TOpenDialog.FileName_W,'FileName');
RegisterPropertyHelper(@TOpenDialog.Filter_R,@TOpenDialog.Filter_W,'Filter');
RegisterPropertyHelper(@TOpenDialog.FilterIndex_R,@TOpenDialog.FilterIndex_W,'FilterIndex');
RegisterPropertyHelper(@TOpenDialog.InitialDir_R,@TOpenDialog.InitialDir_W,'InitialDir');
RegisterPropertyHelper(@TOpenDialog.Options_R,@TOpenDialog.Options_W,'Options');
RegisterPropertyHelper(@TOpenDialog.Title_R,@TOpenDialog.Title_W,'Title');
RegisterPropertyHelper(@TOpenDialog.OnCanClose_R,@TOpenDialog.OnCanClose_W,'OnCanClose');
RegisterPropertyHelper(@TOpenDialog.OnFolderChange_R,@TOpenDialog.OnFolderChange_W,'OnFolderChange');
RegisterPropertyHelper(@TOpenDialog.OnSelectionChange_R,@TOpenDialog.OnSelectionChange_W,'OnSelectionChange');
RegisterPropertyHelper(@TOpenDialog.OnTypeChange_R,@TOpenDialog.OnTypeChange_W,'OnTypeChange');
RegisterPropertyHelper(@TOpenDialog.OnIncludeItem_R,@TOpenDialog.OnIncludeItem_W,'OnIncludeItem');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TOpenDialogOnIncludeItem_W(Self: TOpenDialog; const T: TIncludeItemEvent);
begin Self.OnIncludeItem := T; end;
@ -524,6 +1085,94 @@ begin Self.FileEditStyle := T; end;
procedure TOpenDialogFileEditStyle_R(Self: TOpenDialog; var T: TFileEditStyle);
begin T := Self.FileEditStyle; end;
procedure RIRegister_TOpenDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TOpenDialog) do
begin
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;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCommonDialog'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCommonDialog_PSHelper = class helper for TCommonDialog
public
procedure OnShow_W(const T: TNotifyEvent);
procedure OnShow_R(var T: TNotifyEvent);
procedure OnClose_W(const T: TNotifyEvent);
procedure OnClose_R(var T: TNotifyEvent);
procedure HelpContext_W(const T: THelpContext);
procedure HelpContext_R(var T: THelpContext);
procedure Ctl3D_W(const T: Boolean);
procedure Ctl3D_R(var T: Boolean);
procedure Handle_R(var T: HWnd);
end;
procedure TCommonDialog_PSHelper.OnShow_W(const T: TNotifyEvent);
begin Self.OnShow := T; end;
procedure TCommonDialog_PSHelper.OnShow_R(var T: TNotifyEvent);
begin T := Self.OnShow; end;
procedure TCommonDialog_PSHelper.OnClose_W(const T: TNotifyEvent);
begin Self.OnClose := T; end;
procedure TCommonDialog_PSHelper.OnClose_R(var T: TNotifyEvent);
begin T := Self.OnClose; end;
procedure TCommonDialog_PSHelper.HelpContext_W(const T: THelpContext);
begin Self.HelpContext := T; end;
procedure TCommonDialog_PSHelper.HelpContext_R(var T: THelpContext);
begin T := Self.HelpContext; end;
procedure TCommonDialog_PSHelper.Ctl3D_W(const T: Boolean);
begin Self.Ctl3D := T; end;
procedure TCommonDialog_PSHelper.Ctl3D_R(var T: Boolean);
begin T := Self.Ctl3D; end;
procedure TCommonDialog_PSHelper.Handle_R(var T: HWnd);
begin T := Self.Handle; end;
procedure RIRegister_TCommonDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TCommonDialog) do
begin
RegisterPropertyHelper(@TCommonDialog.Handle_R,nil,'Handle');
RegisterPropertyHelper(@TCommonDialog.Ctl3D_R,@TCommonDialog.Ctl3D_W,'CTL3D');
RegisterPropertyHelper(@TCommonDialog.HelpContext_R,@TCommonDialog.HelpContext_W,'HelpContext');
RegisterPropertyHelper(@TCommonDialog.OnClose_R,@TCommonDialog.OnClose_W,'OnClose');
RegisterPropertyHelper(@TCommonDialog.OnShow_R,@TCommonDialog.OnShow_W,'OnShow');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TCommonDialogOnShow_W(Self: TCommonDialog; const T: TNotifyEvent);
begin Self.OnShow := T; end;
@ -561,6 +1210,19 @@ procedure TCommonDialogHandle_R(Self: TCommonDialog; var T: HWnd);
begin T := Self.Handle; end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TCommonDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TCommonDialog) do
begin
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;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{ This InputQuery wrapper is necessary because Delphi XE2 and higher have two
additional versions of InputQuery, the pointer points to the wrong version and the
@ -590,38 +1252,6 @@ begin
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TFindDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFindDialog) do
begin
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
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
@ -630,31 +1260,6 @@ begin
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TFontDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TFontDialog) do
begin
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
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
@ -663,42 +1268,6 @@ begin
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TOpenDialog(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TOpenDialog) do
begin
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
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

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,12 @@ 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
}
{$IFDEF MSWINDOWS}
{$I ..\PascalScript.inc}
{$ELSE}
{$I ../PascalScript.inc}
{$ENDIF}
interface
uses
@ -120,7 +126,188 @@ begin
end;
(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
{$IFDEF DELPHI10UP}{$REGION 'TJvMail'}{$ENDIF}
{$IFDEF class_helper_present}
type
TJvMail_PSHelper = class helper for TJvMail
public
procedure Attachment_R(var T: TStrings);
procedure Attachment_W(const T: TStrings);
procedure BlindCopy_R(var T: TJvMailRecipients);
procedure BlindCopy_W(const T: TJvMailRecipients);
procedure Body_R(var T: TStrings);
procedure Body_W(const T: TStrings);
procedure CarbonCopy_R(var T: TJvMailRecipients);
procedure CarbonCopy_W(const T: TJvMailRecipients);
procedure LogonOptions_R(var T: TJvMailLogonOptions);
procedure LogonOptions_W(const T: TJvMailLogonOptions);
procedure LongMsgId_R(var T: Boolean);
procedure LongMsgId_W(const T: Boolean);
procedure Password_R(var T: string);
procedure Password_W(const T: string);
procedure ProfileName_R(var T: string);
procedure ProfileName_W(const T: string);
procedure ReadedMail_R(var T: TJvMailReadedData);
procedure ReadOptions_R(var T: TJvMailReadOptions);
procedure ReadOptions_W(const T: TJvMailReadOptions);
procedure Recipient_R(var T: TJvMailRecipients);
procedure Recipient_W(const T: TJvMailRecipients);
procedure SeedMessageID_R(var T: string);
procedure SeedMessageID_W(const T: string);
procedure SessionHandle_R(var T: THandle);
procedure SimpleMAPI_R(var T: TJclSimpleMapi);
procedure Subject_R(var T: string);
procedure Subject_W(const T: string);
procedure UserLogged_R(var T: Boolean);
end;
procedure TJvMail_PSHelper.Subject_W(const T: string);
begin Self.Subject := T; end;
procedure TJvMail_PSHelper.Subject_R(var T: string);
begin T := Self.Subject; end;
procedure TJvMail_PSHelper.Recipient_W(const T: TJvMailRecipients);
begin Self.Recipient := T; end;
procedure TJvMail_PSHelper.Recipient_R(var T: TJvMailRecipients);
begin T := Self.Recipient; end;
procedure TJvMail_PSHelper.ReadOptions_W(const T: TJvMailReadOptions);
begin Self.ReadOptions := T; end;
procedure TJvMail_PSHelper.ReadOptions_R(var T: TJvMailReadOptions);
begin T := Self.ReadOptions; end;
procedure TJvMail_PSHelper.ProfileName_W(const T: string);
begin Self.ProfileName := T; end;
procedure TJvMail_PSHelper.ProfileName_R(var T: string);
begin T := Self.ProfileName; end;
procedure TJvMail_PSHelper.Password_W(const T: string);
begin Self.Password := T; end;
procedure TJvMail_PSHelper.Password_R(var T: string);
begin T := Self.Password; end;
procedure TJvMail_PSHelper.LongMsgId_W(const T: Boolean);
begin Self.LongMsgId := T; end;
procedure TJvMail_PSHelper.LongMsgId_R(var T: Boolean);
begin T := Self.LongMsgId; end;
procedure TJvMail_PSHelper.LogonOptions_W(const T: TJvMailLogonOptions);
begin Self.LogonOptions := T; end;
procedure TJvMail_PSHelper.LogonOptions_R(var T: TJvMailLogonOptions);
begin T := Self.LogonOptions; end;
procedure TJvMail_PSHelper.CarbonCopy_W(const T: TJvMailRecipients);
begin Self.CarbonCopy := T; end;
procedure TJvMail_PSHelper.CarbonCopy_R(var T: TJvMailRecipients);
begin T := Self.CarbonCopy; end;
procedure TJvMail_PSHelper.Body_W(const T: TStrings);
begin Self.Body := T; end;
procedure TJvMail_PSHelper.Body_R(var T: TStrings);
begin T := Self.Body; end;
procedure TJvMail_PSHelper.BlindCopy_W(const T: TJvMailRecipients);
begin Self.BlindCopy := T; end;
procedure TJvMail_PSHelper.BlindCopy_R(var T: TJvMailRecipients);
begin T := Self.BlindCopy; end;
procedure TJvMail_PSHelper.Attachment_W(const T: TStrings);
begin Self.Attachment := T; end;
procedure TJvMail_PSHelper.Attachment_R(var T: TStrings);
begin T := Self.Attachment; end;
procedure TJvMail_PSHelper.UserLogged_R(var T: Boolean);
begin T := Self.UserLogged; end;
procedure TJvMail_PSHelper.SimpleMAPI_R(var T: TJclSimpleMapi);
begin T := Self.SimpleMAPI; end;
procedure TJvMail_PSHelper.SessionHandle_R(var T: THandle);
begin T := Self.SessionHandle; end;
procedure TJvMail_PSHelper.SeedMessageID_W(const T: string);
begin Self.SeedMessageID := T; end;
procedure TJvMail_PSHelper.SeedMessageID_R(var T: string);
begin T := Self.SeedMessageID; end;
procedure TJvMail_PSHelper.ReadedMail_R(var T: TJvMailReadedData);
begin T := Self.ReadedMail; end;
procedure RIRegister_TJvMail(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TJvMail) do
begin
RegisterMethod(@TJvMail.Address, 'Address');
RegisterMethod(@TJvMail.Clear, 'Clear');
RegisterMethod(@TJvMail.ErrorCheck, 'ErrorCheck');
RegisterMethod(@TJvMail.FindFirstMail, 'FindFirstMail');
RegisterMethod(@TJvMail.FindNextMail, 'FindNextMail');
RegisterMethod(@TJvMail.FreeSimpleMapi, 'FreeSimpleMapi');
RegisterMethod(@TJvMail.LogOff, 'LogOff');
RegisterMethod(@TJvMail.LogOn, 'LogOn');
RegisterMethod(@TJvMail.ReadMail, 'ReadMail');
RegisterMethod(@TJvMail.ResolveName, 'ResolveName');
RegisterMethod(@TJvMail.SaveMail, 'SaveMail');
RegisterMethod(@TJvMail.SendMail, 'SendMail');
RegisterPropertyHelper(@TJvMail.ReadedMail_R,nil,'ReadedMail');
RegisterPropertyHelper(@TJvMail.SeedMessageID_R,@TJvMail.SeedMessageID_W,'SeedMessageID');
RegisterPropertyHelper(@TJvMail.SessionHandle_R,nil,'SessionHandle');
RegisterPropertyHelper(@TJvMail.SimpleMAPI_R,nil,'SimpleMAPI');
RegisterPropertyHelper(@TJvMail.UserLogged_R,nil,'UserLogged');
RegisterPropertyHelper(@TJvMail.Attachment_R,@TJvMail.Attachment_W,'Attachment');
RegisterPropertyHelper(@TJvMail.BlindCopy_R,@TJvMail.BlindCopy_W,'BlindCopy');
RegisterPropertyHelper(@TJvMail.Body_R,@TJvMail.Body_W,'Body');
RegisterPropertyHelper(@TJvMail.CarbonCopy_R,@TJvMail.CarbonCopy_W,'CarbonCopy');
RegisterPropertyHelper(@TJvMail.LogonOptions_R,@TJvMail.LogonOptions_W,'LogonOptions');
RegisterPropertyHelper(@TJvMail.LongMsgId_R,@TJvMail.LongMsgId_W,'LongMsgId');
RegisterPropertyHelper(@TJvMail.Password_R,@TJvMail.Password_W,'Password');
RegisterPropertyHelper(@TJvMail.ProfileName_R,@TJvMail.ProfileName_W,'ProfileName');
RegisterPropertyHelper(@TJvMail.ReadOptions_R,@TJvMail.ReadOptions_W,'ReadOptions');
RegisterPropertyHelper(@TJvMail.Recipient_R,@TJvMail.Recipient_W,'Recipient');
RegisterPropertyHelper(@TJvMail.Subject_R,@TJvMail.Subject_W,'Subject');
end;
end;
{$ELSE}
procedure TJvMailSubject_W(Self: TJvMail; const T: string);
begin Self.Subject := T; end;
@ -232,43 +419,6 @@ begin T := Self.SeedMessageID; end;
procedure TJvMailReadedMail_R(Self: TJvMail; var T: TJvMailReadedData);
begin T := Self.ReadedMail; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientsRecipientClass_R(Self: TJvMailRecipients; var T: DWORD);
begin T := Self.RecipientClass; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientsItems_W(Self: TJvMailRecipients; const T: TJvMailRecipient; const t1: Integer);
begin Self.Items[t1] := T; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientsItems_R(Self: TJvMailRecipients; var T: TJvMailRecipient; const t1: Integer);
begin T := Self.Items[t1]; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientValid_R(Self: TJvMailRecipient; var T: Boolean);
begin T := Self.Valid; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientName_W(Self: TJvMailRecipient; const T: string);
begin Self.Name := T; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientName_R(Self: TJvMailRecipient; var T: string);
begin T := Self.Name; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientAddress_W(Self: TJvMailRecipient; const T: string);
begin Self.Address := T; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientAddress_R(Self: TJvMailRecipient; var T: string);
begin T := Self.Address; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientAddressAndName_R(Self: TJvMailRecipient; var T: string);
begin T := Self.AddressAndName; end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TJvMail(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TJvMail) do
@ -304,7 +454,55 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TJvMailRecipients'}{$ENDIF}
{$IFDEF class_helper_present}
type
TJvMailRecipients_PSHelper = class helper for TJvMailRecipients
public
procedure Items_R(var T: TJvMailRecipient; const t1: Integer);
procedure Items_W(const T: TJvMailRecipient; const t1: Integer);
procedure RecipientClass_R(var T: DWORD);
end;
procedure TJvMailRecipients_PSHelper.RecipientClass_R(var T: DWORD);
begin T := Self.RecipientClass; end;
procedure TJvMailRecipients_PSHelper.Items_W(const T: TJvMailRecipient; const t1: Integer);
begin Self.Items[t1] := T; end;
procedure TJvMailRecipients_PSHelper.Items_R(var T: TJvMailRecipient; const t1: Integer);
begin T := Self.Items[t1]; end;
procedure RIRegister_TJvMailRecipients(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TJvMailRecipients) do
begin
RegisterConstructor(@TJvMailRecipients.Create, 'Create');
RegisterMethod(@TJvMailRecipients.Add, 'Add');
RegisterMethod(@TJvMailRecipients.AddRecipient, 'AddRecipient');
RegisterPropertyHelper(@TJvMailRecipients.Items_R,@TJvMailRecipients.Items_W,'Items');
RegisterPropertyHelper(@TJvMailRecipients.RecipientClass_R,nil,'RecipientClass');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientsRecipientClass_R(Self: TJvMailRecipients; var T: DWORD);
begin T := Self.RecipientClass; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientsItems_W(Self: TJvMailRecipients; const T: TJvMailRecipient; const t1: Integer);
begin Self.Items[t1] := T; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientsItems_R(Self: TJvMailRecipients; var T: TJvMailRecipient; const t1: Integer);
begin T := Self.Items[t1]; end;
procedure RIRegister_TJvMailRecipients(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TJvMailRecipients) do
@ -317,7 +515,80 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TJvMailRecipient'}{$ENDIF}
{$IFDEF class_helper_present}
type
TJvMailRecipient_PSHelper = class helper for TJvMailRecipient
public
procedure Address_R(var T: string);
procedure Address_W(const T: string);
procedure Name_R(var T: string);
procedure Name_W(const T: string);
procedure Valid_R(var T: Boolean);
end;
procedure TJvMailRecipient_PSHelper.Valid_R(var T: Boolean);
begin T := Self.Valid; end;
procedure TJvMailRecipient_PSHelper.Name_W(const T: string);
begin Self.Name := T; end;
procedure TJvMailRecipient_PSHelper.Name_R(var T: string);
begin T := Self.Name; end;
procedure TJvMailRecipient_PSHelper.Address_W(const T: string);
begin Self.Address := T; end;
procedure TJvMailRecipient_PSHelper.Address_R(var T: string);
begin T := Self.Address; end;
procedure TJvMailRecipientAddressAndName_R(Self: TJvMailRecipient; var T: string);
begin T := Self.AddressAndName; end;
procedure RIRegister_TJvMailRecipient(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TJvMailRecipient) do
begin
RegisterPropertyHelper(@TJvMailRecipient.AddressAndName_R,nil,'AddressAndName');
RegisterPropertyHelper(@TJvMailRecipient.Address_R,@TJvMailRecipient.Address_W,'Address');
RegisterPropertyHelper(@TJvMailRecipient.Name_R,@TJvMailRecipient.Name_W,'Name');
RegisterPropertyHelper(@TJvMailRecipient.Valid_R,nil,'Valid');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientValid_R(Self: TJvMailRecipient; var T: Boolean);
begin T := Self.Valid; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientName_W(Self: TJvMailRecipient; const T: string);
begin Self.Name := T; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientName_R(Self: TJvMailRecipient; var T: string);
begin T := Self.Name; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientAddress_W(Self: TJvMailRecipient; const T: string);
begin Self.Address := T; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientAddress_R(Self: TJvMailRecipient; var T: string);
begin T := Self.Address; end;
(*----------------------------------------------------------------------------*)
procedure TJvMailRecipientAddressAndName_R(Self: TJvMailRecipient; var T: string);
begin T := Self.AddressAndName; end;
procedure RIRegister_TJvMailRecipient(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TJvMailRecipient) do
@ -329,6 +600,9 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
(*----------------------------------------------------------------------------*)
procedure RIRegister_JvMail(CL: TPSRuntimeClassImporter);
begin

View File

@ -6,6 +6,13 @@ 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
}
{$IFDEF MSWINDOWS}
{$I ..\PascalScript.inc}
{$ELSE}
{$I ../PascalScript.inc}
{$ENDIF}
interface
uses
@ -91,6 +98,51 @@ begin
end;
(* === run-time registration functions === *)
{$IFDEF DELPHI10UP}{$REGION 'TCustomMaskEdit'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCustomMaskEdit_PSHelper = class helper for TCustomMaskEdit
public
procedure EditText_R(var T: string);
procedure EditText_W(const T: string);
procedure IsMasked_R(var T: Boolean);
procedure Text_R(var T: string);
procedure Text_W(const T: string);
end;
(*----------------------------------------------------------------------------*)
procedure TCustomMaskEdit_PSHelper.Text_W(const T: string);
begin Self.Text := T; end;
(*----------------------------------------------------------------------------*)
procedure TCustomMaskEdit_PSHelper.Text_R(var T: string);
begin T := Self.Text; end;
(*----------------------------------------------------------------------------*)
procedure TCustomMaskEdit_PSHelper.EditText_W(const T: string);
begin Self.EditText := T; end;
(*----------------------------------------------------------------------------*)
procedure TCustomMaskEdit_PSHelper.EditText_R(var T: string);
begin T := Self.EditText; end;
(*----------------------------------------------------------------------------*)
procedure TCustomMaskEdit_PSHelper.IsMasked_R(var T: Boolean);
begin T := Self.IsMasked; end;
procedure RIRegister_TCustomMaskEdit(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TCustomMaskEdit) do
begin
RegisterVirtualMethod(@TCustomMaskEdit.ValidateEdit, 'ValidateEdit');
RegisterMethod(@TCustomMaskEdit.GetTextLen, 'GetTextLen');
RegisterPropertyHelper(@TCustomMaskEdit.IsMasked_R,nil,'IsMasked');
RegisterPropertyHelper(@TCustomMaskEdit.EditText_R,@TCustomMaskEdit.EditText_W,'EditText');
RegisterPropertyHelper(@TCustomMaskEdit.Text_R,@TCustomMaskEdit.Text_W,'Text');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TCustomMaskEditText_W(Self: TCustomMaskEdit; const T: string);
begin Self.Text := T; end;
@ -111,6 +163,22 @@ begin T := Self.EditText; end;
procedure TCustomMaskEditIsMasked_R(Self: TCustomMaskEdit; var T: Boolean);
begin T := Self.IsMasked; end;
procedure RIRegister_TCustomMaskEdit(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TCustomMaskEdit) do
begin
RegisterVirtualMethod(@TCustomMaskEdit.ValidateEdit, 'ValidateEdit');
RegisterMethod(@TCustomMaskEdit.GetTextLen, 'GetTextLen');
RegisterPropertyHelper(@TCustomMaskEditIsMasked_R,nil,'IsMasked');
RegisterPropertyHelper(@TCustomMaskEditEditText_R,@TCustomMaskEditEditText_W,'EditText');
RegisterPropertyHelper(@TCustomMaskEditText_R,@TCustomMaskEditText_W,'Text');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
(*----------------------------------------------------------------------------*)
procedure RIRegister_Mask_Routines(S: TPSExec);
begin
@ -129,17 +197,6 @@ begin
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TCustomMaskEdit(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TCustomMaskEdit) do
begin
RegisterVirtualMethod(@TCustomMaskEdit.ValidateEdit, 'ValidateEdit');
RegisterMethod(@TCustomMaskEdit.GetTextLen, 'GetTextLen');
RegisterPropertyHelper(@TCustomMaskEditIsMasked_R,nil,'IsMasked');
RegisterPropertyHelper(@TCustomMaskEditEditText_R,@TCustomMaskEditEditText_W,'EditText');
RegisterPropertyHelper(@TCustomMaskEditText_R,@TCustomMaskEditText_W,'Text');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_Mask(CL: TPSRuntimeClassImporter);

View File

@ -7,6 +7,12 @@ UnitParser. Components of ifps3 are used in the construction of UnitParser,
code implementing the class wrapper is taken from Carlo Kok''s conv unility
}
{$IFDEF MSWINDOWS}
{$I ..\PascalScript.inc}
{$ELSE}
{$I ../PascalScript.inc}
{$ENDIF}
interface
uses
@ -132,6 +138,38 @@ begin
end;
(* === run-time registration functions === *)
{$IFDEF DELPHI10UP}{$REGION 'TRegistryIniFile'}{$ENDIF}
{$IFDEF class_helper_present}
type
TRegistryIniFile_PSHelper = class helper for TRegistryIniFile
public
Function Create_P(CreateNewInstance: Boolean; const FileName : string):TObject;
Function CreateA_P(CreateNewInstance: Boolean; const FileName : string; AAccess : LongWord):TObject;
procedure RegIniFile_R(var T: TRegIniFile);
end;
(*----------------------------------------------------------------------------*)
procedure TRegistryIniFile_PSHelper.RegIniFile_R(var T: TRegIniFile);
begin T := Self.RegIniFile; end;
(*----------------------------------------------------------------------------*)
Function TRegistryIniFile_PSHelper.CreateA_P(CreateNewInstance: Boolean; const FileName : string; AAccess : LongWord):TObject;
Begin Result := TRegistryIniFile.Create(FileName, AAccess); END;
(*----------------------------------------------------------------------------*)
Function TRegistryIniFile_PSHelper.Create_P(CreateNewInstance: Boolean; const FileName : string):TObject;
Begin Result := TRegistryIniFile.Create(FileName); END;
procedure RIRegister_TRegistryIniFile(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegistryIniFile) do
begin
RegisterConstructor(@TRegistryIniFile.Create_P, 'Create');
RegisterConstructor(@TRegistryIniFile.CreateA_P, 'CreateA');
RegisterPropertyHelper(@TRegistryIniFile.RegIniFile_R,nil,'RegIniFile');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TRegistryIniFileRegIniFile_R(Self: TRegistryIniFile; var T: TRegIniFile);
begin T := Self.RegIniFile; end;
@ -144,6 +182,63 @@ Begin Result := TRegistryIniFile.Create(FileName, AAccess); END;
Function TRegistryIniFileCreate_P(Self: TClass; CreateNewInstance: Boolean; const FileName : string):TObject;
Begin Result := TRegistryIniFile.Create(FileName); END;
procedure RIRegister_TRegistryIniFile(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegistryIniFile) do
begin
RegisterConstructor(@TRegistryIniFileCreate_P, 'Create');
RegisterConstructor(@TRegistryIniFileCreateA_P, 'CreateA');
RegisterPropertyHelper(@TRegistryIniFileRegIniFile_R,nil,'RegIniFile');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TRegIniFile'}{$ENDIF}
{$IFDEF class_helper_present}
type
TRegIniFile_PSHelper = class helper for TRegIniFile
public
Function Create_P(CreateNewInstance: Boolean; const FileName : string):TObject;
Function CreateA_P(CreateNewInstance: Boolean; const FileName : string; AAccess : LongWord):TObject;
procedure FileName_R(var T: string);
end;
(*----------------------------------------------------------------------------*)
procedure TRegIniFile_PSHelper.FileName_R(var T: string);
begin T := Self.FileName; end;
(*----------------------------------------------------------------------------*)
Function TRegIniFile_PSHelper.CreateA_P(CreateNewInstance: Boolean; const FileName : string; AAccess : LongWord):TObject;
Begin Result := TRegIniFile.Create(FileName, AAccess); END;
(*----------------------------------------------------------------------------*)
Function TRegIniFile_PSHelper.Create_P(CreateNewInstance: Boolean; const FileName : string):TObject;
Begin Result := TRegIniFile.Create(FileName); END;
procedure RIRegister_TRegIniFile(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegIniFile) do
begin
RegisterConstructor(@TRegIniFile.Create_P, 'Create');
RegisterConstructor(@TRegIniFile.CreateA_P, 'CreateA');
RegisterMethod(@TRegIniFile.ReadString, 'ReadString');
RegisterMethod(@TRegIniFile.ReadInteger, 'ReadInteger');
RegisterMethod(@TRegIniFile.WriteInteger, 'WriteInteger');
RegisterMethod(@TRegIniFile.WriteString, 'WriteString');
RegisterMethod(@TRegIniFile.ReadBool, 'ReadBool');
RegisterMethod(@TRegIniFile.WriteBool, 'WriteBool');
RegisterMethod(@TRegIniFile.ReadSection, 'ReadSection');
RegisterMethod(@TRegIniFile.ReadSections, 'ReadSections');
RegisterMethod(@TRegIniFile.ReadSectionValues, 'ReadSectionValues');
RegisterMethod(@TRegIniFile.EraseSection, 'EraseSection');
RegisterMethod(@TRegIniFile.DeleteKey, 'DeleteKey');
RegisterPropertyHelper(@TRegIniFile.FileName_R,nil,'FileName');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TRegIniFileFileName_R(Self: TRegIniFile; var T: string);
begin T := Self.FileName; end;
@ -156,6 +251,143 @@ Begin Result := TRegIniFile.Create(FileName, AAccess); END;
Function TRegIniFileCreate_P(Self: TClass; CreateNewInstance: Boolean; const FileName : string):TObject;
Begin Result := TRegIniFile.Create(FileName); END;
procedure RIRegister_TRegIniFile(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegIniFile) do
begin
RegisterConstructor(@TRegIniFileCreate_P, 'Create');
RegisterConstructor(@TRegIniFileCreateA_P, 'CreateA');
RegisterMethod(@TRegIniFile.ReadString, 'ReadString');
RegisterMethod(@TRegIniFile.ReadInteger, 'ReadInteger');
RegisterMethod(@TRegIniFile.WriteInteger, 'WriteInteger');
RegisterMethod(@TRegIniFile.WriteString, 'WriteString');
RegisterMethod(@TRegIniFile.ReadBool, 'ReadBool');
RegisterMethod(@TRegIniFile.WriteBool, 'WriteBool');
RegisterMethod(@TRegIniFile.ReadSection, 'ReadSection');
RegisterMethod(@TRegIniFile.ReadSections, 'ReadSections');
RegisterMethod(@TRegIniFile.ReadSectionValues, 'ReadSectionValues');
RegisterMethod(@TRegIniFile.EraseSection, 'EraseSection');
RegisterMethod(@TRegIniFile.DeleteKey, 'DeleteKey');
RegisterPropertyHelper(@TRegIniFileFileName_R,nil,'FileName');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TRegistry'}{$ENDIF}
{$IFDEF class_helper_present}
type
TRegistry_PSHelper = class helper for TRegistry
public
Function Create_P(CreateNewInstance: Boolean):TObject;
Function CreateA_P(CreateNewInstance: Boolean; AAccess : LongWord):TObject;
procedure Access_R(var T: LongWord);
procedure Access_W(const T: LongWord);
procedure CurrentKey_R(var T: HKEY);
procedure CurrentPath_R(var T: string);
procedure LazyWrite_R(var T: Boolean);
procedure LazyWrite_W(const T: Boolean);
procedure RootKey_R(var T: HKEY);
procedure RootKey_W(const T: HKEY);
end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.Access_W(const T: LongWord);
begin Self.Access := T; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.Access_R(var T: LongWord);
begin T := Self.Access; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.RootKey_W(const T: HKEY);
begin Self.RootKey := T; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.RootKey_R(var T: HKEY);
begin T := Self.RootKey; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.LazyWrite_W(const T: Boolean);
begin Self.LazyWrite := T; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.LazyWrite_R(var T: Boolean);
begin T := Self.LazyWrite; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.CurrentPath_R(var T: string);
begin T := Self.CurrentPath; end;
(*----------------------------------------------------------------------------*)
procedure TRegistry_PSHelper.CurrentKey_R(var T: HKEY);
begin T := Self.CurrentKey; end;
(*----------------------------------------------------------------------------*)
Function TRegistry_PSHelper.CreateA_P(CreateNewInstance: Boolean; AAccess : LongWord):TObject;
Begin Result := TRegistry.Create(AAccess); END;
(*----------------------------------------------------------------------------*)
Function TRegistry_PSHelper.Create_P(CreateNewInstance: Boolean):TObject;
Begin Result := TRegistry.Create; END;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TRegistry(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegistry) do
begin
RegisterConstructor(@TRegistry.CreateA_P, 'CreateA');
RegisterConstructor(@TRegistry.Create_P, 'Create');
RegisterMethod(@TRegistry.CloseKey, 'CloseKey');
RegisterMethod(@TRegistry.CreateKey, 'CreateKey');
RegisterMethod(@TRegistry.DeleteKey, 'DeleteKey');
RegisterMethod(@TRegistry.DeleteValue, 'DeleteValue');
RegisterMethod(@TRegistry.GetDataInfo, 'GetDataInfo');
RegisterMethod(@TRegistry.GetDataSize, 'GetDataSize');
RegisterMethod(@TRegistry.GetDataType, 'GetDataType');
RegisterMethod(@TRegistry.GetKeyInfo, 'GetKeyInfo');
RegisterMethod(@TRegistry.GetKeyNames, 'GetKeyNames');
RegisterMethod(@TRegistry.GetValueNames, 'GetValueNames');
RegisterMethod(@TRegistry.HasSubKeys, 'HasSubKeys');
RegisterMethod(@TRegistry.KeyExists, 'KeyExists');
RegisterMethod(@TRegistry.LoadKey, 'LoadKey');
RegisterMethod(@TRegistry.MoveKey, 'MoveKey');
RegisterMethod(@TRegistry.OpenKey, 'OpenKey');
RegisterMethod(@TRegistry.OpenKeyReadOnly, 'OpenKeyReadOnly');
RegisterMethod(@TRegistry.ReadCurrency, 'ReadCurrency');
RegisterMethod(@TRegistry.ReadBool, 'ReadBool');
RegisterMethod(@TRegistry.ReadDate, 'ReadDate');
RegisterMethod(@TRegistry.ReadDateTime, 'ReadDateTime');
RegisterMethod(@TRegistry.ReadFloat, 'ReadFloat');
RegisterMethod(@TRegistry.ReadInteger, 'ReadInteger');
RegisterMethod(@TRegistry.ReadString, 'ReadString');
RegisterMethod(@TRegistry.ReadTime, 'ReadTime');
RegisterMethod(@TRegistry.RegistryConnect, 'RegistryConnect');
RegisterMethod(@TRegistry.RenameValue, 'RenameValue');
RegisterMethod(@TRegistry.ReplaceKey, 'ReplaceKey');
RegisterMethod(@TRegistry.RestoreKey, 'RestoreKey');
RegisterMethod(@TRegistry.SaveKey, 'SaveKey');
RegisterMethod(@TRegistry.UnLoadKey, 'UnLoadKey');
RegisterMethod(@TRegistry.ValueExists, 'ValueExists');
RegisterMethod(@TRegistry.WriteCurrency, 'WriteCurrency');
RegisterMethod(@TRegistry.WriteBool, 'WriteBool');
RegisterMethod(@TRegistry.WriteDate, 'WriteDate');
RegisterMethod(@TRegistry.WriteDateTime, 'WriteDateTime');
RegisterMethod(@TRegistry.WriteFloat, 'WriteFloat');
RegisterMethod(@TRegistry.WriteInteger, 'WriteInteger');
RegisterMethod(@TRegistry.WriteString, 'WriteString');
RegisterMethod(@TRegistry.WriteExpandString, 'WriteExpandString');
RegisterMethod(@TRegistry.WriteTime, 'WriteTime');
RegisterPropertyHelper(@TRegistry.CurrentKey_R,nil,'CurrentKey');
RegisterPropertyHelper(@TRegistry.CurrentPath_R,nil,'CurrentPath');
RegisterPropertyHelper(@TRegistry.LazyWrite_R,@TRegistry.LazyWrite_W,'LazyWrite');
RegisterPropertyHelper(@TRegistry.RootKey_R,@TRegistry.RootKey_W,'RootKey');
RegisterPropertyHelper(@TRegistry.Access_R,@TRegistry.Access_W,'Access');
end;
end;
{$ELSE}
(*----------------------------------------------------------------------------*)
procedure TRegistryAccess_W(Self: TRegistry; const T: LongWord);
begin Self.Access := T; end;
@ -196,39 +428,6 @@ Begin Result := TRegistry.Create(AAccess); END;
Function TRegistryCreate_P(Self: TClass; CreateNewInstance: Boolean):TObject;
Begin Result := TRegistry.Create; END;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TRegistryIniFile(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegistryIniFile) do
begin
RegisterConstructor(@TRegistryIniFileCreate_P, 'Create');
RegisterConstructor(@TRegistryIniFileCreateA_P, 'CreateA');
RegisterPropertyHelper(@TRegistryIniFileRegIniFile_R,nil,'RegIniFile');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TRegIniFile(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TRegIniFile) do
begin
RegisterConstructor(@TRegIniFileCreate_P, 'Create');
RegisterConstructor(@TRegIniFileCreateA_P, 'CreateA');
RegisterMethod(@TRegIniFile.ReadString, 'ReadString');
RegisterMethod(@TRegIniFile.ReadInteger, 'ReadInteger');
RegisterMethod(@TRegIniFile.WriteInteger, 'WriteInteger');
RegisterMethod(@TRegIniFile.WriteString, 'WriteString');
RegisterMethod(@TRegIniFile.ReadBool, 'ReadBool');
RegisterMethod(@TRegIniFile.WriteBool, 'WriteBool');
RegisterMethod(@TRegIniFile.ReadSection, 'ReadSection');
RegisterMethod(@TRegIniFile.ReadSections, 'ReadSections');
RegisterMethod(@TRegIniFile.ReadSectionValues, 'ReadSectionValues');
RegisterMethod(@TRegIniFile.EraseSection, 'EraseSection');
RegisterMethod(@TRegIniFile.DeleteKey, 'DeleteKey');
RegisterPropertyHelper(@TRegIniFileFileName_R,nil,'FileName');
end;
end;
(*----------------------------------------------------------------------------*)
procedure RIRegister_TRegistry(CL: TPSRuntimeClassImporter);
begin
@ -284,6 +483,10 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
(*----------------------------------------------------------------------------*)
procedure RIRegister_Registry(CL: TPSRuntimeClassImporter);
begin

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,231 @@ implementation
uses
Classes;
{$IFDEF DELPHI10UP}{$REGION 'TStrings'}{$ENDIF}
{$IFDEF class_helper_present}
type
TStrings_PSHelper = class helper for TStrings
public
procedure CapacityR(var T: Longint);
procedure CapacityW( T: Longint);
procedure DelimiterR( var T: char);
procedure DelimiterW( T: char);
{$IFDEF DELPHI2006UP}
procedure StrictDelimiterR( var T: boolean);
procedure StrictDelimiterW( T: boolean);
{$ENDIF}
procedure DelimitedTextR( var T: string);
procedure DelimitedTextW( T: string);
procedure NameValueSeparatorR( var T: char);
procedure NameValueSeparatorW( T: char);
procedure QuoteCharR( var T: char);
procedure QuoteCharW( T: char);
procedure CountR( var T: Longint);
procedure TextR( var T: string);
procedure TextW( T: string);
procedure CommaTextR( var T: string);
procedure CommaTextW( T: string);
procedure ObjectsR( var T: TObject; I: Longint);
procedure ObjectsW( const T: TObject; I: Longint);
procedure StringsR( var T: string; I: Longint);
procedure StringsW( const T: string; I: Longint);
procedure NamesR( var T: string; I: Longint);
procedure ValuesR( var T: string; const I: string);
procedure ValuesW( Const T, I: String);
procedure ValueFromIndexR( var T: string; const I: Longint);
procedure ValueFromIndexW( Const T: String; I: Longint);
end;
procedure TStrings_PSHelper.CapacityR( var T: Longint);
begin
T := Self.Capacity;
end;
procedure TStrings_PSHelper.CapacityW( T: Longint);
begin
Self.Capacity := T;
end;
procedure TStrings_PSHelper.DelimiterR( var T: char);
begin
T := Self.Delimiter;
end;
procedure TStrings_PSHelper.DelimiterW( T: char);
begin
Self.Delimiter:= T;
end;
{$IFDEF DELPHI2006UP}
procedure TStrings_PSHelper.StrictDelimiterR( var T: boolean);
begin
T := Self.StrictDelimiter;
end;
procedure TStrings_PSHelper.StrictDelimiterW( T: boolean);
begin
Self.StrictDelimiter:= T;
end;
{$ENDIF}
procedure TStrings_PSHelper.DelimitedTextR( var T: string);
begin
T := Self.DelimitedText;
end;
procedure TStrings_PSHelper.DelimitedTextW( T: string);
begin
Self.DelimitedText:= T;
end;
procedure TStrings_PSHelper.NameValueSeparatorR( var T: char);
begin
T := Self.NameValueSeparator;
end;
procedure TStrings_PSHelper.NameValueSeparatorW( T: char);
begin
Self.NameValueSeparator:= T;
end;
procedure TStrings_PSHelper.QuoteCharR( var T: char);
begin
T := Self.QuoteChar;
end;
procedure TStrings_PSHelper.QuoteCharW( T: char);
begin
Self.QuoteChar:= T;
end;
procedure TStrings_PSHelper.CountR( var T: Longint);
begin
T := Self.Count;
end;
procedure TStrings_PSHelper.TextR( var T: string);
begin
T := Self.Text;
end;
procedure TStrings_PSHelper.TextW( T: string);
begin
Self.Text:= T;
end;
procedure TStrings_PSHelper.CommaTextR( var T: string);
begin
T := Self.CommaText;
end;
procedure TStrings_PSHelper.CommaTextW( T: string);
begin
Self.CommaText:= T;
end;
procedure TStrings_PSHelper.ObjectsR( var T: TObject; I: Longint);
begin
T := Self.Objects[I];
end;
procedure TStrings_PSHelper.ObjectsW( const T: TObject; I: Longint);
begin
Self.Objects[I]:= T;
end;
procedure TStrings_PSHelper.StringsR( var T: string; I: Longint);
begin
T := Self.Strings[I];
end;
procedure TStrings_PSHelper.StringsW( const T: string; I: Longint);
begin
Self.Strings[I]:= T;
end;
procedure TStrings_PSHelper.NamesR( var T: string; I: Longint);
begin
T := Self.Names[I];
end;
procedure TStrings_PSHelper.ValuesR( var T: string; const I: string);
begin
T := Self.Values[I];
end;
procedure TStrings_PSHelper.ValuesW( Const T, I: String);
begin
Self.Values[I]:= T;
end;
procedure TStrings_PSHelper.ValueFromIndexR( var T: string; const I: Longint);
begin
T := Self.ValueFromIndex[I];
end;
procedure TStrings_PSHelper.ValueFromIndexW( Const T: String; I: Longint);
begin
Self.ValueFromIndex[I]:= T;
end;
procedure RIRegisterTStrings(cl: TPSRuntimeClassImporter; Streams: Boolean); // requires TPersistent
begin
with Cl.Add(TStrings) do
begin
{$IFDEF DELPHI2005UP}
RegisterConstructor(@TStrings.CREATE, 'Create');
{$ENDIF}
RegisterVirtualMethod(@TStrings.Add, 'Add');
RegisterMethod(@TStrings.Append, 'Append');
RegisterVirtualMethod(@TStrings.AddStrings, 'AddStrings');
RegisterVirtualAbstractMethod(TStringList, @TStringList.Clear, 'Clear');
RegisterVirtualAbstractMethod(TStringList, @TStringList.Delete, 'Delete');
RegisterVirtualMethod(@TStrings.IndexOf, 'IndexOf');
RegisterVirtualAbstractMethod(TStringList, @TStringList.Insert, 'Insert');
RegisterPropertyHelper(@TStrings.CapacityR, @TStrings.CapacityW, 'Capacity');
RegisterPropertyHelper(@TStrings.DelimiterR, @TStrings.DelimiterW, 'DELIMITER');
{$IFDEF DELPHI2006UP}
RegisterPropertyHelper(@TStrings.StrictDelimiterR, @TStrings.StrictDelimiterW, 'StrictDelimiter');
{$ENDIF}
RegisterPropertyHelper(@TStrings.DelimitedTextR, @TStrings.DelimitedTextW, 'DelimitedText');
RegisterPropertyHelper(@TStrings.NameValueSeparatorR, @TStrings.NameValueSeparatorW, 'NameValueSeparator');
RegisterPropertyHelper(@TStrings.QuoteCharR, @TStrings.QuoteCharW, 'QuoteChar');
RegisterPropertyHelper(@TStrings.CountR, nil, 'Count');
RegisterPropertyHelper(@TStrings.TextR, @TStrings.TextW, 'Text');
RegisterPropertyHelper(@TStrings.CommaTextR, @TStrings.CommatextW, 'CommaText');
if Streams then
begin
RegisterVirtualMethod(@TStrings.LoadFromFile, 'LoadFromFile');
RegisterVirtualMethod(@TStrings.SaveToFile, 'SaveToFile');
end;
RegisterPropertyHelper(@TStrings.StringsR, @TStrings.StringsW, 'Strings');
RegisterPropertyHelper(@TStrings.ObjectsR, @TStrings.ObjectsW, 'Objects');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TStrings.BeginUpdate, 'BeginUpdate');
RegisterMethod(@TStrings.EndUpdate, 'EndUpdate');
RegisterMethod(@TStrings.Equals, 'Equals');
RegisterVirtualMethod(@TStrings.Exchange, 'Exchange');
RegisterMethod(@TStrings.IndexOfName, 'IndexOfName');
if Streams then
RegisterVirtualMethod(@TStrings.LoadFromStream, 'LoadFromStream');
RegisterVirtualMethod(@TStrings.Move, 'Move');
if Streams then
RegisterVirtualMethod(@TStrings.SaveToStream, 'SaveToStream');
RegisterVirtualMethod(@TStrings.SetText, 'SetText');
RegisterPropertyHelper(@TStrings.NamesR, nil, 'Names');
RegisterPropertyHelper(@TStrings.ValuesR, @TStrings.ValuesW, 'Values');
RegisterPropertyHelper(@TStrings.ValueFromIndexR, @TStrings.ValueFromIndexW, 'ValueFromIndex');
RegisterVirtualMethod(@TStrings.ADDOBJECT, 'AddObject');
RegisterVirtualMethod(@TStrings.GETTEXT, 'GetText');
RegisterMethod(@TStrings.INDEXOFOBJECT, 'IndexOfObject');
RegisterMethod(@TStrings.INSERTOBJECT, 'InsertObject');
{$ENDIF}
end;
end;
{$ELSE}
procedure TStringsCapacityR(Self: TStrings; var T: Longint); begin T := Self.Capacity; end;
procedure TStringsCapacityW(Self: TStrings; T: Longint); begin Self.Capacity := T; end;
procedure TStringsDelimiterR(Self: TStrings; var T: char); begin T := Self.Delimiter; end;
@ -92,6 +317,7 @@ procedure TStringsValueFromIndexR(Self: TStrings; var T: string; const I: Longin
begin
T := Self.ValueFromIndex[I];
end;
procedure TStringsValueFromIndexW(Self: TStrings; Const T: String; I: Longint);
begin
Self.ValueFromIndex[I]:= T;
@ -153,7 +379,93 @@ begin
{$ENDIF}
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TStringList'}{$ENDIF}
{$IFDEF class_helper_present}
type
TStringList_PSHelper = class helper for TStringList
public
procedure CASESENSITIVE_R(var T: Boolean);
procedure CASESENSITIVE_W(const T: Boolean);
procedure DUPLICATES_R(var T: TDuplicates);
procedure DUPLICATES_W(const T: TDuplicates);
procedure SORTED_R(var T: Boolean);
procedure SORTED_W(const T: Boolean);
procedure ONCHANGE_R(var T: TNotifyEvent);
procedure ONCHANGE_W(const T: TNotifyEvent);
procedure ONCHANGING_R(var T: TNotifyEvent);
procedure ONCHANGING_W(const T: TNotifyEvent);
end;
procedure TStringList_PSHelper.CASESENSITIVE_R(var T: Boolean);
begin
T := Self.CaseSensitive;
end;
procedure TStringList_PSHelper.CASESENSITIVE_W(const T: Boolean);
begin
Self.CaseSensitive := T;
end;
procedure TStringList_PSHelper.DUPLICATES_R(var T: TDuplicates);
begin
T := Self.Duplicates;
end;
procedure TStringList_PSHelper.DUPLICATES_W(const T: TDuplicates);
begin
Self.Duplicates := T;
end;
procedure TStringList_PSHelper.SORTED_R(var T: Boolean);
begin
T := Self.Sorted;
end;
procedure TStringList_PSHelper.SORTED_W(const T: Boolean);
begin
Self.Sorted := T;
end;
procedure TStringList_PSHelper.ONCHANGE_R(var T: TNotifyEvent);
begin
T := Self.OnChange;
end;
procedure TStringList_PSHelper.ONCHANGE_W(const T: TNotifyEvent);
begin
Self.OnChange := T;
end;
procedure TStringList_PSHelper.ONCHANGING_R(var T: TNotifyEvent);
begin
T := Self.OnChanging;
end;
procedure TStringList_PSHelper.ONCHANGING_W(const T: TNotifyEvent);
begin
Self.OnChanging := T;
end;
procedure RIRegisterTSTRINGLIST(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSTRINGLIST) do
begin
{$IFDEF DELPHI2005UP}
RegisterConstructor(@TStringList.CREATE, 'Create');
{$ENDIF}
RegisterVirtualMethod(@TStringList.FIND, 'Find');
RegisterVirtualMethod(@TStringList.SORT, 'Sort');
RegisterPropertyHelper(@TStringList.CASESENSITIVE_R, @TStringList.CASESENSITIVE_W, 'CaseSensitive');
RegisterPropertyHelper(@TStringList.DUPLICATES_R, @TStringList.DUPLICATES_W, 'Duplicates');
RegisterPropertyHelper(@TStringList.SORTED_R, @TStringList.SORTED_W, 'Sorted');
RegisterEventPropertyHelper(@TStringList.ONCHANGE_R, @TStringList.ONCHANGE_W, 'OnChange');
RegisterEventPropertyHelper(@TStringList.ONCHANGING_R, @TStringList.ONCHANGING_W, 'OnChanging');
end;
end;
{$ELSE}
procedure TSTRINGLISTCASESENSITIVE_R(Self: TSTRINGLIST; var T: BOOLEAN); begin T := Self.CASESENSITIVE; end;
procedure TSTRINGLISTCASESENSITIVE_W(Self: TSTRINGLIST; const T: BOOLEAN); begin Self.CASESENSITIVE := T; end;
procedure TSTRINGLISTDUPLICATES_R(Self: TSTRINGLIST; var T: TDUPLICATES); begin T := Self.DUPLICATES; end;
@ -185,7 +497,53 @@ begin
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TBits'}{$ENDIF}
{$IFNDEF PS_MINIVCL}
{$IFDEF class_helper_present}
type
TBits_PSHelper = class helper for TBits
public
procedure BITS_W( T: BOOLEAN; t1: INTEGER);
procedure BITS_R( var T: BOOLEAN; t1: INTEGER);
procedure SIZE_R( T: INTEGER);
procedure SIZE_W( var T: INTEGER);
end;
procedure TBits_PSHelper.BITS_W( T: BOOLEAN; t1: INTEGER);
begin
Self.BITS[t1] := T;
end;
procedure TBits_PSHelper.BITS_R( var T: BOOLEAN; t1: INTEGER);
begin
T := Self.Bits[t1];
end;
procedure TBits_PSHelper.SIZE_R( T: INTEGER);
begin
Self.SIZE := T;
end;
procedure TBits_PSHelper.SIZE_W( var T: INTEGER);
begin
T := Self.SIZE;
end;
procedure RIRegisterTBITS(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TBits) do
begin
RegisterMethod(@TBits.OPENBIT, 'OpenBit');
RegisterPropertyHelper(@TBits.BITS_R, @TBits.BITS_W, 'Bits');
RegisterPropertyHelper(@TBits.SIZE_R, @TBits.SIZE_W, 'Size');
end;
end;
{$ELSE}
procedure TBITSBITS_W(Self: TBITS; T: BOOLEAN; t1: INTEGER); begin Self.BITS[t1] := T; end;
procedure TBITSBITS_R(Self: TBITS; var T: BOOLEAN; t1: INTEGER); begin T := Self.Bits[t1]; end;
procedure TBITSSIZE_R(Self: TBITS; T: INTEGER); begin Self.SIZE := T; end;
@ -201,7 +559,60 @@ begin
end;
end;
{$ENDIF}
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TStream'}{$ENDIF}
{$IFDEF class_helper_present}
type
TStream_PSHelper = class helper for TStream
public
procedure POSITION_R(var T: LONGINT);
procedure POSITION_W(T: LONGINT);
procedure SIZE_R(var T: LONGINT);
{$IFDEF DELPHI3UP}
procedure SIZE_W(T: LONGINT);
{$ENDIF}
end;
procedure TStream_PSHelper.POSITION_R(var T: LONGINT);
begin
t := Self.Position;
end;
procedure TStream_PSHelper.POSITION_W(T: LONGINT);
begin
Self.Position := t;
end;
procedure TStream_PSHelper.SIZE_R(var T: LONGINT);
begin
t := Self.Size;
end;
{$IFDEF DELPHI3UP}
procedure TStream_PSHelper.SIZE_W(T: LONGINT);
begin
Self.Size := t;
end;
{$ENDIF}
procedure RIRegisterTSTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSTREAM) do
begin
RegisterVirtualAbstractMethod(TMemoryStream, @TMemoryStream.READ, 'Read');
RegisterVirtualAbstractMethod(TMemoryStream, @TMemoryStream.WRITE, 'Write');
RegisterVirtualAbstractMethod(TMemoryStream, @TMemoryStream.SEEK, 'Seek');
RegisterMethod(@TStream.READBUFFER, 'ReadBuffer');
RegisterMethod(@TStream.WRITEBUFFER, 'WriteBuffer');
RegisterMethod(@TStream.COPYFROM, 'CopyFrom');
RegisterPropertyHelper(@TStream.POSITION_R, @TStream.POSITION_W, 'Position');
RegisterPropertyHelper(@TStream.SIZE_R, {$IFDEF DELPHI3UP}@TStream.SIZE_W, {$ELSE}nil, {$ENDIF}'Size');
end;
end;
{$ELSE}
procedure TSTREAMPOSITION_R(Self: TSTREAM; var T: LONGINT); begin t := Self.POSITION; end;
procedure TSTREAMPOSITION_W(Self: TSTREAM; T: LONGINT); begin Self.POSITION := t; end;
procedure TSTREAMSIZE_R(Self: TSTREAM; var T: LONGINT); begin t := Self.SIZE; end;
@ -223,7 +634,32 @@ begin
RegisterPropertyHelper(@TSTREAMSIZE_R, {$IFDEF DELPHI3UP}@TSTREAMSIZE_W, {$ELSE}nil, {$ENDIF}'Size');
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'THandleStream'}{$ENDIF}
{$IFDEF class_helper_present}
type
THandleStream_PSHelper = class helper for THandleStream
public
procedure HANDLE_R(var T: INTEGER);
end;
procedure THandleStream_PSHelper.HANDLE_R(var T: INTEGER);
begin
T := Self.HANDLE;
end;
procedure RIRegisterTHANDLESTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(THandleStream) do
begin
RegisterConstructor(@THandleStream.Create, 'Create');
RegisterPropertyHelper(@THandleStream.HANDLE_R, nil, 'Handle');
end;
end;
{$ELSE}
procedure THANDLESTREAMHANDLE_R(Self: THANDLESTREAM; var T: INTEGER); begin T := Self.HANDLE; end;
procedure RIRegisterTHANDLESTREAM(Cl: TPSRuntimeClassImporter);
@ -235,6 +671,38 @@ begin
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TFilestream'}{$ENDIF}
{$IFDEF class_helper_present}
type
TFilestream_PSHelper = class helper for TFilestream
public
{$IFDEF FPC}
function Create(filename: string; mode: word): TFileStream;
{$ENDIF}
end;
{$IFDEF FPC}
// mh: because FPC doesn't handle pointers to overloaded functions
function TFileStream.Create(filename: string; mode: word): TFileStream;
begin
result := TFilestream.Create(filename, mode);
end;
{$ENDIF}
procedure RIRegisterTFILESTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TFILESTREAM) do
begin
RegisterConstructor(@TFILESTREAM.CREATE, 'Create');
end;
end;
{$ELSE}
{$IFDEF FPC}
// mh: because FPC doesn't handle pointers to overloaded functions
function TFileStreamCreate(filename: string; mode: word): TFileStream;
@ -255,12 +723,39 @@ begin
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TStringStream'}{$ENDIF}
{$IFDEF UNICODE}
{$IFNDEF FPC}
{$DEFINE STRINGSTREAMFIX}
{$ENDIF}
{$ENDIF}
{$IFDEF class_helper_present}
type
TStringStream_PSHelper = class helper for TStringStream
public
function CreateString(AHidden1: Pointer; AHidden2: Byte; const AString: string): TStringStream;
end;
{$IFDEF STRINGSTREAMFIX}
function TStringStream_PSHelper.CreateString(AHidden1: Pointer; AHidden2: Byte; const AString: string): TStringStream;
begin
Result := TStringStream.Create(AString);
end;
{$ENDIF}
procedure RIRegisterTSTRINGSTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSTRINGSTREAM) do
begin
RegisterConstructor({$IFDEF STRINGSTREAMFIX}@TStringStream.CreateString{$ELSE}@TSTRINGSTREAM.CREATE{$ENDIF}, 'Create');
end;
end;
{$ELSE}
{$IFDEF STRINGSTREAMFIX}
function TStringStreamCreateString(AHidden1: Pointer; AHidden2: Byte; const AString: string): TStringStream;
begin
@ -276,19 +771,27 @@ begin
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFNDEF PS_MINIVCL}
{$IFDEF DELPHI10UP}{$REGION 'TCustomMemoryStream'}{$ENDIF}
procedure RIRegisterTCUSTOMMEMORYSTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCUSTOMMEMORYSTREAM) do
with Cl.Add(TCustomMemoryStream) do
begin
RegisterMethod(@TCUSTOMMEMORYSTREAM.SAVETOSTREAM, 'SaveToStream');
RegisterMethod(@TCUSTOMMEMORYSTREAM.SAVETOFILE, 'SaveToFile');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TMemoryStream'}{$ENDIF}
procedure RIRegisterTMEMORYSTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMEMORYSTREAM) do
with Cl.Add(TMemoryStream) do
begin
RegisterMethod(@TMEMORYSTREAM.CLEAR, 'Clear');
RegisterMethod(@TMEMORYSTREAM.LOADFROMSTREAM, 'LoadFromStream');
@ -296,16 +799,61 @@ begin
RegisterMethod(@TMEMORYSTREAM.SETSIZE, 'SetSize');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TResourceStream'}{$ENDIF}
procedure RIRegisterTRESOURCESTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TRESOURCESTREAM) do
with Cl.Add(TResourceStream) do
begin
RegisterConstructor(@TRESOURCESTREAM.CREATE, 'Create');
RegisterConstructor(@TRESOURCESTREAM.CREATEFROMID, 'CreateFromID');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TParser'}{$ENDIF}
{$IFDEF class_helper_present}
type
TParser_PSHelper = class helper for TParser
public
procedure SOURCELINE_R(var T: INTEGER);
procedure TOKEN_R(var T: CHAR);
end;
procedure TParser_PSHelper.SOURCELINE_R(var T: INTEGER);
begin
T := Self.SourceLine;
end;
procedure TParser_PSHelper.TOKEN_R(var T: CHAR);
begin
T := Self.Token;
end;
procedure RIRegisterTPARSER(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TParser) do
begin
RegisterConstructor(@TParser.CREATE, 'Create');
RegisterMethod(@TParser.CHECKTOKEN, 'CheckToken');
RegisterMethod(@TParser.CHECKTOKENSYMBOL, 'CheckTokenSymbol');
RegisterMethod(@TParser.ERROR, 'Error');
RegisterMethod(@TParser.ERRORSTR, 'ErrorStr');
RegisterMethod(@TParser.HEXTOBINARY, 'HexToBinary');
RegisterMethod(@TParser.NEXTTOKEN, 'NextToken');
RegisterMethod(@TParser.SOURCEPOS, 'SourcePos');
RegisterMethod(@TParser.TOKENCOMPONENTIDENT, 'TokenComponentIdent');
RegisterMethod(@TParser.TOKENFLOAT, 'TokenFloat');
RegisterMethod(@TParser.TOKENINT, 'TokenInt');
RegisterMethod(@TParser.TOKENSTRING, 'TokenString');
RegisterMethod(@TParser.TOKENSYMBOLIS, 'TokenSymbolIs');
RegisterPropertyHelper(@TParser.SOURCELINE_R, nil, 'SourceLine');
RegisterPropertyHelper(@TParser.TOKEN_R, nil, 'Token');
end;
end;
{$ELSE}
procedure TPARSERSOURCELINE_R(Self: TPARSER; var T: INTEGER); begin T := Self.SOURCELINE; end;
procedure TPARSERTOKEN_R(Self: TPARSER; var T: CHAR); begin T := Self.TOKEN; end;
@ -330,8 +878,76 @@ begin
RegisterPropertyHelper(@TPARSERTOKEN_R, nil, 'Token');
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure TCOLLECTIONITEMS_W(Self: TCOLLECTION; const T: TCOLLECTIONITEM; const t1: INTEGER);
{$IFDEF DELPHI10UP}{$REGION 'TOwnedCollection'}{$ENDIF}
{$IFDEF DELPHI3UP}
procedure RIRegisterTOWNEDCOLLECTION(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TOwnedCollection) do
begin
RegisterConstructor(@TOWNEDCOLLECTION.CREATE, 'Create');
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCollection'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCollection_PSHelper = class helper for TCollection
public
procedure ITEMS_W(const T: TCollectionItem; const t1: Integer);
procedure ITEMS_R(var T: TCollectionItem; const t1: Integer);
{$IFDEF DELPHI3UP}
procedure ITEMCLASS_R(var T: TCollectionItemClass);
{$ENDIF}
procedure COUNT_R(var T: Integer);
end;
procedure TCollection_PSHelper.ITEMS_W(const T: TCollectionItem; const t1: Integer);
begin
Self.Items[t1] := T;
end;
procedure TCollection_PSHelper.ITEMS_R(var T: TCollectionItem; const t1: Integer);
begin
T := Self.Items[t1];
end;
{$IFDEF DELPHI3UP}
procedure TCollection_PSHelper.ITEMCLASS_R(var T: TCollectionItemClass);
begin
T := Self.ItemClass;
end;
{$ENDIF}
procedure TCollection_PSHelper.COUNT_R(var T: Integer);
begin
T := Self.Count;
end;
procedure RIRegisterTCOLLECTION(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TCollection) do
begin
RegisterConstructor(@TCollection.CREATE, 'Create');
{$IFDEF DELPHI6UP} {$IFNDEF FPC} RegisterMethod(@TCollection.OWNER, 'Owner'); {$ENDIF} {$ENDIF} // no owner in FPC
RegisterMethod(@TCollection.ADD, 'Add');
RegisterVirtualMethod(@TCollection.BEGINUPDATE, 'BeginUpdate');
RegisterMethod(@TCollection.CLEAR, 'Clear');
{$IFDEF DELPHI5UP} RegisterMethod(@TCollection.DELETE, 'Delete'); {$ENDIF}
RegisterVirtualMethod(@TCollection.ENDUPDATE, 'EndUpdate');
{$IFDEF DELPHI3UP} RegisterMethod(@TCollection.FINDITEMID, 'FindItemID'); {$ENDIF}
{$IFDEF DELPHI3UP} RegisterMethod(@TCollection.INSERT, 'Insert'); {$ENDIF}
RegisterPropertyHelper(@TCollection.COUNT_R,nil,'Count');
{$IFDEF DELPHI3UP} RegisterPropertyHelper(@TCollection.ITEMCLASS_R,nil,'ItemClass'); {$ENDIF}
RegisterPropertyHelper(@TCollection.ITEMS_R,@TCollection.ITEMS_W,'Items');
end;
end;
{$ELSE}
procedure TCOLLECTIONITEMS_W(Self: TCollection; const T: TCOLLECTIONITEM; const t1: INTEGER);
begin Self.ITEMS[t1] := T; end;
procedure TCOLLECTIONITEMS_R(Self: TCOLLECTION; var T: TCOLLECTIONITEM; const t1: INTEGER);
@ -345,6 +961,96 @@ begin T := Self.ITEMCLASS; end;
procedure TCOLLECTIONCOUNT_R(Self: TCOLLECTION; var T: INTEGER);
begin T := Self.COUNT; end;
procedure RIRegisterTCOLLECTION(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TCOLLECTION) do
begin
RegisterConstructor(@TCOLLECTION.CREATE, 'Create');
{$IFDEF DELPHI6UP} {$IFNDEF FPC} RegisterMethod(@TCOLLECTION.OWNER, 'Owner'); {$ENDIF} {$ENDIF} // no owner in FPC
RegisterMethod(@TCOLLECTION.ADD, 'Add');
RegisterVirtualMethod(@TCOLLECTION.BEGINUPDATE, 'BeginUpdate');
RegisterMethod(@TCOLLECTION.CLEAR, 'Clear');
{$IFDEF DELPHI5UP} RegisterMethod(@TCOLLECTION.DELETE, 'Delete'); {$ENDIF}
RegisterVirtualMethod(@TCOLLECTION.ENDUPDATE, 'EndUpdate');
{$IFDEF DELPHI3UP} RegisterMethod(@TCOLLECTION.FINDITEMID, 'FindItemID'); {$ENDIF}
{$IFDEF DELPHI3UP} RegisterMethod(@TCOLLECTION.INSERT, 'Insert'); {$ENDIF}
RegisterPropertyHelper(@TCOLLECTIONCOUNT_R,nil,'Count');
{$IFDEF DELPHI3UP} RegisterPropertyHelper(@TCOLLECTIONITEMCLASS_R,nil,'ItemClass'); {$ENDIF}
RegisterPropertyHelper(@TCOLLECTIONITEMS_R,@TCOLLECTIONITEMS_W,'Items');
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCollectionItem'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCollectionItem_PSHelper = class helper for TCollectionItem
public
{$IFDEF DELPHI3UP}
procedure DISPLAYNAME_W(const T: string);
procedure DISPLAYNAME_R(var T: STRING);
procedure ID_R(var T: INTEGER);
{$ENDIF}
procedure INDEX_W(const T: INTEGER);
procedure INDEX_R(var T: INTEGER);
procedure COLLECTION_W(const T: TCOLLECTION);
procedure COLLECTION_R(var T: TCOLLECTION);
end;
{$IFDEF DELPHI3UP}
procedure TCollectionItem_PSHelper.DISPLAYNAME_W(const T: string);
begin
Self.DISPLAYNAME := T;
end;
{$ENDIF}
{$IFDEF DELPHI3UP}
procedure TCollectionItem_PSHelper.DISPLAYNAME_R(var T: STRING);
begin
T := Self.DISPLAYNAME;
end;
{$ENDIF}
procedure TCollectionItem_PSHelper.INDEX_W(const T: INTEGER);
begin
Self.INDEX := T;
end;
procedure TCollectionItem_PSHelper.INDEX_R(var T: INTEGER);
begin T := Self.INDEX; end;
{$IFDEF DELPHI3UP}
procedure TCollectionItem_PSHelper.ID_R(var T: INTEGER);
begin
T := Self.ID;
end;
{$ENDIF}
procedure TCollectionItem_PSHelper.COLLECTION_W(const T: TCOLLECTION);
begin
Self.COLLECTION := T;
end;
procedure TCollectionItem_PSHelper.COLLECTION_R(var T: TCOLLECTION);
begin
T := Self.COLLECTION;
end;
procedure RIRegisterTCOLLECTIONITEM(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TCollectionItem) do
begin
RegisterVirtualConstructor(@TCollectionItem.CREATE, 'Create');
RegisterPropertyHelper(@TCollectionItem.COLLECTION_R,@TCollectionItem.COLLECTION_W,'Collection');
{$IFDEF DELPHI3UP} RegisterPropertyHelper(@TCollectionItem.ID_R,nil,'ID'); {$ENDIF}
RegisterPropertyHelper(@TCollectionItem.INDEX_R,@TCollectionItem.INDEX_W,'Index');
{$IFDEF DELPHI3UP} RegisterPropertyHelper(@TCollectionItem.DISPLAYNAME_R,@TCollectionItem.DISPLAYNAME_W,'DisplayName'); {$ENDIF}
end;
end;
{$ELSE}
{$IFDEF DELPHI3UP}
procedure TCOLLECTIONITEMDISPLAYNAME_W(Self: TCOLLECTIONITEM; const T: STRING);
begin Self.DISPLAYNAME := T; end;
@ -372,38 +1078,9 @@ begin Self.COLLECTION := T; end;
procedure TCOLLECTIONITEMCOLLECTION_R(Self: TCOLLECTIONITEM; var T: TCOLLECTION);
begin T := Self.COLLECTION; end;
{$IFDEF DELPHI3UP}
procedure RIRegisterTOWNEDCOLLECTION(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TOWNEDCOLLECTION) do
begin
RegisterConstructor(@TOWNEDCOLLECTION.CREATE, 'Create');
end;
end;
{$ENDIF}
procedure RIRegisterTCOLLECTION(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TCOLLECTION) do
begin
RegisterConstructor(@TCOLLECTION.CREATE, 'Create');
{$IFDEF DELPHI6UP} {$IFNDEF FPC} RegisterMethod(@TCOLLECTION.OWNER, 'Owner'); {$ENDIF} {$ENDIF} // no owner in FPC
RegisterMethod(@TCOLLECTION.ADD, 'Add');
RegisterVirtualMethod(@TCOLLECTION.BEGINUPDATE, 'BeginUpdate');
RegisterMethod(@TCOLLECTION.CLEAR, 'Clear');
{$IFDEF DELPHI5UP} RegisterMethod(@TCOLLECTION.DELETE, 'Delete'); {$ENDIF}
RegisterVirtualMethod(@TCOLLECTION.ENDUPDATE, 'EndUpdate');
{$IFDEF DELPHI3UP} RegisterMethod(@TCOLLECTION.FINDITEMID, 'FindItemID'); {$ENDIF}
{$IFDEF DELPHI3UP} RegisterMethod(@TCOLLECTION.INSERT, 'Insert'); {$ENDIF}
RegisterPropertyHelper(@TCOLLECTIONCOUNT_R,nil,'Count');
{$IFDEF DELPHI3UP} RegisterPropertyHelper(@TCOLLECTIONITEMCLASS_R,nil,'ItemClass'); {$ENDIF}
RegisterPropertyHelper(@TCOLLECTIONITEMS_R,@TCOLLECTIONITEMS_W,'Items');
end;
end;
procedure RIRegisterTCOLLECTIONITEM(Cl: TPSRuntimeClassImporter);
Begin
with Cl.Add(TCOLLECTIONITEM) do
with Cl.Add(TCollectionItem) do
begin
RegisterVirtualConstructor(@TCOLLECTIONITEM.CREATE, 'Create');
RegisterPropertyHelper(@TCOLLECTIONITEMCOLLECTION_R,@TCOLLECTIONITEMCOLLECTION_W,'Collection');
@ -412,6 +1089,10 @@ with Cl.Add(TCOLLECTIONITEM) do
{$IFDEF DELPHI3UP} RegisterPropertyHelper(@TCOLLECTIONITEMDISPLAYNAME_R,@TCOLLECTIONITEMDISPLAYNAME_W,'DisplayName'); {$ENDIF}
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$ENDIF}
procedure RIRegister_Classes(Cl: TPSRuntimeClassImporter; Streams: Boolean);

View File

@ -6,9 +6,6 @@ interface
uses
uPSRuntime, uPSUtils;
procedure RIRegisterTControl(Cl: TPSRuntimeClassImporter);
procedure RIRegisterTWinControl(Cl: TPSRuntimeClassImporter);
procedure RIRegisterTGraphicControl(cl: TPSRuntimeClassImporter);
@ -29,6 +26,98 @@ uses
Classes, Controls, Graphics;
{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TControl'}{$ENDIF}
{$IFDEF class_helper_present}
type
TControl_PSHelper = class helper for TControl
public
procedure AlignR( var T: Byte);
procedure AlignW( T: Byte);
procedure ClientHeightR( var T: Longint);
procedure ClientHeightW( T: Longint);
procedure ClientWidthR( var T: Longint);
procedure ClientWidthW( T: Longint);
procedure ShowHintR( var T: Boolean);
procedure ShowHintW( T: Boolean);
procedure VisibleR( var T: Boolean);
procedure VisibleW( T: Boolean);
procedure ParentR( var T: TWinControl);
procedure ParentW( T: TWinControl);
procedure SHOWHINT_W( T: BOOLEAN);
procedure SHOWHINT_R( var T: BOOLEAN);
procedure ENABLED_W( T: BOOLEAN);
procedure ENABLED_R( var T: BOOLEAN);
end;
procedure TControl_PSHelper.AlignR( var T: Byte); begin T := Byte(Self.Align); end;
procedure TControl_PSHelper.AlignW( T: Byte); begin Self.Align:= TAlign(T); end;
procedure TControl_PSHelper.ClientHeightR( var T: Longint); begin T := Self.ClientHeight; end;
procedure TControl_PSHelper.ClientHeightW( T: Longint); begin Self.ClientHeight := T; end;
procedure TControl_PSHelper.ClientWidthR( var T: Longint); begin T := Self.ClientWidth; end;
procedure TControl_PSHelper.ClientWidthW( T: Longint); begin Self.ClientWidth:= T; end;
procedure TControl_PSHelper.ShowHintR( var T: Boolean); begin T := Self.ShowHint; end;
procedure TControl_PSHelper.ShowHintW( T: Boolean); begin Self.ShowHint:= T; end;
procedure TControl_PSHelper.VisibleR( var T: Boolean); begin T := Self.Visible; end;
procedure TControl_PSHelper.VisibleW( T: Boolean); begin Self.Visible:= T; end;
procedure TControl_PSHelper.ParentR( var T: TWinControl); begin T := Self.Parent; end;
procedure TControl_PSHelper.ParentW( T: TWinControl); begin Self.Parent:= T; end;
procedure TControl_PSHelper.SHOWHINT_W( T: BOOLEAN); begin Self.SHOWHINT := T; end;
procedure TControl_PSHelper.SHOWHINT_R( var T: BOOLEAN); begin T := Self.SHOWHINT; end;
procedure TControl_PSHelper.ENABLED_W( T: BOOLEAN); begin Self.ENABLED := T; end;
procedure TControl_PSHelper.ENABLED_R( var T: BOOLEAN); begin T := Self.ENABLED; end;
procedure RIRegisterTControl(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TControl) do
begin
RegisterVirtualConstructor(@TControl.Create, 'Create');
RegisterMethod(@TControl.BRingToFront, 'BringToFront');
RegisterMethod(@TControl.Hide, 'Hide');
RegisterVirtualMethod(@TControl.Invalidate, 'Invalidate');
RegisterMethod(@TControl.Refresh, 'Refresh');
RegisterVirtualMethod(@TControl.Repaint, 'Repaint');
RegisterMethod(@TControl.SendToBack, 'SendToBack');
RegisterMethod(@TControl.Show, 'Show');
RegisterVirtualMethod(@TControl.Update, 'Update');
RegisterVirtualMethod(@TControl.SetBounds, 'SetBounds');
RegisterPropertyHelper(@TControl.ShowHintR, @TControl.ShowHintW, 'ShowHint');
RegisterPropertyHelper(@TControl.AlignR, @TControl.AlignW, 'Align');
RegisterPropertyHelper(@TControl.ClientHeightR, @TControl.ClientHeightW, 'ClientHeight');
RegisterPropertyHelper(@TControl.ClientWidthR, @TControl.ClientWidthW, 'ClientWidth');
RegisterPropertyHelper(@TControl.VisibleR, @TControl.VisibleW, 'Visible');
RegisterPropertyHelper(@TControl.ENABLED_R, @TControl.ENABLED_W, 'Enabled');
RegisterPropertyHelper(@TControl.ParentR, @TControl.ParentW, 'Parent');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TControl.Dragging, 'Dragging');
RegisterMethod(@TControl.HasParent, 'HasParent');
RegisterMethod(@TCONTROL.CLIENTTOSCREEN, 'ClientToScreen');
RegisterMethod(@TCONTROL.DRAGGING, 'Dragging');
{$IFNDEF FPC}
RegisterMethod(@TCONTROL.BEGINDRAG, 'BeginDrag');
RegisterMethod(@TCONTROL.ENDDRAG, 'EndDrag');
{$ENDIF}
{$IFNDEF CLX}
RegisterMethod(@TCONTROL.GETTEXTBUF, 'GetTextBuf');
RegisterMethod(@TCONTROL.GETTEXTLEN, 'GetTextLen');
RegisterMethod(@TCONTROL.PERFORM, 'Perform');
RegisterMethod(@TCONTROL.SETTEXTBUF, 'SetTextBuf');
{$ENDIF}
RegisterMethod(@TCONTROL.SCREENTOCLIENT, 'ScreenToClient');
{$ENDIF}
end;
end;
{$ELSE}
procedure TControlAlignR(Self: TControl; var T: Byte); begin T := Byte(Self.Align); end;
procedure TControlAlignW(Self: TControl; T: Byte); begin Self.Align:= TAlign(T); end;
@ -96,6 +185,81 @@ begin
{$ENDIF}
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TWinControl'}{$ENDIF}
{$IFDEF class_helper_present}
type
TWinControl_PSHelper = class helper for TWinControl
public
{$IFNDEF CLX}
procedure HandleR(var T: Longint);
{$ENDIF}
procedure ShowingR(var T: Boolean);
procedure TabOrderR(var T: Longint);
procedure TabOrderW(T: Longint);
procedure TabStopR(var T: Boolean);
procedure TabStopW(T: Boolean);
procedure BRUSH_R(var T: TBRUSH);
procedure CONTROLS_R(var T: TCONTROL; t1: INTEGER);
procedure CONTROLCOUNT_R(var T: INTEGER);
end;
{$IFNDEF CLX}
procedure TWinControl_PSHelper.HandleR(var T: Longint); begin T := Self.Handle; end;
{$ENDIF}
procedure TWinControl_PSHelper.ShowingR(var T: Boolean); begin T := Self.Showing; end;
procedure TWinControl_PSHelper.TabOrderR(var T: Longint); begin T := Self.TabOrder; end;
procedure TWinControl_PSHelper.TabOrderW(T: Longint); begin Self.TabOrder:= T; end;
procedure TWinControl_PSHelper.TabStopR(var T: Boolean); begin T := Self.TabStop; end;
procedure TWinControl_PSHelper.TabStopW(T: Boolean); begin Self.TabStop:= T; end;
procedure TWinControl_PSHelper.BRUSH_R(var T: TBRUSH); begin T := Self.BRUSH; end;
procedure TWinControl_PSHelper.CONTROLS_R(var T: TCONTROL; t1: INTEGER); begin t := Self.CONTROLS[t1]; end;
procedure TWinControl_PSHelper.CONTROLCOUNT_R(var T: INTEGER); begin t := Self.CONTROLCOUNT; end;
procedure RIRegisterTWinControl(Cl: TPSRuntimeClassImporter); // requires TControl
begin
with Cl.Add(TWinControl) do
begin
{$IFNDEF CLX}
RegisterPropertyHelper(@TWinControl.HandleR, nil, 'Handle');
{$ENDIF}
RegisterPropertyHelper(@TWinControl.ShowingR, nil, 'Showing');
RegisterPropertyHelper(@TWinControl.TabOrderR, @TWinControl.TabOrderW, 'TabOrder');
RegisterPropertyHelper(@TWinControl.TabStopR, @TWinControl.TabStopW, 'TabStop');
RegisterMethod(@TWinControl.CANFOCUS, 'CanFocus');
RegisterMethod(@TWinControl.FOCUSED, 'Focused');
RegisterPropertyHelper(@TWinControl.CONTROLS_R, nil, 'Controls');
RegisterPropertyHelper(@TWinControl.CONTROLCOUNT_R, nil, 'ControlCount');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TWinControl.HandleAllocated, 'HandleAllocated');
RegisterMethod(@TWinControl.HandleNeeded, 'HandleNeeded');
RegisterMethod(@TWinControl.EnableAlign, 'EnableAlign');
RegisterMethod(@TWinControl.RemoveControl, 'RemoveControl');
{$IFNDEF FPC}
RegisterMethod(@TWinControl.InsertControl, 'InsertControl');
RegisterMethod(@TWinControl.ScaleBy, 'ScaleBy');
RegisterMethod(@TWinControl.ScrollBy, 'ScrollBy');
{$IFNDEF CLX}
RegisterMethod(@TWinControl.PAINTTO, 'PaintTo');
{$ENDIF}
{$ENDIF}{FPC}
RegisterMethod(@TWinControl.Realign, 'Realign');
RegisterVirtualMethod(@TWinControl.SetFocus, 'SetFocus');
RegisterMethod(@TWinControl.CONTAINSCONTROL, 'ContainsControl');
RegisterMethod(@TWinControl.DISABLEALIGN, 'DisableAlign');
RegisterMethod(@TWinControl.UPDATECONTROLSTATE, 'UpdateControlState');
RegisterPropertyHelper(@TWinControl.BRUSH_R, nil, 'Brush');
{$ENDIF}
end;
end;
{$ELSE}
{$IFNDEF CLX}
procedure TWinControlHandleR(Self: TWinControl; var T: Longint); begin T := Self.Handle; end;
{$ENDIF}
@ -148,17 +312,121 @@ begin
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TGraphicControl'}{$ENDIF}
procedure RIRegisterTGraphicControl(cl: TPSRuntimeClassImporter); // requires TControl
begin
Cl.Add(TGraphicControl);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomControl'}{$ENDIF}
procedure RIRegisterTCustomControl(cl: TPSRuntimeClassImporter); // requires TControl
begin
Cl.Add(TCustomControl);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TDragObject'}{$ENDIF}
{$IFDEF class_helper_present}
{$IFDEF DELPHI4UP}
type
TDragObject_PSHelper = class helper for TDragObject
public
procedure MouseDeltaY_R(var T: Double);
procedure MouseDeltaX_R(var T: Double);
procedure DragTarget_W(const T: Pointer);
procedure DragTarget_R(var T: Pointer);
procedure DragTargetPos_W(const T: TPoint);
procedure DragTargetPos_R(var T: TPoint);
procedure DragPos_W(const T: TPoint);
procedure DragPos_R(var T: TPoint);
procedure DragHandle_W(const T: HWND);
procedure DragHandle_R(var T: HWND);
procedure Cancelling_W(const T: Boolean);
procedure Cancelling_R(var T: Boolean);
end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.MouseDeltaY_R(var T: Double);
begin T := Self.MouseDeltaY; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.MouseDeltaX_R(var T: Double);
begin T := Self.MouseDeltaX; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragTarget_W(const T: Pointer);
begin Self.DragTarget := T; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragTarget_R(var T: Pointer);
begin T := Self.DragTarget; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragTargetPos_W(const T: TPoint);
begin Self.DragTargetPos := T; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragTargetPos_R(var T: TPoint);
begin T := Self.DragTargetPos; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragPos_W(const T: TPoint);
begin Self.DragPos := T; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragPos_R(var T: TPoint);
begin T := Self.DragPos; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragHandle_W(const T: HWND);
begin Self.DragHandle := T; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.DragHandle_R(var T: HWND);
begin T := Self.DragHandle; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.Cancelling_W(const T: Boolean);
begin Self.Cancelling := T; end;
(*----------------------------------------------------------------------------*)
procedure TDragObject_PSHelper.Cancelling_R(var T: Boolean);
begin T := Self.Cancelling; end;
{$ENDIF}
(*----------------------------------------------------------------------------*)
procedure RIRegister_TDragObject(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TDragObject) do
begin
{$IFNDEF PS_MINIVCL}
{$IFDEF DELPHI4UP}
RegisterVirtualMethod(@TDragObject.Assign, 'Assign');
{$ENDIF}
{$IFNDEF FPC}
RegisterVirtualMethod(@TDragObject.GetName, 'GetName');
RegisterVirtualMethod(@TDragObject.Instance, 'Instance');
{$ENDIF}
RegisterVirtualMethod(@TDragObject.HideDragImage, 'HideDragImage');
RegisterVirtualMethod(@TDragObject.ShowDragImage, 'ShowDragImage');
{$IFDEF DELPHI4UP}
RegisterPropertyHelper(@TDragObject.Cancelling_R,@TDragObject.Cancelling_W,'Cancelling');
RegisterPropertyHelper(@TDragObject.DragHandle_R,@TDragObject.DragHandle_W,'DragHandle');
RegisterPropertyHelper(@TDragObject.DragPos_R,@TDragObject.DragPos_W,'DragPos');
RegisterPropertyHelper(@TDragObject.DragTargetPos_R,@TDragObject.DragTargetPos_W,'DragTargetPos');
RegisterPropertyHelper(@TDragObject.DragTarget_R,@TDragObject.DragTarget_W,'DragTarget');
RegisterPropertyHelper(@TDragObject.MouseDeltaX_R,nil,'MouseDeltaX');
RegisterPropertyHelper(@TDragObject.MouseDeltaY_R,nil,'MouseDeltaY');
{$ENDIF}
{$ENDIF}
end;
end;
{$ELSE}
{$IFDEF DELPHI4UP}
(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure TDragObjectMouseDeltaY_R(Self: TDragObject; var T: Double);
begin T := Self.MouseDeltaY; end;
@ -235,11 +503,17 @@ begin
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TSizeConstraints'}{$ENDIF}
procedure RIRegisterTSizeConstraints(cl: TPSRuntimeClassImporter);
begin
Cl.Add(TSizeConstraints);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'Controls'}{$ENDIF}
procedure RIRegister_Controls(Cl: TPSRuntimeClassImporter);
begin
RIRegisterTControl(Cl);
@ -249,6 +523,7 @@ begin
RIRegister_TDragObject(cl);
RIRegisterTSizeConstraints(cl);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
// PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl)

View File

@ -33,89 +33,175 @@ uses
ExtCtrls, Graphics;
{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TShape'}{$ENDIF}
procedure RIRegisterTSHAPE(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSHAPE) do
with Cl.Add(TShape) do
begin
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TSHAPE.STYLECHANGED, 'StyleChanged');
{$ENDIF}
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TImage'}{$ENDIF}
{$IFDEF class_helper_present}
type
TImage_PSHelper = class helper for TImage
public
procedure CANVAS_R(var T: TCANVAS);
end;
procedure TImage_PSHelper.CANVAS_R(var T: TCANVAS); begin T := Self.CANVAS; end;
procedure RIRegisterTIMAGE(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TImage) do
begin
RegisterPropertyHelper(@TImage.CANVAS_R, nil, 'Canvas');
end;
end;
{$ELSE}
procedure TIMAGECANVAS_R(Self: TIMAGE; var T: TCANVAS); begin T := Self.CANVAS; end;
procedure RIRegisterTIMAGE(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TIMAGE) do
with Cl.Add(TImage) do
begin
RegisterPropertyHelper(@TIMAGECANVAS_R, nil, 'Canvas');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPaintBox'}{$ENDIF}
{$IFDEF class_helper_present}
type
TPaintBox_PSHelper = class helper for TPaintBox
public
procedure CANVAS_R(var T: TCanvas);
end;
procedure TPaintBox_PSHelper.CANVAS_R(var T: TCanvas); begin T := Self.CANVAS; end;
procedure RIRegisterTPAINTBOX(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPaintBox) do
begin
RegisterPropertyHelper(@TPaintBox.CANVAS_R, nil, 'Canvas');
end;
end;
{$ELSE}
procedure TPAINTBOXCANVAS_R(Self: TPAINTBOX; var T: TCanvas); begin T := Self.CANVAS; end;
procedure RIRegisterTPAINTBOX(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPAINTBOX) do
with Cl.Add(TPaintBox) do
begin
RegisterPropertyHelper(@TPAINTBOXCANVAS_R, nil, 'Canvas');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TBevel'}{$ENDIF}
procedure RIRegisterTBEVEL(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TBEVEL);
Cl.Add(TBevel);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TTimer'}{$ENDIF}
procedure RIRegisterTTIMER(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TTIMER);
Cl.Add(TTimer);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomPanel'}{$ENDIF}
procedure RIRegisterTCUSTOMPANEL(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TCUSTOMPANEL);
Cl.Add(TCustomPanel);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPanel'}{$ENDIF}
procedure RIRegisterTPANEL(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TPANEL);
Cl.Add(TPanel);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFNDEF CLX}
{$IFDEF DELPHI10UP}{$REGION 'TPage'}{$ENDIF}
procedure RIRegisterTPAGE(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TPAGE);
Cl.Add(TPage);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TNotebook'}{$ENDIF}
procedure RIRegisterTNOTEBOOK(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TNOTEBOOK);
Cl.Add(TNotebook);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'THeader'}{$ENDIF}
{$IFNDEF FPC}
{$IFDEF class_helper_present}
type
THeader_PSHelper = class helper for THeader
public
procedure SECTIONWIDTH_R(var T: INTEGER; t1: INTEGER);
procedure SECTIONWIDTH_W(T: INTEGER; t1: INTEGER);
end;
procedure THeader_PSHelper.SECTIONWIDTH_R(var T: INTEGER; t1: INTEGER); begin T := Self.SECTIONWIDTH[t1]; end;
procedure THeader_PSHelper.SECTIONWIDTH_W(T: INTEGER; t1: INTEGER); begin Self.SECTIONWIDTH[t1] := T; end;
procedure RIRegisterTHEADER(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(THeader) do
begin
RegisterPropertyHelper(@THeader.SECTIONWIDTH_R, @THeader.SECTIONWIDTH_W, 'SectionWidth');
end;
end;
{$IFNDEF FPC}
{$ELSE}
procedure THEADERSECTIONWIDTH_R(Self: THEADER; var T: INTEGER; t1: INTEGER); begin T := Self.SECTIONWIDTH[t1]; end;
procedure THEADERSECTIONWIDTH_W(Self: THEADER; T: INTEGER; t1: INTEGER); begin Self.SECTIONWIDTH[t1] := T; end;
procedure RIRegisterTHEADER(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(THEADER) do
with Cl.Add(THeader) do
begin
RegisterPropertyHelper(@THEADERSECTIONWIDTH_R, @THEADERSECTIONWIDTH_W, 'SectionWidth');
end;
end;
{$ENDIF}
{$ENDIF class_helper_present}
{$ENDIF FPC}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomRadioGroup'}{$ENDIF}
procedure RIRegisterTCUSTOMRADIOGROUP(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TCUSTOMRADIOGROUP);
Cl.Add(TCustomRadioGroup);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TRadioGroup'}{$ENDIF}
procedure RIRegisterTRADIOGROUP(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TRADIOGROUP);
Cl.Add(TRadioGroup);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_ExtCtrls(cl: TPSRuntimeClassImporter);
begin

View File

@ -18,35 +18,166 @@ implementation
uses
sysutils, classes, {$IFDEF CLX}QControls, QForms, QGraphics{$ELSE}Controls, Forms, Graphics{$ENDIF};
{$IFDEF DELPHI10UP}{$REGION 'TControlScrollBar'}{$ENDIF}
{$IFDEF class_helper_present}
type
TControlScrollBar_PSHelper = class helper for TControlScrollBar
public
procedure KIND_R(var T: TSCROLLBARKIND);
procedure SCROLLPOS_R(var T: INTEGER);
end;
procedure TControlScrollBar_PSHelper.KIND_R(var T: TSCROLLBARKIND); begin T := Self.KIND; end;
procedure TControlScrollBar_PSHelper.SCROLLPOS_R(var T: INTEGER); begin t := Self.SCROLLPOS; end;
procedure RIRegisterTCONTROLSCROLLBAR(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TControlScrollBar) do
begin
RegisterPropertyHelper(@TControlScrollBar.KIND_R, nil, 'Kind');
RegisterPropertyHelper(@TControlScrollBar.SCROLLPOS_R, nil, 'ScrollPos');
end;
end;
{$ELSE}
procedure TCONTROLSCROLLBARKIND_R(Self: TCONTROLSCROLLBAR; var T: TSCROLLBARKIND); begin T := Self.KIND; end;
procedure TCONTROLSCROLLBARSCROLLPOS_R(Self: TCONTROLSCROLLBAR; var T: INTEGER); begin t := Self.SCROLLPOS; end;
procedure RIRegisterTCONTROLSCROLLBAR(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCONTROLSCROLLBAR) do
with Cl.Add(TControlScrollBar) do
begin
RegisterPropertyHelper(@TCONTROLSCROLLBARKIND_R, nil, 'Kind');
RegisterPropertyHelper(@TCONTROLSCROLLBARSCROLLPOS_R, nil, 'ScrollPos');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TScrollingWinControl'}{$ENDIF}
{$IFNDEF FPC}
procedure RIRegisterTSCROLLINGWINCONTROL(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSCROLLINGWINCONTROL) do
with Cl.Add(TScrollingWinControl) do
begin
RegisterMethod(@TSCROLLINGWINCONTROL.SCROLLINVIEW, 'ScrollInView');
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TScrollBox'}{$ENDIF}
procedure RIRegisterTSCROLLBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TSCROLLBOX);
Cl.Add(TScrollBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TForm'}{$ENDIF}
{$IFDEF class_helper_present}
type
TForm_PSHelper = class helper for TForm
public
{$IFNDEF FPC}
{$IFNDEF CLX}
procedure ACTIVEOLECONTROL_W(T: TWINCONTROL);
procedure ACTIVEOLECONTROL_R(var T: TWINCONTROL);
procedure TILEMODE_W(T: TTILEMODE);
procedure TILEMODE_R(var T: TTILEMODE);
{$ENDIF}{CLX}
procedure ACTIVEMDICHILD_R(var T: TFORM);
procedure DROPTARGET_W(T: BOOLEAN);
procedure DROPTARGET_R(var T: BOOLEAN);
procedure MDICHILDCOUNT_R(var T: INTEGER);
procedure MDICHILDREN_R(var T: TFORM; t1: INTEGER);
{$ENDIF}{FPC}
procedure MODALRESULT_W(T: TMODALRESULT);
procedure MODALRESULT_R(var T: TMODALRESULT);
procedure ACTIVE_R(var T: BOOLEAN);
procedure CANVAS_R(var T: TCANVAS);
{$IFNDEF CLX}
procedure CLIENTHANDLE_R(var T: Longint);
{$ENDIF}
end;
{$IFNDEF FPC}
{$IFNDEF CLX}
procedure TFORMACTIVEOLECONTROL_W(Self: TFORM; T: TWINCONTROL); begin Self.ACTIVEOLECONTROL := T; end;
procedure TForm_PSHelper.ACTIVEOLECONTROL_W(T: TWINCONTROL); begin Self.ACTIVEOLECONTROL := T; end;
procedure TForm_PSHelper.ACTIVEOLECONTROL_R(var T: TWINCONTROL); begin T := Self.ACTIVEOLECONTROL;
end;
procedure TForm_PSHelper.TILEMODE_W(T: TTILEMODE); begin Self.TILEMODE := T; end;
procedure TForm_PSHelper.TILEMODE_R(var T: TTILEMODE); begin T := Self.TILEMODE; end;
{$ENDIF}{CLX}
procedure TForm_PSHelper.ACTIVEMDICHILD_R(var T: TFORM); begin T := Self.ACTIVEMDICHILD; end;
procedure TForm_PSHelper.DROPTARGET_W(T: BOOLEAN); begin Self.DROPTARGET := T; end;
procedure TForm_PSHelper.DROPTARGET_R(var T: BOOLEAN); begin T := Self.DROPTARGET; end;
procedure TForm_PSHelper.MDICHILDCOUNT_R(var T: INTEGER); begin T := Self.MDICHILDCOUNT; end;
procedure TForm_PSHelper.MDICHILDREN_R(var T: TFORM; t1: INTEGER); begin T := Self.MDICHILDREN[T1];
end;
{$ENDIF}{FPC}
procedure TForm_PSHelper.MODALRESULT_W(T: TMODALRESULT); begin Self.MODALRESULT := T; end;
procedure TForm_PSHelper.MODALRESULT_R(var T: TMODALRESULT); begin T := Self.MODALRESULT; end;
procedure TForm_PSHelper.ACTIVE_R(var T: BOOLEAN); begin T := Self.ACTIVE; end;
procedure TForm_PSHelper.CANVAS_R(var T: TCANVAS); begin T := Self.CANVAS; end;
{$IFNDEF CLX}
procedure TForm_PSHelper.CLIENTHANDLE_R(var T: Longint); begin T := Self.CLIENTHANDLE; end;
{$ENDIF}
{ Innerfuse Pascal Script Class Import Utility (runtime) }
procedure RIRegisterTFORM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TForm) do
begin
{$IFDEF DELPHI4UP}
RegisterVirtualConstructor(@TForm.CREATENEW, 'CreateNew');
{$ELSE}
RegisterConstructor(@TForm.CREATENEW, 'CreateNew');
{$ENDIF}
RegisterMethod(@TForm.CLOSE, 'Close');
RegisterMethod(@TForm.HIDE, 'Hide');
RegisterMethod(@TForm.SHOW, 'Show');
RegisterMethod(@TForm.SHOWMODAL, 'ShowModal');
RegisterMethod(@TForm.RELEASE, 'Release');
RegisterPropertyHelper(@TForm.ACTIVE_R, nil, 'Active');
{$IFNDEF PS_MINIVCL}
{$IFNDEF FPC}
{$IFNDEF CLX}
RegisterMethod(@TForm.ARRANGEICONS, 'ArrangeIcons');
RegisterMethod(@TForm.GETFORMIMAGE, 'GetFormImage');
RegisterMethod(@TForm.PRINT, 'Print');
RegisterMethod(@TForm.SENDCANCELMODE, 'SendCancelMode');
RegisterPropertyHelper(@TForm.ACTIVEOLECONTROL_R, @TForm.ACTIVEOLECONTROL_W, 'ActiveOleControl');
RegisterPropertyHelper(@TForm.CLIENTHANDLE_R, nil, 'ClientHandle');
RegisterPropertyHelper(@TForm.TILEMODE_R, @TForm.TILEMODE_W, 'TileMode');
{$ENDIF}{CLX}
RegisterMethod(@TForm.CASCADE, 'Cascade');
RegisterMethod(@TForm.NEXT, 'Next');
RegisterMethod(@TForm.PREVIOUS, 'Previous');
RegisterMethod(@TForm.TILE, 'Tile');
RegisterPropertyHelper(@TForm.ACTIVEMDICHILD_R, nil, 'ActiveMDIChild');
RegisterPropertyHelper(@TForm.DROPTARGET_R, @TForm.DROPTARGET_W, 'DropTarget');
RegisterPropertyHelper(@TForm.MDICHILDCOUNT_R, nil, 'MDIChildCount');
RegisterPropertyHelper(@TForm.MDICHILDREN_R, nil, 'MDIChildren');
{$ENDIF}{FPC}
RegisterMethod(@TForm.CLOSEQUERY, 'CloseQuery');
RegisterMethod(@TForm.DEFOCUSCONTROL, 'DefocusControl');
RegisterMethod(@TForm.FOCUSCONTROL, 'FocusControl');
RegisterMethod(@TForm.SETFOCUSEDCONTROL, 'SetFocusedControl');
RegisterPropertyHelper(@TForm.CANVAS_R, nil, 'Canvas');
RegisterPropertyHelper(@TForm.MODALRESULT_R, @TForm.MODALRESULT_W, 'ModalResult');
{$ENDIF}{PS_MINIVCL}
end;
end;
{$ELSE}
{$IFNDEF FPC}
{$IFNDEF CLX}
procedure TFORMACTIVEOLECONTROL_W(Self: TForm; T: TWINCONTROL); begin Self.ACTIVEOLECONTROL := T; end;
procedure TFORMACTIVEOLECONTROL_R(Self: TFORM; var T: TWINCONTROL); begin T := Self.ACTIVEOLECONTROL;
end;
procedure TFORMTILEMODE_W(Self: TFORM; T: TTILEMODE); begin Self.TILEMODE := T; end;
@ -116,8 +247,198 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TApplication'}{$ENDIF}
{$IFDEF class_helper_present}
type
TApplication_PSHelper = class helper for TApplication
public
{$IFNDEF FPC}
procedure TAPPLICATIONACTIVE_R(Self: TAPPLICATION; var T: BOOLEAN); begin T := Self.ACTIVE; end;
procedure ACTIVE_R(var T: BOOLEAN);
{$IFNDEF CLX}
procedure DIALOGHANDLE_R(var T: Longint);
procedure DIALOGHANDLE_W(T: Longint);
procedure HANDLE_R(var T: Longint);
procedure HANDLE_W(T: Longint);
procedure UPDATEFORMATSETTINGS_R(var T: BOOLEAN);
procedure UPDATEFORMATSETTINGS_W(T: BOOLEAN);
{$ENDIF}
{$ENDIF}{FPC}
procedure EXENAME_R(var T: STRING);
procedure HELPFILE_R(var T: STRING);
procedure HELPFILE_W(T: STRING);
procedure HINT_R(var T: STRING);
procedure HINT_W(T: STRING);
procedure HINTCOLOR_R(var T: TCOLOR);
procedure HINTCOLOR_W(T: TCOLOR);
procedure HINTPAUSE_R(var T: INTEGER);
procedure HINTPAUSE_W(T: INTEGER);
procedure HINTSHORTPAUSE_R(var T: INTEGER);
procedure HINTSHORTPAUSE_W(T: INTEGER);
procedure HINTHIDEPAUSE_R(var T: INTEGER);
procedure HINTHIDEPAUSE_W(T: INTEGER);
procedure MAINFORM_R(var T: {$IFDEF DELPHI3UP}TCustomForm{$ELSE}TFORM{$ENDIF});
procedure SHOWHINT_R(var T: BOOLEAN);
procedure SHOWHINT_W(T: BOOLEAN);
procedure SHOWMAINFORM_R(var T: BOOLEAN);
procedure SHOWMAINFORM_W(T: BOOLEAN);
procedure TERMINATED_R(var T: BOOLEAN);
procedure TITLE_R(var T: STRING);
procedure TITLE_W(T: STRING);
{$IFNDEF FPC}
procedure ONACTIVATE_R(var T: TNOTIFYEVENT);
procedure ONACTIVATE_W(T: TNOTIFYEVENT);
procedure ONDEACTIVATE_R(var T: TNOTIFYEVENT);
procedure ONDEACTIVATE_W(T: TNOTIFYEVENT);
{$ENDIF}
procedure ONIDLE_R(var T: TIDLEEVENT);
procedure ONIDLE_W(T: TIDLEEVENT);
procedure ONHELP_R(var T: THELPEVENT);
procedure ONHELP_W(T: THELPEVENT);
procedure ONHINT_R(var T: TNOTIFYEVENT);
procedure ONHINT_W(T: TNOTIFYEVENT);
{$IFNDEF FPC}
procedure ONMINIMIZE_R(var T: TNOTIFYEVENT);
procedure ONMINIMIZE_W(T: TNOTIFYEVENT);
procedure ONRESTORE_R(var T: TNOTIFYEVENT);
procedure ONRESTORE_W(T: TNOTIFYEVENT);
{$ENDIF}
end;
{$IFNDEF FPC}
procedure TApplication_PSHelper.ACTIVE_R(var T: BOOLEAN); begin T := Self.ACTIVE; end;
{$IFNDEF CLX}
procedure TApplication_PSHelper.DIALOGHANDLE_R(var T: Longint); begin T := Self.DIALOGHANDLE; end;
procedure TApplication_PSHelper.DIALOGHANDLE_W(T: Longint); begin Self.DIALOGHANDLE := T; end;
procedure TApplication_PSHelper.HANDLE_R(var T: Longint); begin T := Self.HANDLE; end;
procedure TApplication_PSHelper.HANDLE_W(T: Longint); begin Self.HANDLE := T; end;
procedure TApplication_PSHelper.UPDATEFORMATSETTINGS_R(var T: BOOLEAN); begin T := Self.UPDATEFORMATSETTINGS; end;
procedure TApplication_PSHelper.UPDATEFORMATSETTINGS_W(T: BOOLEAN); begin Self.UPDATEFORMATSETTINGS := T; end;
{$ENDIF}
{$ENDIF}{FPC}
procedure TApplication_PSHelper.EXENAME_R(var T: STRING); begin T := Self.EXENAME; end;
procedure TApplication_PSHelper.HELPFILE_R(var T: STRING); begin T := Self.HELPFILE; end;
procedure TApplication_PSHelper.HELPFILE_W(T: STRING); begin Self.HELPFILE := T; end;
procedure TApplication_PSHelper.HINT_R(var T: STRING); begin T := Self.HINT; end;
procedure TApplication_PSHelper.HINT_W(T: STRING); begin Self.HINT := T; end;
procedure TApplication_PSHelper.HINTCOLOR_R(var T: TCOLOR); begin T := Self.HINTCOLOR; end;
procedure TApplication_PSHelper.HINTCOLOR_W(T: TCOLOR); begin Self.HINTCOLOR := T; end;
procedure TApplication_PSHelper.HINTPAUSE_R(var T: INTEGER); begin T := Self.HINTPAUSE; end;
procedure TApplication_PSHelper.HINTPAUSE_W(T: INTEGER); begin Self.HINTPAUSE := T; end;
procedure TApplication_PSHelper.HINTSHORTPAUSE_R(var T: INTEGER); begin T := Self.HINTSHORTPAUSE; end;
procedure TApplication_PSHelper.HINTSHORTPAUSE_W(T: INTEGER); begin Self.HINTSHORTPAUSE := T; end;
procedure TApplication_PSHelper.HINTHIDEPAUSE_R(var T: INTEGER); begin T := Self.HINTHIDEPAUSE; end;
procedure TApplication_PSHelper.HINTHIDEPAUSE_W(T: INTEGER); begin Self.HINTHIDEPAUSE := T; end;
procedure TApplication_PSHelper.MAINFORM_R(var T: {$IFDEF DELPHI3UP}TCustomForm{$ELSE}TFORM{$ENDIF}); begin T := Self.MAINFORM; end;
procedure TApplication_PSHelper.SHOWHINT_R(var T: BOOLEAN); begin T := Self.SHOWHINT; end;
procedure TApplication_PSHelper.SHOWHINT_W(T: BOOLEAN); begin Self.SHOWHINT := T; end;
procedure TApplication_PSHelper.SHOWMAINFORM_R(var T: BOOLEAN); begin T := Self.SHOWMAINFORM; end;
procedure TApplication_PSHelper.SHOWMAINFORM_W(T: BOOLEAN); begin Self.SHOWMAINFORM := T; end;
procedure TApplication_PSHelper.TERMINATED_R(var T: BOOLEAN); begin T := Self.TERMINATED; end;
procedure TApplication_PSHelper.TITLE_R(var T: STRING); begin T := Self.TITLE; end;
procedure TApplication_PSHelper.TITLE_W(T: STRING); begin Self.TITLE := T; end;
{$IFNDEF FPC}
procedure TApplication_PSHelper.ONACTIVATE_R(var T: TNOTIFYEVENT); begin T := Self.ONACTIVATE; end;
procedure TApplication_PSHelper.ONACTIVATE_W(T: TNOTIFYEVENT); begin Self.ONACTIVATE := T; end;
procedure TApplication_PSHelper.ONDEACTIVATE_R(var T: TNOTIFYEVENT); begin T := Self.ONDEACTIVATE; end;
procedure TApplication_PSHelper.ONDEACTIVATE_W(T: TNOTIFYEVENT); begin Self.ONDEACTIVATE := T; end;
{$ENDIF}
procedure TApplication_PSHelper.ONIDLE_R(var T: TIDLEEVENT); begin T := Self.ONIDLE; end;
procedure TApplication_PSHelper.ONIDLE_W(T: TIDLEEVENT); begin Self.ONIDLE := T; end;
procedure TApplication_PSHelper.ONHELP_R(var T: THELPEVENT); begin T := Self.ONHELP; end;
procedure TApplication_PSHelper.ONHELP_W(T: THELPEVENT); begin Self.ONHELP := T; end;
procedure TApplication_PSHelper.ONHINT_R(var T: TNOTIFYEVENT); begin T := Self.ONHINT; end;
procedure TApplication_PSHelper.ONHINT_W(T: TNOTIFYEVENT); begin Self.ONHINT := T; end;
{$IFNDEF FPC}
procedure TApplication_PSHelper.ONMINIMIZE_R(var T: TNOTIFYEVENT); begin T := Self.ONMINIMIZE; end;
procedure TApplication_PSHelper.ONMINIMIZE_W(T: TNOTIFYEVENT); begin Self.ONMINIMIZE := T; end;
procedure TApplication_PSHelper.ONRESTORE_R(var T: TNOTIFYEVENT); begin T := Self.ONRESTORE; end;
procedure TApplication_PSHelper.ONRESTORE_W(T: TNOTIFYEVENT); begin Self.ONRESTORE := T; end;
{$ENDIF}
procedure RIRegisterTAPPLICATION(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TApplication) do
begin
{$IFNDEF FPC}
RegisterMethod(@TApplication.MINIMIZE, 'Minimize');
RegisterMethod(@TApplication.RESTORE, 'Restore');
RegisterPropertyHelper(@TApplication.ACTIVE_R, nil, 'Active');
RegisterPropertyHelper(@TApplication.ONACTIVATE_R, @TApplication.ONACTIVATE_W, 'OnActivate');
RegisterPropertyHelper(@TApplication.ONDEACTIVATE_R, @TApplication.ONDEACTIVATE_W, 'OnDeactivate');
RegisterPropertyHelper(@TApplication.ONMINIMIZE_R, @TApplication.ONMINIMIZE_W, 'OnMinimize');
RegisterPropertyHelper(@TApplication.ONRESTORE_R, @TApplication.ONRESTORE_W, 'OnRestore');
RegisterPropertyHelper(@TApplication.DIALOGHANDLE_R, @TApplication.DIALOGHANDLE_W, 'DialogHandle');
RegisterMethod(@TApplication.CREATEHANDLE, 'CreateHandle');
RegisterMethod(@TApplication.NORMALIZETOPMOSTS, 'NormalizeTopMosts');
RegisterMethod(@TApplication.RESTORETOPMOSTS, 'RestoreTopMosts');
{$IFNDEF CLX}
RegisterPropertyHelper(@TApplication.HANDLE_R, @TApplication.HANDLE_W, 'Handle');
RegisterPropertyHelper(@TApplication.UPDATEFORMATSETTINGS_R, @TApplication.UPDATEFORMATSETTINGS_W, 'UpdateFormatSettings');
{$ENDIF}
{$ENDIF}
RegisterMethod(@TApplication.BRINGTOFRONT, 'BringToFront');
RegisterMethod(@TApplication.MESSAGEBOX, 'MessageBox');
RegisterMethod(@TApplication.PROCESSMESSAGES, 'ProcessMessages');
RegisterMethod(@TApplication.TERMINATE, 'Terminate');
RegisterPropertyHelper(@TApplication.EXENAME_R, nil, 'ExeName');
RegisterPropertyHelper(@TApplication.HINT_R, @TApplication.HINT_W, 'Hint');
RegisterPropertyHelper(@TApplication.MAINFORM_R, nil, 'MainForm');
RegisterPropertyHelper(@TApplication.SHOWHINT_R, @TApplication.SHOWHINT_W, 'ShowHint');
RegisterPropertyHelper(@TApplication.SHOWMAINFORM_R, @TApplication.SHOWMAINFORM_W, 'ShowMainForm');
RegisterPropertyHelper(@TApplication.TERMINATED_R, nil, 'Terminated');
RegisterPropertyHelper(@TApplication.TITLE_R, @TApplication.TITLE_W, 'Title');
RegisterPropertyHelper(@TApplication.ONIDLE_R, @TApplication.ONIDLE_W, 'OnIdle');
RegisterPropertyHelper(@TApplication.ONHINT_R, @TApplication.ONHINT_W, 'OnHint');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TApplication.CONTROLDESTROYED, 'ControlDestroyed');
RegisterMethod(@TApplication.CANCELHINT, 'CancelHint');
{$IFNDEF CLX}
{$IFNDEF FPC}
RegisterMethod(@TApplication.HELPCOMMAND, 'HelpCommand');
{$ENDIF}
RegisterMethod(@TApplication.HELPCONTEXT, 'HelpContext');
{$IFNDEF FPC}
RegisterMethod(@TApplication.HELPJUMP, 'HelpJump');
{$ENDIF}
{$ENDIF}
// RegisterMethod(@TApplication.HANDLEEXCEPTION, 'HandleException');
// RegisterMethod(@TApplication.HOOKMAINWINDOW, 'HookMainWindow');
// RegisterMethod(@TApplication.UNHOOKMAINWINDOW, 'UnhookMainWindow');
RegisterMethod(@TApplication.HANDLEMESSAGE, 'HandleMessage');
RegisterMethod(@TApplication.HIDEHINT, 'HideHint');
RegisterMethod(@TApplication.HINTMOUSEMESSAGE, 'HintMouseMessage');
RegisterMethod(@TApplication.INITIALIZE, 'Initialize');
RegisterMethod(@TApplication.RUN, 'Run');
// RegisterMethod(@TApplication.SHOWEXCEPTION, 'ShowException');
RegisterPropertyHelper(@TApplication.HELPFILE_R, @TApplication.HELPFILE_W, 'HelpFile');
RegisterPropertyHelper(@TApplication.HINTCOLOR_R, @TApplication.HINTCOLOR_W, 'HintColor');
RegisterPropertyHelper(@TApplication.HINTPAUSE_R, @TApplication.HINTPAUSE_W, 'HintPause');
RegisterPropertyHelper(@TApplication.HINTSHORTPAUSE_R, @TApplication.HINTSHORTPAUSE_W, 'HintShortPause');
RegisterPropertyHelper(@TApplication.HINTHIDEPAUSE_R, @TApplication.HINTHIDEPAUSE_W, 'HintHidePause');
RegisterPropertyHelper(@TApplication.ONHELP_R, @TApplication.ONHELP_W, 'OnHelp');
{$ENDIF}
end;
end;
{$ELSE}
{$IFNDEF FPC}
procedure TAPPLICATIONACTIVE_R(Self: TApplication; var T: BOOLEAN); begin T := Self.ACTIVE; end;
{$IFNDEF CLX}
procedure TAPPLICATIONDIALOGHANDLE_R(Self: TAPPLICATION; var T: Longint); begin T := Self.DIALOGHANDLE; end;
procedure TAPPLICATIONDIALOGHANDLE_W(Self: TAPPLICATION; T: Longint); begin Self.DIALOGHANDLE := T; end;
@ -239,6 +560,10 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_Forms(Cl: TPSRuntimeClassImporter);
begin
{$IFNDEF PS_MINIVCL}

View File

@ -27,6 +27,42 @@ uses
Classes, Graphics,LCLType;
{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TFont'}{$ENDIF}
{$IFDEF class_helper_present}
type
TFont_PSHelper = class helper for TFont
public
{$IFNDEF CLX}
procedure HandleR(var T: Longint);
procedure HandleW(T: Longint);
{$ENDIF}
procedure PixelsPerInchR(var T: Longint);
procedure PixelsPerInchW(T: Longint);
procedure StyleR(var T: TFontStyles);
procedure StyleW(T: TFontStyles);
end;
{$IFNDEF CLX}
procedure TFont_PSHelper.HandleR(var T: Longint); begin T := Self.Handle; end;
procedure TFont_PSHelper.HandleW(T: Longint); begin Self.Handle := T; end;
{$ENDIF}
procedure TFont_PSHelper.PixelsPerInchR(var T: Longint); begin T := Self.PixelsPerInch; end;
procedure TFont_PSHelper.PixelsPerInchW(T: Longint); begin {$IFNDEF FPC} Self.PixelsPerInch := T;{$ENDIF} end;
procedure TFont_PSHelper.StyleR(var T: TFontStyles); begin T := Self.Style; end;
procedure TFont_PSHelper.StyleW(T: TFontStyles); begin Self.Style:= T; end;
procedure RIRegisterTFont(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TFont) do
begin
RegisterConstructor(@TFont.Create, 'Create');
{$IFNDEF CLX}
RegisterPropertyHelper(@TFont.HandleR, @TFont.HandleW, 'Handle');
{$ENDIF}
RegisterPropertyHelper(@TFont.PixelsPerInchR, @TFont.PixelsPerInchW, 'PixelsPerInch');
RegisterPropertyHelper(@TFont.StyleR, @TFont.StyleW, 'Style');
end;
end;
{$ELSE}
{$IFNDEF CLX}
procedure TFontHandleR(Self: TFont; var T: Longint); begin T := Self.Handle; end;
procedure TFontHandleW(Self: TFont; T: Longint); begin Self.Handle := T; end;
@ -48,6 +84,85 @@ begin
RegisterPropertyHelper(@TFontStyleR, @TFontStyleW, 'Style');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCanvas'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCanvas_PSHelper = class helper for TCanvas
public
{$IFNDEF CLX}
procedure HandleR(var T: Longint);
procedure HandleW(T: Longint);
{$ENDIF}
procedure PixelsR(var T: Longint; X,Y: Longint);
procedure PixelsW(T, X, Y: Longint);
{$IFDEF FPC}
procedure Arc(Self : TCanvas; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);
procedure Chord(Self : TCanvas; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);
procedure Rectangle(Self : TCanvas; X1,Y1,X2,Y2 : integer);
procedure RoundRect(Self : TCanvas; X1, Y1, X2, Y2, X3, Y3 : integer);
procedure Ellipse(Self : TCanvas;X1, Y1, X2, Y2: Integer);
procedure FillRect(Self : TCanvas; const Rect: TRect);
procedure FloodFill(Self : TCanvas; X, Y: Integer; Color: TColor; FillStyle: TFillStyle);
{$ENDIF}
end;
{$IFNDEF CLX}
procedure TCanvas_PSHelper.HandleR(var T: Longint); begin T := Self.Handle; end;
procedure TCanvas_PSHelper.HandleW(T: Longint); begin Self.Handle:= T; end;
{$ENDIF}
procedure TCanvas_PSHelper.PixelsR(var T: Longint; X,Y: Longint); begin T := Self.Pixels[X,Y]; end;
procedure TCanvas_PSHelper.PixelsW(T, X, Y: Longint); begin Self.Pixels[X,Y]:= T; end;
{$IFDEF FPC}
procedure TCanvas_PSHelper.Arc(Self : TCanvas; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer); begin Self.Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4); end;
procedure TCanvas_PSHelper.Chord(Self : TCanvas; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer); begin self.Chord(X1, Y1, X2, Y2, X3, Y3, X4, Y4); end;
procedure TCanvas_PSHelper.Rectangle(Self : TCanvas; X1,Y1,X2,Y2 : integer); begin self.Rectangle(x1,y1,x2,y2); end;
procedure TCanvas_PSHelper.RoundRect(Self : TCanvas; X1, Y1, X2, Y2, X3, Y3 : integer); begin self.RoundRect(X1, Y1, X2, Y2, X3, Y3); end;
procedure TCanvas_PSHelper.Ellipse(Self : TCanvas;X1, Y1, X2, Y2: Integer); begin self.Ellipse(X1, Y1, X2, Y2); end;
procedure TCanvas_PSHelper.FillRect(Self : TCanvas; const Rect: TRect); begin self.FillRect(rect); end;
procedure TCanvas_PSHelper.FloodFill(Self : TCanvas; X, Y: Integer; Color: TColor; FillStyle: TFillStyle); begin self.FloodFill(x,y,color,fillstyle); end;
{$ENDIF}
procedure RIRegisterTCanvas(cl: TPSRuntimeClassImporter); // requires TPersistent
begin
with Cl.Add(TCanvas) do
begin
RegisterMethod(@TCanvas.Arc, 'Arc');
RegisterMethod(@TCanvas.Chord, 'Chord');
RegisterMethod(@TCanvas.Rectangle, 'Rectangle');
RegisterMethod(@TCanvas.RoundRect, 'RoundRect');
RegisterMethod(@TCanvas.Ellipse, 'Ellipse');
RegisterMethod(@TCanvas.FillRect, 'FillRect');
{$IFDEF FPC}
RegisterMethod(@TCanvas.FloodFill, 'FloodFill');
{$ELSE}
{$IFNDEF CLX}
RegisterMethod(@TCanvas.FloodFill, 'FloodFill');
{$ENDIF}
{$ENDIF}
RegisterMethod(@TCanvas.Draw, 'Draw');
RegisterMethod(@TCanvas.Lineto, 'LineTo');
RegisterMethod(@TCanvas.Moveto, 'MoveTo');
RegisterMethod(@TCanvas.Pie, 'Pie');
RegisterMethod(@TCanvas.Refresh, 'Refresh');
RegisterMethod(@TCanvas.TextHeight, 'TextHeight');
RegisterMethod(@TCanvas.TextOut, 'TextOut');
RegisterMethod(@TCanvas.TextWidth, 'TextWidth');
{$IFNDEF CLX}
RegisterPropertyHelper(@TCanvas.HandleR, @TCanvas.HandleW, 'Handle');
{$ENDIF}
RegisterPropertyHelper(@TCanvas.PixelsR, @TCanvas.PixelsW, 'Pixels');
end;
end;
{$ELSE}
{$IFNDEF CLX}
procedure TCanvasHandleR(Self: TCanvas; var T: Longint); begin T := Self.Handle; end;
procedure TCanvasHandleW(Self: TCanvas; T: Longint); begin Self.Handle:= T; end;
@ -105,10 +220,33 @@ begin
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TGraphicsObject'}{$ENDIF}
{$IFDEF class_helper_present}
type
TGraphicsObject_PSHelper = class helper for TGraphicsObject
public
procedure ONCHANGE_W(T: TNotifyEvent);
procedure ONCHANGE_R(var T: TNotifyEvent);
end;
procedure TGraphicsObject_PSHelper.ONCHANGE_W(T: TNotifyEvent); begin Self.OnChange := t; end;
procedure TGraphicsObject_PSHelper.ONCHANGE_R(var T: TNotifyEvent); begin T :=Self.OnChange; end;
procedure RIRegisterTGRAPHICSOBJECT(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TGraphicsObject) do
begin
RegisterPropertyHelper(@TGraphicsObject.ONCHANGE_R, @TGraphicsObject.ONCHANGE_W, 'OnChange');
end;
end;
{$ELSE}
procedure TGRAPHICSOBJECTONCHANGE_W(Self: TGraphicsObject; T: TNotifyEvent); begin Self.OnChange := t; end;
procedure TGRAPHICSOBJECTONCHANGE_R(Self: TGraphicsObject; var T: TNotifyEvent); begin T :=Self.OnChange; end;
procedure RIRegisterTGRAPHICSOBJECT(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TGRAPHICSOBJECT) do
@ -116,23 +254,74 @@ begin
RegisterPropertyHelper(@TGRAPHICSOBJECTONCHANGE_R, @TGRAPHICSOBJECTONCHANGE_W, 'OnChange');
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPen'}{$ENDIF}
procedure RIRegisterTPEN(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPEN) do
with Cl.Add(TPen) do
begin
RegisterConstructor(@TPEN.CREATE, 'Create');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TBrush'}{$ENDIF}
procedure RIRegisterTBRUSH(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TBRUSH) do
with Cl.Add(TBrush) do
begin
RegisterConstructor(@TBRUSH.CREATE, 'Create');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TGraphic'}{$ENDIF}
{$IFDEF class_helper_present}
type
TGraphic_PSHelper = class helper for TGraphic
public
procedure OnChange_W(const T: TNotifyEvent);
procedure OnChange_R(var T: TNotifyEvent);
procedure Width_W(const T: Integer);
procedure Width_R(var T: Integer);
procedure Modified_W(const T: Boolean);
procedure Modified_R(var T: Boolean);
procedure Height_W(const T: Integer);
procedure Height_R(var T: Integer);
procedure Empty_R(var T: Boolean);
end;
procedure TGraphic_PSHelper.OnChange_W(const T: TNotifyEvent); begin Self.OnChange := T; end;
procedure TGraphic_PSHelper.OnChange_R(var T: TNotifyEvent); begin T := Self.OnChange; end;
procedure TGraphic_PSHelper.Width_W(const T: Integer); begin Self.Width := T; end;
procedure TGraphic_PSHelper.Width_R(var T: Integer); begin T := Self.Width; end;
procedure TGraphic_PSHelper.Modified_W(const T: Boolean); begin Self.Modified := T; end;
procedure TGraphic_PSHelper.Modified_R(var T: Boolean); begin T := Self.Modified; end;
procedure TGraphic_PSHelper.Height_W(const T: Integer); begin Self.Height := T; end;
procedure TGraphic_PSHelper.Height_R(var T: Integer); begin T := Self.Height; end;
procedure TGraphic_PSHelper.Empty_R(var T: Boolean); begin T := Self.Empty; end;
procedure RIRegisterTGraphic(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TGraphic) do
begin
RegisterVirtualConstructor(@TGraphic.Create, 'Create');
RegisterVirtualMethod(@TGraphic.LoadFromFile, 'LoadFromFile');
RegisterVirtualMethod(@TGraphic.SaveToFile, 'SaveToFile');
RegisterPropertyHelper(@TGraphic.Empty_R,nil,'Empty');
RegisterPropertyHelper(@TGraphic.Height_R,@TGraphic.Height_W,'Height');
RegisterPropertyHelper(@TGraphic.Width_R,@TGraphic.Width_W,'Width');
RegisterPropertyHelper(@TGraphic.OnChange_R,@TGraphic.OnChange_W,'OnChange');
{$IFNDEF PS_MINIVCL}
RegisterPropertyHelper(@TGraphic.Modified_R,@TGraphic.Modified_W,'Modified');
{$ENDIF}
end;
end;
{$ELSE}
procedure TGraphicOnChange_W(Self: TGraphic; const T: TNotifyEvent); begin Self.OnChange := T; end;
procedure TGraphicOnChange_R(Self: TGraphic; var T: TNotifyEvent); begin T := Self.OnChange; end;
procedure TGraphicWidth_W(Self: TGraphic; const T: Integer); begin Self.Width := T; end;
@ -161,6 +350,88 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TBitmap'}{$ENDIF}
{$IFDEF class_helper_present}
type
TBitmap_PSHelper = class helper for TBitmap
public
procedure TransparentColor_R(var T: TColor);
{$IFNDEF CLX}
{$IFNDEF FPC}
procedure IgnorePalette_W(const T: Boolean);
procedure IgnorePalette_R(var T: Boolean);
{$ENDIF}
procedure Palette_W(const T: HPALETTE);
procedure Palette_R(var T: HPALETTE);
{$ENDIF}
procedure Monochrome_W(const T: Boolean);
procedure Monochrome_R(var T: Boolean);
{$IFNDEF CLX}
procedure Handle_W(const T: HBITMAP);
procedure Handle_R(var T: HBITMAP);
{$ENDIF}
procedure Canvas_R(var T: TCanvas);
end;
procedure TBitmap_PSHelper.TransparentColor_R(var T: TColor); begin T := Self.TransparentColor; end;
{$IFNDEF CLX}
{$IFNDEF FPC}
procedure TBitmap_PSHelper.IgnorePalette_W(const T: Boolean); begin Self.IgnorePalette := T; end;
procedure TBitmap_PSHelper.IgnorePalette_R(var T: Boolean); begin T := Self.IgnorePalette; end;
{$ENDIF}
procedure TBitmap_PSHelper.Palette_W(const T: HPALETTE); begin Self.Palette := T; end;
procedure TBitmap_PSHelper.Palette_R(var T: HPALETTE); begin T := Self.Palette; end;
{$ENDIF}
procedure TBitmap_PSHelper.Monochrome_W(const T: Boolean); begin Self.Monochrome := T; end;
procedure TBitmap_PSHelper.Monochrome_R(var T: Boolean); begin T := Self.Monochrome; end;
{$IFNDEF CLX}
procedure TBitmap_PSHelper.Handle_W(const T: HBITMAP); begin Self.Handle := T; end;
procedure TBitmap_PSHelper.Handle_R(var T: HBITMAP); begin T := Self.Handle; end;
{$ENDIF}
procedure TBitmap_PSHelper.Canvas_R(var T: TCanvas); begin T := Self.Canvas; end;
procedure RIRegisterTBitmap(CL: TPSRuntimeClassImporter; Streams: Boolean);
begin
with CL.Add(TBitmap) do
begin
if Streams then begin
RegisterMethod(@TBitmap.LoadFromStream, 'LoadFromStream');
RegisterMethod(@TBitmap.SaveToStream, 'SaveToStream');
end;
RegisterPropertyHelper(@TBitmap.Canvas_R,nil,'Canvas');
{$IFNDEF CLX}
RegisterPropertyHelper(@TBitmap.Handle_R,@TBitmap.Handle_W,'Handle');
{$ENDIF}
{$IFNDEF PS_MINIVCL}
{$IFNDEF FPC}
RegisterMethod(@TBitmap.Dormant, 'Dormant');
{$ENDIF}
RegisterMethod(@TBitmap.FreeImage, 'FreeImage');
{$IFNDEF CLX}
RegisterMethod(@TBitmap.LoadFromClipboardFormat, 'LoadFromClipboardFormat');
{$ENDIF}
RegisterMethod(@TBitmap.LoadFromResourceName, 'LoadFromResourceName');
RegisterMethod(@TBitmap.LoadFromResourceID, 'LoadFromResourceID');
{$IFNDEF CLX}
RegisterMethod(@TBitmap.ReleaseHandle, 'ReleaseHandle');
RegisterMethod(@TBitmap.ReleasePalette, 'ReleasePalette');
RegisterMethod(@TBitmap.SaveToClipboardFormat, 'SaveToClipboardFormat');
RegisterPropertyHelper(@TBitmap.Monochrome_R,@TBitmap.Monochrome_W,'Monochrome');
RegisterPropertyHelper(@TBitmap.Palette_R,@TBitmap.Palette_W,'Palette');
{$IFNDEF FPC}
RegisterPropertyHelper(@TBitmap.IgnorePalette_R,@TBitmap.IgnorePalette_W,'IgnorePalette');
{$ENDIF}
{$ENDIF}
RegisterPropertyHelper(@TBitmap.TransparentColor_R,nil,'TransparentColor');
{$ENDIF}
end;
end;
{$ELSE}
procedure TBitmapTransparentColor_R(Self: TBitmap; var T: TColor); begin T := Self.TransparentColor; end;
{$IFNDEF CLX}
{$IFNDEF FPC}
@ -216,6 +487,26 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPicture'}{$ENDIF}
{$IFDEF class_helper_present}
type
TPicture_PSHelper = class helper for TPicture
public
procedure Bitmap_W(const T: TBitmap);
procedure Bitmap_R(var T: TBitmap);
end;
procedure TPicture_PSHelper.Bitmap_W(const T: TBitmap); begin Self.Bitmap := T; end;
procedure TPicture_PSHelper.Bitmap_R(var T: TBitmap); begin T := Self.Bitmap; end;
procedure RIRegisterTPicture(CL: TPSRuntimeClassImporter);
begin
with CL.Add(TPicture) do
registerPropertyHelper(@TPicture.Bitmap_R,@TPicture.Bitmap_W,'Bitmap');
end;
{$ELSE}
procedure TPictureBitmap_W(Self: TPicture; const T: TBitmap); begin Self.Bitmap := T; end;
procedure TPictureBitmap_R(Self: TPicture; var T: TBitmap); begin T := Self.Bitmap; end;
procedure RIRegisterTPicture(CL: TPSRuntimeClassImporter);
@ -223,6 +514,8 @@ begin
with CL.Add(TPicture) do
registerPropertyHelper(@TPictureBitmap_R,@TPictureBitmap_W,'Bitmap');
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_Graphics(Cl: TPSRuntimeClassImporter; Streams: Boolean);
begin

View File

@ -28,13 +28,138 @@ Uses
Uses {$IFNDEF FPC}WINDOWS,{$ELSE} LCLType,{$ENDIF} SYSUTILS, CLASSES, CONTNRS, MESSAGES, GRAPHICS, IMGLIST, ACTNLIST, Menus;
{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPopupList'}{$ENDIF}
{$IFNDEF FPC}
{$IFDEF class_helper_present}
type
TPopupList_PSHelper = class helper for TPopupList
public
procedure WINDOW_R(var T: HWND);
end;
procedure TPopupList_PSHelper.WINDOW_R(var T: HWND);
begin T := Self.WINDOW; end;
procedure RIRegisterTPOPUPLIST(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPOPUPLIST) do
begin
RegisterPropertyHelper(@TPOPUPLIST.WINDOW_R,nil,'Window');
RegisterMethod(@TPOPUPLIST.ADD, 'Add');
RegisterMethod(@TPOPUPLIST.REMOVE, 'Remove');
end;
end;
{$ELSE}
procedure TPOPUPLISTWINDOW_R(Self: TPopupList; var T: HWND);
begin T := Self.WINDOW; end;
procedure RIRegisterTPOPUPLIST(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPOPUPLIST) do
begin
RegisterPropertyHelper(@TPOPUPLISTWINDOW_R,nil,'Window');
RegisterMethod(@TPOPUPLIST.ADD, 'Add');
RegisterMethod(@TPOPUPLIST.REMOVE, 'Remove');
end;
end;
{$ENDIF class_helper_present}
{$ENDIF FPC}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPopupMenu'}{$ENDIF}
{$IFDEF class_helper_present}
type
TPopupMenu_PSHelper = class helper for TPopupMenu
public
procedure ONPOPUP_W(const T: TNOTIFYEVENT);
procedure ONPOPUP_R(var T: TNOTIFYEVENT);
{$IFNDEF FPC}
procedure TRACKBUTTON_W(const T: TTRACKBUTTON);
procedure TRACKBUTTON_R(var T: TTRACKBUTTON);
procedure MENUANIMATION_W(const T: TMENUANIMATION);
procedure MENUANIMATION_R(var T: TMENUANIMATION);
procedure HELPCONTEXT_W(const T: THELPCONTEXT);
procedure HELPCONTEXT_R(var T: THELPCONTEXT);
{$ENDIF}
procedure AUTOPOPUP_W(const T: BOOLEAN);
procedure AUTOPOPUP_R(var T: BOOLEAN);
{$IFNDEF FPC}
procedure ALIGNMENT_W(const T: TPOPUPALIGNMENT);
procedure ALIGNMENT_R(var T: TPOPUPALIGNMENT);
{$ENDIF}
procedure POPUPCOMPONENT_W(const T: TCOMPONENT);
procedure POPUPCOMPONENT_R(var T: TCOMPONENT);
end;
procedure TPopupMenu_PSHelper.ONPOPUP_W(const T: TNOTIFYEVENT);
begin Self.ONPOPUP := T; end;
procedure TPopupMenu_PSHelper.ONPOPUP_R(var T: TNOTIFYEVENT);
begin T := Self.ONPOPUP; end;
{$IFNDEF FPC}
procedure TPOPUPLISTWINDOW_R(Self: TPOPUPLIST; var T: HWND);
begin T := Self.WINDOW; end;
procedure TPopupMenu_PSHelper.TRACKBUTTON_W(const T: TTRACKBUTTON);
begin Self.TRACKBUTTON := T; end;
procedure TPopupMenu_PSHelper.TRACKBUTTON_R(var T: TTRACKBUTTON);
begin T := Self.TRACKBUTTON; end;
procedure TPopupMenu_PSHelper.MENUANIMATION_W(const T: TMENUANIMATION);
begin Self.MENUANIMATION := T; end;
procedure TPopupMenu_PSHelper.MENUANIMATION_R(var T: TMENUANIMATION);
begin T := Self.MENUANIMATION; end;
procedure TPopupMenu_PSHelper.HELPCONTEXT_W(const T: THELPCONTEXT);
begin Self.HELPCONTEXT := T; end;
procedure TPopupMenu_PSHelper.HELPCONTEXT_R(var T: THELPCONTEXT);
begin T := Self.HELPCONTEXT; end;
{$ENDIF}
procedure TPOPUPMENUONPOPUP_W(Self: TPOPUPMENU; const T: TNOTIFYEVENT);
procedure TPopupMenu_PSHelper.AUTOPOPUP_W(const T: BOOLEAN);
begin Self.AUTOPOPUP := T; end;
procedure TPopupMenu_PSHelper.AUTOPOPUP_R(var T: BOOLEAN);
begin T := Self.AUTOPOPUP; end;
{$IFNDEF FPC}
procedure TPopupMenu_PSHelper.ALIGNMENT_W(const T: TPOPUPALIGNMENT);
begin Self.ALIGNMENT := T; end;
procedure TPopupMenu_PSHelper.ALIGNMENT_R(var T: TPOPUPALIGNMENT);
begin T := Self.ALIGNMENT; end;
{$ENDIF}
procedure TPopupMenu_PSHelper.POPUPCOMPONENT_W(const T: TCOMPONENT);
begin Self.POPUPCOMPONENT := T; end;
procedure TPopupMenu_PSHelper.POPUPCOMPONENT_R(var T: TCOMPONENT);
begin T := Self.POPUPCOMPONENT; end;
procedure RIRegisterTPOPUPMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPopupMenu) do
begin
RegisterConstructor(@TPopupMenu.CREATE, 'Create');
RegisterVirtualMethod(@TPopupMenu.POPUP, 'Popup');
RegisterPropertyHelper(@TPopupMenu.POPUPCOMPONENT_R,@TPopupMenu.POPUPCOMPONENT_W,'PopupComponent');
RegisterEventPropertyHelper(@TPopupMenu.ONPOPUP_R,@TPopupMenu.ONPOPUP_W,'OnPopup');
{$IFNDEF FPC}
RegisterPropertyHelper(@TPopupMenu.ALIGNMENT_R,@TPopupMenu.ALIGNMENT_W,'Alignment');
RegisterPropertyHelper(@TPopupMenu.AUTOPOPUP_R,@TPopupMenu.AUTOPOPUP_W,'AutoPopup');
RegisterPropertyHelper(@TPopupMenu.HELPCONTEXT_R,@TPopupMenu.HELPCONTEXT_W,'HelpContext');
RegisterPropertyHelper(@TPopupMenu.MENUANIMATION_R,@TPopupMenu.MENUANIMATION_W,'MenuAnimation');
RegisterPropertyHelper(@TPopupMenu.TRACKBUTTON_R,@TPopupMenu.TRACKBUTTON_W,'TrackButton');
{$ENDIF}
end;
end;
{$ELSE}
procedure TPOPUPMENUONPOPUP_W(Self: TPopupMenu; const T: TNOTIFYEVENT);
begin Self.ONPOPUP := T; end;
procedure TPOPUPMENUONPOPUP_R(Self: TPOPUPMENU; var T: TNOTIFYEVENT);
@ -80,18 +205,189 @@ begin Self.POPUPCOMPONENT := T; end;
procedure TPOPUPMENUPOPUPCOMPONENT_R(Self: TPOPUPMENU; var T: TCOMPONENT);
begin T := Self.POPUPCOMPONENT; end;
procedure RIRegisterTPOPUPMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPOPUPMENU) do
begin
RegisterConstructor(@TPOPUPMENU.CREATE, 'Create');
RegisterVirtualMethod(@TPOPUPMENU.POPUP, 'Popup');
RegisterPropertyHelper(@TPOPUPMENUPOPUPCOMPONENT_R,@TPOPUPMENUPOPUPCOMPONENT_W,'PopupComponent');
RegisterEventPropertyHelper(@TPOPUPMENUONPOPUP_R,@TPOPUPMENUONPOPUP_W,'OnPopup');
{$IFNDEF FPC}
RegisterPropertyHelper(@TPOPUPMENUALIGNMENT_R,@TPOPUPMENUALIGNMENT_W,'Alignment');
RegisterPropertyHelper(@TPOPUPMENUAUTOPOPUP_R,@TPOPUPMENUAUTOPOPUP_W,'AutoPopup');
RegisterPropertyHelper(@TPOPUPMENUHELPCONTEXT_R,@TPOPUPMENUHELPCONTEXT_W,'HelpContext');
RegisterPropertyHelper(@TPOPUPMENUMENUANIMATION_R,@TPOPUPMENUMENUANIMATION_W,'MenuAnimation');
RegisterPropertyHelper(@TPOPUPMENUTRACKBUTTON_R,@TPOPUPMENUTRACKBUTTON_W,'TrackButton');
{$ENDIF}
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TMainMenu'}{$ENDIF}
{$IFDEF class_helper_present}
type
TMainMenu_PSHelper = class helper for TMainMenu
public
{$IFNDEF FPC}
procedure AUTOMERGE_W(const T: BOOLEAN);
procedure AUTOMERGE_R(var T: BOOLEAN);
{$ENDIF}
end;
{$IFNDEF FPC}
procedure TMAINMENUAUTOMERGE_W(Self: TMAINMENU; const T: BOOLEAN);
procedure TMainMenu_PSHelper.AUTOMERGE_W(const T: BOOLEAN);
begin Self.AUTOMERGE := T; end;
procedure TMainMenu_PSHelper.AUTOMERGE_R(var T: BOOLEAN);
begin T := Self.AUTOMERGE; end;
{$ENDIF}
procedure RIRegisterTMAINMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMAINMENU) do
begin
{$IFNDEF FPC}
RegisterMethod(@TMAINMENU.MERGE, 'Merge');
RegisterMethod(@TMAINMENU.UNMERGE, 'Unmerge');
RegisterMethod(@TMAINMENU.POPULATEOLE2MENU, 'PopulateOle2Menu');
RegisterMethod(@TMAINMENU.GETOLE2ACCELERATORTABLE, 'GetOle2AcceleratorTable');
RegisterMethod(@TMAINMENU.SETOLE2MENUHANDLE, 'SetOle2MenuHandle');
RegisterPropertyHelper(@TMAINMENU.AUTOMERGE_R,@TMAINMENU.AUTOMERGE_W,'AutoMerge');
{$ENDIF}
end;
end;
{$ELSE}
{$IFNDEF FPC}
procedure TMAINMENUAUTOMERGE_W(Self: TMainMenu; const T: BOOLEAN);
begin Self.AUTOMERGE := T; end;
procedure TMAINMENUAUTOMERGE_R(Self: TMAINMENU; var T: BOOLEAN);
begin T := Self.AUTOMERGE; end;
{$ENDIF}
procedure RIRegisterTMAINMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMAINMENU) do
begin
{$IFNDEF FPC}
RegisterMethod(@TMAINMENU.MERGE, 'Merge');
RegisterMethod(@TMAINMENU.UNMERGE, 'Unmerge');
RegisterMethod(@TMAINMENU.POPULATEOLE2MENU, 'PopulateOle2Menu');
RegisterMethod(@TMAINMENU.GETOLE2ACCELERATORTABLE, 'GetOle2AcceleratorTable');
RegisterMethod(@TMAINMENU.SETOLE2MENUHANDLE, 'SetOle2MenuHandle');
RegisterPropertyHelper(@TMAINMENUAUTOMERGE_R,@TMAINMENUAUTOMERGE_W,'AutoMerge');
{$ENDIF}
end;
end;
procedure TMENUITEMS_R(Self: TMENU; var T: TMENUITEM);
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TMenu'}{$ENDIF}
{$IFDEF class_helper_present}
type
TMenu_PSHelper = class helper for TMenu
public
procedure ITEMS_R(var T: TMENUITEM);
{$IFNDEF FPC}
procedure WINDOWHANDLE_W(const T: HWND);
procedure WINDOWHANDLE_R(var T: HWND);
procedure PARENTBIDIMODE_W(const T: BOOLEAN);
procedure PARENTBIDIMODE_R(var T: BOOLEAN);
procedure OWNERDRAW_W(const T: BOOLEAN);
procedure OWNERDRAW_R(var T: BOOLEAN);
procedure BIDIMODE_W(const T: TBIDIMODE);
procedure BIDIMODE_R(var T: TBIDIMODE);
procedure AUTOLINEREDUCTION_W(const T: TMENUAUTOFLAG);
procedure AUTOLINEREDUCTION_R(var T: TMENUAUTOFLAG);
procedure AUTOHOTKEYS_W(const T: TMENUAUTOFLAG);
procedure AUTOHOTKEYS_R(var T: TMENUAUTOFLAG);
{$ENDIF}
procedure HANDLE_R(var T: HMENU);
procedure IMAGES_W(const T: TCUSTOMIMAGELIST);
procedure IMAGES_R(var T: TCUSTOMIMAGELIST);
end;
procedure TMenu_PSHelper.ITEMS_R(var T: TMENUITEM);
begin T := Self.ITEMS; end;
{$IFNDEF FPC}
procedure TMenu_PSHelper.WINDOWHANDLE_W(const T: HWND);
begin Self.WINDOWHANDLE := T; end;
procedure TMenu_PSHelper.WINDOWHANDLE_R(var T: HWND);
begin T := Self.WINDOWHANDLE; end;
procedure TMenu_PSHelper.PARENTBIDIMODE_W(const T: BOOLEAN);
begin Self.PARENTBIDIMODE := T; end;
procedure TMenu_PSHelper.PARENTBIDIMODE_R(var T: BOOLEAN);
begin T := Self.PARENTBIDIMODE; end;
procedure TMenu_PSHelper.OWNERDRAW_W(const T: BOOLEAN);
begin Self.OWNERDRAW := T; end;
procedure TMenu_PSHelper.OWNERDRAW_R(var T: BOOLEAN);
begin T := Self.OWNERDRAW; end;
procedure TMenu_PSHelper.BIDIMODE_W(const T: TBIDIMODE);
begin Self.BIDIMODE := T; end;
procedure TMenu_PSHelper.BIDIMODE_R(var T: TBIDIMODE);
begin T := Self.BIDIMODE; end;
procedure TMenu_PSHelper.AUTOLINEREDUCTION_W(const T: TMENUAUTOFLAG);
begin Self.AUTOLINEREDUCTION := T; end;
procedure TMenu_PSHelper.AUTOLINEREDUCTION_R(var T: TMENUAUTOFLAG);
begin T := Self.AUTOLINEREDUCTION; end;
procedure TMenu_PSHelper.AUTOHOTKEYS_W(const T: TMENUAUTOFLAG);
begin Self.AUTOHOTKEYS := T; end;
procedure TMenu_PSHelper.AUTOHOTKEYS_R(var T: TMENUAUTOFLAG);
begin T := Self.AUTOHOTKEYS; end;
{$ENDIF}
procedure TMenu_PSHelper.HANDLE_R(var T: HMENU);
begin T := Self.HANDLE; end;
procedure TMenu_PSHelper.IMAGES_W(const T: TCUSTOMIMAGELIST);
begin Self.IMAGES := T; end;
procedure TMenu_PSHelper.IMAGES_R(var T: TCUSTOMIMAGELIST);
begin T := Self.IMAGES; end;
procedure RIRegisterTMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMENU) do
begin
RegisterConstructor(@TMENU.CREATE, 'Create');
RegisterMethod(@TMENU.DISPATCHCOMMAND, 'DispatchCommand');
RegisterMethod(@TMENU.FINDITEM, 'FindItem');
RegisterPropertyHelper(@TMENU.IMAGES_R,@TMENU.IMAGES_W,'Images');
RegisterMethod(@TMENU.ISRIGHTTOLEFT, 'IsRightToLeft');
RegisterPropertyHelper(@TMENU.HANDLE_R,nil,'Handle');
RegisterPropertyHelper(@TMENU.ITEMS_R,nil,'Items');
{$IFNDEF FPC}
RegisterMethod(@TMENU.DISPATCHPOPUP, 'DispatchPopup');
RegisterMethod(@TMENU.PARENTBIDIMODECHANGED, 'ParentBiDiModeChanged');
RegisterMethod(@TMENU.PROCESSMENUCHAR, 'ProcessMenuChar');
RegisterPropertyHelper(@TMENU.AUTOHOTKEYS_R,@TMENU.AUTOHOTKEYS_W,'AutoHotkeys');
RegisterPropertyHelper(@TMENU.AUTOLINEREDUCTION_R,@TMENU.AUTOLINEREDUCTION_W,'AutoLineReduction');
RegisterPropertyHelper(@TMENU.BIDIMODE_R,@TMENU.BIDIMODE_W,'BiDiMode');
RegisterMethod(@TMENU.GETHELPCONTEXT, 'GetHelpContext');
RegisterPropertyHelper(@TMENU.OWNERDRAW_R,@TMENU.OWNERDRAW_W,'OwnerDraw');
RegisterPropertyHelper(@TMENU.PARENTBIDIMODE_R,@TMENU.PARENTBIDIMODE_W,'ParentBiDiMode');
RegisterPropertyHelper(@TMENU.WINDOWHANDLE_R,@TMENU.WINDOWHANDLE_W,'WindowHandle');
{$ENDIF}
end;
end;
{$ELSE}
procedure TMENUITEMS_R(Self: TMenu; var T: TMENUITEM);
begin T := Self.ITEMS; end;
{$IFNDEF FPC}
procedure TMENUWINDOWHANDLE_W(Self: TMENU; const T: HWND);
@ -145,8 +441,298 @@ begin Self.IMAGES := T; end;
procedure TMENUIMAGES_R(Self: TMENU; var T: TCUSTOMIMAGELIST);
begin T := Self.IMAGES; end;
procedure RIRegisterTMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMENU) do
begin
RegisterConstructor(@TMENU.CREATE, 'Create');
RegisterMethod(@TMENU.DISPATCHCOMMAND, 'DispatchCommand');
RegisterMethod(@TMENU.FINDITEM, 'FindItem');
RegisterPropertyHelper(@TMENUIMAGES_R,@TMENUIMAGES_W,'Images');
RegisterMethod(@TMENU.ISRIGHTTOLEFT, 'IsRightToLeft');
RegisterPropertyHelper(@TMENUHANDLE_R,nil,'Handle');
RegisterPropertyHelper(@TMENUITEMS_R,nil,'Items');
{$IFNDEF FPC}
procedure TMENUITEMONMEASUREITEM_W(Self: TMENUITEM; const T: TMENUMEASUREITEMEVENT);
RegisterMethod(@TMENU.DISPATCHPOPUP, 'DispatchPopup');
RegisterMethod(@TMENU.PARENTBIDIMODECHANGED, 'ParentBiDiModeChanged');
RegisterMethod(@TMENU.PROCESSMENUCHAR, 'ProcessMenuChar');
RegisterPropertyHelper(@TMENUAUTOHOTKEYS_R,@TMENUAUTOHOTKEYS_W,'AutoHotkeys');
RegisterPropertyHelper(@TMENUAUTOLINEREDUCTION_R,@TMENUAUTOLINEREDUCTION_W,'AutoLineReduction');
RegisterPropertyHelper(@TMENUBIDIMODE_R,@TMENUBIDIMODE_W,'BiDiMode');
RegisterMethod(@TMENU.GETHELPCONTEXT, 'GetHelpContext');
RegisterPropertyHelper(@TMENUOWNERDRAW_R,@TMENUOWNERDRAW_W,'OwnerDraw');
RegisterPropertyHelper(@TMENUPARENTBIDIMODE_R,@TMENUPARENTBIDIMODE_W,'ParentBiDiMode');
RegisterPropertyHelper(@TMENUWINDOWHANDLE_R,@TMENUWINDOWHANDLE_W,'WindowHandle');
{$ENDIF}
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TMenuItem'}{$ENDIF}
{$IFDEF class_helper_present}
type
TMenuItem_PSHelper = class helper for TMenuItem
public
{$IFNDEF FPC}
procedure ONMEASUREITEM_W(const T: TMENUMEASUREITEMEVENT);
procedure ONMEASUREITEM_R(var T: TMENUMEASUREITEMEVENT);
procedure ONADVANCEDDRAWITEM_W(const T: TADVANCEDMENUDRAWITEMEVENT);
procedure ONADVANCEDDRAWITEM_R(var T: TADVANCEDMENUDRAWITEMEVENT);
procedure ONDRAWITEM_W(const T: TMENUDRAWITEMEVENT);
procedure ONDRAWITEM_R(var T: TMENUDRAWITEMEVENT);
{$ENDIF}
procedure ONCLICK_W(const T: TNOTIFYEVENT);
procedure ONCLICK_R(var T: TNOTIFYEVENT);
procedure VISIBLE_W(const T: BOOLEAN);
procedure VISIBLE_R(var T: BOOLEAN);
procedure SHORTCUT_W(const T: TSHORTCUT);
procedure SHORTCUT_R(var T: TSHORTCUT);
procedure RADIOITEM_W(const T: BOOLEAN);
procedure RADIOITEM_R(var T: BOOLEAN);
procedure IMAGEINDEX_W(const T: TIMAGEINDEX);
procedure IMAGEINDEX_R(var T: TIMAGEINDEX);
procedure HINT_W(const T: STRING);
procedure HINT_R(var T: STRING);
procedure HELPCONTEXT_W(const T: THELPCONTEXT);
procedure HELPCONTEXT_R(var T: THELPCONTEXT);
procedure GROUPINDEX_W(const T: BYTE);
procedure GROUPINDEX_R(var T: BYTE);
procedure ENABLED_W(const T: BOOLEAN);
procedure ENABLED_R(var T: BOOLEAN);
procedure DEFAULT_W(const T: BOOLEAN);
procedure DEFAULT_R(var T: BOOLEAN);
procedure SUBMENUIMAGES_W(const T: TCUSTOMIMAGELIST);
procedure SUBMENUIMAGES_R(var T: TCUSTOMIMAGELIST);
procedure CHECKED_W(const T: BOOLEAN);
procedure CHECKED_R(var T: BOOLEAN);
procedure CAPTION_W(const T: STRING);
procedure CAPTION_R(var T: STRING);
procedure BITMAP_W(const T: TBITMAP);
procedure BITMAP_R(var T: TBITMAP);
{$IFNDEF FPC}
procedure AUTOLINEREDUCTION_W(const T: TMENUITEMAUTOFLAG);
procedure AUTOLINEREDUCTION_R(var T: TMENUITEMAUTOFLAG);
procedure AUTOHOTKEYS_W(const T: TMENUITEMAUTOFLAG);
procedure AUTOHOTKEYS_R(var T: TMENUITEMAUTOFLAG);
{$ENDIF}
procedure ACTION_W(const T: TBASICACTION);
procedure ACTION_R(var T: TBASICACTION);
procedure PARENT_R(var T: TMENUITEM);
procedure MENUINDEX_W(const T: INTEGER);
procedure MENUINDEX_R(var T: INTEGER);
procedure ITEMS_R(var T: TMENUITEM; const t1: INTEGER);
procedure COUNT_R(var T: INTEGER);
procedure HANDLE_R(var T: HMENU);
procedure COMMAND_R(var T: WORD);
end;
{$IFNDEF FPC}
procedure TMenuItem_PSHelper.ONMEASUREITEM_W(const T: TMENUMEASUREITEMEVENT);
begin Self.ONMEASUREITEM := T; end;
procedure TMenuItem_PSHelper.ONMEASUREITEM_R(var T: TMENUMEASUREITEMEVENT);
begin T := Self.ONMEASUREITEM; end;
procedure TMenuItem_PSHelper.ONADVANCEDDRAWITEM_W(const T: TADVANCEDMENUDRAWITEMEVENT);
begin Self.ONADVANCEDDRAWITEM := T; end;
procedure TMenuItem_PSHelper.ONADVANCEDDRAWITEM_R(var T: TADVANCEDMENUDRAWITEMEVENT);
begin T := Self.ONADVANCEDDRAWITEM; end;
procedure TMenuItem_PSHelper.ONDRAWITEM_W(const T: TMENUDRAWITEMEVENT);
begin Self.ONDRAWITEM := T; end;
procedure TMenuItem_PSHelper.ONDRAWITEM_R(var T: TMENUDRAWITEMEVENT);
begin T := Self.ONDRAWITEM; end;
{$ENDIF}
procedure TMenuItem_PSHelper.ONCLICK_W(const T: TNOTIFYEVENT);
begin Self.ONCLICK := T; end;
procedure TMenuItem_PSHelper.ONCLICK_R(var T: TNOTIFYEVENT);
begin T := Self.ONCLICK; end;
procedure TMenuItem_PSHelper.VISIBLE_W(const T: BOOLEAN);
begin Self.VISIBLE := T; end;
procedure TMenuItem_PSHelper.VISIBLE_R(var T: BOOLEAN);
begin T := Self.VISIBLE; end;
procedure TMenuItem_PSHelper.SHORTCUT_W(const T: TSHORTCUT);
begin Self.SHORTCUT := T; end;
procedure TMenuItem_PSHelper.SHORTCUT_R(var T: TSHORTCUT);
begin T := Self.SHORTCUT; end;
procedure TMenuItem_PSHelper.RADIOITEM_W(const T: BOOLEAN);
begin Self.RADIOITEM := T; end;
procedure TMenuItem_PSHelper.RADIOITEM_R(var T: BOOLEAN);
begin T := Self.RADIOITEM; end;
procedure TMenuItem_PSHelper.IMAGEINDEX_W(const T: TIMAGEINDEX);
begin Self.IMAGEINDEX := T; end;
procedure TMenuItem_PSHelper.IMAGEINDEX_R(var T: TIMAGEINDEX);
begin T := Self.IMAGEINDEX; end;
procedure TMenuItem_PSHelper.HINT_W(const T: STRING);
begin Self.HINT := T; end;
procedure TMenuItem_PSHelper.HINT_R(var T: STRING);
begin T := Self.HINT; end;
procedure TMenuItem_PSHelper.HELPCONTEXT_W(const T: THELPCONTEXT);
begin Self.HELPCONTEXT := T; end;
procedure TMenuItem_PSHelper.HELPCONTEXT_R(var T: THELPCONTEXT);
begin T := Self.HELPCONTEXT; end;
procedure TMenuItem_PSHelper.GROUPINDEX_W(const T: BYTE);
begin Self.GROUPINDEX := T; end;
procedure TMenuItem_PSHelper.GROUPINDEX_R(var T: BYTE);
begin T := Self.GROUPINDEX; end;
procedure TMenuItem_PSHelper.ENABLED_W(const T: BOOLEAN);
begin Self.ENABLED := T; end;
procedure TMenuItem_PSHelper.ENABLED_R(var T: BOOLEAN);
begin T := Self.ENABLED; end;
procedure TMenuItem_PSHelper.DEFAULT_W(const T: BOOLEAN);
begin Self.DEFAULT := T; end;
procedure TMenuItem_PSHelper.DEFAULT_R(var T: BOOLEAN);
begin T := Self.DEFAULT; end;
procedure TMenuItem_PSHelper.SUBMENUIMAGES_W(const T: TCUSTOMIMAGELIST);
begin Self.SUBMENUIMAGES := T; end;
procedure TMenuItem_PSHelper.SUBMENUIMAGES_R(var T: TCUSTOMIMAGELIST);
begin T := Self.SUBMENUIMAGES; end;
procedure TMenuItem_PSHelper.CHECKED_W(const T: BOOLEAN);
begin Self.CHECKED := T; end;
procedure TMenuItem_PSHelper.CHECKED_R(var T: BOOLEAN);
begin T := Self.CHECKED; end;
procedure TMenuItem_PSHelper.CAPTION_W(const T: STRING);
begin Self.CAPTION := T; end;
procedure TMenuItem_PSHelper.CAPTION_R(var T: STRING);
begin T := Self.CAPTION; end;
procedure TMenuItem_PSHelper.BITMAP_W(const T: TBITMAP);
begin Self.BITMAP := T; end;
procedure TMenuItem_PSHelper.BITMAP_R(var T: TBITMAP);
begin T := Self.BITMAP; end;
{$IFNDEF FPC}
procedure TMenuItem_PSHelper.AUTOLINEREDUCTION_W(const T: TMENUITEMAUTOFLAG);
begin Self.AUTOLINEREDUCTION := T; end;
procedure TMenuItem_PSHelper.AUTOLINEREDUCTION_R(var T: TMENUITEMAUTOFLAG);
begin T := Self.AUTOLINEREDUCTION; end;
procedure TMenuItem_PSHelper.AUTOHOTKEYS_W(const T: TMENUITEMAUTOFLAG);
begin Self.AUTOHOTKEYS := T; end;
procedure TMenuItem_PSHelper.AUTOHOTKEYS_R(var T: TMENUITEMAUTOFLAG);
begin T := Self.AUTOHOTKEYS; end;
{$ENDIF}
procedure TMenuItem_PSHelper.ACTION_W(const T: TBASICACTION);
begin Self.ACTION := T; end;
procedure TMenuItem_PSHelper.ACTION_R(var T: TBASICACTION);
begin T := Self.ACTION; end;
procedure TMenuItem_PSHelper.PARENT_R(var T: TMENUITEM);
begin T := Self.PARENT; end;
procedure TMenuItem_PSHelper.MENUINDEX_W(const T: INTEGER);
begin Self.MENUINDEX := T; end;
procedure TMenuItem_PSHelper.MENUINDEX_R(var T: INTEGER);
begin T := Self.MENUINDEX; end;
procedure TMenuItem_PSHelper.ITEMS_R(var T: TMENUITEM; const t1: INTEGER);
begin T := Self.ITEMS[t1]; end;
procedure TMenuItem_PSHelper.COUNT_R(var T: INTEGER);
begin T := Self.COUNT; end;
procedure TMenuItem_PSHelper.HANDLE_R(var T: HMENU);
begin T := Self.HANDLE; end;
procedure TMenuItem_PSHelper.COMMAND_R(var T: WORD);
begin T := Self.COMMAND; end;
procedure RIRegisterTMENUITEM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMenuItem) do
begin
RegisterConstructor(@TMenuItem.CREATE, 'Create');
RegisterVirtualMethod(@TMenuItem.INITIATEACTION, 'InitiateAction');
RegisterMethod(@TMenuItem.INSERT, 'Insert');
RegisterMethod(@TMenuItem.DELETE, 'Delete');
RegisterMethod(@TMenuItem.CLEAR, 'Clear');
RegisterVirtualMethod(@TMenuItem.CLICK, 'Click');
{$IFNDEF FPC}
RegisterMethod(@TMenuItem.FIND, 'Find');
RegisterMethod(@TMenuItem.NEWTOPLINE, 'NewTopLine');
RegisterMethod(@TMenuItem.NEWBOTTOMLINE, 'NewBottomLine');
RegisterMethod(@TMenuItem.INSERTNEWLINEBEFORE, 'InsertNewLineBefore');
RegisterMethod(@TMenuItem.INSERTNEWLINEAFTER, 'InsertNewLineAfter');
RegisterMethod(@TMenuItem.RETHINKHOTKEYS, 'RethinkHotkeys');
RegisterMethod(@TMenuItem.RETHINKLINES, 'RethinkLines');
RegisterMethod(@TMenuItem.ISLINE, 'IsLine');
{$ENDIF}
RegisterMethod(@TMenuItem.INDEXOF, 'IndexOf');
RegisterMethod(@TMenuItem.GETIMAGELIST, 'GetImageList');
RegisterMethod(@TMenuItem.GETPARENTCOMPONENT, 'GetParentComponent');
RegisterMethod(@TMenuItem.GETPARENTMENU, 'GetParentMenu');
RegisterMethod(@TMenuItem.HASPARENT, 'HasParent');
RegisterMethod(@TMenuItem.ADD, 'Add');
RegisterMethod(@TMenuItem.REMOVE, 'Remove');
{$IFNDEF FPC}
RegisterPropertyHelper(@TMenuItem.AUTOHOTKEYS_R,@TMenuItem.AUTOHOTKEYS_W,'AutoHotkeys');
RegisterPropertyHelper(@TMenuItem.AUTOLINEREDUCTION_R,@TMenuItem.AUTOLINEREDUCTION_W,'AutoLineReduction');
RegisterEventPropertyHelper(@TMenuItem.ONDRAWITEM_R,@TMenuItem.ONDRAWITEM_W,'OnDrawItem');
RegisterEventPropertyHelper(@TMenuItem.ONADVANCEDDRAWITEM_R,@TMenuItem.ONADVANCEDDRAWITEM_W,'OnAdvancedDrawItem');
RegisterEventPropertyHelper(@TMenuItem.ONMEASUREITEM_R,@TMenuItem.ONMEASUREITEM_W,'OnMeasureItem');
{$ENDIF}
RegisterPropertyHelper(@TMenuItem.COMMAND_R,nil,'Command');
RegisterPropertyHelper(@TMenuItem.HANDLE_R,nil,'Handle');
RegisterPropertyHelper(@TMenuItem.COUNT_R,nil,'Count');
RegisterPropertyHelper(@TMenuItem.ITEMS_R,nil,'Items');
RegisterPropertyHelper(@TMenuItem.MENUINDEX_R,@TMenuItem.MENUINDEX_W,'MenuIndex');
RegisterPropertyHelper(@TMenuItem.PARENT_R,nil,'Parent');
RegisterPropertyHelper(@TMenuItem.ACTION_R,@TMenuItem.ACTION_W,'Action');
RegisterPropertyHelper(@TMenuItem.BITMAP_R,@TMenuItem.BITMAP_W,'Bitmap');
RegisterPropertyHelper(@TMenuItem.CAPTION_R,@TMenuItem.CAPTION_W,'Caption');
RegisterPropertyHelper(@TMenuItem.CHECKED_R,@TMenuItem.CHECKED_W,'Checked');
RegisterPropertyHelper(@TMenuItem.SUBMENUIMAGES_R,@TMenuItem.SUBMENUIMAGES_W,'SubMenuImages');
RegisterPropertyHelper(@TMenuItem.DEFAULT_R,@TMenuItem.DEFAULT_W,'Default');
RegisterPropertyHelper(@TMenuItem.ENABLED_R,@TMenuItem.ENABLED_W,'Enabled');
RegisterPropertyHelper(@TMenuItem.GROUPINDEX_R,@TMenuItem.GROUPINDEX_W,'GroupIndex');
RegisterPropertyHelper(@TMenuItem.HELPCONTEXT_R,@TMenuItem.HELPCONTEXT_W,'HelpContext');
RegisterPropertyHelper(@TMenuItem.HINT_R,@TMenuItem.HINT_W,'Hint');
RegisterPropertyHelper(@TMenuItem.IMAGEINDEX_R,@TMenuItem.IMAGEINDEX_W,'ImageIndex');
RegisterPropertyHelper(@TMenuItem.RADIOITEM_R,@TMenuItem.RADIOITEM_W,'RadioItem');
RegisterPropertyHelper(@TMenuItem.SHORTCUT_R,@TMenuItem.SHORTCUT_W,'ShortCut');
RegisterPropertyHelper(@TMenuItem.VISIBLE_R,@TMenuItem.VISIBLE_W,'Visible');
RegisterEventPropertyHelper(@TMenuItem.ONCLICK_R,@TMenuItem.ONCLICK_W,'OnClick');
end;
end;
{$ELSE}
{$IFNDEF FPC}
procedure TMENUITEMONMEASUREITEM_W(Self: TMenuItem; const T: TMENUMEASUREITEMEVENT);
begin Self.ONMEASUREITEM := T; end;
procedure TMENUITEMONMEASUREITEM_R(Self: TMENUITEM; var T: TMENUMEASUREITEMEVENT);
@ -290,102 +876,6 @@ begin T := Self.HANDLE; end;
procedure TMENUITEMCOMMAND_R(Self: TMENUITEM; var T: WORD);
begin T := Self.COMMAND; end;
procedure RIRegister_Menus_Routines(S: TPSExec);
begin
S.RegisterDelphiFunction(@SHORTCUT, 'ShortCut', cdRegister);
S.RegisterDelphiFunction(@SHORTCUTTOKEY, 'ShortCutToKey', cdRegister);
{$IFNDEF FPC}
S.RegisterDelphiFunction(@SHORTCUTTOTEXT, 'ShortCutToText', cdRegister);
S.RegisterDelphiFunction(@TEXTTOSHORTCUT, 'TextToShortCut', cdRegister);
S.RegisterDelphiFunction(@NEWMENU, 'NewMenu', cdRegister);
S.RegisterDelphiFunction(@NEWPOPUPMENU, 'NewPopupMenu', cdRegister);
S.RegisterDelphiFunction(@NEWSUBMENU, 'NewSubMenu', cdRegister);
S.RegisterDelphiFunction(@NEWITEM, 'NewItem', cdRegister);
S.RegisterDelphiFunction(@NEWLINE, 'NewLine', cdRegister);
S.RegisterDelphiFunction(@DRAWMENUITEM, 'DrawMenuItem', cdRegister);
{$ENDIF}
end;
{$IFNDEF FPC}
procedure RIRegisterTMENUITEMSTACK(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMENUITEMSTACK) do
begin
RegisterMethod(@TMENUITEMSTACK.CLEARITEM, 'ClearItem');
end;
end;
procedure RIRegisterTPOPUPLIST(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPOPUPLIST) do
begin
RegisterPropertyHelper(@TPOPUPLISTWINDOW_R,nil,'Window');
RegisterMethod(@TPOPUPLIST.ADD, 'Add');
RegisterMethod(@TPOPUPLIST.REMOVE, 'Remove');
end;
end;
{$ENDIF}
procedure RIRegisterTPOPUPMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPOPUPMENU) do
begin
RegisterConstructor(@TPOPUPMENU.CREATE, 'Create');
RegisterVirtualMethod(@TPOPUPMENU.POPUP, 'Popup');
RegisterPropertyHelper(@TPOPUPMENUPOPUPCOMPONENT_R,@TPOPUPMENUPOPUPCOMPONENT_W,'PopupComponent');
RegisterEventPropertyHelper(@TPOPUPMENUONPOPUP_R,@TPOPUPMENUONPOPUP_W,'OnPopup');
{$IFNDEF FPC}
RegisterPropertyHelper(@TPOPUPMENUALIGNMENT_R,@TPOPUPMENUALIGNMENT_W,'Alignment');
RegisterPropertyHelper(@TPOPUPMENUAUTOPOPUP_R,@TPOPUPMENUAUTOPOPUP_W,'AutoPopup');
RegisterPropertyHelper(@TPOPUPMENUHELPCONTEXT_R,@TPOPUPMENUHELPCONTEXT_W,'HelpContext');
RegisterPropertyHelper(@TPOPUPMENUMENUANIMATION_R,@TPOPUPMENUMENUANIMATION_W,'MenuAnimation');
RegisterPropertyHelper(@TPOPUPMENUTRACKBUTTON_R,@TPOPUPMENUTRACKBUTTON_W,'TrackButton');
{$ENDIF}
end;
end;
procedure RIRegisterTMAINMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMAINMENU) do
begin
{$IFNDEF FPC}
RegisterMethod(@TMAINMENU.MERGE, 'Merge');
RegisterMethod(@TMAINMENU.UNMERGE, 'Unmerge');
RegisterMethod(@TMAINMENU.POPULATEOLE2MENU, 'PopulateOle2Menu');
RegisterMethod(@TMAINMENU.GETOLE2ACCELERATORTABLE, 'GetOle2AcceleratorTable');
RegisterMethod(@TMAINMENU.SETOLE2MENUHANDLE, 'SetOle2MenuHandle');
RegisterPropertyHelper(@TMAINMENUAUTOMERGE_R,@TMAINMENUAUTOMERGE_W,'AutoMerge');
{$ENDIF}
end;
end;
procedure RIRegisterTMENU(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMENU) do
begin
RegisterConstructor(@TMENU.CREATE, 'Create');
RegisterMethod(@TMENU.DISPATCHCOMMAND, 'DispatchCommand');
RegisterMethod(@TMENU.FINDITEM, 'FindItem');
RegisterPropertyHelper(@TMENUIMAGES_R,@TMENUIMAGES_W,'Images');
RegisterMethod(@TMENU.ISRIGHTTOLEFT, 'IsRightToLeft');
RegisterPropertyHelper(@TMENUHANDLE_R,nil,'Handle');
RegisterPropertyHelper(@TMENUITEMS_R,nil,'Items');
{$IFNDEF FPC}
RegisterMethod(@TMENU.DISPATCHPOPUP, 'DispatchPopup');
RegisterMethod(@TMENU.PARENTBIDIMODECHANGED, 'ParentBiDiModeChanged');
RegisterMethod(@TMENU.PROCESSMENUCHAR, 'ProcessMenuChar');
RegisterPropertyHelper(@TMENUAUTOHOTKEYS_R,@TMENUAUTOHOTKEYS_W,'AutoHotkeys');
RegisterPropertyHelper(@TMENUAUTOLINEREDUCTION_R,@TMENUAUTOLINEREDUCTION_W,'AutoLineReduction');
RegisterPropertyHelper(@TMENUBIDIMODE_R,@TMENUBIDIMODE_W,'BiDiMode');
RegisterMethod(@TMENU.GETHELPCONTEXT, 'GetHelpContext');
RegisterPropertyHelper(@TMENUOWNERDRAW_R,@TMENUOWNERDRAW_W,'OwnerDraw');
RegisterPropertyHelper(@TMENUPARENTBIDIMODE_R,@TMENUPARENTBIDIMODE_W,'ParentBiDiMode');
RegisterPropertyHelper(@TMENUWINDOWHANDLE_R,@TMENUWINDOWHANDLE_W,'WindowHandle');
{$ENDIF}
end;
end;
procedure RIRegisterTMENUITEM(Cl: TPSRuntimeClassImporter);
begin
@ -445,6 +935,37 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_Menus_Routines(S: TPSExec);
begin
S.RegisterDelphiFunction(@SHORTCUT, 'ShortCut', cdRegister);
S.RegisterDelphiFunction(@SHORTCUTTOKEY, 'ShortCutToKey', cdRegister);
{$IFNDEF FPC}
S.RegisterDelphiFunction(@SHORTCUTTOTEXT, 'ShortCutToText', cdRegister);
S.RegisterDelphiFunction(@TEXTTOSHORTCUT, 'TextToShortCut', cdRegister);
S.RegisterDelphiFunction(@NEWMENU, 'NewMenu', cdRegister);
S.RegisterDelphiFunction(@NEWPOPUPMENU, 'NewPopupMenu', cdRegister);
S.RegisterDelphiFunction(@NEWSUBMENU, 'NewSubMenu', cdRegister);
S.RegisterDelphiFunction(@NEWITEM, 'NewItem', cdRegister);
S.RegisterDelphiFunction(@NEWLINE, 'NewLine', cdRegister);
S.RegisterDelphiFunction(@DRAWMENUITEM, 'DrawMenuItem', cdRegister);
{$ENDIF}
end;
{$IFDEF DELPHI10UP}{$REGION 'TMenuItemStack'}{$ENDIF}
{$IFNDEF FPC}
procedure RIRegisterTMENUITEMSTACK(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMenuItemStack) do
begin
RegisterMethod(@TMENUITEMSTACK.CLEARITEM, 'ClearItem');
end;
end;
{$ENDIF}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_Menus(CL: TPSRuntimeClassImporter);
begin
RIRegisterTMENUITEM(Cl);

View File

@ -15,8 +15,7 @@ implementation
uses
Classes;
{$IFDEF DELPHI10UP}{$REGION 'TObject'}{$ENDIF}
procedure RIRegisterTObject(CL: TPSRuntimeClassImporter);
begin
with cl.Add(TObject) do
@ -25,7 +24,9 @@ begin
RegisterMethod(@TObject.Free, 'Free');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TPersistent'}{$ENDIF}
procedure RIRegisterTPersistent(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TPersistent) do
@ -33,10 +34,52 @@ begin
RegisterVirtualMethod(@TPersistent.Assign, 'Assign');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TComponent'}{$ENDIF}
{$IFDEF class_helper_present}
type
TComponent_PSHelper = class helper for TComponent
public
procedure OwnerR(var T: TComponent);
procedure COMPONENTS_R(var T: TCOMPONENT; t1: INTEGER);
procedure COMPONENTCOUNT_R(var T: INTEGER);
procedure COMPONENTINDEX_R(var T: INTEGER);
procedure COMPONENTINDEX_W(T: INTEGER);
procedure COMPONENTSTATE_R(var T: TCOMPONENTSTATE);
procedure DESIGNINFO_R(var T: LONGINT);
procedure DESIGNINFO_W(T: LONGINT);
end;
procedure TComponent_PSHelper.OwnerR(var T: TComponent); begin T := Self.Owner; end;
procedure TComponent_PSHelper.COMPONENTS_R(var T: TCOMPONENT; t1: INTEGER); begin T := Self.COMPONENTS[t1]; end;
procedure TComponent_PSHelper.COMPONENTCOUNT_R(var T: INTEGER); begin t := Self.COMPONENTCOUNT; end;
procedure TComponent_PSHelper.COMPONENTINDEX_R(var T: INTEGER); begin t := Self.COMPONENTINDEX; end;
procedure TComponent_PSHelper.COMPONENTINDEX_W(T: INTEGER); begin Self.COMPONENTINDEX := t; end;
procedure TComponent_PSHelper.COMPONENTSTATE_R(var T: TCOMPONENTSTATE); begin t := Self.COMPONENTSTATE; end;
procedure TComponent_PSHelper.DESIGNINFO_R(var T: LONGINT); begin t := Self.DESIGNINFO; end;
procedure TComponent_PSHelper.DESIGNINFO_W(T: LONGINT); begin Self.DESIGNINFO := t; end;
procedure RIRegisterTComponent(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TComponent) do
begin
RegisterMethod(@TComponent.FindComponent, 'FindComponent');
RegisterVirtualConstructor(@TComponent.Create, 'Create');
RegisterPropertyHelper(@TComponent.OwnerR, nil, 'Owner');
RegisterMethod(@TComponent.DESTROYCOMPONENTS, 'DestroyComponents');
RegisterPropertyHelper(@TComponent.COMPONENTS_R, nil, 'Components');
RegisterPropertyHelper(@TComponent.COMPONENTCOUNT_R, nil, 'ComponentCount');
RegisterPropertyHelper(@TComponent.COMPONENTINDEX_R, @TComponent.COMPONENTINDEX_W, 'ComponentIndex');
RegisterPropertyHelper(@TComponent.COMPONENTSTATE_R, nil, 'ComponentState');
RegisterPropertyHelper(@TComponent.DESIGNINFO_R, @TComponent.DESIGNINFO_W, 'DesignInfo');
end;
end;
{$ELSE}
procedure TComponentOwnerR(Self: TComponent; var T: TComponent); begin T := Self.Owner; end;
procedure TCOMPONENTCOMPONENTS_R(Self: TCOMPONENT; var T: TCOMPONENT; t1: INTEGER); begin T := Self.COMPONENTS[t1]; end;
procedure TCOMPONENTCOMPONENTCOUNT_R(Self: TCOMPONENT; var T: INTEGER); begin t := Self.COMPONENTCOUNT; end;
procedure TCOMPONENTCOMPONENTINDEX_R(Self: TCOMPONENT; var T: INTEGER); begin t := Self.COMPONENTINDEX; end;
@ -63,12 +106,8 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_Std(Cl: TPSRuntimeClassImporter);
begin
RIRegisterTObject(CL);

View File

@ -32,16 +32,45 @@ implementation
uses
sysutils, classes{$IFDEF CLX}, QControls, QStdCtrls, QGraphics{$ELSE}, controls, stdctrls, Graphics{$ENDIF}{$IFDEF FPC},buttons{$ENDIF};
{$IFDEF DELPHI10UP}{$REGION 'TCustomGroupBox'}{$ENDIF}
procedure RIRegisterTCUSTOMGROUPBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TCUSTOMGROUPBOX);
Cl.Add(TCustomGroupBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'MyRegion'}{$ENDIF}
procedure RIRegisterTGROUPBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TGROUPBOX);
Cl.Add(TGroupBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomLabel'}{$ENDIF}
{$IFDEF class_helper_present}
{$IFNDEF PS_MINIVCL}{$IFNDEF CLX}
type
TCustomLabel_PSHelper = class helper for TCustomLabel
public
procedure CANVAS_R(var T: TCanvas);
end;
procedure TCustomLabel_PSHelper.CANVAS_R(var T: TCanvas); begin T := Self.CANVAS; end;
{$ENDIF}{$ENDIF}
procedure RIRegisterTCUSTOMLABEL(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCustomLabel) do
begin
{$IFNDEF PS_MINIVCL}
{$IFNDEF CLX}
RegisterPropertyHelper(@TCustomLabel.CANVAS_R, nil, 'Canvas');
{$ENDIF}
{$ENDIF}
end;
end;
{$ELSE}
{$IFNDEF CLX}
procedure TCUSTOMLABELCANVAS_R(Self: TCUSTOMLABEL; var T: TCanvas); begin T := Self.CANVAS; end;
{$ENDIF}
@ -58,11 +87,72 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TLabel'}{$ENDIF}
procedure RIRegisterTLABEL(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TLABEL);
Cl.Add(TLabel);
end;
procedure TCUSTOMEDITMODIFIED_R(Self: TCUSTOMEDIT; var T: BOOLEAN); begin T := Self.MODIFIED; end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomEdit'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCustomEdit_PSHelper = class helper for TCustomEdit
public
procedure MODIFIED_R(var T: BOOLEAN);
procedure MODIFIED_W(T: BOOLEAN);
procedure SELLENGTH_R(var T: INTEGER);
procedure SELLENGTH_W(T: INTEGER);
procedure SELSTART_R(var T: INTEGER);
procedure SELSTART_W(T: INTEGER);
procedure SELTEXT_R(var T: STRING);
procedure SELTEXT_W(T: STRING);
procedure TEXT_R(var T: string);
procedure TEXT_W(T: string);
end;
procedure TCustomEdit_PSHelper.MODIFIED_R(var T: BOOLEAN); begin T := Self.MODIFIED; end;
procedure TCustomEdit_PSHelper.MODIFIED_W(T: BOOLEAN); begin Self.MODIFIED := T; end;
procedure TCustomEdit_PSHelper.SELLENGTH_R(var T: INTEGER); begin T := Self.SELLENGTH; end;
procedure TCustomEdit_PSHelper.SELLENGTH_W(T: INTEGER); begin Self.SELLENGTH := T; end;
procedure TCustomEdit_PSHelper.SELSTART_R(var T: INTEGER); begin T := Self.SELSTART; end;
procedure TCustomEdit_PSHelper.SELSTART_W(T: INTEGER); begin Self.SELSTART := T; end;
procedure TCustomEdit_PSHelper.SELTEXT_R(var T: STRING); begin T := Self.SELTEXT; end;
procedure TCustomEdit_PSHelper.SELTEXT_W(T: STRING); begin Self.SELTEXT := T; end;
procedure TCustomEdit_PSHelper.TEXT_R(var T: string); begin T := Self.TEXT; end;
procedure TCustomEdit_PSHelper.TEXT_W(T: string); begin Self.TEXT := T; end;
procedure RIRegisterTCUSTOMEDIT(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCustomEdit) do
begin
RegisterMethod(@TCustomEdit.CLEAR, 'Clear');
RegisterMethod(@TCustomEdit.CLEARSELECTION, 'ClearSelection');
RegisterMethod(@TCustomEdit.SELECTALL, 'SelectAll');
RegisterPropertyHelper(@TCustomEdit.MODIFIED_R, @TCustomEdit.MODIFIED_W, 'Modified');
RegisterPropertyHelper(@TCustomEdit.SELLENGTH_R, @TCustomEdit.SELLENGTH_W, 'SelLength');
RegisterPropertyHelper(@TCustomEdit.SELSTART_R, @TCustomEdit.SELSTART_W, 'SelStart');
RegisterPropertyHelper(@TCustomEdit.SELTEXT_R, @TCustomEdit.SELTEXT_W, 'SelText');
RegisterPropertyHelper(@TCustomEdit.TEXT_R, @TCustomEdit.TEXT_W, 'Text');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TCustomEdit.COPYTOCLIPBOARD, 'CopyToClipboard');
RegisterMethod(@TCustomEdit.CUTTOCLIPBOARD, 'CutToClipboard');
RegisterMethod(@TCustomEdit.PASTEFROMCLIPBOARD, 'PasteFromClipboard');
{$IFNDEF FPC}
RegisterMethod(@TCustomEdit.GETSELTEXTBUF, 'GetSelTextBuf');
RegisterMethod(@TCustomEdit.SETSELTEXTBUF, 'SetSelTextBuf');
{$ENDIF}{FPC}
{$ENDIF}
end;
end;
{$ELSE}
procedure TCUSTOMEDITMODIFIED_R(Self: TCustomEdit; var T: BOOLEAN); begin T := Self.MODIFIED; end;
procedure TCUSTOMEDITMODIFIED_W(Self: TCUSTOMEDIT; T: BOOLEAN); begin Self.MODIFIED := T; end;
procedure TCUSTOMEDITSELLENGTH_R(Self: TCUSTOMEDIT; var T: INTEGER); begin T := Self.SELLENGTH; end;
procedure TCUSTOMEDITSELLENGTH_W(Self: TCUSTOMEDIT; T: INTEGER); begin Self.SELLENGTH := T; end;
@ -99,19 +189,49 @@ begin
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TEdit'}{$ENDIF}
procedure RIRegisterTEDIT(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TEDIT);
Cl.Add(TEdit);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomMemo/TMemo'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCustomMemo_PSHelper = class helper for TCustomMemo
public
procedure LINES_R(var T: TSTRINGS);
procedure LINES_W(T: TSTRINGS);
end;
procedure TCustomMemo_PSHelper.LINES_R(var T: TSTRINGS); begin T := Self.LINES; end;
procedure TCustomMemo_PSHelper.LINES_W(T: TSTRINGS); begin Self.LINES := T; end;
procedure RIRegisterTCUSTOMMEMO(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCustomMemo) do
begin
RegisterPropertyHelper(@TCustomMemo.LINES_R, @TCustomMemo.LINES_W, 'Lines');
end;
end;
procedure RIRegisterTMEMO(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TMEMO);
end;
{$ELSE}
procedure TCUSTOMMEMOLINES_R(Self: {$IFDEF CLX}TMemo{$ELSE}TCUSTOMMEMO{$ENDIF}; var T: TSTRINGS); begin T := Self.LINES; end;
procedure TCUSTOMMEMOLINES_W(Self: {$IFDEF CLX}TMemo{$ELSE}TCUSTOMMEMO{$ENDIF}; T: TSTRINGS); begin Self.LINES := T; end;
procedure RIRegisterTCUSTOMMEMO(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCUSTOMMEMO) do
with Cl.Add(TCustomMemo) do
begin
{$IFNDEF CLX}
RegisterPropertyHelper(@TCUSTOMMEMOLINES_R, @TCUSTOMMEMOLINES_W, 'Lines');
@ -119,7 +239,6 @@ begin
end;
end;
procedure RIRegisterTMEMO(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TMEMO) do
@ -129,9 +248,65 @@ begin
{$ENDIF}
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomComboBox'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCustomComboBox_PSHelper = class helper for TCustomComboBox
public
procedure CANVAS_R(var T: TCANVAS);
procedure DROPPEDDOWN_R(var T: BOOLEAN);
procedure DROPPEDDOWN_W(T: BOOLEAN);
procedure ITEMS_R(var T: TSTRINGS);
procedure ITEMS_W(T: TSTRINGS);
procedure ITEMINDEX_R(var T: INTEGER);
procedure ITEMINDEX_W(T: INTEGER);
procedure SELLENGTH_R(var T: INTEGER);
procedure SELLENGTH_W(T: INTEGER);
procedure SELSTART_R(var T: INTEGER);
procedure SELSTART_W(T: INTEGER);
procedure SELTEXT_R(var T: STRING);
procedure SELTEXT_W(T: STRING);
end;
procedure TCustomComboBox_PSHelper.CANVAS_R(var T: TCANVAS); begin T := Self.CANVAS; end;
procedure TCustomComboBox_PSHelper.DROPPEDDOWN_R(var T: BOOLEAN); begin T := Self.DROPPEDDOWN; end;
procedure TCustomComboBox_PSHelper.DROPPEDDOWN_W(T: BOOLEAN); begin Self.DROPPEDDOWN := T; end;
procedure TCustomComboBox_PSHelper.ITEMS_R(var T: TSTRINGS); begin T := Self.ITEMS; end;
procedure TCustomComboBox_PSHelper.ITEMS_W(T: TSTRINGS); begin Self.ITEMS := T; end;
procedure TCustomComboBox_PSHelper.ITEMINDEX_R(var T: INTEGER); begin T := Self.ITEMINDEX; end;
procedure TCustomComboBox_PSHelper.ITEMINDEX_W(T: INTEGER); begin Self.ITEMINDEX := T; end;
procedure TCustomComboBox_PSHelper.SELLENGTH_R(var T: INTEGER); begin T := Self.SELLENGTH; end;
procedure TCustomComboBox_PSHelper.SELLENGTH_W(T: INTEGER); begin Self.SELLENGTH := T; end;
procedure TCustomComboBox_PSHelper.SELSTART_R(var T: INTEGER); begin T := Self.SELSTART; end;
procedure TCustomComboBox_PSHelper.SELSTART_W(T: INTEGER); begin Self.SELSTART := T; end;
procedure TCustomComboBox_PSHelper.SELTEXT_R(var T: STRING); begin T := Self.SELTEXT; end;
procedure TCustomComboBox_PSHelper.SELTEXT_W(T: STRING); begin Self.SELTEXT := T; end;
procedure TCUSTOMCOMBOBOXCANVAS_R(Self: TCUSTOMCOMBOBOX; var T: TCANVAS); begin T := Self.CANVAS; end;
procedure RIRegisterTCUSTOMCOMBOBOX(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCustomComboBox) do
begin
RegisterPropertyHelper(@TCustomComboBox.DROPPEDDOWN_R, @TCustomComboBox.DROPPEDDOWN_W, 'DroppedDown');
RegisterPropertyHelper(@TCustomComboBox.ITEMS_R, @TCustomComboBox.ITEMS_W, 'Items');
RegisterPropertyHelper(@TCustomComboBox.ITEMINDEX_R, @TCustomComboBox.ITEMINDEX_W, 'ItemIndex');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TCustomComboBox.CLEAR, 'Clear');
RegisterMethod(@TCustomComboBox.SELECTALL, 'SelectAll');
RegisterPropertyHelper(@TCustomComboBox.CANVAS_R, nil, 'Canvas');
RegisterPropertyHelper(@TCustomComboBox.SELLENGTH_R, @TCustomComboBox.SELLENGTH_W, 'SelLength');
RegisterPropertyHelper(@TCustomComboBox.SELSTART_R, @TCustomComboBox.SELSTART_W, 'SelStart');
RegisterPropertyHelper(@TCustomComboBox.SELTEXT_R, @TCustomComboBox.SELTEXT_W, 'SelText');
{$ENDIF}
end;
end;
{$ELSE}
procedure TCUSTOMCOMBOBOXCANVAS_R(Self: TCustomComboBox; var T: TCANVAS); begin T := Self.CANVAS; end;
procedure TCUSTOMCOMBOBOXDROPPEDDOWN_R(Self: TCUSTOMCOMBOBOX; var T: BOOLEAN); begin T := Self.DROPPEDDOWN; end;
procedure TCUSTOMCOMBOBOXDROPPEDDOWN_W(Self: TCUSTOMCOMBOBOX; T: BOOLEAN); begin Self.DROPPEDDOWN := T; end;
procedure TCUSTOMCOMBOBOXITEMS_R(Self: TCUSTOMCOMBOBOX; var T: TSTRINGS); begin T := Self.ITEMS; end;
@ -164,50 +339,101 @@ begin
{$ENDIF}
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TComboBox'}{$ENDIF}
procedure RIRegisterTCOMBOBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TCOMBOBOX);
Cl.Add(TComboBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TButtonControl'}{$ENDIF}
procedure RIRegisterTBUTTONCONTROL(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TBUTTONCONTROL);
Cl.Add(TButtonControl);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TButton'}{$ENDIF}
procedure RIRegisterTBUTTON(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TBUTTON);
Cl.Add(TButton);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCustomCheckBox'}{$ENDIF}
procedure RIRegisterTCUSTOMCHECKBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TCUSTOMCHECKBOX);
Cl.Add(TCustomCheckBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TCheckBox'}{$ENDIF}
procedure RIRegisterTCHECKBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TCHECKBOX);
Cl.Add(TCheckBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TRadioButton'}{$ENDIF}
procedure RIRegisterTRADIOBUTTON(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TRADIOBUTTON);
Cl.Add(TRadioButton);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure TCUSTOMLISTBOXCANVAS_R(Self: TCUSTOMLISTBOX; var T: TCANVAS); begin T := Self.CANVAS; end;
{$IFDEF DELPHI10UP}{$REGION 'TCustomListBox'}{$ENDIF}
{$IFDEF class_helper_present}
type
TCustomListBox_PSHelper = class helper for TCustomListBox
public
procedure CANVAS_R(var T: TCANVAS);
procedure ITEMS_R(var T: TSTRINGS);
procedure ITEMS_W(T: TSTRINGS);
procedure ITEMINDEX_R(var T: INTEGER);
procedure ITEMINDEX_W(T: INTEGER);
procedure SELCOUNT_R(var T: INTEGER);
procedure SELECTED_R(var T: BOOLEAN; t1: INTEGER);
procedure SELECTED_W(T: BOOLEAN; t1: INTEGER);
procedure TOPINDEX_R(var T: INTEGER);
procedure TOPINDEX_W(T: INTEGER);
end;
procedure TCustomListBox_PSHelper.CANVAS_R(var T: TCANVAS); begin T := Self.CANVAS; end;
procedure TCustomListBox_PSHelper.ITEMS_R(var T: TSTRINGS); begin T := Self.ITEMS; end;
procedure TCustomListBox_PSHelper.ITEMS_W(T: TSTRINGS); begin Self.ITEMS := T; end;
procedure TCustomListBox_PSHelper.ITEMINDEX_R(var T: INTEGER); begin T := Self.ITEMINDEX; end;
procedure TCustomListBox_PSHelper.ITEMINDEX_W(T: INTEGER); begin Self.ITEMINDEX := T; end;
procedure TCustomListBox_PSHelper.SELCOUNT_R(var T: INTEGER); begin T := Self.SELCOUNT; end;
procedure TCustomListBox_PSHelper.SELECTED_R(var T: BOOLEAN; t1: INTEGER); begin T := Self.SELECTED[t1]; end;
procedure TCustomListBox_PSHelper.SELECTED_W(T: BOOLEAN; t1: INTEGER); begin Self.SELECTED[t1] := T; end;
procedure TCustomListBox_PSHelper.TOPINDEX_R(var T: INTEGER); begin T := Self.TOPINDEX; end;
procedure TCustomListBox_PSHelper.TOPINDEX_W(T: INTEGER); begin Self.TOPINDEX := T; end;
procedure RIRegisterTCUSTOMLISTBOX(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TCustomListBox) do
begin
RegisterPropertyHelper(@TCustomListBox.ITEMS_R, @TCustomListBox.ITEMS_W, 'Items');
RegisterPropertyHelper(@TCustomListBox.ITEMINDEX_R, @TCustomListBox.ITEMINDEX_W, 'ItemIndex');
RegisterPropertyHelper(@TCustomListBox.SELCOUNT_R, nil, 'SelCount');
RegisterPropertyHelper(@TCustomListBox.SELECTED_R, @TCustomListBox.SELECTED_W, 'Selected');
{$IFNDEF PS_MINIVCL}
RegisterMethod(@TCustomListBox.CLEAR, 'Clear');
RegisterMethod(@TCustomListBox.ITEMATPOS, 'ItemAtPos');
RegisterMethod(@TCustomListBox.ITEMRECT, 'ItemRect');
RegisterPropertyHelper(@TCustomListBox.CANVAS_R, nil, 'Canvas');
RegisterPropertyHelper(@TCustomListBox.TOPINDEX_R, @TCustomListBox.TOPINDEX_W, 'TopIndex');
{$ENDIF}
end;
end;
{$ELSE}
procedure TCUSTOMLISTBOXCANVAS_R(Self: TCustomListBox; var T: TCANVAS); begin T := Self.CANVAS; end;
procedure TCUSTOMLISTBOXITEMS_R(Self: TCUSTOMLISTBOX; var T: TSTRINGS); begin T := Self.ITEMS; end;
procedure TCUSTOMLISTBOXITEMS_W(Self: TCUSTOMLISTBOX; T: TSTRINGS); begin Self.ITEMS := T; end;
procedure TCUSTOMLISTBOXITEMINDEX_R(Self: TCUSTOMLISTBOX; var T: INTEGER); begin T := Self.ITEMINDEX; end;
@ -237,21 +463,26 @@ begin
{$ENDIF}
end;
end;
{$ENDIF class_helper_present}
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TListBox'}{$ENDIF}
procedure RIRegisterTLISTBOX(Cl: TPSRuntimeClassImporter);
begin
Cl.Add(TLISTBOX);
Cl.Add(TListBox);
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
{$IFDEF DELPHI10UP}{$REGION 'TScrollBar'}{$ENDIF}
procedure RIRegisterTSCROLLBAR(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSCROLLBAR) do
with Cl.Add(TScrollBar) do
begin
RegisterMethod(@TSCROLLBAR.SETPARAMS, 'SetParams');
end;
end;
{$IFDEF DELPHI10UP}{$ENDREGION}{$ENDIF}
procedure RIRegister_stdctrls(cl: TPSRuntimeClassImporter);

View File

@ -10476,7 +10476,6 @@ var
CurrStack: Cardinal;
cc: TPSCallingConvention;
s: tbtString;
dx: Integer;
begin
s := p.Decl;
if length(S) < 2 then