mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-26 12:42:09 +01:00
IDE: TMainIDE.OnPropHookCreateMethod: todo
git-svn-id: trunk@55217 -
This commit is contained in:
parent
02d03fe47f
commit
549f824d8c
13
ide/main.pp
13
ide/main.pp
@ -12626,6 +12626,7 @@ var
|
|||||||
OldChange: Boolean;
|
OldChange: Boolean;
|
||||||
InheritedMethodPath, MethodClassName, ShortMethodName: String;
|
InheritedMethodPath, MethodClassName, ShortMethodName: String;
|
||||||
UseRTTIForMethods, AddOverride: Boolean;
|
UseRTTIForMethods, AddOverride: Boolean;
|
||||||
|
MethodComponent: TComponent;
|
||||||
begin
|
begin
|
||||||
Result.Code:=nil;
|
Result.Code:=nil;
|
||||||
Result.Data:=nil;
|
Result.Data:=nil;
|
||||||
@ -12633,7 +12634,7 @@ begin
|
|||||||
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource])
|
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource])
|
||||||
then exit;
|
then exit;
|
||||||
{$IFDEF VerboseOnPropHookCreateMethod}
|
{$IFDEF VerboseOnPropHookCreateMethod}
|
||||||
debugln('');
|
debugln(' ');
|
||||||
debugln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName);
|
debugln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName);
|
||||||
DebugLn([' Persistent=',dbgsName(APersistent),' Unit=',GetClassUnitName(APersistent.ClassType),' Path=',APropertyPath]);
|
DebugLn([' Persistent=',dbgsName(APersistent),' Unit=',GetClassUnitName(APersistent.ClassType),' Path=',APropertyPath]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -12643,9 +12644,10 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
MethodComponent:=ActiveUnitInfo.Component;
|
||||||
if IsValidIdentPair(AMethodName,MethodClassName,ShortMethodName) then
|
if IsValidIdentPair(AMethodName,MethodClassName,ShortMethodName) then
|
||||||
begin
|
begin
|
||||||
if CompareText(MethodClassName,ActiveUnitInfo.Component.ClassName)<>0 then
|
if CompareText(MethodClassName,MethodComponent.ClassName)<>0 then
|
||||||
begin
|
begin
|
||||||
debugln(['TMainIDE.PropHookCreateMethod wrong class AMethodName="',AMethodName,'" lookuproot=',DbgSName(ActiveUnitInfo.Component)]);
|
debugln(['TMainIDE.PropHookCreateMethod wrong class AMethodName="',AMethodName,'" lookuproot=',DbgSName(ActiveUnitInfo.Component)]);
|
||||||
raise Exception.Create('Invalid classname "'+AMethodName+'"');
|
raise Exception.Create('Invalid classname "'+AMethodName+'"');
|
||||||
@ -12666,6 +12668,10 @@ begin
|
|||||||
{$IFDEF VerboseOnPropHookCreateMethod}
|
{$IFDEF VerboseOnPropHookCreateMethod}
|
||||||
debugln(['TMainIDE.OnPropHookCreateMethod CreatePublishedMethod ',ActiveUnitInfo.Source.Filename,' LookupRoot=',ActiveUnitInfo.Component.ClassName,' ShortMethodName="',ShortMethodName,'" PropertyUnit=',GetClassUnitName(APersistent.ClassType),' APropertyPath="',APropertyPath,'" CallInherited=',InheritedMethodPath]);
|
debugln(['TMainIDE.OnPropHookCreateMethod CreatePublishedMethod ',ActiveUnitInfo.Source.Filename,' LookupRoot=',ActiveUnitInfo.Component.ClassName,' ShortMethodName="',ShortMethodName,'" PropertyUnit=',GetClassUnitName(APersistent.ClassType),' APropertyPath="',APropertyPath,'" CallInherited=',InheritedMethodPath]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
if not AddOverride then begin
|
||||||
|
// ToDo: check if there is already an ancestor method
|
||||||
|
// The JITMethod must be created for that class
|
||||||
|
end;
|
||||||
r:=CodeToolBoss.CreatePublishedMethod(ActiveUnitInfo.Source,
|
r:=CodeToolBoss.CreatePublishedMethod(ActiveUnitInfo.Source,
|
||||||
ActiveUnitInfo.Component.ClassName,ShortMethodName,
|
ActiveUnitInfo.Component.ClassName,ShortMethodName,
|
||||||
ATypeInfo,UseRTTIForMethods,GetClassUnitName(APersistent.ClassType),
|
ATypeInfo,UseRTTIForMethods,GetClassUnitName(APersistent.ClassType),
|
||||||
@ -12675,8 +12681,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
ApplyCodeToolChanges;
|
ApplyCodeToolChanges;
|
||||||
if r then begin
|
if r then begin
|
||||||
Result:=FormEditor1.CreateNewJITMethod(ActiveUnitInfo.Component,
|
Result:=FormEditor1.CreateNewJITMethod(MethodComponent,ShortMethodName);
|
||||||
ShortMethodName);
|
|
||||||
{$IFDEF VerboseOnPropHookCreateMethod}
|
{$IFDEF VerboseOnPropHookCreateMethod}
|
||||||
debugln(['TMainIDE.PropHookCreateMethod JITClass=',TJITMethod(Result.Data).TheClass.ClassName]);
|
debugln(['TMainIDE.PropHookCreateMethod JITClass=',TJITMethod(Result.Data).TheClass.ClassName]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user